:root {
  --bg: #111018;
  --card: #ffffff12;
  --line: #ffffff24;
  --text: #fff;
  --muted: #c7c2d5;
  --dim: #9c95ae;
  --accent: #7657ed;
  --accent-2: #b9aaff;
  --good: #176b47;
  --good-line: #36c98b;
  --bad: #762e38;
  --bad-line: #dc6877;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse at top, #282044 0%, var(--bg) 68%) fixed;
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; width: min(1100px, 100%); margin: 0 auto; padding: clamp(16px, 4vw, 40px); }
[hidden] { display: none !important; }

.kicker { color: var(--accent-2); font-size: 12px; letter-spacing: 2px; font-weight: 700; text-align: center; margin-top: 4vh; }
h1 { font-size: clamp(34px, 7vw, 64px); margin: 12px 0 8px; text-align: center; }
.lead { color: var(--muted); text-align: center; max-width: 560px; margin: 0 auto 28px; line-height: 1.5; }
.block { max-width: 760px; margin: 0 auto 24px; text-align: center; }
.hint { color: var(--dim); font-size: 13px; line-height: 1.5; text-align: center; }
.msg { min-height: 1.4em; text-align: center; color: var(--muted); }
code { background: #ffffff18; padding: 1px 5px; border-radius: 5px; }
a { color: var(--accent-2); }

.btn {
  border: 0; border-radius: 12px; padding: 13px 18px; cursor: pointer;
  font: 700 15px/1.2 inherit; background: #ffffff1c; color: var(--text);
}
.btn:hover { background: #ffffff2a; }
.btn.primary { background: var(--accent); }
.btn.primary:hover { background: #8569f2; }
.btn.big { font-size: 18px; padding: 16px 26px; }
.btn:disabled { opacity: .5; cursor: progress; }
.link { background: none; border: 0; color: var(--accent-2); cursor: pointer; font: inherit; padding: 6px; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }

.lib-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); margin-bottom: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; text-align: left; }
.card {
  display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); color: var(--text); cursor: pointer; font: inherit; text-align: left;
}
.card:hover { background: #ffffff22; }
.card .thumb { width: 100%; aspect-ratio: 16 / 9; border-radius: 9px; background: #ffffff14 center / cover no-repeat; display: grid; place-items: center; font-size: 30px; }
.card .t { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .s { color: var(--dim); font-size: 12px; }

#ytm-connect-box, .code-box { padding: 6px 0 4px; }
.code-box p { color: var(--muted); margin: 6px 0; }
.user-code { font: 800 clamp(28px, 6vw, 40px)/1.2 ui-monospace, Consolas, monospace; letter-spacing: 3px; margin: 8px 0; user-select: all; }
#ytm-grid:not(:empty) { margin-top: 4px; }

.link-form label { display: block; color: var(--muted); margin-bottom: 8px; }
.row { display: flex; gap: 8px; }
.row input {
  flex: 1; min-width: 0; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #00000040; color: var(--text); font: inherit;
}

.bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pool { flex: 1; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.score { color: #ddd6ef; font-weight: 700; white-space: nowrap; }

.stage { display: grid; grid-template-columns: minmax(200px, 1.1fr) 1fr; gap: 18px; align-items: center; }
.player-box {
  position: relative; width: 100%; aspect-ratio: 16 / 9; min-width: 200px; min-height: 200px;
  border-radius: 16px; overflow: hidden; background: #000;
}
.player-box iframe, #player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cover {
  position: absolute; inset: 0; pointer-events: none; /* taps reach the player underneath */
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(circle at 50% 40%, #3a2c6e, #17131f 75%);
  font-size: clamp(16px, 2.4vw, 22px); font-weight: 700;
}
.eq { display: flex; gap: 6px; align-items: flex-end; height: 48px; }
.eq i { width: 8px; background: var(--accent-2); border-radius: 3px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.2s } .eq i:nth-child(3) { animation-delay: -.5s }
.eq i:nth-child(4) { animation-delay: -.7s } .eq i:nth-child(5) { animation-delay: -.35s }
@keyframes eq { 0%, 100% { height: 12px } 50% { height: 48px } }

.answer { padding: 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); min-height: 96px; text-align: center; }
#a-title { font-size: clamp(20px, 3vw, 28px); font-weight: 800; }
#a-artist { color: var(--muted); margin-top: 6px; }
.answer.revealed { border-color: var(--good-line); }
.status { display: inline-block; margin-top: 12px; padding: 7px 12px; border-radius: 999px; background: #ffffff14; color: #cfc6ee; font-size: 13px; }
.side { text-align: center; }
.map { margin-top: 12px; }
.map svg { display: block; width: 100%; height: 38px; }
#map-label { color: var(--dim); font-size: 11px; margin-top: 4px; }

/* lyrics: only the line being sung is readable until the answer is revealed */
.lyrics { margin-top: 14px; padding: 6px 10px 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.lyrics-lines {
  position: relative; height: 9.6em; overflow: hidden; padding: 3.6em 0; scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
}
.ly-line {
  padding: 3px 6px; line-height: 1.35; color: var(--muted); filter: blur(6px); opacity: .65;
  transition: filter .25s, opacity .25s, color .25s;
}
.ly-line.now { filter: none; opacity: 1; color: var(--text); font-weight: 800; font-size: 1.1em; }
.ly-title { border-radius: 6px; background: #ffffff3d; color: transparent; } /* the title's words stay hidden */
.lyrics.revealed .lyrics-lines { overflow-y: auto; }
.lyrics.revealed .ly-line { filter: none; opacity: .8; }
.lyrics.revealed .ly-line.now { opacity: 1; }
.lyrics.revealed .ly-title { background: none; color: var(--accent-2); }
.lyrics.empty .lyrics-lines { display: none; }
.lyrics-src { color: var(--dim); font-size: 11px; margin-top: 4px; }
.ly-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-weight: 700; border: 1px solid currentColor; cursor: help; }
.ly-badge[data-kind="synced"] { color: var(--good-line); }
.ly-badge[data-kind="heard"] { color: var(--accent-2); }
.ly-badge[data-kind="estimate"] { color: #f0c36b; }
.ly-badge[hidden] { display: none; }
.ly-listen { font-size: 13px; margin-top: 6px; }
.ly-listen[aria-pressed="true"] { color: var(--accent-2); font-weight: 700; }
.lyrics-ear { color: var(--dim); font-size: 11px; margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .ly-line { transition: none; } }
@media (max-width: 760px) { .lyrics-lines { height: 7.8em; padding: 2.8em 0; } }

/* pop-up notes */
.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 10px;
  width: min(380px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  position: relative; pointer-events: auto; padding: 12px 40px 12px 14px; border-radius: 14px;
  background: #2a2540; border: 1px solid var(--accent-2); color: var(--text); box-shadow: 0 10px 30px #0008;
  font-size: 14px; animation: toast-in .25s ease-out; transition: opacity .3s, transform .3s;
}
.toast b { display: block; margin-bottom: 3px; overflow-wrap: anywhere; }
.toast div { color: var(--muted); }
.toast.out { opacity: 0; transform: translateY(8px); }
.toast-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 8px; background: #ffffff14; color: var(--text); cursor: pointer; }
.toast-x:hover { background: #ffffff2a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; transition: none; } }
@media (max-width: 520px) { .toasts { right: 16px; left: 16px; bottom: auto; top: 16px; width: auto; } }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0 6px; }
.option {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  text-align: left; padding: 14px 16px; min-height: 72px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit;
}
.option:hover:not(:disabled) { background: #ffffff25; }
.option .key { grid-row: span 2; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #ffffff18; font-weight: 800; }
.option .o-title { font-weight: 800; font-size: clamp(15px, 2vw, 19px); }
.option .o-artist { color: var(--muted); font-size: 13px; }
.option.correct { background: var(--good); border-color: var(--good-line); }
.option.wrong { background: var(--bad); border-color: var(--bad-line); }
.option:disabled { cursor: default; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.foot { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; color: var(--dim); font-size: 12px; margin-top: 8px; }
.foot label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.toggles { display: flex; flex-wrap: wrap; gap: 8px 18px; }
select { background: #2a2540; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; font: inherit; color-scheme: dark; }
/* the opened list is drawn by the system: give it solid colours so it's readable without hovering */
select option { background: #1d1a2b; color: #fff; }
.link-form .tune-line { display: block; margin: 10px 0 0; font-size: 13px; color: var(--dim); }

/* chips (playlist builder) */
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); font: 700 14px/1.2 inherit; cursor: pointer;
}
.chip:hover:not(:disabled) { background: #ffffff25; border-color: var(--accent-2); }
.chip:disabled { opacity: .5; cursor: default; }
.chip.is-loading { padding-right: 38px; }
.chip.is-loading::after { top: 50%; margin-top: -10px; right: 9px; }
.legal { color: #7f7891; font-size: 11px; text-align: center; padding: 14px; }

/* song search */
#search-msg:empty { display: none; }
.results { display: grid; gap: 6px; margin-top: 10px; text-align: left; }
.result {
  display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding: 8px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); color: var(--text); font: inherit; cursor: pointer; text-align: left;
}
.result:hover { background: #ffffff22; }
.result > div { min-width: 0; }
.r-thumb { width: 48px; height: 48px; border-radius: 8px; background: #ffffff14 center / cover no-repeat; }
.r-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-sub { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.option.skeleton .o-title { opacity: .35; }

/* teams & timer */
.setup-line { text-align: center; margin: -14px 0 24px; color: var(--dim); font-size: 13px; }
.teams-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: -4px 0 14px; }
.team-chip {
  display: flex; gap: 10px; align-items: center; padding: 7px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.team-chip b { color: var(--text); font-size: 16px; }
.team-chip.turn { border-color: var(--accent-2); background: #7657ed40; color: var(--text); }
.team-chip.turn::before { content: "▶"; font-size: 10px; color: var(--accent-2); }
.score-fix {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: #ffffff14;
  color: var(--text); font: 800 15px/1 inherit; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.score-fix:hover { background: #ffffff2a; }
#edit-scores { font-size: 13px; }

/* "Who guessed first?" after picking an answer in teams + timer mode */
.who-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  margin: 16px 0 -8px; padding: 12px 14px; border-radius: 14px; background: #f2b84b1f; border: 1px solid #f2b84b66;
}
.who-label { width: 100%; text-align: center; font-weight: 800; font-size: clamp(17px, 2.4vw, 22px); color: #f7cd74; }
.who-bar .btn { padding: 10px 16px; }
.option.picked { border-color: #f2b84b; box-shadow: 0 0 0 2px #f2b84b inset; background: #f2b84b1f; }
.option.picked:disabled { opacity: 1; }

.timer { margin-top: 12px; }
.timer-track { height: 8px; border-radius: 99px; background: #ffffff14; overflow: hidden; }
#timer-fill { height: 100%; width: 100%; background: var(--accent-2); transition: width .1s linear; }
#timer-text { display: block; margin-top: 6px; font-weight: 800; font-size: clamp(16px, 2.2vw, 20px); color: var(--accent-2); }
.timer[data-phase="guess"] #timer-fill { background: #f2b84b; }
.timer[data-phase="guess"] #timer-text { color: #f7cd74; }
.timer.low #timer-fill { background: var(--bad-line); }
.timer.low #timer-text { color: var(--bad-line); }

/* playlist builder (same artist) */
dialog.builder { width: min(640px, calc(100vw - 32px)); }
.b-chart { margin: 4px 0 12px; }
.b-bars { display: flex; align-items: flex-end; gap: 2px; height: 74px; padding: 6px 0 0; border-bottom: 1px solid var(--line); }
.b-bar {
  flex: 1 1 0; min-width: 3px; height: var(--h); padding: 0; border: 0; border-radius: 3px 3px 0 0;
  background: #ffffff26; cursor: pointer; position: relative;
}
.b-bar.on { background: var(--accent-2); }
.b-bar.seed { box-shadow: 0 0 0 2px #f2b84b; }
.b-bar:hover { filter: brightness(1.3); }
.b-axis { position: relative; display: flex; justify-content: space-between; color: var(--dim); font-size: 11px; margin-top: 4px; min-height: 15px; }
.b-seed-label { position: absolute; top: 0; transform: translateX(-50%); color: #f7cd74; font-weight: 700; white-space: nowrap; }
/* Cancel / Play stay in view while the options scroll */
.builder .setup-actions { position: sticky; bottom: -22px; margin: 14px -22px -22px; padding: 12px 22px; background: #1d1a2b; border-top: 1px solid var(--line); }
.b-group { margin: 10px 0; }
.b-label { display: block; color: var(--muted); font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.b-label small { font-weight: 400; color: var(--dim); }
.b-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent-2); color: #fff; }
.b-summary { font-weight: 800; margin: 14px 0 6px; }
.b-preview { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.b-preview .more { list-style: none; margin-left: -20px; color: var(--dim); }

/* loading feedback */
.loading-bar { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 1000; overflow: hidden; background: #7657ed40; }
.loading-bar i {
  position: absolute; top: 0; bottom: 0; width: 40%;
  background: linear-gradient(90deg, transparent, var(--accent-2), #fff, var(--accent-2), transparent);
  animation: loading-slide 1.1s ease-in-out infinite;
}
@keyframes loading-slide { from { left: -40%; } to { left: 100%; } }
body.busy { cursor: progress; }
.is-loading { position: relative; opacity: 1 !important; border-color: var(--accent-2) !important; }
.is-loading::after {
  content: ""; position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid #ffffff40; border-top-color: #fff; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .loading-bar i { animation-duration: 3s; }
  .is-loading::after { animation-duration: 2.4s; }
}

dialog.setup {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  border: 1px solid var(--line); border-radius: 18px; background: #1d1a2b; color: var(--text); padding: 22px;
}
dialog.setup::backdrop { background: #000a; }
.setup h2 { margin: 0 0 6px; font-size: 20px; }
.setup .switch { display: flex; gap: 8px; align-items: center; font-weight: 700; margin: 14px 0 6px; cursor: pointer; }
.setup .hint.left { text-align: left; margin: 4px 0 8px; }
.setup hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0 4px; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.plain:disabled { opacity: .45; }
.team-row { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.setup input[type="text"], .setup input[type="number"] {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #00000040; color: var(--text); font: inherit;
}
.team-row input { flex: 1; min-width: 0; }
#timer-fields label { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); margin: 8px 0; }
#timer-fields input { width: 84px; }
.setup-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }

@media (max-width: 760px) {
  .stage { grid-template-columns: 1fr; }
  .keys { display: none; }
}
@media (max-width: 520px) {
  .options { grid-template-columns: 1fr; }
  .option { min-height: 60px; }
  .row { flex-direction: column; }
  /* keep the controls reachable with one thumb */
  .actions { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 35%); }
}
/* Big screens (TV): scale everything up a notch */
@media (min-width: 1600px) {
  :root { font-size: 20px; }
  main { width: min(1500px, 100%); }
  .btn { font-size: 20px; padding: 16px 24px; }
}
.b-help { margin: 6px 0 0; min-height: 1.2em; }

/* songs heard: counter, stats, end of a list */
.heard-count { font-size: 13px; white-space: nowrap; }
.bar .heard-count { padding: 4px 6px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 10px 0 6px; }
.stat-tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.stat-tile b { display: block; font-size: 24px; }
.stat-tile span { color: var(--dim); font-size: 12px; }
#stats-body h3 { font-size: 14px; color: var(--muted); margin: 16px 0 6px; }
.stat-list { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.stat-list.recent { list-style: none; padding-left: 0; }
.stat-list .ok::first-letter { color: var(--good-line); }
.stat-list .miss::first-letter { color: var(--bad-line); }
.forget-confirm { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #8d3743; }
.end-choices { display: grid; gap: 10px; margin-top: 14px; }
.end-choices .btn { width: 100%; text-align: left; }
@media (max-width: 520px) { .bar .heard-count { display: none; } }
.b-range { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px; padding: 8px 10px; border-radius: 12px; border: 1px dashed var(--line); color: var(--muted); font-size: 14px; }
.b-range label { display: flex; gap: 6px; align-items: center; }
.b-range select { padding: 5px 8px; font-weight: 700; }
.b-range.active { border-style: solid; border-color: var(--accent-2); background: #7657ed26; color: var(--text); }

/* 📱 party: on the big screen */
.options.watch-only .option { cursor: default; }
.options.watch-only .option:hover:not(:disabled) { background: var(--card); }
.option { position: relative; }
.o-votes { position: absolute; top: 8px; right: 10px; padding: 2px 8px; border-radius: 99px; background: #00000055; font-size: 13px; font-weight: 800; }
.party-chip { cursor: pointer; font: inherit; font-size: 14px; color: var(--accent-2); border-color: #b9aaff66; }
.party-chip:hover { background: #ffffff22; }
.team-chip.offline { opacity: .5; }
.team-chip .chip-mark { font-style: normal; font-weight: 800; font-size: 13px; }
.team-chip.answered { border-color: var(--accent-2); }
.team-chip.answered .chip-mark { color: var(--accent-2); }
.team-chip.got { border-color: var(--good-line); background: #176b4766; }
.team-chip.got .chip-mark { color: var(--good-line); }
.team-chip.missed .chip-mark { color: var(--bad-line); }
dialog.party { width: min(600px, calc(100vw - 32px)); }
.party-join { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; justify-content: center; margin: 10px 0; }
.party-qr { width: 190px; aspect-ratio: 1; background: #fff; border-radius: 12px; padding: 8px; display: grid; place-items: center; color: #333; font-size: 13px; }
.party-qr svg { width: 100%; height: auto; display: block; }
.party-how { text-align: center; }
.party-how p { margin: 4px 0; color: var(--muted); }
.party-url { font-weight: 800; color: var(--text) !important; font-size: 18px; overflow-wrap: anywhere; }
.party-code { font-size: clamp(40px, 9vw, 56px); letter-spacing: 8px; color: var(--accent-2); }
.party-players { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.party-players li { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 10px; background: var(--card); }
.party-players li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-players li.offline { opacity: .6; }
.party-players li.hint { background: none; justify-content: center; }

/* 📱 party: the phone page (join.html) */
body.phone main { width: 100%; max-width: 560px; padding: 16px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.ph-join h1 { font-size: clamp(30px, 9vw, 44px); }
.ph-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 18px; }
.ph-form label { color: var(--muted); font-weight: 700; margin-top: 8px; }
.ph-form label small { font-weight: 400; color: var(--dim); }
.ph-form input {
  width: 100%; min-width: 0; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: #00000040; color: var(--text); font: inherit; font-size: 18px;
}
.ph-form .ph-code-input { font: 800 34px/1.1 ui-monospace, Consolas, monospace; letter-spacing: 10px; text-transform: uppercase; text-align: center; }
.ph-form .btn { margin-top: 14px; }
.ph-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ph-team { font-weight: 800; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-points { color: var(--accent-2); font-weight: 800; white-space: nowrap; }
.ph-banner { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: #f2b84b1f; border: 1px solid #f2b84b66; color: #f7cd74; text-align: center; font-weight: 700; }
.ph-status { margin: 16px 0 4px; font-size: 20px; font-weight: 800; text-align: center; }
.ph-timer { margin: 8px 0 4px; }
#ph-fill { height: 100%; width: 100%; background: var(--accent-2); transition: width .2s linear; }
#ph-timer-text { display: block; margin-top: 6px; font-weight: 800; text-align: center; color: var(--accent-2); }
.ph-timer[data-phase="guess"] #ph-fill { background: #f2b84b; }
.ph-timer[data-phase="guess"] #ph-timer-text { color: #f7cd74; }
.ph-timer.low #ph-fill { background: var(--bad-line); }
.ph-options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 14px 0 6px; }
.ph-option {
  display: grid; gap: 3px; text-align: left; padding: 16px 18px; min-height: 76px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--card); color: var(--text); font: inherit; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.ph-option:nth-child(1) { border-left: 8px solid #7657ed; }
.ph-option:nth-child(2) { border-left: 8px solid #36a3c9; }
.ph-option:nth-child(3) { border-left: 8px solid #e0a43a; }
.ph-option:nth-child(4) { border-left: 8px solid #d4588e; }
.ph-option:active:not(:disabled) { transform: scale(.98); }
.ph-option .o-title { font-weight: 800; font-size: 19px; }
.ph-option .o-artist { color: var(--muted); font-size: 14px; }
.ph-option:disabled { cursor: default; opacity: .55; }
.ph-option.mine { opacity: 1; border-color: var(--accent-2); background: #7657ed40; }
.ph-option.correct { opacity: 1; background: var(--good); border-color: var(--good-line); }
.ph-option.wrong { opacity: 1; background: var(--bad); border-color: var(--bad-line); }
.ph-result { min-height: 1.5em; margin: 10px 0; text-align: center; font-weight: 700; color: var(--muted); }
.ph-result.good { color: var(--good-line); font-size: 20px; }
.ph-result.bad { color: var(--bad-line); }
.ph-board { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.ph-board li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--card); }
.ph-board li.me { background: #7657ed40; border: 1px solid var(--accent-2); }
.ph-board li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-foot { margin-top: 22px; text-align: center; color: var(--dim); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .ph-option:active:not(:disabled) { transform: none; } #ph-fill { transition: none; } }

/* 📱 party: who answered first (at the reveal) */
.party-order { list-style: none; margin: 4px 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.party-order li {
  display: flex; gap: 8px; align-items: center; padding: 6px 12px 6px 6px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.party-order .po-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #ffffff1c; color: var(--text); font-size: 14px; }
.party-order .po-name { color: var(--text); font-weight: 700; }
.party-order li i { font-style: normal; font-weight: 800; }
.party-order li.got { border-color: var(--good-line); }
.party-order li.got .po-n { background: var(--good); }
.party-order li.got i { color: var(--good-line); }
.party-order li.missed i { color: var(--bad-line); }
.party-order li.none { opacity: .55; }
.ph-sub { margin: 16px 0 6px; color: var(--dim); font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.ph-when { display: block; margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--muted); }
.ph-order { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ph-order li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; border-radius: 10px; background: #ffffff0d; font-size: 15px; }
.ph-order li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-order li.me { border: 1px solid var(--accent-2); }
.ph-order li.got b { color: var(--good-line); }
.ph-order li.missed b { color: var(--bad-line); }
.ph-order li.none { opacity: .55; }

/* 📱 an answer the big screen hasn't confirmed yet */
.ph-option.mine.pending { border-style: dashed; }
