:root {
  --accent: #F6B73C;
  --bg: #07070b;
  --panel: #111118;
  --panel2: #181822;
  --line: rgba(255, 255, 255, .09);
  --text: #f5f3ef;
  --mute: #9a98a8;
  --good: #3ddc97;
  --bad: #ff5d6c;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.label { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.mute { color: var(--mute); }

/* Slow moving glow behind guest and stage screens */
.glow { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.glow i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .34; background: var(--accent); }
.glow i:nth-child(1) { width: 60vmax; height: 60vmax; left: -22vmax; top: -26vmax; animation: drift1 26s ease-in-out infinite alternate; }
.glow i:nth-child(2) { width: 46vmax; height: 46vmax; right: -18vmax; bottom: -22vmax; opacity: .22; animation: drift2 32s ease-in-out infinite alternate; }
.glow i:nth-child(3) { width: 30vmax; height: 30vmax; left: 40%; top: 55%; opacity: .1; background: #fff; animation: drift1 40s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(9vmax, 7vmax) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-8vmax, -6vmax) scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .glow i { animation: none; } }

/* ---------- Guest (phone) ---------- */
body.guest { min-height: 100%; height: auto; }
.guest-wrap { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 22px 40px; }
.guest-brand { font-size: .78rem; letter-spacing: .28em; text-transform: uppercase; color: var(--mute); font-weight: 600; }
.guest h1 { font-size: clamp(2rem, 9vw, 2.7rem); line-height: 1.02; letter-spacing: -.03em; margin: 14px 0 8px; font-weight: 800; }
.guest h1 em { font-style: normal; color: var(--accent); }
.guest p.lead { color: var(--mute); margin: 0 0 26px; font-size: 1.02rem; line-height: 1.45; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: .8rem; font-weight: 600; color: var(--mute); margin-bottom: 7px; letter-spacing: .02em; }
.field input { width: 100%; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; font-size: 1.05rem; outline: none; transition: border-color .15s, background .15s; }
.field input::placeholder { color: rgba(255, 255, 255, .28); }
.field input:focus { border-color: var(--accent); background: rgba(255, 255, 255, .09); }
.consent { display: flex; gap: 12px; align-items: flex-start; margin: 22px 0 8px; font-size: .9rem; line-height: 1.45; color: #cfcdd8; }
.consent input { width: 24px; height: 24px; flex: none; accent-color: var(--accent); margin: 0; }
.consent button { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.btn-main { width: 100%; border: 0; border-radius: 16px; padding: 17px; margin-top: 16px; font-size: 1.08rem; font-weight: 800; letter-spacing: .01em; background: var(--accent); color: #0a0a0f; transition: transform .08s, opacity .15s; }
.btn-main:active { transform: scale(.985); }
.btn-main:disabled { opacity: .55; }
.btn-ghost { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-top: 12px; background: transparent; font-weight: 600; }
.error { color: var(--bad); font-size: .92rem; min-height: 1.3em; margin: 10px 0 0; }
.terms { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; font-size: .86rem; line-height: 1.5; color: #cfcdd8; margin: 6px 0 4px; }
.terms h3 { margin: 0 0 8px; font-size: .95rem; color: var(--text); }
.terms ul { margin: 0; padding-left: 18px; }
.card { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-top: 18px; backdrop-filter: blur(12px); }
.you { border-color: var(--accent); }
.you .big { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.board-row { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.board-row:first-of-type { border-top: 0; }
.board-row b { font-weight: 700; }
.board-row small { color: var(--mute); display: block; }
.board-row .n { color: var(--accent); font-weight: 800; width: 1.4em; flex: none; }
.board-row.me b { color: var(--accent); }
.foot { margin-top: 28px; font-size: .74rem; color: rgba(255, 255, 255, .34); text-align: center; }

/* ---------- Stage (crowd screen + comfort monitor) ---------- */
body.stage { overflow: hidden; cursor: none; background: #000; }
body.stage.unarmed { cursor: pointer; }
.stage-view { position: fixed; inset: 0; z-index: 1; display: none; }
.stage-view.on { display: grid; animation: fadein .6s ease both; }
@keyframes fadein { from { opacity: 0; } }
#v-hold { grid-template-columns: 1fr auto; grid-template-rows: 1fr auto; padding: 6vh 6vw 5vh; gap: 4vh 5vw; }
.hold-main { align-self: center; min-width: 0; }
.hold-main img { max-width: 46vw; max-height: 40vh; object-fit: contain; display: block; filter: drop-shadow(0 2vh 5vh rgba(0, 0, 0, .5)); }
.hold-title { font-size: clamp(2rem, 7.4vw, 14vh); font-weight: 800; letter-spacing: -.04em; line-height: .95; margin: 0; text-wrap: balance; }
.hold-sub { font-size: 2.1vw; color: #d9d6e2; margin-top: 3.4vh; font-weight: 500; letter-spacing: -.01em; }
.hold-sub em { font-style: normal; color: var(--accent); font-weight: 700; }
.qr-card { align-self: center; background: #fff; color: #0a0a0f; border-radius: 2.2vw; padding: 1.8vw 1.8vw 1.3vw; width: 24vw; text-align: center; box-shadow: 0 3vh 9vh rgba(0, 0, 0, .55); }
.qr-card svg { width: 100%; height: auto; display: block; }
.qr-card .cta { font-weight: 800; font-size: 1.75vw; letter-spacing: .14em; text-transform: uppercase; margin-top: 1.1vw; }
.qr-card .url { font-size: 1.05vw; color: #55535f; margin-top: .3vw; font-weight: 600; }
.qr-card.closed svg { opacity: .12; }
.upnext { grid-column: 1 / -1; display: flex; align-items: center; gap: 2vw; border-top: 1px solid var(--line); padding-top: 3vh; min-height: 9vh; }
.upnext .label { font-size: 1.05vw; flex: none; }
.chips { display: flex; gap: 1.2vw; min-width: 0; flex: 1; }
.chip { background: rgba(255, 255, 255, .07); border: 1px solid var(--line); border-radius: 1.2vw; padding: 1.1vh 1.4vw; min-width: 0; flex: 0 1 22vw; }
.chip b { display: block; font-size: 1.55vw; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip span { display: block; font-size: 1.05vw; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .3vh; }
.chip:first-child { border-color: var(--accent); }
.brandmark { font-size: .95vw; letter-spacing: .3em; text-transform: uppercase; color: rgba(255, 255, 255, .38); font-weight: 600; flex: none; }

#v-next { place-items: center; padding: 6vh 6vw; text-align: center; }
.next-inner { max-width: 88vw; }
#v-next .label { font-size: 1.5vw; letter-spacing: .4em; }
.next-name { font-size: 13vw; font-weight: 800; letter-spacing: -.045em; line-height: .92; margin: 2.5vh 0 3vh; white-space: nowrap; animation: rise .8s cubic-bezier(.2, .9, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(5vh) scale(.97); } }
.next-song { font-size: 3.6vw; font-weight: 600; color: #e7e4ee; letter-spacing: -.02em; text-wrap: balance; animation: rise .8s .12s cubic-bezier(.2, .9, .2, 1) both; }
.next-deck { position: fixed; left: 6vw; bottom: 5vh; font-size: 1.4vw; color: var(--mute); text-align: left; }
.next-deck b { color: var(--text); font-weight: 600; }
.next-qr { position: fixed; right: 4vw; bottom: 4vh; width: 9vw; background: #fff; border-radius: 1vw; padding: .7vw; }
.next-qr svg { display: block; width: 100%; height: auto; }

#v-play { background: #000; }
#v-play video, #yt, #yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
#v-play video { object-fit: contain; }
#audio-card { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; background: var(--bg); }
.lower { position: absolute; left: 4vw; bottom: 6vh; z-index: 5; background: rgba(8, 8, 12, .82); border-left: .5vw solid var(--accent); border-radius: .6vw; padding: 1.6vh 2vw 1.8vh 1.6vw; backdrop-filter: blur(14px); opacity: 0; transform: translateY(2vh); transition: opacity .6s, transform .6s; }
.lower.show { opacity: 1; transform: none; }
.lower .label { font-size: .95vw; }
.lower b { display: block; font-size: 2.6vw; font-weight: 800; letter-spacing: -.02em; margin-top: .4vh; }
.lower span { display: block; font-size: 1.3vw; color: #cfcdd8; margin-top: .2vh; }

#v-msg { place-items: center; text-align: center; padding: 8vh 8vw; }
.msg-text { font-size: 7.5vw; font-weight: 800; letter-spacing: -.04em; line-height: 1; text-wrap: balance; }
#v-black { background: #000; }

#arm { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(4, 4, 8, .9); text-align: center; }
#arm div { font-size: 2.2vw; font-weight: 700; }
#arm small { display: block; margin-top: 1.4vh; font-size: 1.2vw; color: var(--mute); font-weight: 500; }

/* ---------- Host console ---------- */
body.host { display: grid; grid-template-rows: auto 1fr; height: 100vh; overflow: hidden; font-size: 15px; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.topbar .brand { font-weight: 800; letter-spacing: -.02em; font-size: 1.05rem; }
.topbar .ev { color: var(--mute); margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw; }
.topbar .ev b { color: var(--text); font-weight: 600; }
.pill { font-size: .76rem; font-weight: 700; padding: 5px 10px; border-radius: 99px; background: rgba(255, 255, 255, .07); color: var(--mute); white-space: nowrap; }
.pill.ok { background: rgba(61, 220, 151, .14); color: var(--good); }
.pill.warn { background: rgba(255, 93, 108, .14); color: var(--bad); }
.b { border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: .86rem; white-space: nowrap; }
a.b { text-decoration: none; color: var(--text); display: inline-block; }
input[type=range] { accent-color: var(--accent); }
.b:hover { border-color: rgba(255, 255, 255, .25); }
.b.on { border-color: var(--accent); color: var(--accent); }
.b.accent { background: var(--accent); color: #0a0a0f; border-color: var(--accent); }
.b.danger { color: var(--bad); }
.b:disabled { opacity: .4; cursor: default; }
.cols { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(420px, 1.15fr); min-height: 0; }
.col { min-height: 0; overflow-y: auto; padding: 16px; }
.col + .col { border-left: 1px solid var(--line); background: #0b0b11; }
.col h2 { font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); margin: 4px 0 10px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.col h2 .count { color: var(--accent); }
.q-row { display: grid; grid-template-columns: 2.2em 1fr auto; gap: 10px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--panel); cursor: pointer; }
.q-row:hover { border-color: rgba(255, 255, 255, .22); }
.q-row.sel { border-color: var(--accent); background: var(--panel2); }
.q-row.fresh { animation: flash 1.6s ease; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 35%, var(--panel)); } }
.q-row .n { font-weight: 800; color: var(--accent); font-size: 1.05rem; text-align: center; }
.q-row .who { min-width: 0; }
.q-row .who b { display: block; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-row .who span { display: block; color: var(--mute); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-row .acts { display: flex; gap: 4px; }
.q-row .acts button { border: 0; background: rgba(255, 255, 255, .06); border-radius: 8px; width: 30px; height: 30px; font-size: .9rem; color: var(--mute); }
.q-row .acts button:hover { color: var(--text); background: rgba(255, 255, 255, .14); }
.q-row.done { opacity: .5; cursor: default; }
.q-row.done b, .q-row.done span { text-decoration: line-through; }
.q-row.live { border-color: var(--good); }
.q-row.held { border-style: dashed; border-color: var(--bad); }
.q-row.held .n { color: var(--bad); }
.q-row.held .who span { color: var(--bad); }
.rdy { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: 7px; vertical-align: middle; }
.check { display: flex; gap: 10px; align-items: center; margin-top: 14px; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.q-row.live .n { color: var(--good); }
.empty { color: var(--mute); border: 1px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; line-height: 1.5; }
.walkup { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; margin: 4px 0 18px; }
.in { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; outline: none; min-width: 0; width: 100%; }
.in:focus { border-color: var(--accent); }
.deck-name { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; margin: 2px 0 10px; }
.songpick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.songpick .b { white-space: normal; text-align: left; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.row .in { flex: 1; }
.results { display: grid; gap: 6px; margin-bottom: 14px; }
.res { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--panel); text-align: left; width: 100%; }
.res:hover, .res.loaded { border-color: var(--accent); }
.res img, .res .ph { width: 96px; height: 54px; border-radius: 6px; object-fit: cover; background: #000; display: grid; place-items: center; font-size: .68rem; color: var(--mute); letter-spacing: .1em; }
.res b { display: block; font-size: .9rem; font-weight: 600; line-height: 1.25; }
.res span { display: block; font-size: .78rem; color: var(--mute); margin-top: 2px; }
.transport { position: sticky; bottom: -16px; background: #0b0b11; border-top: 1px solid var(--line); margin: 0 -16px -16px; padding: 14px 16px 16px; }
.transport .now { font-size: .86rem; color: var(--mute); margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transport .now b { color: var(--text); }
.bar { height: 6px; border-radius: 9px; background: rgba(255, 255, 255, .1); overflow: hidden; margin-bottom: 12px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.transport .row { margin: 0; }
.play { font-size: 1.05rem; padding: 14px 26px; border-radius: 14px; font-weight: 800; }
.note { font-size: .82rem; color: var(--mute); line-height: 1.45; }
.note.bad { color: var(--bad); }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 22px; width: min(520px, 92vw); }
dialog::backdrop { background: rgba(0, 0, 0, .65); }
dialog h3 { margin: 0 0 14px; font-size: 1.15rem; }
dialog label { display: block; font-size: .8rem; color: var(--mute); margin: 12px 0 6px; font-weight: 600; }
.setup { place-self: center; width: min(440px, 92vw); grid-row: 1 / -1; }
.setup h1 { font-size: 2.2rem; letter-spacing: -.03em; margin: 0 0 6px; }
.joinbox { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 16px; background: var(--panel); }
.joinbox .qr { background: #fff; border-radius: 8px; padding: 6px; }
.joinbox .qr svg { display: block; width: 100%; height: auto; }
.joinbox code { font-size: 1rem; color: var(--accent); word-break: break-all; }
