:root {
  --bg: #0a0910;
  --bg2: #12101a;
  --card: rgba(255, 255, 255, 0.045);
  --card-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f5f2ff;
  --muted: #9d96b8;
  --dim: #6b6585;
  --hot: #ff3d7f;
  --sun: #ffa53d;
  --violet: #8b5cff;
  --mint: #3df5b0;
  --red: #ff5257;
  --grad: linear-gradient(120deg, #ff3d7f 0%, #ff7a45 55%, #ffb03d 100%);
  --grad-cool: linear-gradient(120deg, #8b5cff, #3d9bff);
  --radius: 22px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Inter Tight', system-ui, -apple-system, Segoe UI, sans-serif;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; }
::selection { background: var(--hot); color: #fff; }

/* ---------------- background ---------------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.38; animation: drift 26s ease-in-out infinite alternate; }
.b1 { width: 55vmax; height: 55vmax; background: #ff2d74; top: -25vmax; left: -15vmax; }
.b2 { width: 45vmax; height: 45vmax; background: #6d3dff; bottom: -22vmax; right: -12vmax; animation-delay: -8s; opacity: 0.32; }
.b3 { width: 30vmax; height: 30vmax; background: #ff8a3d; top: 40%; left: 55%; animation-delay: -15s; opacity: 0.18; }
@keyframes drift { to { transform: translate(6vmax, 5vmax) scale(1.12); } }
.grain {
  position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  opacity: 0.09; mix-blend-mode: overlay;
}

/* ---------------- primitives ---------------- */
.wrap { width: min(1180px, 100%); margin: 0 auto; padding: 0 20px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: 14px;
  background: var(--card-2); border: 1px solid var(--line);
  font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
  transition: transform 0.12s ease, background 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.btn:hover { background: rgba(255, 255, 255, 0.11); border-color: var(--line-2); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.primary { background: var(--grad); border: 0; color: #1a0610; box-shadow: 0 10px 30px -10px rgba(255, 61, 127, 0.8); }
.btn.primary:hover { box-shadow: 0 14px 38px -10px rgba(255, 61, 127, 0.95); filter: brightness(1.05); }
.btn.big { height: 58px; font-size: 17px; border-radius: 18px; padding: 0 28px; font-family: var(--display); font-weight: 700; }
.btn.small { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 11px; }
.btn.ghost { background: transparent; }
.btn.icon { width: 46px; padding: 0; }
.btn.mint { background: var(--mint); color: #05261a; border: 0; }
.btn.gold { background: linear-gradient(120deg, #ffd34d, #ff9d2e); color: #2a1600; border: 0; box-shadow: 0 10px 30px -10px rgba(255, 190, 61, 0.9); }

.input {
  width: 100%; height: 50px; padding: 0 16px; border-radius: 14px;
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { border-color: rgba(255, 61, 127, 0.7); box-shadow: 0 0 0 4px rgba(255, 61, 127, 0.15); }
.input::placeholder { color: var(--dim); }
label.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 8px; letter-spacing: 0.02em; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--card-2); border: 1px solid var(--line); white-space: nowrap;
}
.pill.hot { background: rgba(255, 61, 127, 0.14); border-color: rgba(255, 61, 127, 0.35); color: #ff8db4; }
.pill.mint { background: rgba(61, 245, 176, 0.12); border-color: rgba(61, 245, 176, 0.3); color: var(--mint); }
.pill.gold { background: rgba(255, 196, 61, 0.14); border-color: rgba(255, 196, 61, 0.35); color: #ffd36b; }

.seg { display: flex; gap: 4px; padding: 4px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); border-radius: 13px; flex-wrap: wrap; }
.seg button { flex: 1; min-width: 44px; height: 34px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); transition: all 0.15s; }
.seg button:hover:not(:disabled) { color: var(--text); }
.seg button.on { background: var(--text); color: var(--bg); }
.seg button:disabled { cursor: default; }

.switch { position: relative; width: 46px; height: 28px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); transition: background 0.2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.2s cubic-bezier(.3, 1.4, .5, 1); }
.switch.on { background: var(--hot); }
.switch.on::after { transform: translateX(18px); }
.switch:disabled { opacity: 0.6; cursor: default; }

.avatar {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  display: grid; place-items: center; font-size: 21px;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line);
}

/* ---------------- logo ---------------- */
.logo { font-family: var(--display); font-weight: 800; letter-spacing: -0.04em; font-size: 22px; display: inline-flex; align-items: center; gap: 8px; }
.logo .mark { width: 30px; height: 30px; border-radius: 50%; background: repeating-radial-gradient(circle, #1b1a22 0 2px, #0c0b10 2px 4px); position: relative; box-shadow: 0 0 0 1px var(--line); animation: spin 4s linear infinite; }
.logo .mark::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--grad); }
.logo b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- home ---------------- */
.home { min-height: 100vh; display: flex; flex-direction: column; }
.home-top { display: flex; justify-content: space-between; align-items: center; padding: 22px 0; }
.home-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; padding: 30px 0 60px; flex: 1; }
.hero h1 {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.055em; line-height: 0.88;
  font-size: clamp(64px, 10vw, 138px); margin: 18px 0 22px;
}
.hero h1 .l2 { display: block; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 0.06em; }
.hero p.tag { font-size: 19px; color: var(--muted); max-width: 470px; margin: 0 0 30px; }
.hero p.tag strong { color: var(--text); font-weight: 600; }
.steps { display: flex; gap: 10px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-size: 13.5px; font-weight: 500; }
.step span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: var(--card-2); font-size: 16px; }

.hero-disc { position: relative; width: clamp(160px, 18vw, 230px); aspect-ratio: 1; margin-bottom: 4px; }
.hero-disc .vinyl { position: absolute; inset: 0; }

.join-card { padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.join-card h2 { font-family: var(--display); margin: 0; font-size: 26px; letter-spacing: -0.03em; }
.avatars { display: flex; flex-wrap: wrap; gap: 6px; }
.avatars button { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; background: rgba(255, 255, 255, 0.05); border: 1px solid transparent; transition: all 0.15s; }
.avatars button:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); }
.avatars button.on { border-color: var(--hot); background: rgba(255, 61, 127, 0.16); transform: scale(1.06); }
.or { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 12px; font-weight: 600; letter-spacing: 0.1em; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.code-row { display: flex; gap: 8px; }
.code-row .input { text-transform: uppercase; letter-spacing: 0.4em; font-family: var(--display); font-weight: 700; font-size: 20px; text-align: center; }
.code-row .input::placeholder { letter-spacing: 0.2em; font-size: 15px; }
.invite-banner { padding: 12px 14px; border-radius: 14px; background: rgba(255, 61, 127, 0.12); border: 1px solid rgba(255, 61, 127, 0.3); font-size: 14px; }

.public-rooms h3 { margin: 0 0 12px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(61, 245, 176, 0.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(61, 245, 176, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 245, 176, 0); } }
.room-list { display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow: auto; }
.room-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); text-align: left; width: 100%; transition: background 0.15s; }
.room-item:hover { background: rgba(255, 255, 255, 0.07); }
.room-item .code { font-family: var(--display); font-weight: 800; letter-spacing: 0.08em; }
.room-item .meta { flex: 1; font-size: 12.5px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--dim); font-size: 13px; padding: 10px 2px; }

/* ---------------- vinyl ---------------- */
.vinyl {
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 31%, transparent 31%),
    repeating-radial-gradient(circle at 50% 50%, #17161d 0 1.5px, #0b0a0f 1.5px 3.5px);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  position: relative;
}
.vinyl::before { /* sheen */
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 30deg, transparent 0 10%, rgba(255,255,255,.11) 14%, transparent 20% 60%, rgba(255,255,255,.08) 64%, transparent 70%);
}
.vinyl .label {
  position: absolute; inset: 32%; border-radius: 50%; background: var(--grad); background-size: cover; background-position: center;
  box-shadow: 0 0 0 4px rgba(0,0,0,.35);
}
.vinyl .label::after { content: ''; position: absolute; inset: 44%; border-radius: 50%; background: var(--bg); }
.spinning { animation: spin 3.2s linear infinite; }
.paused { animation-play-state: paused; }

/* ---------------- top bar ---------------- */
.topbar { display: flex; align-items: center; gap: 14px; padding: 16px 0; }
.topbar .spacer { flex: 1; }
.room-chip { font-family: var(--display); font-weight: 800; letter-spacing: 0.12em; padding: 7px 12px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--line); font-size: 14px; }
.vol { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.vol input { width: 90px; accent-color: var(--hot); }

/* ---------------- lobby ---------------- */
.lobby-grid { display: grid; grid-template-columns: 340px 1fr; gap: 18px; padding-bottom: 40px; }
.lobby-side { display: flex; flex-direction: column; gap: 18px; }
.code-card { text-align: center; padding: 26px 22px; }
.big-code { font-family: var(--display); font-weight: 800; font-size: 64px; letter-spacing: 0.14em; line-height: 1; margin: 10px 0 18px; padding-left: 0.14em; }
.big-code span { display: inline-block; animation: pop 0.5s cubic-bezier(.3, 1.6, .5, 1) backwards; }
.big-code span:nth-child(2) { animation-delay: 0.05s; }
.big-code span:nth-child(3) { animation-delay: 0.1s; }
.big-code span:nth-child(4) { animation-delay: 0.15s; }
@keyframes pop { from { transform: scale(0.3) translateY(20px); opacity: 0; } }
.code-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.players-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.player-row { display: flex; align-items: center; gap: 12px; padding: 8px; padding-right: 12px; border-radius: 15px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); animation: slideIn 0.35s ease backwards; }
.player-row.off { opacity: 0.4; }
.player-row .nm { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-row .you { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 6px; }
@keyframes slideIn { from { transform: translateY(8px); opacity: 0; } }
.slot-empty { border-style: dashed; background: transparent; color: var(--dim); font-size: 13px; justify-content: center; height: 58px; }

.settings h3, .lobby-side h3 { margin: 0; font-family: var(--display); font-size: 20px; letter-spacing: -0.02em; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 22px; }
.mode {
  text-align: left; padding: 14px; border-radius: 17px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; transition: all 0.18s; position: relative; overflow: hidden;
}
.mode:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); transform: translateY(-2px); }
.mode:disabled { cursor: default; }
.mode .e { font-size: 26px; margin-bottom: 4px; }
.mode .n { font-weight: 700; font-family: var(--display); font-size: 16px; letter-spacing: -0.01em; }
.mode .d { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.mode.on { border-color: transparent; background: linear-gradient(var(--bg2), var(--bg2)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; }
.mode.on::after { content: '✓'; position: absolute; top: 10px; right: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--grad); color: #1a0610; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.opt-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.opt-toggle .t { font-weight: 600; font-size: 14px; }
.opt-toggle .s { font-size: 12px; color: var(--muted); }
.start-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ---------------- game ---------------- */
.game-body { display: grid; grid-template-columns: 1fr 280px; gap: 18px; padding-bottom: 110px; align-items: start; }
.round-info { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.timer { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; padding: 7px 13px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--line); min-width: 70px; text-align: center; position: relative; overflow: hidden; }
.timer .fill { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--grad); transition: width 0.3s linear; }
.timer.low { color: var(--red); border-color: rgba(255, 82, 87, 0.4); animation: shake 0.5s infinite; }
@keyframes shake { 25% { transform: translateX(-1px); } 75% { transform: translateX(1px); } }
.timer:empty { display: none; }

.scoreboard { position: sticky; top: 16px; padding: 18px; }
.scoreboard h4 { margin: 0 0 12px; }
.score-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); transition: transform 0.4s; }
.score-row:last-child { border-bottom: 0; }
.score-row .rank { width: 18px; font-size: 12px; color: var(--dim); font-weight: 700; text-align: center; }
.score-row .avatar { width: 34px; height: 34px; font-size: 18px; border-radius: 11px; position: relative; }
.score-row .nm { flex: 1; font-weight: 600; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-row .pts { font-family: var(--display); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.score-row.off { opacity: 0.4; }
.score-row .badge { font-size: 13px; }
.status-dot { position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--bg2); background: var(--dim); }
.status-dot.ok { background: var(--mint); }

/* prompt card */
.prompt-card {
  position: relative; overflow: hidden; padding: 30px 30px 28px;
  border-radius: 28px; border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 61, 127, 0.35), transparent 55%),
    radial-gradient(120% 140% at 100% 100%, rgba(139, 92, 255, 0.35), transparent 55%),
    rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
  animation: rise 0.5s cubic-bezier(.2, 1, .3, 1) backwards;
}
.prompt-card .big-emoji { position: absolute; right: 18px; top: -10px; font-size: 130px; opacity: 0.14; transform: rotate(12deg); pointer-events: none; }
.prompt-card h1 { font-family: var(--display); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; font-size: clamp(30px, 4.2vw, 50px); margin: 14px 0 16px; max-width: 18ch; position: relative; }
.prompt-card h1 mark { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.prompt-card .judge-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.prompt-card .judge-line b { color: var(--text); }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }

.stage { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* search */
.picker { padding: 20px; }
.searchbox { position: relative; }
.searchbox .input { height: 58px; font-size: 16px; padding-left: 50px; padding-right: 50px; border-radius: 17px; }
.searchbox .ico { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; pointer-events: none; }
.searchbox .spin { position: absolute; right: 18px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--hot); animation: spin 0.7s linear infinite; display: none; }
.searchbox.loading .spin { display: block; }
.sources { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 2px 4px; font-size: 12px; color: var(--muted); }
.src { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); font-weight: 600; }
.src i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.results { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.result {
  display: flex; align-items: center; gap: 14px; padding: 8px; padding-right: 10px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.025); border: 1px solid transparent; transition: background 0.15s, border-color 0.15s;
  animation: slideIn 0.3s ease backwards;
}
.result:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--line); }
.result .cover { width: 56px; height: 56px; border-radius: 11px; object-fit: cover; background: var(--card-2); flex: none; position: relative; }
.cover-btn { position: relative; flex: none; border-radius: 11px; overflow: hidden; }
.cover-btn .ov { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.45); opacity: 0; transition: opacity 0.15s; font-size: 20px; }
.cover-btn:hover .ov, .cover-btn.playing .ov { opacity: 1; }
.result .info { flex: 1; min-width: 0; }
.result .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result .a { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result .badges { display: flex; gap: 6px; margin-top: 4px; }
.tiny { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; padding: 2px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); color: var(--muted); text-transform: uppercase; }
.tiny.e { background: rgba(255, 255, 255, 0.85); color: #000; }
.tiny.sp { background: rgba(30, 215, 96, 0.18); color: #1ed760; }
.result .pick { height: 40px; padding: 0 16px; border-radius: 12px; font-size: 14px; }
.notice-line { padding: 12px 14px; border-radius: 14px; background: rgba(255, 196, 61, 0.1); border: 1px solid rgba(255, 196, 61, 0.25); color: #ffd36b; font-size: 13.5px; margin-top: 12px; }

.locked {
  display: flex; align-items: center; gap: 18px; padding: 18px; border-radius: 22px;
  background: linear-gradient(120deg, rgba(61, 245, 176, 0.12), rgba(61, 245, 176, 0.03)); border: 1px solid rgba(61, 245, 176, 0.3);
  animation: rise 0.4s cubic-bezier(.2, 1, .3, 1) backwards;
}
.locked img { width: 84px; height: 84px; border-radius: 14px; object-fit: cover; box-shadow: 0 10px 30px -10px #000; }
.locked .info { flex: 1; min-width: 0; }
.locked .t { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.locked .a { color: var(--muted); }

.waiting { display: flex; flex-wrap: wrap; gap: 8px; }
.wchip { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); font-size: 13px; font-weight: 600; transition: all 0.3s; }
.wchip .avatar { width: 28px; height: 28px; font-size: 15px; border-radius: 50%; }
.wchip.done { background: rgba(61, 245, 176, 0.1); border-color: rgba(61, 245, 176, 0.35); color: var(--mint); }
.wchip.judge { background: rgba(255, 196, 61, 0.1); border-color: rgba(255, 196, 61, 0.3); color: #ffd36b; }

.judge-panel { text-align: center; padding: 40px 24px; }
.judge-panel .crown { font-size: 64px; animation: bob 2.4s ease-in-out infinite; display: inline-block; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-6deg); } }
.judge-panel h2 { font-family: var(--display); font-size: 32px; letter-spacing: -0.03em; margin: 8px 0 6px; }
.judge-panel p { color: var(--muted); margin: 0 auto 22px; max-width: 420px; }
.judge-panel .waiting { justify-content: center; }
.prompt-input { display: flex; gap: 10px; margin-top: 10px; }
.prompt-input .input { height: 58px; font-size: 17px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.suggestions button { padding: 8px 12px; border-radius: 99px; font-size: 13px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.suggestions button:hover { color: var(--text); background: var(--card-2); }

/* listen */
.now { display: grid; grid-template-columns: auto 1fr; gap: 34px; align-items: center; padding: 30px; }
.deck { position: relative; width: clamp(200px, 24vw, 300px); aspect-ratio: 1; margin-right: clamp(50px, 6.5vw, 84px); }
.tile .ph { display: grid; place-items: center; font-size: 34px; background: repeating-radial-gradient(circle, #1b1a22 0 2px, #0f0e14 2px 4px); color: var(--dim); }
.deck .vinyl { position: absolute; inset: 0; transform: translateX(28%); transition: transform 0.6s cubic-bezier(.2, 1, .3, 1); }
.deck .sleeve { position: absolute; inset: 0; border-radius: 16px; object-fit: cover; width: 100%; height: 100%; box-shadow: 0 30px 60px -18px rgba(0, 0, 0, 0.95); z-index: 1; background: var(--card-2); animation: sleeveIn 0.6s cubic-bezier(.2, 1, .3, 1) backwards; }
@keyframes sleeveIn { from { transform: translateX(-30px) rotate(-4deg); opacity: 0; } }
.now-info { min-width: 0; }
.now-info .num { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.now-info h2 { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 3.6vw, 46px); line-height: 1.02; letter-spacing: -0.035em; margin: 0 0 8px; word-break: break-word; }
.now-info .artist { font-size: 18px; color: var(--muted); margin: 0 0 22px; }
.progress { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--grad); border-radius: 99px; }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); margin-top: 6px; font-variant-numeric: tabular-nums; }
.controls { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; align-items: center; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: var(--mint); border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; } .eq i:nth-child(3) { animation-delay: -0.6s; } .eq i:nth-child(4) { animation-delay: -0.15s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 14px; } }
.eq.stop i { animation: none; height: 3px; }
.vote-btn.on { background: rgba(255, 61, 127, 0.2); border-color: var(--hot); color: #ff8db4; }

.tracklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile {
  position: relative; text-align: left; padding: 8px; border-radius: 18px; background: var(--card); border: 1px solid var(--line);
  transition: all 0.2s; display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.tile:hover:not(:disabled) { transform: translateY(-3px); background: var(--card-2); }
.tile:disabled { cursor: default; }
.tile img, .tile .ph { width: 100%; aspect-ratio: 1; border-radius: 12px; object-fit: cover; background: var(--card-2); }
.tile .t { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.tile .a { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px 4px; margin-top: -6px; }
.tile.active { border-color: transparent; background: linear-gradient(var(--bg2), var(--bg2)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; }
.tile .n { position: absolute; top: 14px; left: 14px; width: 26px; height: 26px; border-radius: 9px; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(6px); display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.tile .seen { position: absolute; top: 14px; right: 14px; font-size: 11px; padding: 3px 7px; border-radius: 8px; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(6px); font-weight: 700; }
.tile.unseen img { filter: grayscale(0.7) brightness(0.6); }
.tile .crown-it { margin: 0 2px 2px; height: 36px; border-radius: 11px; font-weight: 700; font-size: 13px; }
.tile .mine-tag { position: absolute; top: 14px; right: 14px; font-size: 11px; padding: 3px 7px; border-radius: 8px; background: var(--mint); color: #05261a; font-weight: 800; }

/* reveal */
.winner {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 30px; align-items: center; padding: 32px; overflow: hidden;
  border-radius: 30px; border: 1px solid rgba(255, 210, 90, 0.35);
  background: radial-gradient(120% 120% at 0% 0%, rgba(255, 196, 61, 0.28), transparent 60%), radial-gradient(100% 120% at 100% 100%, rgba(255, 61, 127, 0.25), transparent 60%), rgba(255, 255, 255, 0.04);
  animation: rise 0.6s cubic-bezier(.2, 1, .3, 1) backwards;
  box-shadow: 0 30px 80px -30px rgba(255, 170, 61, 0.45);
}
.winner .cover { width: clamp(150px, 20vw, 230px); aspect-ratio: 1; border-radius: 18px; object-fit: cover; box-shadow: 0 30px 60px -20px #000; transform: rotate(-3deg); animation: wobble 0.9s cubic-bezier(.3, 1.6, .5, 1) 0.2s backwards; }
@keyframes wobble { from { transform: rotate(-12deg) scale(0.6); opacity: 0; } }
.winner h2 { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 4vw, 52px); line-height: 1; letter-spacing: -0.04em; margin: 12px 0 6px; }
.winner .artist { color: var(--muted); font-size: 17px; margin: 0 0 20px; }
.picked-by { display: inline-flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border-radius: 99px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); }
.picked-by .avatar { border-radius: 50%; }
.picked-by b { font-size: 17px; }
.plus { font-family: var(--display); font-weight: 800; color: #ffd36b; margin-left: 4px; }
.others { display: flex; flex-direction: column; gap: 8px; }
.other { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); animation: slideIn 0.4s ease backwards; }
.other img { width: 50px; height: 50px; border-radius: 10px; object-fit: cover; }
.other .info { flex: 1; min-width: 0; }
.other .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.other .a { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.other .by { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.other .by .avatar { width: 30px; height: 30px; font-size: 16px; border-radius: 50%; }
.next-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* final */
.final { text-align: center; padding: 20px 0 30px; }
.final h1 { font-family: var(--display); font-size: clamp(42px, 6vw, 76px); letter-spacing: -0.05em; margin: 6px 0 34px; line-height: 0.95; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 14px; margin-bottom: 30px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(190px, 30%); animation: rise 0.7s cubic-bezier(.2, 1, .3, 1) backwards; }
.pod .avatar { width: 74px; height: 74px; font-size: 40px; border-radius: 24px; }
.pod .nm { font-weight: 700; font-size: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .block { width: 100%; border-radius: 18px 18px 6px 6px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 16px; font-family: var(--display); font-weight: 800; border: 1px solid var(--line); }
.pod .block .place { font-size: 34px; line-height: 1; }
.pod .block .sc { font-size: 14px; color: var(--muted); font-family: var(--body); font-weight: 600; margin-top: 6px; }
.pod.p1 { animation-delay: 0.5s; } .pod.p2 { animation-delay: 0.25s; } .pod.p3 { animation-delay: 0s; }
.pod.p1 .block { height: 190px; background: linear-gradient(180deg, rgba(255, 196, 61, 0.4), rgba(255, 196, 61, 0.05)); border-color: rgba(255, 196, 61, 0.4); }
.pod.p2 .block { height: 140px; background: linear-gradient(180deg, rgba(200, 200, 230, 0.28), rgba(200, 200, 230, 0.04)); }
.pod.p3 .block { height: 105px; background: linear-gradient(180deg, rgba(255, 140, 80, 0.3), rgba(255, 140, 80, 0.04)); }
.pod.p1 .avatar { box-shadow: 0 0 0 3px #ffc43d, 0 0 50px rgba(255, 196, 61, 0.5); }
.final-rest { max-width: 460px; margin: 0 auto 26px; text-align: left; }
.final-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* loading */
.loading-panel { text-align: center; padding: 70px 20px; }
.loading-panel .vinyl { width: 140px; height: 140px; margin: 0 auto 22px; }
.loading-panel h2 { font-family: var(--display); letter-spacing: -0.03em; margin: 0 0 6px; }

/* reactions */
.reactbar {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; gap: 4px; padding: 6px; border-radius: 20px; z-index: 20;
  background: rgba(18, 16, 26, 0.8); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.reactbar button { width: 46px; height: 46px; border-radius: 14px; font-size: 22px; transition: transform 0.12s, background 0.15s; }
.reactbar button:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-3px) scale(1.1); }
.reactbar button:active { transform: scale(0.9); }
#floaters { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.floater { position: absolute; bottom: 70px; font-size: 40px; animation: floatUp 2.6s cubic-bezier(.2, .8, .3, 1) forwards; display: flex; flex-direction: column; align-items: center; }
.floater small { font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, 0.6); padding: 2px 7px; border-radius: 99px; margin-top: 2px; font-family: var(--body); }
@keyframes floatUp {
  0% { transform: translateY(0) scale(0.4); opacity: 0; }
  12% { transform: translateY(-40px) scale(1.15); opacity: 1; }
  100% { transform: translateY(-62vh) translateX(var(--dx, 0)) scale(0.9); opacity: 0; }
}

/* toasts */
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast { padding: 11px 18px; border-radius: 14px; background: rgba(28, 25, 38, 0.95); border: 1px solid var(--line-2); font-weight: 600; font-size: 14px; box-shadow: var(--shadow); animation: toastIn 0.35s cubic-bezier(.2, 1.4, .4, 1); max-width: 100%; text-align: center; }
.toast.err { border-color: rgba(255, 82, 87, 0.5); color: #ff9a9d; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all 0.3s; }
@keyframes toastIn { from { transform: translateY(-14px) scale(0.95); opacity: 0; } }

.tap-to-play { position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%); z-index: 40; height: 50px; padding: 0 24px; border-radius: 99px; background: var(--grad); color: #1a0610; font-weight: 800; box-shadow: 0 10px 40px -8px rgba(255, 61, 127, 0.9); animation: bob 1.6s ease-in-out infinite; }
.tap-to-play[hidden] { display: none; }

/* judge reveal overlay */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(6, 5, 10, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: fadeIn 0.25s ease; padding: 20px; }
.overlay.out { opacity: 0; transition: opacity 0.35s; }
@keyframes fadeIn { from { opacity: 0; } }
.reveal-box { text-align: center; width: min(560px, 100%); }
.reveal-box .eyebrow { margin-bottom: 18px; }
.reel { height: 120px; display: grid; place-items: center; position: relative; }
.reel .who { display: flex; align-items: center; gap: 16px; font-family: var(--display); font-weight: 800; font-size: clamp(34px, 7vw, 54px); letter-spacing: -0.04em; }
.reel .who .avatar { width: 76px; height: 76px; font-size: 42px; border-radius: 24px; }
.reel.tick .who { animation: tick 0.12s ease; }
@keyframes tick { from { transform: translateY(-14px); opacity: 0.4; } }
.reel.landed .who { animation: land 0.6s cubic-bezier(.3, 1.8, .5, 1); }
.reel.landed .avatar { box-shadow: 0 0 0 3px #ffc43d, 0 0 60px rgba(255, 196, 61, 0.6); }
@keyframes land { from { transform: scale(0.6); } }
.reveal-box .crown { font-size: 46px; height: 56px; opacity: 0; transition: all 0.4s cubic-bezier(.3, 1.8, .5, 1); transform: translateY(20px) scale(0.5); }
.reveal-box.landed .crown { opacity: 1; transform: none; }
.reveal-box .judge-is { color: var(--muted); font-size: 16px; opacity: 0; transition: opacity 0.4s 0.2s; margin-top: 4px; }
.reveal-box.landed .judge-is { opacity: 1; }
.reveal-box .you-judge { color: #ffd36b; font-weight: 700; }
.reveal-prompt { margin-top: 30px; padding: 20px 22px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); opacity: 0; transform: translateY(14px); transition: all 0.5s cubic-bezier(.2, 1, .3, 1) 0.45s; }
.reveal-box.landed .reveal-prompt { opacity: 1; transform: none; }
.reveal-prompt .p { font-family: var(--display); font-weight: 800; font-size: clamp(22px, 4vw, 30px); letter-spacing: -0.03em; line-height: 1.1; margin-top: 8px; }

/* ---------------- responsive ---------------- */
@media (max-width: 980px) {
  .home-grid { grid-template-columns: 1fr; gap: 30px; padding-top: 10px; }
  .lobby-grid { grid-template-columns: 1fr; }
  .game-body { grid-template-columns: 1fr; }
  .scoreboard { position: static; order: 2; }
  .modes { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 16px; }
  .hero h1 { font-size: 64px; }
  .hero p.tag { font-size: 16.5px; }
  .hero-disc { display: none; }
  .join-card, .card { padding: 18px; }
  .opts { grid-template-columns: 1fr; }
  .modes { gap: 8px; }
  .mode { padding: 12px; }
  .mode .d { display: none; }
  .now { grid-template-columns: 1fr; gap: 22px; padding: 20px; justify-items: center; text-align: center; }
  .now-info { width: 100%; }
  .controls { justify-content: center; }
  .now-info .num { justify-content: center; }
  .deck { width: 62vw; margin-right: 0; }
  .deck .vinyl { transform: translateX(14%); }
  .winner { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 24px; }
  .prompt-card { padding: 22px; }
  .big-code { font-size: 52px; }
  .topbar { gap: 8px; flex-wrap: wrap; }
  .topbar .vol { display: none; }
  .logo { font-size: 18px; }
  .result .pick { padding: 0 12px; }
  .tracklist { grid-template-columns: repeat(2, 1fr); }
  .reactbar button { width: 40px; height: 40px; font-size: 19px; }
  .other .by span.n { display: none; }
  .locked { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
