/* Kantahanan mockup: shared tokens and components. Dark only: it runs on a TV at a party. */
@font-face{font-family:"Bricolage Grotesque";src:url(../fonts/bricolage.woff2) format("woff2");font-weight:400 800;font-display:swap}
@font-face{font-family:"Figtree";src:url(../fonts/figtree.woff2) format("woff2");font-weight:400 800;font-display:swap}

:root{
  --bg:#0b0d12; --surface:#141821; --surface-2:#1d2230; --line:#2c3343;
  --text:#f3efe7; --muted:#b6bdcb; --dim:#8d95a7;
  --gold:#e8b64a; --on-gold:#14110a; --gold-soft:rgba(232,182,74,.14);
  --red:#b8232f; --red-ui:#d63c45; --red-ink:#f07a76; --red-soft:rgba(184,35,47,.22);
  --green:#5fc28c; --green-soft:rgba(95,194,140,.14); --evergreen:#1f6b45;
  --danger:#f07a76; --danger-soft:rgba(240,122,118,.14);
  --r-chip:4px; --r-ctl:8px; --r-card:12px; --r-sheet:16px;
  --shadow-sm:0 2px 8px rgba(0,0,0,.35); --shadow-lg:0 16px 48px rgba(0,0,0,.55);
  --display:"Bricolage Grotesque",system-ui,sans-serif; --body:"Figtree",system-ui,sans-serif;
  color-scheme:dark;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{font-size:16px;-webkit-text-size-adjust:100%;touch-action:manipulation}  /* fast taps never zoom; pinch still does (Cypher, 2026-12-01) */
html.tv{font-size:clamp(16px,1.05vw,30px)}
body{margin:0;background:var(--bg);color:var(--text);font:400 1rem/1.5 var(--body);min-height:100dvh}
h1,h2,h3{font-family:var(--display);line-height:1.1;margin:0;letter-spacing:-.02em}
p{margin:0}
a{color:var(--gold)}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.muted{color:var(--muted)} .dim{color:var(--dim)}
.num{font-variant-numeric:tabular-nums}
svg.i{width:1.5em;height:1.5em;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}
svg.i.sm{width:1.25em;height:1.25em}

/* brand */
.brand{display:flex;align-items:center;gap:.5em;font:800 1.25rem/1 var(--display);letter-spacing:-.02em;color:var(--text);text-decoration:none}
.brand .mark{width:1.6em;height:1.6em;flex:none}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.5em;min-height:48px;padding:0 1.25em;border-radius:var(--r-ctl);
  border:1px solid var(--line);background:var(--surface-2);font-weight:700;text-decoration:none;color:var(--text);transition:background .15s,border-color .15s,transform .1s;white-space:nowrap}
