/* RT Golf styles. The look comes from the game's PowerPoint: a theater marquee on navy. */

:root {
  --night: #0d182b;
  --navy: #162a48;
  --panel: #1d3458;
  --panel-2: #26426d;
  --line: rgba(255, 255, 255, 0.14);
  --text: #f4f0e6;
  --dim: #a9b7cc;
  --sign: #ebe8e0;
  --sign-rail: #a8a6a0;
  --sign-ink: #262626;
  --tomato: #d42a2a;
  --tomato-2: #b01d1d;
  --bulb: #ffe921;
  --bulb-soft: #fff7c2;
  --fairway: #3f9b4f;
  --gold: #f4c542;
  --ok: #52c771;
  --c-ace: #f4c542;
  --c-eagle: #27b36a;
  --c-birdie: #52c771;
  --c-green: #9bd696;
  --c-bogey: #f0a640;
  --c-double: #ea7a3c;
  --c-water: #4592de;
  --c-lost: #8290a5;
  --c-mulligan: #b089e3;
  --font-display: 'Alfa Slab One', Rockwell, 'Roboto Slab', Georgia, serif;
  --font-text: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 30%, #1b3459 0%, var(--navy) 45%, var(--night) 100%) fixed;
  background-color: var(--navy);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.45;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.01em; line-height: 1.15; margin: 0; }
