/* MusicLinX: an evening-stage palette for dim karaoke rooms. */
:root {
  --night: #191842;
  --stage: #24225a;
  --rail: #33317a;
  --sampaguita: #fbf9f2;
  --dim: #aeacd6;
  --kalamansi: #f6c445;
  --fiesta: #e8467f;
  --dagat: #34bdb4;
  --danger: #ff8a7a;
  --display-font: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --ui-font: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--night); color: var(--sampaguita); font: 17px/1.45 var(--ui-font); -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 3px solid var(--kalamansi); outline-offset: 2px; }
.hidden { display: none !important; }

/* toast */
#toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0;
  background: var(--sampaguita); color: var(--night); padding: 10px 16px; border-radius: 12px; font-weight: 700;
  transition: .2s; pointer-events: none; z-index: 50; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast[data-kind="error"] { background: var(--danger); }

/* ---------------------------------------------------------------- login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 70% at 50% 0%, #2c2a6b 0%, var(--night) 60%); }
.login-box { width: min(420px, 100%); }
.brand { font: 800 clamp(48px, 14vw, 72px)/0.9 var(--display-font); letter-spacing: -0.04em; margin: 0 0 6px; }
.brand span { color: var(--kalamansi); }
.tagline { color: var(--dim); margin: 0 0 28px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 15px; color: var(--dim); margin-bottom: 4px; }
.field input { width: 100%; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--rail); background: var(--stage); }
.field input:focus { border-color: var(--kalamansi); outline: none; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
.mode { text-align: left; padding: 14px; border-radius: 14px; border: 2px solid var(--rail); background: var(--stage); }
.mode b { display: block; font: 700 19px var(--display-font); }
.mode small { color: var(--dim); }
.mode[aria-pressed="true"] { border-color: var(--kalamansi); box-shadow: inset 0 0 0 1px var(--kalamansi); }
.primary { width: 100%; padding: 15px; border-radius: 14px; background: var(--kalamansi); color: var(--night); font-weight: 800; font-size: 18px; }
.primary:disabled { opacity: .6; }
.link { color: var(--dim); text-decoration: underline; padding: 8px 0; }
.err { color: var(--danger); min-height: 1.4em; margin: 8px 0 0; }

/* ---------------------------------------------------------------- remote */
.remote { display: flex; flex-direction: column; height: 100dvh; max-width: 560px; margin: 0 auto; }
.now { padding: calc(12px + env(safe-area-inset-top)) 18px 12px; background: var(--stage); border-bottom: 1px solid var(--rail); }
.now-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--dim); font-size: 14px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); margin-right: 6px; vertical-align: 1px; }
.dot.online { background: var(--dagat); }
.now-title { font: 700 21px/1.2 var(--display-font); margin: 6px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-artist { color: var(--dim); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 4px; background: var(--rail); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--kalamansi); transition: width .9s linear; }