@media (hover:hover){.btn:hover{border-color:var(--muted)}}
.btn:active{transform:scale(.97)}
.btn.primary{background:var(--gold);border-color:var(--gold);color:var(--on-gold);box-shadow:var(--shadow-sm)}
@media (hover:hover){.btn.primary:hover{background:#f0c66a}}
.btn.ghost{background:transparent;border-color:transparent;color:var(--muted)}
@media (hover:hover){.btn.ghost:hover{color:var(--text);background:var(--surface-2)}}
.btn.block{width:100%}
.btn[aria-busy=true]{cursor:progress}
.btn[disabled],.btn[aria-disabled=true]{opacity:.45;cursor:not-allowed;transform:none;box-shadow:none}
.icon-btn{display:inline-grid;place-items:center;width:48px;height:48px;border-radius:var(--r-ctl);border:1px solid var(--line);background:var(--surface-2);color:var(--text)}
@media (hover:hover){.icon-btn:hover{border-color:var(--muted)}}
.icon-btn.quiet{background:transparent;border-color:transparent;color:var(--muted)}
@media (hover:hover){.icon-btn.quiet:hover{color:var(--text);background:var(--surface-2)}}
.link{background:none;border:0;padding:12px 0;color:var(--muted);text-decoration:underline;text-underline-offset:3px;font-weight:600;min-height:44px}
@media (hover:hover){.link:hover{color:var(--text)}}

/* fields */
.field{display:grid;gap:6px}
.field label,.label{font-weight:700;font-size:.9375rem}
.input,.select{width:100%;min-height:48px;padding:0 14px;border-radius:var(--r-ctl);border:1px solid var(--line);background:var(--bg);font-size:1rem}
.input::placeholder{color:var(--dim)}
.input:focus,.select:focus{outline:2px solid var(--gold);outline-offset:2px;border-color:var(--gold)}
.hint{font-size:.875rem;color:var(--muted)}
.error{font-size:.875rem;color:var(--danger);min-height:1.3em}
.field:has(.input[aria-invalid=true]) .input{border-color:var(--danger)}

/* chips, badges, status */
.chip{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border-radius:999px;background:var(--surface-2);font-size:.8125rem;font-weight:700;white-space:nowrap}
.chip.gold{background:var(--gold-soft);color:var(--gold)}
.chip.red{background:var(--red-soft);color:#f07a76}
.chip.green{background:var(--green-soft);color:var(--green)}
.dot{width:8px;height:8px;border-radius:50%;background:currentColor;flex:none}
.live-dot{animation:pulse 2s ease-in-out infinite}
@keyframes pulse{50%{opacity:.35}}

/* song rows */
.song{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}
.song:last-child{border-bottom:0}
.thumb{width:56px;height:42px;border-radius:var(--r-chip);display:grid;place-items:center;font:800 .875rem/1 var(--body);color:rgba(255,255,255,.9);flex:none}
.song .t{font-weight:700;line-height:1.25;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.song .a{font-size:.875rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* toast: taps pass through to the row under it, only its Undo button catches them (phone audit, 2026-12-01) */
.toast-wrap{position:fixed;left:50%;bottom:calc(88px + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:60;display:grid;gap:8px;width:min(92vw,420px);pointer-events:none}
.toast{pointer-events:none;display:flex;align-items:center;gap:10px;padding:12px 16px;border-radius:var(--r-card);background:#222838;border:1px solid var(--line);box-shadow:var(--shadow-lg);font-weight:600;animation:toast-in .2s cubic-bezier(.25,1,.5,1)}
.toast button{pointer-events:auto;margin-left:auto;background:none;border:0;color:var(--gold);font-weight:800;min-height:44px;padding:0 4px}
@keyframes toast-in{from{opacity:0;transform:translateY(8px)}}

/* christmas: lights + snow */
.lights{position:fixed;inset:0 0 auto 0;height:28px;pointer-events:none;z-index:2}
.lights svg{width:100%;height:100%}
.lights circle{animation:twinkle 2.4s ease-in-out infinite}
.lights circle:nth-child(3n){animation-delay:.8s}.lights circle:nth-child(3n+1){animation-delay:1.6s}
@keyframes twinkle{50%{opacity:.35}}
#snow{position:fixed;inset:0;pointer-events:none;z-index:1}
html:not(.xmas) .lights,html:not(.xmas) #snow{display:none}

/* storyboard frames */
.frame{position:relative;aspect-ratio:16/9;border-radius:var(--r-card);overflow:hidden;background:#141821}
.frame svg{display:block;width:100%;height:100%}
.slideshow{position:relative}
.slideshow .frame{position:absolute;inset:0;opacity:0;transition:opacity .8s ease}
.slideshow .frame.on{opacity:1}
.slideshow .stage{position:relative;aspect-ratio:16/9}
.slideshow video.film{display:block;width:100%;height:100%;object-fit:cover;background:#000}
.slideshow .cap{display:flex;gap:12px;align-items:baseline;margin-top:12px;min-height:3em}
.slideshow .cap b{font:800 1em/1 var(--display);color:var(--gold);flex:none}
.slideshow .pips{display:flex;gap:6px;margin-top:8px}
.slideshow .pips i{height:4px;flex:1;border-radius:2px;background:var(--line)}
.slideshow .pips i.on{background:var(--gold)}
.vtag{position:absolute;top:10px;left:10px;z-index:3;font-size:.75rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;background:rgba(11,13,18,.8);color:var(--muted);padding:4px 8px;border-radius:var(--r-chip)}


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

/* ---------- host TV: remote focus, gear, room settings ---------- */
html.tv :focus-visible{outline:4px solid #fff;outline-offset:4px;box-shadow:0 0 0 10px rgba(232,182,74,.6);border-radius:var(--r-ctl)}
.gear{display:inline-flex;align-items:center;gap:.5em;min-height:3rem;padding:0 1.1em;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--text);font-weight:700;font-size:.9rem}
@media (hover:hover){.gear:hover{border-color:var(--muted)}}
.gear svg{width:1.3em;height:1.3em}
html.nosnow .lights,html.nosnow #snow{display:none}
.rs{position:fixed;inset:0;z-index:80}
.rs[hidden]{display:none}
html.rs-open{overflow:hidden}   /* the page behind the room settings or Skip sheet stays still (phone audit, 2026-12-01) */
.rs-back{position:absolute;inset:0;background:rgba(4,5,8,.6)}
.rs-in{position:absolute;top:0;right:0;bottom:0;width:min(100vw,34rem);background:var(--surface);border-left:1px solid var(--line);box-shadow:var(--shadow-lg);display:flex;flex-direction:column;padding:1.75rem 1.5rem 1.25rem;animation:rs-in .22s cubic-bezier(.25,1,.5,1)}
@keyframes rs-in{from{transform:translateX(24px);opacity:0}}
.rs-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1rem}
.rs-head h2{font-size:1.6rem}
.rs-body{flex:1;overflow:auto;overscroll-behavior:contain;display:grid;align-content:start;gap:.4rem;padding:.6rem}
.srow{display:flex;align-items:center;gap:.9rem;width:100%;min-height:3.6rem;padding:0 1rem;border-radius:var(--r-card);border:1px solid transparent;background:transparent;color:var(--text);font-size:1.1rem;font-weight:700;text-align:left}
@media (hover:hover){.srow:hover{background:var(--surface-2)}}
.srow:focus-visible{background:var(--surface-2)}
.srow > svg{width:1.4em;height:1.4em;color:var(--muted)}
.srow .lab{flex:1;min-width:0}
.srow .lab small{display:block;font-size:.8em;font-weight:600;color:var(--muted)}
.srow .val{display:inline-flex;align-items:center;gap:.4rem;color:var(--gold);font-size:.95rem;white-space:nowrap}
.srow .val svg{color:var(--dim)}
.srow.danger,.srow.danger > svg{color:var(--danger)}
.srow.ghostrow{color:var(--muted);min-height:3rem;font-size:1rem}
.srow .pos{width:1.6rem;text-align:center;color:var(--dim);font-variant-numeric:tabular-nums}
.srow.moving{background:var(--gold-soft);border-color:var(--gold);transform:scale(1.01)}
.rs-q{font-size:1.15rem;line-height:1.4;margin:0 .4rem 1rem}
.rs-q b{display:block;margin-bottom:6px;overflow-wrap:anywhere}
.srow[aria-busy=true]{cursor:progress}
.srow[aria-busy=true]>*{opacity:.6}  /* the row's own focus ring stays at full strength */
.rs-keys{margin:.75rem .6rem 0;color:var(--dim);font-size:.85rem}
.rs-head .roomchip{margin-left:auto}
/* on a phone the same panel is a bottom sheet */
html:not(.tv) .rs-in{top:auto;left:0;right:0;width:auto;max-height:88dvh;border-left:0;border-top:1px solid var(--line);border-radius:var(--r-sheet) var(--r-sheet) 0 0;padding:16px 12px calc(16px + env(safe-area-inset-bottom));animation:sheet-in .22s cubic-bezier(.25,1,.5,1)}
html:not(.tv) .rs-head h2{font-size:1.25rem}
html:not(.tv) .srow{font-size:1rem;min-height:56px}
html:not(.tv) .rs-keys{display:none}
@keyframes sheet-in{from{transform:translateY(24px);opacity:0}}
html:not(.tv) .gear{min-height:44px;font-size:.9375rem}
/* small quiet TV icon buttons: full screen and gear. Fade when idle, full strength on focus */
.tvbtn{display:inline-grid;place-items:center;width:2.6rem;height:2.6rem;min-width:48px;min-height:48px;border-radius:50%;border:0;background:transparent;color:var(--muted);transition:opacity .4s cubic-bezier(.25,1,.5,1),color .15s,background .15s}
.tvbtn svg{width:1.3rem;height:1.3rem}
.tvbtn:focus-visible{color:var(--text);background:var(--surface-2)}@media (hover:hover){.tvbtn:hover{color:var(--text);background:var(--surface-2)}}
html.idle .tvbtn:not(:focus-visible):not(:hover){opacity:.35}
.hdr-tools{display:flex;align-items:center;gap:8px}

.toast.err{border-color:var(--red-ui)}
.toast.err svg{color:var(--red-ink)}
img.thumb{object-fit:cover;background:var(--surface-2)}
.offline{position:fixed;left:50%;top:12px;transform:translateX(-50%);z-index:95;padding:6px 12px;border-radius:999px;background:var(--surface-2);border:1px solid var(--line);color:var(--muted);font-size:.875rem}

/* TV page: the player fills the stage; message view; sound hint */
#v-room #yt,#v-room .screen iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.msgview main{max-width:640px;margin:18vh auto 0;padding:0 24px;display:grid;gap:16px;justify-items:start}
.msgview h1{font-size:2.2rem}
.msgview .acts{display:flex;gap:12px;flex-wrap:wrap;margin-top:8px}
.sound-hint{color:var(--muted);flex:none}
.sound-hint svg{width:1rem;height:1rem}
