/* ==========================================================================
   JAMROOM — design system
   Dark gig-poster aesthetic: smoky red/cyan stage light, condensed display
   type, a brush-script accent. Mobile first.
   ========================================================================== */

:root {
  --bg: #09090b;
  --bg-2: #0f0f12;
  --surface: #141418;
  --surface-2: #1b1b21;
  --surface-3: #24242b;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #f4f4f2;
  --muted: #a3a3ad;
  --dim: #6d6d78;
  --accent: #ff3b4f;
  --accent-hi: #ff5b6c;
  --accent-soft: rgba(255, 59, 79, 0.14);
  --cyan: #2ee6e6;
  --cyan-soft: rgba(46, 230, 230, 0.12);
  --ok: #3ddc97;
  --warn: #ffb020;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  /* Kanit / Mali supply the Thai glyphs that the Latin fonts lack (room names can be Thai in any UI language). */
  --font: "Manrope", "Kanit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bebas Neue", "Kanit", "Oswald", Impact, sans-serif;
  --script: "Permanent Marker", "Mali", "Brush Script MT", cursive;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --tap: 48px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: #fff; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- stage-light backdrop ---------- */
.app { position: relative; min-height: 100dvh; isolation: isolate; }
.stage::before {
  content: ""; position: fixed; inset: -20vh -20vw auto; height: 90vh; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40vw 40vh at 18% 25%, rgba(255, 59, 79, 0.20), transparent 70%),
    radial-gradient(38vw 36vh at 72% 12%, rgba(46, 230, 230, 0.13), transparent 70%),
    radial-gradient(50vw 30vh at 50% 60%, rgba(255, 59, 79, 0.06), transparent 70%);
  filter: blur(10px);
}
.grain::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.05;
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- type ---------- */
.display { font-family: var(--display); font-weight: 400; letter-spacing: 0.02em; line-height: 0.92; text-transform: uppercase; margin: 0; }
.script { font-family: var(--script); font-weight: 400; color: var(--accent); letter-spacing: 0; text-transform: none; }
.eyebrow { font: 700 11px/1 var(--font); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.tnum { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
h1, h2, h3 { margin: 0; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

/* ---------- top nav ---------- */
.nav { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(9, 9, 11, 0.9), rgba(9, 9, 11, 0.6)); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link { font: 700 12px/1 var(--font); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  padding: 10px 12px; border-radius: 999px; transition: color .2s, background .2s; white-space: nowrap; }
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.logo { display: inline-flex; align-items: center; gap: 9px; font-family: var(--display); font-size: 26px; letter-spacing: 0.04em; line-height: 1; }
.logo-mark { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 22px; }
.logo-mark i { display: block; width: 4px; border-radius: 3px; background: var(--text); animation: eq 1.2s var(--ease) infinite alternate; }
.logo-mark i:nth-child(1) { height: 55%; background: var(--cyan); animation-delay: -.3s; }
.logo-mark i:nth-child(2) { height: 100%; background: var(--accent); animation-delay: -.8s; }
.logo-mark i:nth-child(3) { height: 75%; animation-delay: -.1s; }
.logo-mark i:nth-child(4) { height: 45%; background: var(--accent); animation-delay: -.6s; }
.logo-mark.still i { animation: none; }
.logo b { font-weight: 400; }
.logo em { font-family: var(--script); font-style: normal; font-size: 0.7em; color: var(--accent); margin-left: 1px; transform: translateY(-1px) rotate(-4deg); display: inline-block; }
@keyframes eq { from { transform: scaleY(0.45); } to { transform: scaleY(1); } }
.logo-mark i { transform-origin: bottom; }

/* ---------- buttons ---------- */
.btn { --b: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--b); color: var(--text); font: 700 13px/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s, opacity .2s; white-space: nowrap; user-select: none; }
.btn:hover { border-color: rgba(255, 255, 255, 0.25); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 10px 30px -10px rgba(255, 59, 79, 0.7); }
.btn-primary:hover { background: var(--accent-hi); border-color: transparent; }
.btn-light { background: var(--text); color: #0a0a0c; border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-outline { background: transparent; border: 1.5px solid var(--text); border-radius: 4px; }
.btn-danger { background: transparent; border-color: rgba(255, 59, 79, 0.5); color: var(--accent-hi); }
.btn-danger:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 11px; }
.btn-block { width: 100%; }
.btn.loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); transition: background .2s, transform .15s, color .2s, border-color .2s; flex: none; position: relative; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.sm svg { width: 17px; height: 17px; }
.icon-btn.plain { background: transparent; border-color: transparent; }
.icon-btn.plain:hover { background: rgba(255, 255, 255, 0.06); }
.icon-btn.big { width: 64px; height: 64px; background: var(--text); color: #0a0a0c; border: 0; }
.icon-btn.big svg { width: 28px; height: 28px; }
.icon-btn.big:hover { background: #fff; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  font: 700 11px/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase; background: rgba(255, 255, 255, 0.06);
  color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill svg { width: 13px; height: 13px; }
.pill.red { color: var(--accent-hi); background: var(--accent-soft); border-color: rgba(255, 59, 79, 0.25); }
.pill.cyan { color: var(--cyan); background: var(--cyan-soft); border-color: rgba(46, 230, 230, 0.25); }
.pill.ok { color: var(--ok); background: rgba(61, 220, 151, 0.1); border-color: rgba(61, 220, 151, 0.25); }
.pill.warn { color: var(--warn); background: rgba(255, 176, 32, 0.1); border-color: rgba(255, 176, 32, 0.25); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dot.live { box-shadow: 0 0 0 0 currentColor; animation: live 1.8s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, .6); } 100% { box-shadow: 0 0 0 8px rgba(61, 220, 151, 0); } }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span, .label { font: 700 11px/1 var(--font); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.input { width: 100%; min-height: 52px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); font-size: 16px; transition: border-color .2s, box-shadow .2s, background .2s; }
textarea.input { padding: 14px 16px; min-height: 84px; resize: vertical; }
.input::placeholder { color: var(--dim); }
.input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(46, 230, 230, 0.12); background: #0c0c0f; }
.input.invalid { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.hint { font-size: 13px; color: var(--dim); }
.form-error { color: var(--accent-hi); font-size: 14px; font-weight: 600; min-height: 1em; }
.form-error:empty { display: none; }

.pin-input { display: block; position: relative; }
.pin-input input { width: 100%; height: 72px; text-align: center; font: 400 44px/1 var(--display); letter-spacing: 0.7em; padding: 0 0 0 0.7em;
  border-radius: 16px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); caret-color: var(--accent); }
.pin-input input::placeholder { color: var(--surface-3); letter-spacing: 0.7em; }
.pin-input input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(46, 230, 230, 0.12); }
.pin-input.shake { animation: shake .4s; }
.pin-input.invalid input { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; gap: 4px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { min-height: 42px; border-radius: 999px; border: 0; background: transparent; color: var(--muted);
  font: 700 12px/1 var(--font); letter-spacing: 0.1em; text-transform: uppercase; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background .2s, color .2s; }
.seg button svg { width: 15px; height: 15px; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); }

.switch-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }
.switch-row .t { font-weight: 700; }
.switch-row .d { font-size: 13px; color: var(--dim); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.switch input:checked + span { background: var(--accent); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:disabled + span { opacity: .4; }
.switch input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }

.num-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.num-grid .input { min-height: 46px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-pad { padding: 20px; }
@media (min-width: 720px) { .card-pad { padding: 26px; } }

/* ---------- auth pages ---------- */
.auth { min-height: calc(100dvh - 64px); display: grid; place-items: center; padding: 32px 16px 60px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 56px; }
.auth-card .script { font-size: 26px; display: block; margin-bottom: 4px; transform: rotate(-3deg); transform-origin: left; }
.auth-foot { text-align: center; color: var(--muted); font-size: 14px; }
.auth-foot a, .link { color: var(--text); font-weight: 700; border-bottom: 1px solid var(--accent); }

/* ---------- landing ---------- */
.hero { position: relative; min-height: calc(100dvh - 64px); display: flex; align-items: center; padding: 40px 0 70px; overflow: hidden; }
.hero-inner { position: relative; z-index: 1; text-align: center; margin: 0 auto; max-width: 980px; }
.hero .script { font-size: clamp(34px, 7vw, 64px); display: inline-block; transform: rotate(-5deg); margin-bottom: -6px; text-shadow: 0 6px 30px rgba(255, 59, 79, .45); }
.hero h1 { font-size: clamp(64px, 15vw, 168px); letter-spacing: 0.01em; }
.hero h1 .outline { color: transparent; -webkit-text-stroke: 2px var(--text); }
.hero p.lead { color: var(--muted); font-size: clamp(16px, 2.4vw, 19px); max-width: 560px; margin: 22px auto 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.join-code { display: flex; gap: 8px; max-width: 380px; margin: 26px auto 0; padding: 6px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); }
.join-code input { flex: 1; min-width: 0; background: transparent; border: 0; padding: 0 16px; font: 400 24px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; }
.join-code input:focus { outline: none; }
.join-code input::placeholder { color: var(--dim); letter-spacing: .12em; }
.hero-bars { position: absolute; inset: auto 0 0; height: 36vh; display: flex; align-items: flex-end; gap: 6px; padding: 0 8px; opacity: .22; z-index: 0; mask-image: linear-gradient(to top, #000, transparent); -webkit-mask-image: linear-gradient(to top, #000, transparent); }
.hero-bars i { flex: 1; background: linear-gradient(to top, var(--accent), transparent); border-radius: 4px 4px 0 0; transform-origin: bottom; animation: eq 1.6s ease-in-out infinite alternate; }
.hero-bars i:nth-child(3n) { background: linear-gradient(to top, var(--cyan), transparent); }

.steps { display: grid; gap: 14px; padding: 70px 0; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { padding: 26px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden; }
.step .n { font: 400 88px/0.8 var(--display); color: transparent; -webkit-text-stroke: 1.5px var(--line-2); position: absolute; right: 18px; top: 16px; }
.step h3 { font: 400 32px/1 var(--display); letter-spacing: .02em; margin: 40px 0 8px; }
.step p { color: var(--muted); margin: 0; }
.section-title { text-align: center; margin-top: 30px; }
.section-title .script { font-size: 34px; display: block; color: var(--dim); transform: rotate(-3deg); }
.section-title h2 { font-size: clamp(40px, 7vw, 64px); }
.footer { border-top: 1px solid var(--line); padding: 30px 0 40px; color: var(--dim); font-size: 13px; }

/* ---------- dashboard ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; justify-content: space-between; padding: 36px 0 24px; }
.page-head h1 { font-size: clamp(52px, 9vw, 84px); }
.page-head .script { font-size: 28px; display: block; transform: rotate(-3deg); transform-origin: left; margin-bottom: 2px; }
.usage { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.usage-bar { width: 120px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.usage-bar b { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.rooms-grid { display: grid; gap: 14px; padding-bottom: 60px; }
@media (min-width: 720px) { .rooms-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .rooms-grid { grid-template-columns: repeat(3, 1fr); } }
.room-card { display: flex; flex-direction: column; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: border-color .2s, transform .2s var(--ease); }
.room-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.room-card .cover { position: relative; height: 128px; background: linear-gradient(135deg, #1a0b0f, #0b1718); overflow: hidden; }
.room-card .cover img { width: 100%; height: 100%; object-fit: cover; opacity: .55; filter: saturate(1.2); }
.room-card .cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--surface) 2%, transparent 70%); }
.room-card .cover .tags { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 6px; z-index: 1; flex-wrap: wrap; }
.room-card .cover .code { position: absolute; bottom: 8px; left: 18px; z-index: 1; font: 400 30px/1 var(--display); letter-spacing: .14em; }
.room-card .body { padding: 6px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.room-card h3 { font-size: 19px; font-weight: 800; }
.room-card .now { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-height: 20px; }
.room-card .now svg { width: 14px; height: 14px; color: var(--accent); flex: none; }
.room-card .meta { display: flex; gap: 14px; font-size: 12px; color: var(--dim); }
.room-card .actions { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; margin-top: auto; padding-top: 6px; }
.new-room { min-height: 300px; display: grid; place-items: center; text-align: center; border: 1.5px dashed var(--line-2); background: transparent; border-radius: var(--radius-lg); color: var(--muted); gap: 12px; transition: border-color .2s, color .2s, background .2s; }
.new-room:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.new-room .plus { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; margin: 0 auto 12px; box-shadow: 0 10px 30px -8px rgba(255,59,79,.7); }
.new-room .plus svg { width: 28px; height: 28px; }

/* ---------- empty / status screens ---------- */
.center-screen { min-height: calc(100dvh - 64px); display: grid; place-items: center; text-align: center; padding: 40px 16px; }
.center-screen h1 { font-size: clamp(48px, 10vw, 80px); }
.center-screen p { color: var(--muted); max-width: 420px; margin: 10px auto 24px; }
.big-emoji { font-size: 56px; line-height: 1; margin-bottom: 14px; }

/* ---------- lobby ---------- */
.lobby { min-height: calc(100dvh - 64px); display: grid; place-items: center; padding: 30px 16px 60px; }
.lobby-card { width: 100%; max-width: 440px; text-align: center; }
.lobby-card .code-tag { font: 400 20px/1 var(--display); letter-spacing: .3em; color: var(--dim); }
.lobby-card h1 { font-size: clamp(46px, 11vw, 72px); margin: 8px 0 6px; overflow-wrap: anywhere; }
.lobby-card .host { color: var(--muted); }
.lobby-card .host b { color: var(--text); }
.lobby-card form { text-align: left; margin-top: 26px; }
.lock-badge { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(255,59,79,.3); }
.lock-badge svg { width: 30px; height: 30px; }

/* ==========================================================================
   ROOM
   ========================================================================== */
.room-top { position: sticky; top: 0; z-index: 30; background: rgba(9, 9, 11, 0.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.room-top .wrap { display: flex; align-items: center; gap: 10px; height: 64px; }
.room-title { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.1; }
.room-title b { font: 400 24px/1 var(--display); letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-title span svg { width: 11px; height: 11px; flex: none; }
.room-title span { font-size: 11px; color: var(--dim); letter-spacing: .12em; text-transform: uppercase; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.room-top .logo { font-size: 0; gap: 0; }
.room-top .logo .logo-mark { height: 22px; }
.people-btn { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 800; font-size: 14px; }
.people-btn svg { width: 17px; height: 17px; color: var(--ok); }
.people-btn .n { font-variant-numeric: tabular-nums; }
.people-btn .l { display: none; color: var(--muted); font-weight: 600; }
@media (min-width: 560px) { .people-btn .l { display: inline; } }

.room-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; font-weight: 700; font-size: 14px; }
.room-banner svg { width: 18px; height: 18px; flex: none; }
.room-banner.warn { background: rgba(255,176,32,.1); color: var(--warn); border: 1px solid rgba(255,176,32,.25); }
.room-banner.red { background: var(--accent-soft); color: var(--accent-hi); border: 1px solid rgba(255,59,79,.28); }

.room-grid { display: grid; gap: 16px; padding: 16px 0 60px; }
@media (min-width: 1024px) {
  .room-grid { grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); gap: 24px; padding-top: 24px; align-items: start; }
  .room-side { position: sticky; top: 88px; }
  .room-side .add-form { flex-direction: column; }  /* narrower column: input and button stacked */
}
.room-main, .room-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* player */
.player-card { border-radius: var(--radius-lg); overflow: hidden; background: #000; border: 1px solid var(--line); position: relative; box-shadow: var(--shadow); }
.player-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.player-frame > div, .player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px;
  background: radial-gradient(60% 80% at 30% 20%, rgba(255,59,79,.22), transparent 70%), radial-gradient(60% 80% at 80% 90%, rgba(46,230,230,.14), transparent 70%), #0a0a0c; z-index: 1; }
.player-empty .display { font-size: clamp(34px, 7vw, 54px); }
.player-empty p { color: var(--muted); margin: 8px 0 0; }
.vinyl { width: 90px; height: 90px; border-radius: 50%; margin: 0 auto 16px; background: repeating-radial-gradient(circle, #111 0 2px, #1c1c1c 2px 4px); position: relative; box-shadow: 0 10px 40px rgba(0,0,0,.6); animation: spin 6s linear infinite; }
.vinyl::after { content: ""; position: absolute; inset: 34%; border-radius: 50%; background: var(--accent); box-shadow: inset 0 0 0 6px rgba(0,0,0,.25); }
.vinyl.stop { animation-play-state: paused; }

/* now playing */
.now-card { padding: 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 720px) { .now-card { padding: 22px 24px; } }
.now-top { display: flex; gap: 14px; align-items: flex-start; }
.now-thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-3); }
.now-info { min-width: 0; flex: 1; }
.now-info .t { font-size: 18px; font-weight: 800; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.now-info .c { color: var(--muted); font-size: 14px; margin-top: 3px; }
.now-by { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.now-by b { color: var(--text); }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font: 800 11px/1 var(--font); color: #0a0a0c; flex: none; text-transform: uppercase; }
.avatar.lg { width: 36px; height: 36px; font-size: 14px; }

.progress { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.progress .bar { flex: 1; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; position: relative; }
.progress .bar b { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--accent), #ff7a59); border-radius: 99px; transition: width .9s linear; }
.progress.paused .bar b { background: var(--dim); }

.controls { display: flex; align-items: center; gap: 10px; }
.controls .spacer { flex: 1; }
.volume { display: flex; align-items: center; gap: 6px; }
.volume input[type=range] { width: 90px; accent-color: var(--accent); }
@media (max-width: 420px) { .volume input[type=range] { display: none; } }
.eq-anim { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq-anim i { width: 3px; background: currentColor; border-radius: 2px; animation: eq .8s ease-in-out infinite alternate; transform-origin: bottom; }
.eq-anim i:nth-child(1) { height: 60%; animation-delay: -.4s; } .eq-anim i:nth-child(2) { height: 100%; } .eq-anim i:nth-child(3) { height: 40%; animation-delay: -.2s; }
.eq-anim.stop i { animation: none; height: 30%; }

.unmute-cta { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; border-radius: 14px; border: 1px dashed rgba(46,230,230,.5); background: var(--cyan-soft); color: var(--cyan); font-weight: 800; }
.unmute-cta svg { width: 20px; height: 20px; }

/* add song */
.add-card { padding: 18px; border-radius: var(--radius-lg); background: linear-gradient(135deg, rgba(255,59,79,.10), rgba(46,230,230,.05)), var(--surface); border: 1px solid var(--line); }
@media (min-width: 720px) { .add-card { padding: 22px 24px; } }
.add-card h2 { font: 400 28px/1 var(--display); letter-spacing: .03em; margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; }
.add-card h2 .script { font-size: 18px; }
.add-form { display: flex; flex-direction: column; gap: 10px; }
.add-input { position: relative; }
.add-input svg.yt { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--accent); pointer-events: none; }
.add-input .input { padding-left: 50px; }
.add-input .paste { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); min-height: 38px; padding: 0 14px; font-size: 11px; }
@media (min-width: 560px) { .add-form { flex-direction: row; } .add-input { flex: 1; } }
.add-help { margin-top: 10px; font-size: 12px; color: var(--dim); display: flex; gap: 12px; flex-wrap: wrap; }

/* side panel: tabs */
.side-card { border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.tabs { display: flex; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1; min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font: 700 12px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; padding: 0 12px; transition: background .2s, color .2s; }
.tab .c { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface-3); color: var(--text); display: inline-grid; place-items: center; font-size: 11px; letter-spacing: 0; }
.tab.on { background: var(--surface-2); color: var(--text); }
.tab.on .c { background: var(--accent); color: #fff; }
.tab-body { max-height: none; }
@media (min-width: 1024px) { .tab-body { max-height: max(280px, calc(100dvh - 430px)); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; } }
.panel-tools { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; }
.panel-tools .eyebrow { flex: 1; }

/* queue list */
.q-list { list-style: none; margin: 0; padding: 6px; }
.q-item { display: grid; grid-template-columns: 22px 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; position: relative; transition: background .2s; }
.q-item:hover { background: rgba(255,255,255,.03); }
.q-item .idx { font: 400 20px/1 var(--display); color: var(--dim); text-align: center; }
.q-item img { width: 56px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--surface-3); }
.q-item .t { font-weight: 700; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.q-item .m { font-size: 12px; color: var(--dim); display: flex; gap: 6px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.q-item .m b { color: var(--muted); font-weight: 700; }
.q-item .m .host-tag { color: var(--accent-hi); }
.q-item.mine { background: linear-gradient(90deg, rgba(46,230,230,.06), transparent 60%); }
.q-item.enter { animation: enter .55s var(--ease); }
.q-item.enter::before { content: ""; position: absolute; inset: 0; border-radius: 14px; border: 1px solid var(--cyan); opacity: 0; animation: flash 1.4s var(--ease); pointer-events: none; }
@keyframes enter { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }
.q-side { display: flex; align-items: center; gap: 2px; }
.vote { display: flex; align-items: center; gap: 0; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); height: 36px; }
.vote button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--dim); display: grid; place-items: center; transition: color .15s, transform .15s; }
.vote button svg { width: 16px; height: 16px; }
.vote button:hover { color: var(--text); }
.vote button:active { transform: scale(.85); }
.vote button.on.up { color: var(--ok); }
.vote button.on.down { color: var(--accent); }
.vote .s { min-width: 20px; text-align: center; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.vote .s.pop { animation: pop .35s var(--ease); }
@keyframes pop { 50% { transform: scale(1.45); color: var(--cyan); } }
.vote.readonly { padding: 0 10px; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 190px; padding: 6px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: enter .2s var(--ease); }
.menu button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; text-align: left; font-weight: 600; font-size: 14px; }
.menu button svg { width: 17px; height: 17px; color: var(--muted); }
.menu button:hover { background: rgba(255,255,255,.06); }
.menu button.danger { color: var(--accent-hi); }
.menu button.danger svg { color: var(--accent-hi); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }

.empty { text-align: center; padding: 44px 20px 48px; }
.empty .big-emoji { font-size: 44px; }
.empty h3 { font-size: 18px; font-weight: 800; }
.empty p { color: var(--muted); margin: 6px 0 18px; }

/* people */
.people { list-style: none; margin: 0; padding: 6px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; animation: enter .4s var(--ease); }
.person:hover { background: rgba(255,255,255,.03); }
.person .n { font-weight: 700; flex: 1; min-width: 0; }
.person .n small { display: block; font-size: 12px; font-weight: 600; color: var(--dim); }

/* history */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 14px 4px; }
.stat { padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.stat b { display: block; font: 400 28px/1 var(--display); letter-spacing: .02em; }
.stat span { font-size: 11px; color: var(--dim); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- modal / sheet ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.modal { width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 24px 24px 0 0; box-shadow: var(--shadow); animation: sheet .35s var(--ease); padding-bottom: env(safe-area-inset-bottom); overscroll-behavior: contain; }
@media (min-width: 640px) { .modal-backdrop { align-items: center; padding: 20px; } .modal { border-radius: 24px; animation: pop-in .3s var(--ease); } }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 400 30px/1 var(--display); letter-spacing: .03em; flex: 1; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.modal-foot { position: sticky; bottom: 0; padding: 14px 20px; background: var(--surface); border-top: 1px solid var(--line); display: flex; gap: 10px; }
.modal-foot .btn { flex: 1; }
.section-label { font: 700 11px/1 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--accent-hi); margin: 6px 0 -6px; }
.grab { width: 40px; height: 4px; border-radius: 99px; background: var(--line-2); margin: 8px auto 0; }
@media (min-width: 640px) { .grab { display: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop-in { from { transform: scale(.96); opacity: 0; } }

.share-qr { width: 220px; max-width: 70vw; aspect-ratio: 1; margin: 0 auto; padding: 14px; border-radius: 20px; background: #fff; }
.share-qr img { width: 100%; height: 100%; }
.share-code { text-align: center; }
.share-code b { display: block; font: 400 54px/1 var(--display); letter-spacing: .22em; margin-right: -.22em; }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-size: 14px; min-height: 48px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 200; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column-reverse; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: rgba(28, 28, 34, 0.96); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; pointer-events: auto; animation: toast-in .35s var(--ease); backdrop-filter: blur(10px); }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.success svg { color: var(--ok); }
.toast.error { border-color: rgba(255,59,79,.45); }
.toast.error svg { color: var(--accent); }
.toast.info svg { color: var(--cyan); }
.toast.out { animation: toast-out .3s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }

.conn-banner { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; align-items: center; gap: 9px; padding: 9px 16px; border-radius: 999px; font-weight: 800; font-size: 13px; box-shadow: var(--shadow); animation: toast-in .3s var(--ease); }
.conn-banner.bad { background: var(--warn); color: #1a1200; }
.conn-banner.good { background: var(--ok); color: #03170e; }
.conn-banner .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(0,0,0,.25); border-top-color: currentColor; animation: spin .7s linear infinite; }

/* ---------- tables (admin) ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t th { font: 700 11px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); background: var(--bg-2); }
table.t select { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 24px; }
@media (min-width: 820px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- skeleton ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- PRO upsell / insights ---------- */
.pro-box { padding: 16px 18px; border-radius: var(--radius); border: 1px solid rgba(46, 230, 230, 0.25);
  background: linear-gradient(135deg, rgba(46,230,230,.08), rgba(255,59,79,.06)), var(--bg-2); }
.pro-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 9px; }
.pro-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.pro-list li b { color: var(--text); }
.pro-list li svg { width: 17px; height: 17px; color: var(--cyan); flex: none; margin-top: 2px; }
.verdict { padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); margin-bottom: 14px; }
.verdict b { display: block; font-size: 17px; margin-bottom: 4px; }
.verdict.hot { border-color: rgba(61,220,151,.4); background: rgba(61,220,151,.07); }
.verdict.warm { border-color: rgba(255,176,32,.4); background: rgba(255,176,32,.07); }
.seg.sm { display: inline-grid; } .seg.sm button { min-height: 34px; padding: 0 14px; font-size: 11px; }
table.t td.wrap { white-space: normal; min-width: 220px; max-width: 420px; }

/* ---------- legal pages ---------- */
.legal { max-width: 780px; padding-bottom: 70px; line-height: 1.75; }
.legal .lead { color: var(--text); font-size: 16px; margin: 0 0 8px; }
.legal section { padding: 20px 0 4px; border-top: 1px solid var(--line); margin-top: 18px; }
.legal h2 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.legal section > div { color: var(--muted); }
.legal ul { margin: 6px 0 8px; padding-left: 20px; display: grid; gap: 6px; }
.legal b { color: var(--text); font-weight: 700; }
.legal code { font-size: 13px; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); color: var(--cyan); }
.legal-switch { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.legal[lang="th"] .display { font-family: var(--font); font-weight: 800; letter-spacing: 0; line-height: 1.15; font-size: clamp(34px, 6vw, 52px); text-transform: none; }
.fine { font-size: 12.5px; color: var(--dim); text-align: center; margin: 0; }
.fine .link { font-weight: 600; color: var(--muted); }

/* ---------- speaker mode: remote view (no video on this device) ---------- */
.player-remote { position: absolute; inset: 0; z-index: 1; overflow: hidden; display: grid; place-items: center; background: #0a0a0c; }
.player-remote .bg { position: absolute; inset: -12%; width: 124%; height: 124%; object-fit: cover; filter: blur(34px) saturate(1.3) brightness(.45); }
.player-remote .inner { position: relative; text-align: center; padding: 14px; display: grid; gap: 10px; justify-items: center; }
.player-remote .cover { width: min(42%, 180px); height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.player-remote p { margin: 0; color: var(--muted); font-size: 13px; }
.speaker-pill { height: 24px; }
@media (max-width: 420px) { .speaker-pill { display: none; } .player-remote .cover { width: 34%; } }


/* ==========================================================================
   Thai
   - Thai letters carry vowels/tone marks above and below: tight line-heights clip them.
   - Wide letter-spacing and uppercase are Latin conventions; they make Thai hard to read.
   ========================================================================== */
.room-title b, .lobby-card h1, .modal-head h2, .add-card h2, .step h3, .display { font-weight: 500; }   /* Thai falls back to Kanit Medium; Bebas has one weight */
.room-title b { line-height: 1.3; }
.lobby-card h1 { line-height: 1.14; }

.lang-btn { height: 34px; min-width: 40px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent;
  color: var(--muted); font: 700 12px/1 var(--font); letter-spacing: .04em; transition: color .2s, border-color .2s; }
.lang-btn:hover { color: var(--text); border-color: rgba(255,255,255,.3); }

html[lang="th"] body { line-height: 1.6; }
html[lang="th"] .display { font-family: "Kanit", var(--font); font-weight: 700; letter-spacing: 0; line-height: 1.2; text-transform: none; }
html[lang="th"] .script { font-family: "Mali", "Kanit", cursive; font-weight: 700; }
html[lang="th"] :is(.eyebrow, .btn, .nav-link, .tab, .pill, .seg button, .field > span, .label, .section-label, .people-btn, .stat span, .room-title span, table.t th) { letter-spacing: 0.01em; }
html[lang="th"] :is(.btn, .tab, .seg button, .nav-link) { font-size: 14px; font-weight: 600; }
html[lang="th"] .btn-sm { font-size: 13px; }
html[lang="th"] :is(.eyebrow, .field > span, .label, .section-label, .pill, .stat span) { font-size: 12.5px; }
html[lang="th"] .hero h1 { font-size: clamp(46px, 10.5vw, 116px); line-height: 1.16; }
html[lang="th"] .hero .script { font-size: clamp(22px, 4.6vw, 40px); margin-bottom: 6px; }
html[lang="th"] .page-head h1 { font-size: clamp(40px, 7vw, 64px); }
html[lang="th"] .auth-card h1 { font-size: 44px; }
html[lang="th"] .center-screen h1 { font-size: clamp(34px, 7vw, 56px); }
html[lang="th"] .section-title h2 { font-size: clamp(30px, 5.4vw, 48px); }
html[lang="th"] :is(.modal-head h2, .add-card h2, .step h3) { font-family: "Kanit", var(--font); font-weight: 600; font-size: 22px; line-height: 1.3; letter-spacing: 0; }
html[lang="th"] .add-card h2 .script { font-size: 15px; }
html[lang="th"] .player-empty .display { font-size: clamp(24px, 5vw, 38px); }
html[lang="th"] .new-room .display { font-size: 24px !important; }
html[lang="th"] .q-item .t, html[lang="th"] .now-info .t { line-height: 1.45; }

/* Narrow phones: the language button must not push the nav off-screen. */
@media (max-width: 480px) {
  .nav .wrap { gap: 6px; }
  .nav-links { gap: 0; }
  .nav .nav-link { padding-left: 8px; padding-right: 8px; white-space: nowrap; }
  .nav .btn-sm { padding-left: 12px; padding-right: 12px; white-space: nowrap; }
  .lang-btn { min-width: 34px; padding: 0 8px; margin-right: 2px; }
}
@media (max-width: 420px) { .nav .logo em { display: none; } }

/* Dashboard: rooms the member recently joined */
.rooms-grid:has(+ .recent) { padding-bottom: 36px; }
.recent { padding-bottom: 60px; }
.recent:has(+ .recent) { padding-bottom: 36px; }
.recent-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.recent-head h2 { font-size: 30px; margin: 0; }
.recent-list { display: grid; gap: 8px; }
@media (min-width: 900px) { .recent-list { grid-template-columns: repeat(2, 1fr); } }
.recent-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: border-color .2s, transform .2s var(--ease); min-width: 0; }
.recent-row:hover { border-color: var(--line-2); transform: translateY(-1px); }
.recent-row .thumb { flex: none; width: 64px; height: 44px; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.05); display: grid; place-items: center; color: var(--muted); }
.recent-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-row .info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.recent-row .info b { font-size: 15px; }
.recent-row .sub { font-size: 12.5px; color: var(--muted); }
.recent-row .side { flex: none; display: grid; justify-items: end; gap: 4px; }
.recent-row .when { font-size: 12px; }
.recent-row .thumb svg { width: 20px; height: 20px; }
.recent-row .info b svg { width: 13px; height: 13px; margin-right: 5px; vertical-align: -1px; color: var(--muted); }
.trending .recent-list { grid-template-columns: 1fr; }
@media (min-width: 900px) { .trending .recent-list { grid-template-columns: repeat(3, 1fr); } }
.trending .recent-row { border-color: rgba(255, 176, 32, 0.22); background: linear-gradient(120deg, rgba(255, 176, 32, 0.07), var(--surface) 55%); }
.recent-row .rank { flex: none; width: 22px; text-align: center; font-size: 26px; color: var(--warn); }
.recent-row .hot { color: var(--warn); font-weight: 600; }

/* Room: one-tap re-adds under the add box */
.again-group { margin-top: 16px; }
.again-title { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.again-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.again-item { flex: none; width: 112px; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; scroll-snap-align: start; font: inherit; }
.again-item .th { position: relative; display: grid; place-items: center; width: 112px; height: 63px; border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--muted); }
.again-item .th img { width: 100%; height: 100%; object-fit: cover; }
.again-item .th > svg { width: 20px; height: 20px; }
.again-item .plus { position: absolute; right: 5px; bottom: 5px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.again-item .plus svg { width: 14px; height: 14px; }
.again-item .tt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; font-size: 12px; line-height: 1.35; color: var(--text); }
.again-item:hover .th, .again-item:focus-visible .th { border-color: var(--line-2); }
.again-item:active { transform: scale(.97); }

/* Support JAMROOM */
.support-link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.dash-foot { margin: 0; padding: 0 0 48px; text-align: center; font-size: 13px; color: var(--dim); }
.support-amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 16px; }
.support-amount { display: grid; gap: 2px; justify-items: center; padding: 16px 8px 14px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface-2, rgba(255,255,255,.04)); color: var(--text); text-decoration: none; transition: border-color .2s, transform .2s var(--ease), background .2s; }
.support-amount b { font-size: 34px; line-height: 1; }
.support-amount span { font-size: 11.5px; color: var(--muted); text-align: center; }
.support-amount:hover, .support-amount:focus-visible { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.support-notes { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 12.5px; color: var(--dim); }

/* ?debug=1 diagnostics overlay in a room */
.debug-box { position: fixed; left: 8px; bottom: 8px; z-index: 60; margin: 0; padding: 8px 10px; max-width: calc(100vw - 16px); border-radius: 10px; background: rgba(0,0,0,.86); border: 1px solid var(--line-2); color: #9fe6c0; font: 11px/1.45 ui-monospace, Menlo, monospace; white-space: pre-wrap; pointer-events: none; }

/* Room: song search results under the add box */
#search-results:empty { display: none; }
#search-results { margin-top: 14px; }
.search-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.search-list { display: grid; gap: 6px; max-height: 360px; overflow-y: auto; padding-right: 2px; }
.search-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px 6px 6px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: inherit; text-align: left; cursor: pointer; font: inherit; transition: border-color .2s, background .2s; }
.search-row:hover:not(:disabled), .search-row:focus-visible { border-color: var(--line-2); background: rgba(255,255,255,.06); }
.search-row:disabled { cursor: default; opacity: .6; }
.search-row .th { flex: none; width: 80px; height: 45px; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.05); display: grid; place-items: center; color: var(--muted); }
.search-row .th img { width: 100%; height: 100%; object-fit: cover; }
.search-row .info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.search-row .info b { font-size: 13.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-row .sub { font-size: 12px; color: var(--muted); }
.search-row .go { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; }
.search-row .go svg { width: 16px; height: 16px; }
.search-row:disabled .go { background: none; width: auto; }
