/* WCA Room (room.html): the app's multi-guest LIVE in the browser.
   Lobby = create card + live rooms; room = 9:16 stage with the guest grid
   (TikTok multi-guest), controls under it, chat / people on the right
   (stacked under the stage on phones). Always dark, like the app's live. */
:root {
  color-scheme: dark;
  --bg: #08090d;
  --panel: #12141b;
  --panel2: #1a1d27;
  --line: #262a37;
  --ink: #f1f3f8;
  --mute: #8f97a8;
  --live: #fe2c55;
  --aqua: #25f4ee;
  --gold: #f6c445;
  --ok: #3ddc97;
  --sans: "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
  /* the app's live-room backdrop: pink top right, violet left, teal low */
  --roombg: radial-gradient(120% 55% at 100% 0, rgba(214,51,108,.55), transparent 62%), radial-gradient(90% 55% at 0 42%, rgba(96,64,190,.5), transparent 66%), radial-gradient(95% 50% at 100% 88%, rgba(18,112,132,.48), transparent 66%), #0b0d1d;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; overflow: hidden; }
button, select { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; }
input, select { font: inherit; color: var(--ink); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.muted { color: var(--mute); }
.empty { color: var(--mute); text-align: center; padding: 28px 16px; line-height: 1.55; font-size: 13px; }

.app { height: 100%; height: 100dvh; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); }

/* ------------------------------------------------------------- header */
.top { display: flex; align-items: center; gap: 10px; padding: 10px max(14px, env(safe-area-inset-right)) 10px max(10px, env(safe-area-inset-left)); background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; }
.ib { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--mute); flex: none; }
.ib:hover { background: var(--panel2); color: var(--ink); }
.ib.on { color: var(--aqua); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; white-space: nowrap; }
.brand img { border-radius: 6px; }
.inroom .brand span { display: none; }
.sp { flex: 1; }
.av { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--gold) center / cover no-repeat; }
.hostcard { display: flex; align-items: center; gap: 8px; min-width: 0; background: rgba(255,255,255,.06); border-radius: 22px; padding: 4px 12px 4px 4px; }
.hostcard .av { width: 34px; height: 34px; }
.hc-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.hc-t b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.hc-t small { color: var(--mute); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.hc-likes { color: #ff8fa6; font-size: 12px; font-weight: 700; white-space: nowrap; padding-left: 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; background: rgba(255,255,255,.07); font-weight: 700; position: relative; }
.pill:hover { background: rgba(255,255,255,.12); }
.pill svg { width: 17px; height: 17px; }
.pill em { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--live); color: #fff; font: 700 11px/18px var(--sans); text-align: center; padding: 0 5px; }
.acct { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 4px; border-radius: 18px; background: var(--panel2); border: 1px solid var(--line); font-weight: 600; max-width: 200px; min-width: 0; }
.acct span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn { height: 38px; padding: 0 16px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; white-space: nowrap; background: var(--panel2); border: 1px solid var(--line); }
.btn:hover:not(:disabled) { border-color: #3c4458; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn.ghost { background: transparent; }
.btn.end { background: transparent; color: var(--live); border-color: var(--live); }
.golive { background: var(--live); border-color: var(--live); color: #fff; }
.golive:hover:not(:disabled) { background: #ff4469; }
.btn.big { height: 48px; font-size: 15.5px; border-radius: 14px; width: 100%; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; animation: blink 1.1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* -------------------------------------------------------------- lobby */
.lobby { overflow: auto; padding: 22px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 22px; align-content: start; grid-auto-rows: max-content; max-width: 1240px; width: 100%; margin: 0 auto; }
.create { background: linear-gradient(160deg, #1a1220, #12141b 55%); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.cr-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 14px; height: 168px; background: radial-gradient(circle at 30% 0, rgba(254,44,85,.35), transparent 60%), radial-gradient(circle at 90% 100%, rgba(37,244,238,.25), transparent 60%); }
.cr-art i { border-radius: 10px; background: rgba(255,255,255,.07); position: relative; }
.cr-art i:first-child { background: linear-gradient(135deg, rgba(254,44,85,.55), rgba(160,107,255,.45)); }
.cr-art i:first-child::after { content: "Host"; position: absolute; left: 6px; top: 6px; font: 700 10px var(--sans); background: var(--live); padding: 2px 6px; border-radius: 6px; }
.cr-art i:nth-child(n+4)::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; color: rgba(255,255,255,.45); }
.cr-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.cr-body h1 { margin: 0; font-size: 22px; }
.cr-body p { margin: 0; line-height: 1.55; font-size: 13.5px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { color: var(--mute); font-size: 12px; font-weight: 600; }
.field input:not([type=range]), .field select { height: 42px; border-radius: 11px; background: var(--panel2); border: 1px solid var(--line); padding: 0 12px; outline: 0; width: 100%; }
.field input:focus { border-color: #4a5470; }
.seg { display: inline-flex; background: var(--panel2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { height: 34px; min-width: 52px; padding: 0 12px; border-radius: 8px; font-weight: 700; color: var(--mute); }
.seg button.on { background: var(--ink); color: #0b0d12; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--live); }
.hint { color: var(--mute); font-size: 12px; margin: 0; }
.hint.warn { color: #ffcf7a; line-height: 1.5; }
.roomlist h2 { margin: 6px 0 14px; font-size: 17px; display: flex; align-items: baseline; gap: 8px; }
.roomlist h2 small { color: var(--mute); font-weight: 600; font-size: 12.5px; }
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.rooms .empty { grid-column: 1 / -1; background: var(--panel); border: 1px dashed var(--line); border-radius: 16px; }
.rcard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); text-align: left; min-width: 0; }
.rcard:hover { border-color: #3c4458; background: var(--panel2); }
.rcard .av { width: 44px; height: 44px; font-size: 16px; box-shadow: 0 0 0 2px var(--live); }
.rc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rc-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-t small { color: var(--mute); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-live { display: inline-flex; align-items: center; gap: 5px; background: var(--live); color: #fff; font-size: 10.5px; font-weight: 800; padding: 3px 7px; border-radius: 6px; }
.rc-live .dot { width: 6px; height: 6px; }
.rc-v { color: var(--mute); font-size: 12px; white-space: nowrap; }

/* --------------------------------------------------------------- room */
.room { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
.stagewrap { display: flex; flex-direction: column; align-items: center; min-height: 0; padding: 12px 12px 10px; gap: 10px; }
.stagebox { flex: 1; min-height: 0; width: 100%; display: grid; place-items: center; container-type: size; }
.stage { height: min(100cqh, 100cqw * 16 / 9); aspect-ratio: 9 / 16; position: relative; border-radius: 18px; overflow: hidden; background: var(--roombg); box-shadow: 0 18px 60px rgba(0,0,0,.5); }
.grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); grid-template-rows: repeat(var(--rows, 3), 1fr); gap: 3px; padding: 3px; }
.tile { position: relative; border-radius: 12px; overflow: hidden; background: linear-gradient(160deg, rgba(255,255,255,.15), rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.13); cursor: pointer; transition: box-shadow .15s, background .15s; }
.tile .vid { position: absolute; inset: 0; }
.tile .vid video { object-fit: cover !important; }
.tile.mirror .vid { transform: scaleX(-1); }
.tile .ph { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20,22,34,.35) center / cover no-repeat; }
.tile .ph::before { content: ""; position: absolute; inset: 0; backdrop-filter: blur(18px) brightness(.55); -webkit-backdrop-filter: blur(18px) brightness(.55); }
.tile .ph > * { grid-area: 1 / 1; }
.tile .ph .av.big { position: relative; width: 42%; height: auto; aspect-ratio: 1; max-width: 96px; font-size: clamp(14px, 4cqw, 34px); box-shadow: 0 0 0 3px rgba(255,255,255,.14); transition: transform .09s linear, box-shadow .2s; }
/* voice pulse (TikTok voice seat): the avatar swells with the level (--lv
   0..1 from meterTick) and sends out rings while the person talks */
.tile .ph .pr { position: relative; width: 42%; max-width: 96px; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--aqua); opacity: 0; pointer-events: none; }
.tile.talk .ph .av.big { transform: scale(calc(1 + var(--lv, 0) * .14)); box-shadow: 0 0 0 3px var(--aqua), 0 0 calc(10px + var(--lv, 0) * 26px) rgba(37,244,238,.55); }
.tile.talk .ph .pr { animation: voicering 1.5s ease-out infinite; }
.tile.talk .ph .pr:nth-child(2) { animation-delay: .5s; }
.tile.talk .ph .pr:nth-child(3) { animation-delay: 1s; }
@keyframes voicering { 0% { transform: scale(1); opacity: .85; } 100% { transform: scale(1.9); opacity: 0; } }
.tile.live .ph, .tile.empty .ph, .tile.empty .lbl { display: none; }
.tile .empty-t { display: none; }
.tile.empty .empty-t { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: rgba(255,255,255,.72); font-weight: 700; font-size: clamp(12px, 3.6cqw, 17px); container-type: inline-size; }
.tile.empty:hover { background: linear-gradient(160deg, rgba(255,255,255,.22), rgba(255,255,255,.07)); }
.tile .chair { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(254,44,85,.16); color: #ff6f8c; box-shadow: 0 0 0 0 rgba(254,44,85,.5); animation: chair 3s ease-in-out infinite; }
@keyframes chair { 0%, 100% { transform: translateY(0); box-shadow: 0 0 0 0 rgba(254,44,85,.35); } 50% { transform: translateY(-3px); box-shadow: 0 0 0 8px rgba(254,44,85,0); } }
.tile .lbl { position: absolute; left: 6px; bottom: 6px; right: 6px; display: flex; align-items: center; gap: 4px; pointer-events: none; }
.tile .lbl b { font-size: 11.5px; background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.tile .mute:empty { display: none; }
.tile .mute { width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; color: #ff6f8c; flex: none; }
.tile .mute svg { width: 12px; height: 12px; }
.tile .badge { position: absolute; left: 6px; top: 6px; font-size: 10.5px; font-weight: 800; color: rgba(255,255,255,.55); }
.tile.hostbox .badge { color: #fff; background: var(--live); padding: 2px 7px; border-radius: 6px; }
.tile .badge:empty { display: none; }
.tile.talk { box-shadow: inset 0 0 0 2px var(--aqua), 0 0 14px rgba(37,244,238,.35); }

.ctrls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.cb { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 62px; color: var(--ink); }
.cb .ci { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.09); transition: background .15s; }
.cb:hover .ci { background: rgba(255,255,255,.16); }
.cb small { font-size: 11px; color: var(--mute); font-weight: 600; }
.cb.off .ci { background: rgba(254,44,85,.18); color: #ff6f8c; }
.cb.music .ci { background: linear-gradient(135deg, #a06bff, #fe2c55); }
.cb.music.on .ci { box-shadow: 0 0 0 3px rgba(254,44,85,.35); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(254,44,85,.08); } }
.cb.req .ci { background: var(--live); }

.hearts { position: absolute; right: 10px; bottom: 10px; width: 60px; height: 60%; pointer-events: none; }
.hearts span { position: absolute; bottom: 0; right: 14px; font-size: 26px; animation: heart var(--d, 2.6s) ease-out forwards; }
.hearts span.mine { font-size: 32px; }
@keyframes heart { 0% { transform: translate(0, 0) scale(.4); opacity: 0; } 12% { opacity: 1; transform: translate(0, -20px) scale(1.1); } 100% { transform: translate(var(--x, 0), -360px) scale(.9); opacity: 0; } }
.giftfx { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; }
.gb { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; gap: 8px; animation: gift 2.8s ease-out forwards; }
.gb .ge { font-size: 92px; filter: drop-shadow(0 8px 24px rgba(254,44,85,.5)); }
.gb .gn { background: rgba(0,0,0,.6); padding: 6px 14px; border-radius: 16px; font-size: 13px; }
@keyframes gift { 0% { transform: scale(.3); opacity: 0; } 15% { transform: scale(1.15); opacity: 1; } 25% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-40px); } }
.nowplay { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: 80%; background: rgba(0,0,0,.55); padding: 5px 12px; border-radius: 14px; font-size: 12px; font-weight: 600; pointer-events: none; }
.nowplay span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; flex: none; }
.eq i { width: 3px; background: var(--aqua); border-radius: 1px; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .2s; } .eq i:nth-child(3) { animation-delay: .45s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }

.tune, .xbtn, .compose .rb { display: none; }

/* side: chat + people */
.side { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--line); }
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { flex: 1; height: 44px; font-weight: 700; color: var(--mute); border-bottom: 2px solid transparent; position: relative; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--live); }
.tabs em { font-style: normal; background: var(--live); color: #fff; border-radius: 9px; font-size: 11px; padding: 1px 6px; margin-left: 4px; }
.panel { flex: 1; overflow: auto; min-height: 0; padding: 10px 12px; }
.feed { display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 9px; align-items: flex-start; }
.msg .av { width: 30px; height: 30px; }
.msg .t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.msg .nm { color: var(--mute); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.msg .nm i { font-style: normal; background: var(--live); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 5px; }
.msg .tx { font-weight: 600; line-height: 1.4; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.sys .tx { color: var(--mute); font-weight: 500; }
.msg .gift { color: #ff8fa6; }
.gsec { color: var(--mute); font-size: 12px; font-weight: 700; margin: 12px 2px 6px; text-transform: uppercase; letter-spacing: .04em; }
.gsec:first-child { margin-top: 2px; }
.prow { display: flex; align-items: center; gap: 10px; padding: 7px 4px; }
.prow .av { width: 36px; height: 36px; }
.pt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt small { color: var(--mute); font-size: 12px; }
.prow .b { height: 30px; padding: 0 12px; border-radius: 9px; font-weight: 700; font-size: 12.5px; background: var(--panel2); border: 1px solid var(--line); }
.prow .b.ok { background: var(--live); border-color: var(--live); color: #fff; }
.prow .b.no { color: var(--mute); }
.compose { display: flex; align-items: center; gap: 8px; padding: 10px 12px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); flex: none; }
.compose input { flex: 1; min-width: 0; height: 40px; border-radius: 20px; background: var(--panel2); border: 1px solid var(--line); padding: 0 14px; outline: 0; }
.compose .send { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--mute); }
.compose .rose { font-size: 20px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.07); }
.compose .heart { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(254,44,85,.16); color: var(--live); }
.compose .heart svg { fill: currentColor; stroke: none; width: 22px; height: 22px; }
.compose .heart:active { transform: scale(.9); }

/* ------------------------------------------------------------- sheets */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; justify-content: flex-end; }
.sh-card { width: min(440px, 100%); height: 100%; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 16px; overflow: hidden; animation: slidein .2s ease-out; }
.sh-card.small { height: auto; align-self: center; margin-right: 24px; border: 1px solid var(--line); border-radius: 18px; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.sh-head { display: flex; align-items: center; gap: 10px; }
.sh-head h3 { margin: 0; font-size: 17px; flex: 1; }
.player { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; background: linear-gradient(135deg, rgba(160,107,255,.18), rgba(254,44,85,.14)); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.pl-art { width: 64px; height: 64px; border-radius: 12px; background: var(--panel2) center / cover; display: grid; place-items: center; color: rgba(255,255,255,.8); }
.pl-art svg { width: 26px; height: 26px; }
.pl-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pl-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.pl-main small { color: var(--mute); font-size: 12px; }
.pl-seek { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--mute); margin-top: 6px; font-variant-numeric: tabular-nums; }
.pl-seek input { flex: 1; min-width: 0; accent-color: var(--live); }
.pl-btns { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; gap: 10px; }
.pl-btns .play { width: 52px; height: 52px; border-radius: 50%; background: var(--ink); color: #0b0d12; display: grid; place-items: center; }
.pl-btns .play svg { fill: currentColor; width: 22px; height: 22px; }
.vols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vols label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--mute); font-weight: 600; }
.vols input, .field input[type=range] { accent-color: var(--live); width: 100%; }
.mnote { margin: 0; color: var(--mute); font-size: 12px; line-height: 1.5; }
.msearch { display: flex; align-items: center; gap: 8px; height: 40px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); padding: 0 12px; color: var(--mute); flex: none; }
.msearch input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; }
.msearch svg { width: 17px; height: 17px; }
.songs { flex: 1; overflow: auto; min-height: 0; margin: 0 -6px; }
.song { display: flex; align-items: center; gap: 12px; padding: 7px 6px; border-radius: 12px; cursor: pointer; }
.song:hover { background: var(--panel2); }
.song.on { background: rgba(254,44,85,.12); }
.song.on .st b { color: #ff6f8c; }
.sa { width: 42px; height: 42px; border-radius: 9px; flex: none; display: grid; place-items: center; background-size: cover; background-position: center; color: rgba(255,255,255,.85); }
.sa svg { width: 18px; height: 18px; }
.sa .eq { background: rgba(0,0,0,.45); padding: 6px; height: auto; border-radius: 6px; }
.st { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.st small { color: var(--mute); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .del { width: 30px; height: 30px; opacity: .6; }
.song .del svg { width: 15px; height: 15px; }
.pcbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pcbar small { font-size: 11.5px; }

/* ------------------------------------------------------------- modals */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.card h2 { margin: 0; font-size: 18px; }
.card p { margin: 0; line-height: 1.5; font-size: 13.5px; }
.card input { height: 44px; border-radius: 11px; background: var(--panel2); border: 1px solid var(--line); padding: 0 12px; outline: 0; }
.card .row { display: flex; gap: 10px; justify-content: flex-end; }
.btn.google { background: #fff; color: #1f1f1f; border-color: #fff; }
.or { display: flex; align-items: center; gap: 10px; color: var(--mute); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.err { color: #ff8fa6; font-size: 12.5px; min-height: 1em; margin: 0; }
.menu { gap: 6px; }
.menu h2 { margin-bottom: 6px; }
.mi { height: 46px; border-radius: 12px; background: var(--panel2); font-weight: 700; text-align: left; padding: 0 16px; }
.mi:hover { background: #22263a; }
.mi.danger { color: #ff6f8c; }
.mi.ghost { background: transparent; color: var(--mute); text-align: center; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #262a37; color: var(--ink); padding: 11px 18px; border-radius: 14px; font-weight: 600; font-size: 13.5px; opacity: 0; pointer-events: none; transition: .2s; z-index: 70; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------- phones */
@media (max-width: 899px) {
  .lobby { grid-template-columns: minmax(0, 1fr); padding-top: 14px; }
  .roomlist { order: -1; }
  .top { gap: 6px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 8px; }
  .acct span:last-child, .hc-likes { display: none; }
  .inroom .acct, .inroom .brand { display: none; }
  .hostcard { flex: 1 1 auto; }
  .acct { padding-right: 4px; }
  .hc-t b, .hc-t small { max-width: 34vw; }
  .room { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .stagewrap { padding: 8px 8px 6px; gap: 8px; }
  .side { border-left: 0; border-top: 1px solid var(--line); height: 34dvh; }
  .sidepeek .side { height: 62dvh; }
  .cb { min-width: 52px; }
  .cb .ci { width: 42px; height: 42px; }
  .sheet { align-items: flex-end; }
  .sh-card { height: 88dvh; border-left: 0; border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; animation-name: slideup; }
  .sh-card.small { height: auto; margin: 0; align-self: auto; border-radius: 20px 20px 0 0; }
  @keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
  .btn.end, .btn.ghost#leaveBtn { padding: 0 12px; }
  .btn.end { font-size: 12.5px; }
  .pill { padding: 0 9px; }
}
/* phones in a room = the app's live screen: full-screen backdrop, grid across
   the top, TikTok chat on the backdrop, round buttons at the bottom; mic /
   camera / music / devices under the pink tune button (.ctrlsopen). */
@media (max-width: 899px) {
  body.inroom { background: var(--roombg); }
  body.inroom .app { background: transparent; }
  .inroom .top { background: transparent; border-bottom: 0; gap: 8px; }
  .inroom #backBtn, .inroom #endBtn, .inroom #leaveBtn { display: none; }
  .inroom .top { gap: 6px; }
  .inroom .hostcard { background: rgba(0,0,0,.32); flex: 0 1 auto; min-width: 0; }
  .inroom .hc-t b { max-width: 100%; }
  .inroom .pill { padding: 0 10px; }
  .inroom .hc-likes { display: inline; }
  .inroom .hc-t small { display: none; }
  .inroom .pill { background: rgba(0,0,0,.32); }
  .inroom .xbtn { display: grid; color: #fff; width: 38px; height: 38px; }
  .inroom .xbtn svg { width: 26px; height: 26px; stroke-width: 2.4; }
  .inroom .tune { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--live); color: #fff; box-shadow: 0 4px 14px rgba(254,44,85,.4); flex: none; }
  .inroom .tune[hidden] { display: none; }
  .ctrlsopen .tune { background: #fff; color: var(--live); }
  .room { display: flex; flex-direction: column; background: transparent; }
  .stagewrap { flex: none; padding: 2px 8px 0; gap: 0; }
  .stagebox { display: block; container-type: normal; }
  .stage { width: 100%; height: auto; aspect-ratio: var(--ar, 1); max-height: 56dvh; background: transparent; box-shadow: none; border-radius: 0; overflow: visible; }
  .grid { gap: 7px; padding: 0; }
  .tile { border-radius: 14px; }
  .ctrls { display: none; }
  .ctrlsopen .ctrls { display: flex; position: fixed; z-index: 45; right: 10px; top: calc(max(8px, env(safe-area-inset-top)) + 54px); width: min(300px, calc(100% - 20px)); justify-content: flex-start; gap: 6px 4px; padding: 12px 8px; border-radius: 20px; background: rgba(16,18,32,.94); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: pop .16s ease-out; }
  @keyframes pop { from { transform: translateY(-6px) scale(.97); opacity: 0; } }
  .side { flex: 1; height: auto; min-height: 0; background: transparent; border: 0; position: relative; }
  .side .tabs { display: none; }
  .side .panel { padding: 6px 14px 4px; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%); mask-image: linear-gradient(to bottom, transparent 0, #000 22%); }
  .feed { gap: 12px; min-height: 100%; justify-content: flex-end; }
  .msg .av { width: 34px; height: 34px; }
  .msg .nm { color: rgba(255,255,255,.62); font-size: 13px; }
  .msg .tx { font-size: 14.5px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.55); }
  .msg.sys .tx { color: rgba(255,255,255,.75); font-weight: 600; }
  .msg .gift { color: #ffd36b; }
  .compose { position: relative; border-top: 0; gap: 8px; padding: 8px 12px max(10px, env(safe-area-inset-bottom)); }
  .compose input { height: 46px; border-radius: 23px; background: rgba(255,255,255,.12); border: 0; }
  .compose input:placeholder-shown ~ .send { display: none; }
  .compose .send { color: #fff; }
  .compose .rb { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; flex: none; }
  .compose .rb.people { color: #7fd3ff; }
  .compose .rb.people svg path, .compose .rb.people svg circle { fill: currentColor; stroke: none; }
  .compose .rb.barmusic { color: #ff7aa2; }
  .compose .rb.barmusic.on { background: linear-gradient(135deg, #a06bff, #fe2c55); color: #fff; }
  .compose .rose { width: 46px; height: 46px; background: rgba(255,255,255,.12); }
  .compose .heart { position: absolute; right: 14px; bottom: calc(100% + 10px); width: 56px; height: 56px; background: rgba(40,42,58,.85); }
  .compose .heart svg { width: 28px; height: 28px; }
  .sidepeek .side { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: 70dvh; background: var(--panel); border-radius: 20px 20px 0 0; border-top: 1px solid var(--line); box-shadow: 0 -16px 40px rgba(0,0,0,.5); }
  .sidepeek .side .tabs { display: flex; }
  .sidepeek .side .panel { -webkit-mask-image: none; mask-image: none; }
  .sidepeek .compose .heart { display: none; }
}
@media (max-width: 420px) {
  .brand img + span { display: none; }
  .hostcard { padding-right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile .chair, .dot, .eq i, .cb.music.on .ci, .tile.talk .ph .pr { animation: none; }
  .tile.talk .ph .av.big { transform: none; }
}
@media (max-width: 380px) {
  .inroom .hc-likes { display: none; }
  .inroom .hostcard { padding-right: 10px; }
}
/* the browser blocked the room's sound until a tap */
.soundbtn { white-space: nowrap; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; display: flex; align-items: center; gap: 10px; padding: 14px 22px; border: 0; border-radius: 999px; background: linear-gradient(135deg, #fe2c55, #c13584); color: #fff; font: 700 15px/1 inherit; font-family: inherit; box-shadow: 0 10px 34px rgba(254,44,85,.45); cursor: pointer; animation: soundpulse 1.6s ease-in-out infinite; }
.soundbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.soundbtn[hidden] { display: none; }
@keyframes soundpulse { 50% { box-shadow: 0 10px 34px rgba(254,44,85,.45), 0 0 0 10px rgba(254,44,85,.18); } }
@media (prefers-reduced-motion: reduce) { .soundbtn { animation: none; } }