.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-bottom: 1px solid var(--rail); }
.tabs button { padding: 12px 4px; color: var(--dim); font-weight: 700; border-bottom: 3px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--sampaguita); border-color: var(--kalamansi); }
.tabs .count { display: inline-block; min-width: 20px; padding: 0 5px; margin-left: 4px; border-radius: 10px; background: var(--fiesta); color: #fff; font-size: 13px; }

.panes { flex: 1; overflow-y: auto; padding: 16px 18px 24px; }
.pane { display: none; }
.pane.active { display: block; }

.readout { text-align: center; padding: 6px 0 14px; }
.readout .digits { font: 800 56px/1 var(--display-font); font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.readout .digits .ghost { color: var(--rail); }
.readout .match { min-height: 2.9em; color: var(--dim); }
.readout .match b { color: var(--sampaguita); display: block; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pad button { padding: 16px 0; border-radius: 16px; background: var(--stage); border: 1px solid var(--rail);
  font: 700 28px var(--display-font); }
.pad button:active { background: var(--rail); }
.pad .soft { font-size: 17px; color: var(--dim); font-family: var(--ui-font); }
.reserve-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin-top: 12px; }
.reserve-row button { padding: 14px 6px; border-radius: 14px; font-weight: 800; background: var(--rail); }
.reserve-row .go { background: var(--kalamansi); color: var(--night); font-size: 18px; }

.search { width: 100%; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--rail); background: var(--stage); margin-bottom: 8px; }
.search:focus { outline: none; border-color: var(--kalamansi); }
.song { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--stage); }
.song .num { font: 700 15px var(--display-font); color: var(--kalamansi); font-variant-numeric: tabular-nums; }
.song .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song .a { color: var(--dim); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song .acts { display: flex; gap: 6px; }
.icon { min-width: 42px; height: 42px; padding: 0 10px; border-radius: 12px; background: var(--stage); border: 1px solid var(--rail); font-weight: 800; }
.icon.add { background: var(--kalamansi); color: var(--night); border: 0; }
.empty { color: var(--dim); padding: 24px 0; text-align: center; }
.section-title { font: 700 18px var(--display-font); margin: 18px 0 4px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.chip { padding: 9px 14px; border-radius: 12px; background: var(--stage); border: 1px solid var(--rail); font-weight: 700; }
.chip.warn { color: var(--danger); }
.by { color: var(--dagat); font-size: 13px; }

.dock { border-top: 1px solid var(--rail); background: var(--stage); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
.transport { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.transport button { padding: 11px 0; border-radius: 12px; background: var(--rail); font-weight: 800; }
.transport .play { background: var(--fiesta); color: #fff; }
.knobs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.knob { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; background: var(--night); border-radius: 12px; }
.knob button { height: 40px; font: 800 22px var(--display-font); }
.knob div { text-align: center; font-size: 13px; color: var(--dim); line-height: 1.15; }
.knob div b { display: block; color: var(--sampaguita); font: 700 17px var(--display-font); }
.vol { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.vol input { flex: 1; accent-color: var(--kalamansi); }
.vol button { width: 64px; padding: 6px 0; border-radius: 10px; background: var(--night); font-weight: 700; font-size: 14px; }

.sheet-bg { position: fixed; inset: 0; background: rgba(10, 9, 30, .6); display: flex; align-items: flex-end; justify-content: center; z-index: 40; }
.sheet { width: min(560px, 100%); background: var(--stage); border-radius: 20px 20px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 80dvh; overflow-y: auto; }
.sheet h2 { font: 700 20px var(--display-font); margin: 0 0 10px; }
.sheet .opt { display: block; width: 100%; text-align: left; padding: 13px 4px; border-bottom: 1px solid var(--rail); font-weight: 700; }

.join { padding: 40px 24px; text-align: center; }
.join input { width: 200px; text-align: center; font: 800 40px var(--display-font); letter-spacing: .2em; padding: 10px;
  border-radius: 14px; border: 2px solid var(--rail); background: var(--stage); margin: 16px 0; }

/* ---------------------------------------------------------------- display */
.display { position: fixed; inset: 0; overflow: hidden; background: var(--night); cursor: none; font-size: 2.2vh; }
.display.pointer { cursor: default; }
.bg { position: absolute; inset: 0; background:
  radial-gradient(60% 50% at 30% 20%, rgba(232, 70, 127, .22), transparent 70%),
  radial-gradient(55% 45% at 75% 75%, rgba(52, 189, 180, .18), transparent 70%), var(--night); }
.bg video { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(25, 24, 66, .55), transparent 30%, transparent 45%, rgba(25, 24, 66, .85)); }

.d-top { position: absolute; top: 3vh; left: 4vw; right: 4vw; display: flex; justify-content: space-between; align-items: flex-start; gap: 3vw; }
.d-song .n { font: 800 3.2vh var(--display-font); color: var(--kalamansi); font-variant-numeric: tabular-nums; }
.d-song .t { font: 700 3.6vh/1.1 var(--display-font); }
.d-song .a { color: var(--dim); font-size: 2.6vh; }
.badges { display: flex; gap: 1vh; }
.badge { padding: .7vh 1.4vh; border-radius: 1vh; background: rgba(36, 34, 90, .8); font: 700 2.3vh var(--display-font); transition: background .3s; }
.badge.flash { background: var(--fiesta); }

.lyrics { position: absolute; left: 4vw; right: calc(3vw + 26vh); bottom: 21vh; display: grid; gap: 2.2vh; }
.lyric { font: 800 clamp(28px, 7.4vh, 120px)/1.12 var(--display-font); letter-spacing: -0.01em; min-height: 1.15em;
  filter: drop-shadow(0 .5vh 0 rgba(15, 14, 45, .9)); transition: opacity .25s; }
.lyric:nth-child(1) { text-align: left; }
.lyric:nth-child(2) { text-align: right; }
.lyric.upcoming { opacity: .85; }
.lyric span { --p: 0; color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(90deg, var(--kalamansi) calc(var(--p) * 100%), var(--sampaguita) calc(var(--p) * 100%)); }
.countdown { position: absolute; left: 4vw; bottom: 42vh; display: flex; gap: 1.6vh; }
.countdown i { width: 2.4vh; height: 2.4vh; border-radius: 50%; background: var(--kalamansi); }

.d-bottom { position: absolute; left: 4vw; right: calc(3vw + 30vh); bottom: 3.5vh; display: flex; justify-content: space-between; align-items: flex-end; gap: 3vw; color: var(--dim); font-size: 2.3vh; }
.next b { color: var(--sampaguita); }
.next .n { color: var(--kalamansi); font-weight: 700; }
.roomcode { text-align: right; }
.roomcode b { color: var(--sampaguita); font: 800 3vh var(--display-font); letter-spacing: .12em; }
.progress { position: absolute; left: 0; bottom: 0; height: .6vh; background: var(--kalamansi); width: 0; }
.typed { position: absolute; right: 4vw; top: 14vh; font: 800 7vh var(--display-font); color: var(--kalamansi); font-variant-numeric: tabular-nums; }
.typed small { display: block; font: 400 2.4vh var(--ui-font); color: var(--sampaguita); text-align: right; }

.titlecard { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 0 8vw; }
.titlecard .n { font: 800 9vh var(--display-font); color: var(--kalamansi); font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.titlecard .t { font: 800 clamp(32px, 9vh, 140px)/1.02 var(--display-font); letter-spacing: -0.03em; margin: 1vh 0; }
.titlecard .a { font-size: 3.6vh; color: var(--dim); }
.titlecard .by { font-size: 2.6vh; margin-top: 2vh; color: var(--dagat); }

.idle { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 34vh; gap: 4vw; padding: 6vh 4vw 5vh; z-index: 2; }
.idle-main { display: grid; grid-template-rows: auto 1fr; gap: 3vh; min-height: 0; }
.idle h1 { font: 800 11vh/0.9 var(--display-font); letter-spacing: -0.045em; margin: 0; text-shadow: 0 .4vh 2vh rgba(10, 9, 30, .7); }
.idle h1 span { color: var(--kalamansi); }
.idle .studio-name { margin-top: .6vh; text-shadow: 0 .2vh 1vh rgba(10, 9, 30, .8); }

/* scrolling song suggestions */
.recs { display: grid; grid-template-rows: auto 1fr; min-height: 0; background: rgba(25, 24, 66, .62); border-radius: 2.4vh; padding: 2.4vh 3vh 0; backdrop-filter: blur(6px); }
.recs-head { display: flex; align-items: baseline; gap: 2vh; flex-wrap: wrap; margin-bottom: 1.2vh; }
.recs-head b { font: 800 3.6vh var(--display-font); }
.recs-head span { color: var(--dim); font-size: 2.2vh; }
.recs-window { overflow: hidden; min-height: 0; -webkit-mask-image: linear-gradient(transparent, #000 8%, #000 90%, transparent); mask-image: linear-gradient(transparent, #000 8%, #000 90%, transparent); }
.recs-track { animation: recs-scroll var(--dur, 120s) linear infinite; will-change: transform; }
@keyframes recs-scroll { from { transform: translateY(0); } to { transform: translateY(-50%); } }
.rec { display: grid; grid-template-columns: 21vh 1fr; align-items: center; gap: 2vh; padding: 1.4vh 0; border-bottom: 1px solid rgba(174, 172, 214, .14); }
.rec .n { font: 800 4.4vh var(--display-font); color: var(--kalamansi); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.rec .t { font: 700 3.4vh/1.15 var(--display-font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec .a { color: var(--dim); font-size: 2.4vh; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec .a i { font-style: normal; color: var(--dagat); margin-left: 1vh; }

/* QR card and queue on the right */
.idle-side { display: flex; flex-direction: column; gap: 2.4vh; min-height: 0; }
.qr-card { background: rgba(25, 24, 66, .78); border-radius: 2.4vh; padding: 2.4vh; text-align: center; backdrop-filter: blur(6px); }
.idle .qr { background: var(--sampaguita); padding: 1.2vh; border-radius: 1.6vh; width: 100%; aspect-ratio: 1; }
.idle .qr img { width: 100%; height: 100%; display: block; }
.idle .code-label { color: var(--dim); font-size: 2vh; margin-top: 2vh; }
.idle .code { font: 800 9vh/1 var(--display-font); letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.idle .scan { font-weight: 700; font-size: 2.4vh; margin-top: .8vh; }
.idle .url { font-size: 1.7vh; color: var(--dim); margin-top: .8vh; word-break: break-all; }
.idle .queue-list { background: rgba(25, 24, 66, .78); border-radius: 2.4vh; padding: 2vh 2.4vh; font-size: 2.3vh; backdrop-filter: blur(6px); }
.idle .queue-list:empty { display: none; }
.idle .queue-list h3 { font: 800 2.6vh var(--display-font); margin: 0 0 .8vh; }
.idle .queue-list div { padding: .4vh 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gate { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 3vh; padding: 6vw; background: var(--night); z-index: 30; cursor: default; }
.gate h1 { font: 800 10vh/0.9 var(--display-font); margin: 0; letter-spacing: -0.04em; }
.gate h1 span { color: var(--kalamansi); }
.gate p { color: var(--dim); font-size: 2.6vh; margin: 0; }
.gate button { justify-self: center; padding: 2vh 5vh; border-radius: 2vh; background: var(--kalamansi); color: var(--night); font: 800 3.4vh var(--display-font); }
.gate progress { justify-self: center; width: 40vh; accent-color: var(--kalamansi); }
.warn-strip { position: absolute; top: 0; left: 0; right: 0; background: var(--danger); color: var(--night); text-align: center; font-weight: 700; padding: .6vh; font-size: 2vh; z-index: 5; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
@media (max-aspect-ratio: 1/1) {
  .idle { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .idle-side { flex-direction: row; }
  .qr-card { width: 34vh; }
}

/* ---------------------------------------------------------------- studio states (display + remote) */
.studio-name { font: 700 4vh var(--display-font); color: var(--dagat); margin-top: 1vh; }
.badge.warn { background: var(--danger); color: var(--night); }
.display .announce { position: absolute; left: 50%; top: 13vh; transform: translateX(-50%); max-width: 80vw; z-index: 6;
  background: var(--kalamansi); color: var(--night); padding: 1.6vh 3vh; border-radius: 1.6vh; font: 800 3.6vh/1.2 var(--display-font); text-align: center; }
.display .lockscreen { position: absolute; inset: 0; z-index: 8; display: grid; place-content: center; text-align: center; background: rgba(25, 24, 66, .92); }
.display .lockscreen h2 { font: 800 9vh/1 var(--display-font); margin: 0 0 2vh; letter-spacing: -0.03em; }
.display .lockscreen p { font-size: 3vh; color: var(--dim); margin: 0; }
.display .dimmed { opacity: .15; }

/* remote QR in the lower right, visible while songs play */
.display .corner-qr { position: absolute; right: 3vw; bottom: 3vh; z-index: 4; display: flex; align-items: flex-end; gap: 1.4vh; text-align: right;
  background: rgba(25, 24, 66, .82); padding: 1.2vh 1.2vh 1.2vh 2vh; border-radius: 1.8vh; }
.display .corner-qr img { width: 15vh; height: 15vh; border-radius: 1.2vh; display: block; }
.display .corner-qr div { font-size: 2vh; color: var(--dim); line-height: 1.3; }
.display .corner-qr b { display: block; color: var(--sampaguita); font: 800 3.2vh var(--display-font); letter-spacing: .1em; }
.display .songvideo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; z-index: 0; }
.picks { display: flex; flex-wrap: wrap; justify-content: center; gap: 2vh; max-width: 80vw; }
.picks button { min-width: 28vh; padding: 2.4vh 3vh; border-radius: 2vh; background: var(--stage); border: 2px solid var(--rail); font: 800 3.4vh var(--display-font); }
.picks button:focus-visible, .picks button:hover { border-color: var(--kalamansi); }
.picks button small { display: block; font: 400 2.2vh var(--ui-font); color: var(--dim); margin-top: .5vh; }
.picks .alt { background: none; }
.lockbar { background: var(--danger); color: var(--night); font-weight: 700; padding: 8px 18px; font-size: 15px; }
.dock.disabled { opacity: .45; }

/* ---------------------------------------------------------------- admin */
.admin { display: grid; grid-template-columns: 220px 1fr; min-height: 100dvh; }
.side { background: var(--stage); border-right: 1px solid var(--rail); padding: 22px 14px; position: sticky; top: 0; height: 100dvh; }
.side .brand { font-size: 40px; margin-bottom: 2px; }
.side .who { color: var(--dim); font-size: 14px; margin-bottom: 22px; }
.side nav button { display: block; width: 100%; text-align: left; padding: 11px 12px; border-radius: 10px; font-weight: 700; color: var(--dim); }
.side nav button[aria-current="page"] { background: var(--rail); color: var(--sampaguita); }
.side .foot { position: absolute; bottom: 18px; left: 14px; right: 14px; display: grid; gap: 4px; }
.side .foot a, .side .foot button { color: var(--dim); font-size: 14px; text-align: left; padding: 4px 12px; }
.main { padding: 26px clamp(16px, 3vw, 36px) 60px; min-width: 0; }
.main h1 { font: 800 34px/1.1 var(--display-font); letter-spacing: -0.02em; margin: 0 0 4px; }
.main .lede { color: var(--dim); margin: 0 0 20px; max-width: 70ch; }
.view { display: none; }
.view.active { display: block; }

.stats { display: flex; flex-wrap: wrap; gap: 28px; margin: 0 0 20px; }
.stats div { color: var(--dim); font-size: 14px; }
.stats b { display: block; color: var(--sampaguita); font: 800 26px var(--display-font); font-variant-numeric: tabular-nums; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.toolbar .label { color: var(--dim); margin-right: 4px; }
.btn { padding: 8px 13px; border-radius: 10px; background: var(--rail); font-weight: 700; font-size: 15px; white-space: nowrap; }
.btn.primary-sm { background: var(--kalamansi); color: var(--night); }
.btn.danger { background: none; border: 1px solid var(--danger); color: var(--danger); }
.btn.ghost { background: none; border: 1px solid var(--rail); }
.btn:disabled { opacity: .45; cursor: default; }

.studios-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.scard { background: var(--stage); border: 1px solid var(--rail); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; }
.scard.offline { opacity: .62; }
.scard.locked { border-color: var(--danger); }
.scard-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.scard-head h3 { font: 800 21px var(--display-font); margin: 0; }
.scard-head .code { color: var(--dim); font-size: 14px; font-variant-numeric: tabular-nums; }
.pill { font-size: 13px; font-weight: 700; padding: 2px 9px; border-radius: 20px; background: var(--rail); color: var(--dim); }
.pill.on { background: rgba(52, 189, 180, .2); color: var(--dagat); }
.pill.lock { background: rgba(255, 138, 122, .18); color: var(--danger); }
.pill.time { background: rgba(246, 196, 69, .18); color: var(--kalamansi); }
.nowline { min-height: 2.8em; }
.nowline .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowline .a { color: var(--dim); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowline .n { color: var(--kalamansi); font-weight: 700; margin-right: 6px; font-variant-numeric: tabular-nums; }
.meta { color: var(--dim); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.remotes { display: flex; flex-wrap: wrap; gap: 6px; }
.remotes button { font-size: 13px; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--rail); }
.remotes button:hover { border-color: var(--danger); color: var(--danger); }
.volrow { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; font-size: 14px; color: var(--dim); }
.volrow input { accent-color: var(--kalamansi); width: 100%; }
.volrow output { color: var(--sampaguita); font-weight: 700; min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; }
.btnrow { display: flex; flex-wrap: wrap; gap: 6px; }

table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
.list th { text-align: left; color: var(--dim); font-weight: 400; font-size: 14px; padding: 8px 10px; border-bottom: 1px solid var(--rail); }
.list td { padding: 10px; border-bottom: 1px solid var(--stage); vertical-align: middle; }
.list td.actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.list .num { color: var(--kalamansi); font-weight: 700; font-variant-numeric: tabular-nums; }
.list .muted { color: var(--dim); font-size: 14px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 6px; margin-right: 4px; background: var(--rail); }
.tag.hide { background: rgba(255, 138, 122, .2); color: var(--danger); }
.tag.edit { background: rgba(246, 196, 69, .18); color: var(--kalamansi); }
.tag.up { background: rgba(52, 189, 180, .2); color: var(--dagat); }
.scroll-x { overflow-x: auto; }

.panel { background: var(--stage); border: 1px solid var(--rail); border-radius: 14px; padding: 16px 18px; margin-bottom: 18px; }
.panel h2 { font: 700 20px var(--display-font); margin: 0 0 10px; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; align-items: end; }
.formgrid label, .modal label { display: block; font-size: 14px; color: var(--dim); }
.formgrid input, .formgrid select, .modal input, .modal select, .modal textarea, .main .search {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--rail); background: var(--night); color: var(--sampaguita); font: inherit; }
.check { display: flex !important; align-items: center; gap: 8px; color: var(--sampaguita) !important; }
.check input { width: auto; margin: 0; accent-color: var(--kalamansi); }
.userpicks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 6px; }
.edit-inline { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 6px; }
.edit-inline input { padding: 7px 9px; border-radius: 8px; border: 1px solid var(--kalamansi); background: var(--night); }
.hint { color: var(--dim); font-size: 14px; margin: 6px 0 0; }

.modal-bg { position: fixed; inset: 0; background: rgba(10, 9, 30, .65); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { width: min(520px, 100%); max-height: 90dvh; overflow-y: auto; background: var(--stage); border: 1px solid var(--rail); border-radius: 16px; padding: 20px; display: grid; gap: 12px; }
.modal h2 { font: 700 22px var(--display-font); margin: 0; }
.modal .btnrow { justify-content: flex-end; margin-top: 4px; }

.log { font-size: 15px; }
.log div { display: grid; grid-template-columns: 130px 120px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--stage); }
.log time { color: var(--dim); font-variant-numeric: tabular-nums; }
.log .u { color: var(--dagat); overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 760px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 14px; border-right: 0; border-bottom: 1px solid var(--rail); }
  .side .brand { font-size: 30px; }
  .side .who { margin-bottom: 10px; }
  .side nav { display: flex; overflow-x: auto; gap: 4px; }
  .side nav button { width: auto; white-space: nowrap; }
  .side .foot { position: static; display: flex; margin-top: 8px; }
  .log div { grid-template-columns: 1fr; gap: 0; }
  .edit-inline { grid-template-columns: 1fr; }
}

.upload-bar { width: 100%; max-width: 420px; height: 10px; accent-color: var(--kalamansi); margin-top: 10px; }

/* keep text readable over bright video songs */
.display .d-song, .display .next { text-shadow: 0 .2vh .8vh rgba(10, 9, 30, .85); }
.display .titlecard { background: radial-gradient(70% 60% at 50% 50%, rgba(25, 24, 66, .78), rgba(25, 24, 66, .35)); }

/* boot-guard.js: shown only if a page fails to start */
.boot-fail { position: fixed; inset: 0; z-index: 100; background: var(--night); display: grid; place-content: center; gap: 12px;
  padding: 24px; text-align: center; font: 17px/1.45 var(--ui-font); color: var(--sampaguita); }
.boot-fail h1 { font: 800 44px/1 var(--display-font); margin: 0 0 8px; letter-spacing: -0.03em; }
.boot-fail h1 span { color: var(--kalamansi); }
.boot-fail p { margin: 0; }
.boot-fail .hint { color: var(--dim); font-size: 15px; max-width: 34ch; justify-self: center; }
.boot-fail code { font-size: 13px; color: var(--dim); word-break: break-all; }
.boot-fail .boot-row { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }
.boot-fail button { padding: 12px 18px; border-radius: 12px; background: var(--kalamansi); color: var(--night); font-weight: 800; border: 0; }
.boot-fail button + button { background: var(--rail); color: var(--sampaguita); }
a.btn { display: inline-block; text-decoration: none; color: inherit; }

/* ---------------------------------------------------------------- remote: singer, reactions, browse, settings */
.now-top { gap: 8px; }
.now-top #roominfo { flex: 1; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gear { font-size: 20px; line-height: 1; padding: 4px 2px 4px 8px; color: var(--dim); }
.singer { margin-top: 8px; font-size: 14px; color: var(--dagat); }
.linkish { color: var(--dim); text-decoration: underline; font-size: 14px; padding: 2px 4px; }
.reacts { display: flex; gap: 8px; margin-top: 10px; }
.reacts button { flex: 1; height: 42px; border-radius: 12px; background: var(--night); font-size: 22px; line-height: 1; }
.reacts button.pop { animation: react-pop .35s ease; }
@keyframes react-pop { 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.chip.on { background: var(--kalamansi); color: var(--night); border-color: var(--kalamansi); }
.browse-chips { margin-top: 0; }
.letters { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.letters .chip { min-width: 38px; padding: 7px 8px; text-align: center; }
.opt.artist { display: block; width: 100%; text-align: left; padding: 12px 2px; border-bottom: 1px solid var(--stage); font-weight: 700; }
.icon.star { color: var(--dim); }
.icon.star[aria-pressed="true"] { color: var(--kalamansi); border-color: var(--kalamansi); }
.fair-note { margin: 6px 0 0; }
.join-links { display: flex; gap: 18px; justify-content: center; }
.join-links a { color: var(--dim); }
.sheet label.by { display: block; margin: 10px 0 2px; }
.sheet select.search { appearance: auto; }

/* Large text (remote Settings) */
html.big .remote { font-size: 20px; }
html.big .song .t { font-size: 20px; }
html.big .song .a, html.big .by { font-size: 16px; }
html.big .song .num { font-size: 17px; }
html.big .now-title { font-size: 25px; }
html.big .now-artist, html.big .singer { font-size: 17px; }
html.big .tabs button { font-size: 18px; padding: 14px 2px; }
html.big .pad button { font-size: 34px; padding: 19px 0; }
html.big .pad .soft { font-size: 19px; }
html.big .reserve-row button, html.big .transport button { font-size: 19px; }
html.big .knob div { font-size: 15px; }
html.big .knob div b { font-size: 20px; }
html.big .search, html.big .chip, html.big .opt { font-size: 19px; }
html.big .icon { min-width: 48px; height: 48px; font-size: 20px; }
html.big .readout .match, html.big .empty, html.big .section-title { font-size: 20px; }

/* reactions on the TV */
.display .reactions { position: absolute; inset: 0; pointer-events: none; z-index: 7; overflow: hidden; }
.display .reaction { position: absolute; bottom: 8vh; display: flex; flex-direction: column; align-items: center;
  animation: float-up linear forwards; }
.display .reaction .e { font-size: 8vh; line-height: 1; filter: drop-shadow(0 .4vh .8vh rgba(10, 9, 30, .6)); }
.display .reaction .who { font: 700 2vh var(--ui-font); color: var(--sampaguita); background: rgba(25, 24, 66, .7);
  padding: .2vh 1vh; border-radius: 1vh; margin-top: .4vh; max-width: 24vh; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes float-up {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  12% { transform: translateY(-6vh) scale(1); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(-62vh) scale(1.05); opacity: 0; }
}
.song .by.extra { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.big .song .by.extra { font-size: 17px; }

/* admin bulk uploader */
.dropzone { border: 2px dashed var(--rail); border-radius: 14px; padding: 18px; text-align: center; transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--kalamansi); background: rgba(246, 196, 69, .06); }
.dropzone p { margin: 0 0 10px; }
.filepick { cursor: pointer; display: inline-block; }
.filepick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.up-table td { vertical-align: top; }
.up-table input { width: 100%; min-width: 90px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--rail); background: var(--night); color: var(--sampaguita); font: inherit; }
.up-table input.num { width: 92px; min-width: 92px; }
.up-table input.bad { border-color: var(--danger); }
.up-table .fname { max-width: 260px; overflow-wrap: anywhere; font-size: 14px; }
.up-table .status { font-size: 13px; min-width: 150px; }
.up-table .status.ok { color: var(--dagat); }
.up-table .status.warn { color: var(--kalamansi); }
.up-table .status.err { color: var(--danger); }
.up-table progress { width: 120px; accent-color: var(--kalamansi); }
.up-table tr.done td { opacity: .6; }
.up-actions { margin-top: 12px; }
.remotes.tvs button { border-color: var(--dagat); color: var(--dagat); }
.remotes.tvs button:hover { border-color: var(--danger); color: var(--danger); }