a { color: var(--bulb-soft); }
p { margin: 0; }
[hidden] { display: none !important; }
.dim { color: var(--dim); }
.small { font-size: 0.86em; }
.error { color: #ff9b8f; font-weight: 700; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- buttons and fields ---- */
.btn {
  appearance: none; border: 2px solid transparent; border-radius: 12px; cursor: pointer;
  font: 700 16px/1.1 var(--font-text); padding: 12px 18px; min-height: 46px;
  background: var(--panel-2); color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: #30507f; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--bulb); outline-offset: 2px; }
.btn.primary { background: var(--tomato); color: #fff; }
.btn.primary:hover { background: var(--tomato-2); }
.btn.gold { background: var(--bulb); color: #2a2400; }
.btn.gold:hover { background: #f2db12; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn.small { font-size: 14px; padding: 7px 12px; min-height: 36px; border-radius: 10px; }
.btn.danger { color: #ffb4aa; }
.btn[disabled] { opacity: 0.5; cursor: default; }

label.field { display: block; }
label.field > span { display: block; font-weight: 700; font-size: 14px; color: var(--dim); margin-bottom: 5px; }
input[type=text], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; font: 17px var(--font-text); color: var(--text); background: var(--night);
  border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 46px;
}
input::placeholder { color: #6f7e95; }
select { appearance: auto; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 0; }
legend { font-weight: 700; color: var(--dim); padding: 0 6px; font-size: 14px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.choice input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--tomato); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

.dialog {
  border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text);
  padding: 22px; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
}
.dialog::backdrop { background: rgba(5, 10, 20, 0.72); }
.dialog h2 { font-size: 24px; }

/* ---- the marquee sign ---- */
.marquee {
  position: relative; margin: 22px auto; padding: 0.35em 0.9em 0.45em; text-align: center;
  background: repeating-linear-gradient(to bottom, var(--sign) 0, var(--sign) calc(1.05em - 2px), var(--sign-rail) calc(1.05em - 2px), var(--sign-rail) 1.05em);
  color: var(--sign-ink); border-radius: 0.5em; box-shadow: 0 0 0 0.32em var(--navy), 0 18px 50px rgba(0, 0, 0, 0.45);
  max-width: calc(100% - 1.6em);
}
.marquee::before {
  content: ''; position: absolute; inset: -0.62em; border-radius: 0.8em; pointer-events: none;
  border: 0.2em dotted var(--bulb-soft);
  filter: drop-shadow(0 0 0.18em var(--bulb)) drop-shadow(0 0 0.4em rgba(255, 233, 33, 0.55));
  animation: twinkle 1.6s steps(2) infinite;
}
@keyframes twinkle { 50% { opacity: 0.78; } }
.marquee .m-title { font-family: var(--font-display); color: var(--tomato); font-size: 1.6em; line-height: 1.05; text-transform: uppercase; }
.marquee .m-line { font-family: var(--font-display); font-size: 0.95em; line-height: 1.1; text-transform: uppercase; }
.marquee .m-stars { font-family: var(--font-display); font-size: 0.7em; letter-spacing: 0.3em; }
.logo-mini { font-family: var(--font-display); color: var(--tomato); background: var(--sign); padding: 2px 10px 3px; border-radius: 6px; box-shadow: 0 0 0 2px var(--bulb-soft), 0 0 10px rgba(255, 233, 33, 0.6); white-space: nowrap; text-decoration: none; }

/* ---- golf names ---- */
.tag { display: inline-block; padding: 0.18em 0.6em 0.2em; border-radius: 99px; font-weight: 700; color: #10200f; background: var(--c-green); white-space: nowrap; font-size: 0.9em; }
.tag.ace { background: var(--c-ace); color: #2c1f00; }
.tag.eagle { background: var(--c-eagle); color: #04220f; }
.tag.birdie { background: var(--c-birdie); color: #062610; }
.tag.green { background: var(--c-green); }
.tag.bogey { background: var(--c-bogey); color: #2b1800; }
.tag.double { background: var(--c-double); color: #2b1000; }
.tag.water { background: var(--c-water); color: #04172b; }
.tag.lost { background: var(--c-lost); color: #111822; }
.tag.mulligan { background: var(--c-mulligan); color: #1d0b33; }

.golf-names { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 14px; align-items: center; }
.golf-names .dim { font-size: 15px; }

/* ---- shared page chrome (home, builders) ---- */
.page { max-width: 1120px; margin: 0 auto; padding: 18px 16px 60px; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; }
.site-foot { margin-top: 48px; color: var(--dim); font-size: 14px; border-top: 1px solid var(--line); padding-top: 14px; }

/* home */
.hero { font-size: clamp(17px, 3.4vw, 38px); width: fit-content; max-width: calc(100% - 28px); margin: 34px auto 40px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.home-grid h2 { font-size: 22px; margin-bottom: 10px; }
.join-box input { font-family: var(--font-display); font-size: 28px; text-transform: uppercase; letter-spacing: 0.15em; text-align: center; }
.game-list { list-style: none; margin: 0; padding: 0; }
.game-list li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.game-list li:first-child { border-top: 0; }
.game-list .g-name { font-weight: 700; }
.code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.08em; }

/* builder */
.build-top { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.notice { border-left: 4px solid var(--bulb); background: rgba(255, 233, 33, 0.08); padding: 10px 14px; border-radius: 8px; }
.holes { display: grid; gap: 12px; margin-top: 16px; }
.hole-card { display: grid; grid-template-columns: 34px 92px 1fr; gap: 14px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.hole-card.playoff { border-style: dashed; }
.hole-num { font-family: var(--font-display); font-size: 26px; color: var(--bulb); text-align: center; }
.hole-num small { display: block; font-family: var(--font-text); font-size: 11px; color: var(--dim); font-weight: 700; }
.poster-slot { width: 92px; aspect-ratio: 2 / 3; border-radius: 8px; background: var(--night) center / cover no-repeat; border: 2px dashed var(--line); display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--dim); cursor: pointer; padding: 4px; }
.poster-slot.has { border-style: solid; color: transparent; }
.hole-fields { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.score-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.score-fields label.field > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-fields .need input { border-color: var(--bulb); }
.hole-tools { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hole-tools .links { margin-left: auto; font-size: 14px; display: flex; gap: 12px; }
.save-bar { position: sticky; bottom: 0; margin-top: 18px; padding: 12px 0; background: linear-gradient(transparent, var(--night) 30%); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.results-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; max-height: 52vh; overflow: auto; }
.results-list button { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; background: var(--night); color: var(--text); border: 2px solid var(--line); border-radius: 10px; padding: 8px; cursor: pointer; font: inherit; }
.results-list button:hover, .results-list button:focus-visible { border-color: var(--bulb); }
.results-list img { width: 46px; height: 69px; object-fit: cover; border-radius: 5px; background: var(--panel-2); flex: none; }
.results-list .r-text { line-height: 1.25; }
.saved-box { margin-top: 16px; }
.big-code { font-family: var(--font-display); font-size: 40px; letter-spacing: 0.12em; color: var(--bulb); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button[aria-pressed=true] { background: var(--tomato); color: #fff; }
.picked { display: flex; gap: 12px; align-items: center; background: var(--night); border: 2px solid var(--ok); border-radius: 10px; padding: 8px 12px; }

@media (max-width: 720px) {
  .build-top { grid-template-columns: 1fr; }
  .hole-card { grid-template-columns: 70px 1fr; }
  .hole-num { grid-column: 1 / -1; text-align: left; font-size: 20px; }
  .hole-num small { display: inline; margin-left: 8px; }
  .poster-slot { width: 70px; }
  .hole-fields { grid-template-columns: 1fr 86px; }
  .score-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- big screen ---- */
body.screen { height: 100vh; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); font-size: 2.3vh; }
.topbar { display: flex; align-items: center; gap: 2vw; padding: 1.6vh 2.4vw; font-size: 2.2vh; }
.topbar .logo-mini { font-size: 2.2vh; }
.topbar .t-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar .t-hole { color: var(--bulb); font-weight: 700; white-space: nowrap; }
.topbar .t-join { margin-left: auto; white-space: nowrap; color: var(--dim); }
.topbar .t-join b { color: var(--text); font-family: var(--font-display); font-weight: 400; letter-spacing: 0.08em; font-size: 1.2em; }
.conn { display: inline-block; width: 1.1vh; height: 1.1vh; border-radius: 50%; background: var(--ok); margin-right: 0.6vw; vertical-align: middle; }
.conn.off { background: #e0533f; }
#stage { min-height: 0; padding: 0 2.4vw 2.4vh; position: relative; }

/* lobby */
.lobby { height: 100%; display: grid; grid-template-columns: 1.25fr 1fr; gap: 4vw; align-items: center; }
.lobby .marquee { font-size: 5.4vh; margin: 0 auto; }
.join-panel { background: rgba(13, 24, 43, 0.6); border: 1px solid var(--line); border-radius: 2vh; padding: 3vh; text-align: center; }
.join-panel .qr { width: 26vh; height: 26vh; margin: 0 auto 2vh; background: #fff; border-radius: 1.4vh; padding: 0.8vh; }
.join-panel .qr svg { width: 100%; height: 100%; display: block; }
.join-panel .addr { font-size: 2.6vh; }
.join-panel .room-code { font-family: var(--font-display); font-size: 9vh; letter-spacing: 0.14em; color: var(--bulb); line-height: 1.1; }
.lobby-players { margin-top: 2vh; }
.chips { display: flex; flex-wrap: wrap; gap: 1vh; justify-content: center; }
.chip { padding: 0.7vh 1.4vh; border-radius: 99px; background: var(--panel-2); font-weight: 700; font-size: 2.3vh; display: inline-flex; gap: 0.6vh; align-items: center; transition: background 0.25s, color 0.25s; }
.chip.in { background: var(--ok); color: #082711; }
.chip.away { opacity: 0.5; }
.chip .tick { font-size: 0.9em; }

/* a hole */
.hole-view { height: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3.5vw; align-items: center; }
.poster { height: 76vh; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 1.4vh; box-shadow: 0 2vh 6vh rgba(0, 0, 0, 0.55), 0 0 0 0.4vh rgba(255, 255, 255, 0.08); background: var(--panel); display: block; }
.poster.blank { display: grid; place-items: center; font-family: var(--font-display); font-size: 4vh; color: var(--dim); text-align: center; padding: 2vh; }
.hole-view.compact .poster { height: 50vh; }
.hole-info { min-width: 0; }
.hole-n { font-family: var(--font-display); color: var(--bulb); font-size: 3vh; letter-spacing: 0.06em; text-transform: uppercase; }
.hole-n.playoff { color: var(--tomato); background: var(--sign); display: inline-block; padding: 0 1vh; border-radius: 0.6vh; }
.movie-title { font-family: var(--font-display); font-size: 7.2vh; line-height: 1.05; margin: 1vh 0 0.6vh; overflow-wrap: anywhere; }
.movie-year { color: var(--dim); font-size: 0.62em; }
.target-pill { display: inline-flex; gap: 1vh; align-items: center; background: var(--sign); color: var(--sign-ink); font-weight: 700; padding: 0.6vh 1.6vh; border-radius: 99px; font-size: 2.4vh; }
.target-pill .src { color: var(--tomato); }
.guess-status { margin-top: 4vh; }
.guess-status h3 { font-family: var(--font-text); font-weight: 700; font-size: 2.6vh; color: var(--dim); margin-bottom: 1.4vh; }
.guess-status .chips { justify-content: flex-start; }
.locked-badge { display: inline-block; margin-left: 1.4vh; background: var(--tomato); color: #fff; padding: 0.3vh 1.2vh; border-radius: 0.8vh; font-size: 0.85em; }

/* the fairway: a 0-100 line with everyone's guesses */
.fairway-wrap { margin: 1vh 0 5.5vh; padding-top: var(--fw-top, 14vh); }
.fairway { position: relative; height: 3.6vh; border-radius: 99px; background: repeating-linear-gradient(90deg, var(--fairway) 0 10%, #47a957 10% 20%); box-shadow: inset 0 -0.5vh 0 rgba(0, 0, 0, 0.18); }
.fairway .tick { position: absolute; top: 100%; transform: translateX(-50%); color: var(--dim); font-size: 1.8vh; margin-top: 0.6vh; }
.marker { position: absolute; bottom: 50%; left: calc(var(--x) * 1%); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.marker .m-label { background: var(--sign); color: var(--sign-ink); font-weight: 700; border-radius: 0.8vh; padding: 0.2vh 0.9vh; font-size: 2vh; white-space: nowrap; box-shadow: 0 0.4vh 1vh rgba(0, 0, 0, 0.35); }
.marker .m-label b { color: var(--tomato); margin-left: 0.5vh; }
.marker .m-stem { width: 0.35vh; height: calc(1.6vh + var(--lvl) * 4.4vh); background: var(--sign); opacity: 0.85; }
.marker .m-ball { width: 1.6vh; height: 1.6vh; border-radius: 50%; background: #fff; box-shadow: 0 0.2vh 0.4vh rgba(0, 0, 0, 0.5); margin-bottom: -0.8vh; }
.marker.dim .m-label { opacity: 0.35; }
.flag { position: absolute; bottom: 50%; left: calc(var(--x) * 1%); width: 0; pointer-events: none; z-index: 3; }
.flag .pole { position: absolute; bottom: 0; left: -0.25vh; width: 0.5vh; height: var(--fh, 16vh); background: #f3f3f3; }
.flag .cloth { position: absolute; bottom: calc(var(--fh, 16vh) - 5vh); left: 0.2vh; background: var(--tomato); color: #fff; font-family: var(--font-display); font-size: 2.6vh; padding: 0.6vh 1.4vh 0.6vh 1vh; clip-path: polygon(0 0, 100% 0, 86% 50%, 100% 100%, 0 100%); white-space: nowrap; }
.flag .hole-cup { position: absolute; bottom: -1vh; left: -1.2vh; width: 2.4vh; height: 2.4vh; border-radius: 50%; background: #0c1f10; }
.drop { animation: drop 0.7s cubic-bezier(0.2, 1.4, 0.5, 1) both; }
@keyframes drop { from { transform: translateY(-30vh); opacity: 0; } to { transform: none; opacity: 1; } }
.pop { animation: pop 0.45s cubic-bezier(0.2, 1.5, 0.5, 1) both; animation-delay: var(--delay, 0s); }
@keyframes pop { from { transform: translateX(-50%) scale(0.2); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.rise { animation: rise 0.45s ease-out both; animation-delay: var(--delay, 0s); }
@keyframes rise { from { transform: translateY(2vh); opacity: 0; } to { transform: none; opacity: 1; } }

.reveal-view { height: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3vw; align-items: start; padding-top: 1vh; }
.reveal-view .poster { height: 44vh; }
.reveal-side { min-width: 0; }
.reveal-head { display: flex; align-items: flex-end; gap: 2vw; flex-wrap: wrap; }
.reveal-head .movie-title { font-size: 5vh; margin: 0.4vh 0 0; }
.par-big { margin-left: auto; text-align: right; }
.par-big .lbl { font-family: var(--font-display); color: var(--bulb); font-size: 2.4vh; letter-spacing: 0.1em; }
.par-big .val { font-family: var(--font-display); font-size: 9vh; line-height: 1; color: #fff; text-shadow: 0 0 2vh rgba(255, 233, 33, 0.5); }

.board { display: grid; gap: 0.7vh; }
.board-row { display: grid; grid-template-columns: 4vh minmax(0, 1fr) 8vh 9vh 17vh 7vh 8vh; gap: 1.2vw; align-items: center; background: rgba(13, 24, 43, 0.55); border-radius: 1vh; padding: 0.7vh 1.2vw; font-size: 2.5vh; }
.board-row.head { background: none; color: var(--dim); font-size: 1.8vh; font-weight: 700; padding-top: 0; padding-bottom: 0; }
.board-row .b-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.board-row .b-score { font-family: var(--font-display); font-size: 1.15em; }
.board-row .b-rank { color: var(--dim); }
.board-row.closest { box-shadow: inset 0 0 0 0.3vh var(--bulb); }
.board.many .board-row { font-size: 2vh; padding-top: 0.4vh; padding-bottom: 0.4vh; }
.guess-list .board-row { grid-template-columns: minmax(0, 1fr) 10vh; }
.pin-badge { font-size: 0.75em; color: var(--bulb); margin-left: 0.6vh; }
.missing { color: var(--dim); margin-top: 1.4vh; font-size: 2.1vh; }

/* scorecard */
.scorecard-view { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.scorecard-view h2 { font-size: 4.4vh; margin: 0.5vh 0 1.6vh; }
.sc-wrap { overflow: auto; min-height: 0; border-radius: 1.4vh; }
table.sc { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--sign); color: var(--sign-ink); font-size: 2.3vh; }
table.sc th, table.sc td { padding: 0.7vh 0.8vw; text-align: center; border-bottom: 1px solid #cfcbc2; border-right: 1px solid #d9d5cc; font-variant-numeric: tabular-nums; }
table.sc thead th { background: var(--navy); color: var(--text); position: sticky; top: 0; z-index: 1; font-size: 1.9vh; }
table.sc .par-row td, table.sc .par-row th { background: #d8d2c3; font-weight: 700; }
table.sc .name { text-align: left; font-weight: 700; white-space: nowrap; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; }
table.sc .total { font-family: var(--font-display); font-size: 1.15em; background: #f6f4ee; }
table.sc td.ace { background: var(--c-ace); font-weight: 700; }
table.sc td.mulligan { background: #e6dbf6; }
table.sc td.mulligan::after { content: 'M'; font-size: 0.6em; vertical-align: super; color: #6b3fb0; margin-left: 0.2em; }
table.sc td.lost { color: #7c7a74; font-style: italic; }
table.sc tr.lead .name::before { content: '★ '; color: var(--tomato); }
table.sc th.h-title { max-width: 9vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; font-size: 1.5vh; color: var(--dim); }

/* final */
.final-view { height: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 3vw; align-items: center; }
.final-view .marquee { font-size: 4.6vh; }
.awards { display: grid; gap: 1.4vh; }
.award { background: rgba(13, 24, 43, 0.6); border: 1px solid var(--line); border-radius: 1.4vh; padding: 1.4vh 1.6vw; }
.award h3 { font-size: 2.6vh; color: var(--bulb); }
.award .who { font-weight: 700; font-size: 2.6vh; }
.award .detail { color: var(--dim); font-size: 2vh; }
.tie-box { text-align: center; }
.tie-box h2 { font-size: 7vh; color: var(--bulb); }

/* host controls on the big screen: they fade away when the mouse is still */
.controls {
  position: fixed; left: 50%; bottom: 1.6vh; transform: translateX(-50%); z-index: 10;
  display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 16px;
  background: rgba(10, 18, 32, 0.92); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s; font-size: 16px; max-width: calc(100vw - 24px); flex-wrap: wrap; justify-content: center;
}
body.idle .controls:not(:focus-within) { opacity: 0; pointer-events: none; }
body.idle { cursor: none; }
.controls .btn.primary { font-size: 18px; min-width: 220px; }
.controls .kbd { color: var(--dim); font-size: 12px; margin-left: 4px; }
.panel-pop { position: fixed; right: 16px; bottom: 90px; z-index: 11; width: min(420px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-size: 16px; }
.panel-pop h3 { font-size: 20px; margin-bottom: 8px; }
.panel-pop .qr { width: 220px; background: #fff; padding: 8px; border-radius: 12px; margin: 8px auto; }
.panel-pop .qr svg { display: block; width: 100%; height: auto; }
.player-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.overlay { position: fixed; inset: 0; z-index: 9; background: rgba(9, 16, 29, 0.97); padding: 3vh 2.4vw 12vh; display: flex; flex-direction: column; }
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 30; background: var(--sign); color: var(--sign-ink); padding: 10px 16px; border-radius: 12px; font-weight: 700; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); max-width: calc(100vw - 32px); }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.confetti i { position: absolute; top: -40px; width: 14px; height: 14px; border-radius: 3px; }

/* ---- phones: players and the host remote ---- */
body.phone { font-size: 18px; }
.phone-wrap { max-width: 520px; margin: 0 auto; padding: 12px 16px 120px; }
.phone-top { display: flex; align-items: center; gap: 10px; padding: 4px 0 12px; font-size: 15px; white-space: nowrap; }
.phone-top .me { margin-left: auto; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.phone-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.phone-card + .phone-card { margin-top: 14px; }
.phone-card h2 { font-size: 24px; }
.phone-movie { display: flex; gap: 14px; align-items: center; }
.phone-movie img, .phone-movie .ph { width: 92px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; background: var(--night); flex: none; }
.phone-movie .pm-title { font-family: var(--font-display); font-size: 24px; line-height: 1.1; }
.phone-movie .pm-sub { color: var(--dim); font-size: 15px; margin-top: 4px; }
.guess-form { margin-top: 16px; }
.guess-input { font-family: var(--font-display); font-size: 64px; text-align: center; height: 96px; letter-spacing: 0.04em; }
.guess-form .btn { width: 100%; font-size: 20px; min-height: 58px; margin-top: 12px; }
.your-guess { text-align: center; padding: 8px 0; }
.your-guess .big { font-family: var(--font-display); font-size: 72px; line-height: 1; color: var(--bulb); }
.result-big { text-align: center; }
.result-big .tag { font-size: 26px; padding: 6px 18px; }
.result-big .strokes { font-family: var(--font-display); font-size: 64px; line-height: 1.1; margin-top: 10px; }
.result-big .line { color: var(--dim); margin-top: 6px; }
.mini-board { list-style: none; margin: 0; padding: 0; }
.mini-board li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.mini-board li:first-child { border-top: 0; }
.mini-board .mb-rank { width: 26px; color: var(--dim); text-align: right; }
.mini-board .mb-name { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-board .mb-val { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.mini-board li.me { background: rgba(255, 233, 33, 0.1); border-radius: 8px; }
.status-line { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(10, 18, 32, 0.96); border-top: 1px solid var(--line); font-size: 15px; color: var(--dim); text-align: center; }
.remote-actions { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(10, 18, 32, 0.97); border-top: 1px solid var(--line); display: grid; gap: 8px; }
.remote-actions .btn.primary { min-height: 60px; font-size: 20px; }
.remote-actions .row .btn { flex: 1; }
.peek { background: var(--sign); color: var(--sign-ink); border-radius: 12px; padding: 10px 14px; margin-top: 12px; font-weight: 700; }
.peek .val { font-family: var(--font-display); font-size: 30px; color: var(--tomato); margin-left: 6px; }

@media (prefers-reduced-motion: reduce) {
  .marquee::before { animation: none; }
  .drop, .pop, .rise { animation: none; }
}
