/* Phone controller: one-thumb, full-height, big targets. */
.phone { font-size: 18px; overflow: auto; }
#screen { min-height: 100vh; min-height: 100dvh; padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); display: flex; }
#screen > section { flex: 1; display: flex; flex-direction: column; gap: 18px; max-width: 520px; margin: 0 auto; width: 100%; }
.phone .btn { font-size: 22px; padding: 18px 24px; }
.phone .toast { font-size: 16px; }

input {
  width: 100%;
  color: var(--ink);
  background: var(--input);
  font-size: 26px; font-weight: 800;
  padding: 16px 18px;
  border-radius: 18px;
  border: 3px solid var(--panel-2);
  outline: none;
  -webkit-appearance: none;
}
input::placeholder { color: var(--ink-mute); }
input:focus { border-color: var(--action); }
.err { color: var(--bs); margin: 0; font-size: 16px; }

.join { justify-content: center; }
.join .brand { font-size: 18px; }
/* Sundown wordmark (same mark as the TV home) */
.phone .sd-brand { display: flex; align-items: center; gap: 10px; color: #fff; letter-spacing: -0.01em; font-weight: 900; font-size: 22px; }
.phone .sd-brand span { color: #fff; }
.phone .sd-sun { width: 32px; height: 19px; fill: #FF8A3D; margin-top: -3px; }
.join-title { font-size: 76px; line-height: 0.9; margin: 0 0 8px; }
.join-title span { color: var(--action); }
.join-form { display: flex; flex-direction: column; gap: 18px; }
.join-form label { display: flex; flex-direction: column; gap: 8px; color: var(--ink-dim); font-size: 14px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 900; }
.join-form input[name="code"] { text-transform: uppercase; letter-spacing: 0.4em; text-align: center; font-family: var(--display); font-weight: 400; font-size: 48px; padding: 10px 18px; }
.fine { color: var(--ink-dim); font-size: 14px; text-align: center; font-weight: 500; }

.plobby { justify-content: center; text-align: center; }
.me-big { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.me-av { width: 170px; height: 170px; font-family: var(--display); font-weight: 400; font-size: 100px; animation: pop 0.5s ease-out; }
.me-name { font-family: var(--display); text-transform: uppercase; font-size: 46px; line-height: 1; display: flex; align-items: center; gap: 12px; }
.me-name .pill { font-family: var(--font); font-size: 15px; }
.plobby-msg { color: var(--ink-dim); font-size: 18px; }
.plobby-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.mini { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); padding: 4px 14px 4px 4px; border-radius: 999px; font-size: 15px; }
.mini .avatar { width: 28px; height: 28px; font-size: 15px; }
.mini-kick { border: 0; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mini-x { margin-left: 4px; color: var(--ink-mute); font-weight: 900; }
.mini-kick.armed { background: var(--hype, #FF2E63); color: #fff; font-weight: 800; }
.psettings { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.pset { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 18px; border: 2px solid var(--line, #2A2A33); border-radius: 12px; background: transparent; color: var(--ink); font: inherit; font-size: 17px; }
.pset { flex-wrap: wrap; padding: 10px 18px; }
.pset b { color: var(--action); font-weight: 800; }
.pset small { flex-basis: 100%; text-align: left; color: var(--ink-dim); font-size: 14px; line-height: 1.3; margin-top: 2px; }
.pset-hint { color: var(--ink-dim); font-size: 14px; margin: 4px 0 0; line-height: 1.35; display: block; }
.psettings { gap: 16px; }
.pset-row { display: flex; flex-direction: column; gap: 8px; }
.pset-label { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-dim); }
.pset-count { letter-spacing: 0.04em; text-transform: none; font-weight: 700; margin-left: 6px; }
.pset-opts { display: flex; gap: 6px; }
.pset-opt { flex: 1; min-height: 48px; border: 2px solid var(--line, #2A2A33); border-radius: 12px; background: transparent; color: var(--ink); font: inherit; font-size: 16px; font-weight: 800; }
.pset-opt.on { background: var(--action); border-color: var(--action); color: var(--bg); }
.pset-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pset-chip { min-height: 46px; border: 2px solid var(--line, #2A2A33); border-radius: 12px; background: transparent; color: var(--ink-dim); font: inherit; font-size: 15px; font-weight: 800; text-align: left; padding: 0 12px; text-decoration: line-through; }
.pset-chip.on { background: var(--panel, #1C1C24); border-color: var(--action); color: var(--ink); text-decoration: none; }
.pset-chip.on::before { content: '✓ '; color: var(--action); }
.pset:disabled { opacity: 0.6; }
.pset-line { color: var(--ink-dim); font-size: 15px; margin: 0; }
.fine.legal { font-size: 12px; margin-top: -8px; }
.fine.legal a { color: var(--ink-dim); }

/* Mode cards (mirrors the TV after Start) */
.pmodes { gap: 14px; }
.pmodes-kicker { font-size: 13px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-dim); }
.pmodes-title { font-size: 52px; line-height: 0.92; margin: 0; }
.pmodes-msg { margin: 0; color: var(--ink-dim); font-size: 15px; }
.pmodes-list { display: flex; flex-direction: column; gap: 12px; }
.pmode { display: flex; align-items: stretch; padding: 0; border: 0; border-radius: 20px; overflow: hidden; background: var(--panel); color: var(--ink); text-align: left; font: inherit; cursor: pointer;
  box-shadow: 0 0 0 3px transparent; transition: box-shadow 0.15s ease, opacity 0.15s ease, transform 0.15s ease; -webkit-tap-highlight-color: transparent; }
.pmodes-list:has(.pmode.on) .pmode:not(.on) { opacity: 0.6; }
.pmode.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--action); transform: scale(1.01); }
.pmode:disabled { cursor: default; color: var(--ink); }
.pm-art { flex: none; width: 104px; background: var(--m); color: var(--m-ink); display: grid; place-items: center; }
.pm-art .mode-glyph { width: 84px; height: 60px; }
.pm-body { display: flex; flex-direction: column; gap: 5px; padding: 14px 16px; min-width: 0; }
.pm-name { font-family: var(--display); text-transform: uppercase; font-size: 30px; line-height: 1; color: var(--m); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pm-badge { font-family: var(--font); font-size: 11px; font-weight: 900; letter-spacing: 0.1em; background: var(--m); color: var(--m-ink); padding: 4px 9px; border-radius: 999px; }
.pm-desc { font-size: 14px; font-weight: 600; line-height: 1.35; color: #D6D6E2; }
.pm-meta { font-size: 12px; font-weight: 900; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.pm-insp { font-size: 12px; font-weight: 700; color: var(--ink-mute); }
.pmodes-legal { margin: 0; font-size: 11px; font-weight: 600; color: var(--ink-mute); text-align: center; }

/* ---- lobby: game colour wash, big Start, one Game options button ------------- */
.plobby, .poptions { position: relative; }
.plobby::before, .poptions::before { content: ''; position: fixed; left: 0; right: 0; top: 0; height: 260px; background: linear-gradient(180deg, color-mix(in srgb, var(--game) 26%, transparent), transparent); pointer-events: none; z-index: -1; }
.plobby { justify-content: flex-start; gap: 16px; }
.plobby-game { font-size: 14px; font-weight: 900; letter-spacing: 0.18em; text-transform: uppercase; color: var(--game); text-align: center; }
.plobby .me-av { width: 132px; height: 132px; font-size: 78px; }
.plobby .me-name { font-size: 40px; }
.plobby-actions { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.phone .btn-start { font-size: 30px; padding: 26px 24px; border-radius: 26px; }
.phone .btn-start:disabled { opacity: 1; background: var(--panel); color: var(--ink-dim); box-shadow: none; font-size: 22px; }
.popts-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; padding: 16px 20px; border: 0; border-radius: 20px; background: var(--panel); color: var(--ink); font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; position: relative; }
.popts-btn::after { content: '›'; position: absolute; right: 20px; top: 50%; transform: translateY(-52%); font-size: 34px; color: var(--ink-dim); }
.popts-l { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 900; }
.popts-icon { width: 20px; height: 15px; display: inline-block; background:
  linear-gradient(currentColor, currentColor) 0 0 / 100% 3px no-repeat,
  linear-gradient(currentColor, currentColor) 0 50% / 70% 3px no-repeat,
  linear-gradient(currentColor, currentColor) 0 100% / 40% 3px no-repeat; }
.popts-sum { font-size: 14px; color: var(--ink-dim); font-weight: 600; padding-right: 30px; line-height: 1.4; }
.plobby .pset-line { text-align: center; font-size: 14px; line-height: 1.4; }

/* options screen */
.poptions { gap: 18px; }
.poptions .plobby-game { text-align: left; }
.popt-title { font-size: 48px; line-height: 0.95; margin: 0; }
.poptions .psettings { gap: 22px; }
.poptions .pset-label { text-align: left; }
.poptions .pset-hint { text-align: left; }
.poptions .pset-opt.on { background: var(--game); border-color: var(--game); color: var(--game-ink); }
.poptions .pset-chip.on { border-color: var(--game); }
.poptions .pset-chip.on::before { color: var(--game); }
.poptions .pset-opt:disabled, .poptions .pset-chip:disabled { opacity: 1; }
.poptions [data-done] { margin-top: auto; position: sticky; bottom: 0; }
.poptions [data-wait] { text-align: center; }
.plobby .btn-primary, .poptions .btn-primary { background: var(--game); color: var(--game-ink); box-shadow: 0 6px 0 color-mix(in srgb, var(--game) 60%, #000); }
.plobby .me-name .pill { background: var(--game); color: var(--game-ink); }
/* Mode cards: chip row for one more setting (difficulty) */
.pmx { display: flex; flex-direction: column; gap: 8px; }
.pmx-label { font-size: 13px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-dim); }
.pmx-row { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 6px; }
.pmx-chip { font: inherit; font-size: 13px; font-weight: 900; line-height: 1.15; padding: 10px 2px; border: 0; border-radius: 12px; background: var(--panel); color: var(--ink); cursor: pointer; }
.pmx-chip.on { background: var(--action); color: var(--action-ink); }
.pmx-chip:disabled { cursor: default; }
.pmx-chip:disabled:not(.on) { opacity: 0.6; }
.pmx-hint { margin: 0; font-size: 13px; color: var(--ink-dim); font-weight: 600; }

/* Accessibility toggles (join + lobby): text size and colours on this phone. */
.pa11y { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.pa11y-row { display: flex; align-items: center; gap: 6px; }
.pa11y-label { width: 68px; font-size: 13px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.pa11y-opt { flex: 1; min-height: 40px; border: 2px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 800; }
.pa11y-opt.on { background: var(--panel-2); border-color: var(--ink-dim); }
.plobby-flags:empty { display: none; }
.plobby-flags { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.pflag { align-self: flex-start; font-size: 12px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; background: var(--panel-2); }
.pstream { background: var(--panel); border-radius: 14px; padding: 12px 14px; font-size: 14px; color: var(--ink-dim); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pstream b { color: var(--ink); font-size: 18px; letter-spacing: 0.1em; }
.pstream .btn-sm { margin-left: auto; min-height: 36px; padding: 6px 14px; font-size: 14px; }
.pstream { text-align: left; }
.pstream p { margin: 0; width: 100%; }
.pset-opt:disabled { opacity: 0.55; }

/* Audience phone */
.paud { display: flex; flex-direction: column; gap: 10px; }
.paud-kicker { font-size: 13px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--action); }
.paud-title { font-family: var(--display); font-weight: 400; font-size: 44px; line-height: 1; margin: 0; }
.paud-msg { color: var(--ink-dim); font-size: 15px; margin: 0 0 6px; }
.paud-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.paud-p { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); font: inherit; font-size: 18px; font-weight: 800; text-align: left; }
.paud-p .avatar { width: 38px; height: 38px; font-size: 20px; }
.paud-name { flex: 1; }
.paud-n { font-family: var(--display); font-size: 24px; color: var(--ink-dim); }
.paud-p.on { border-color: var(--action); background: var(--panel-2); }
.paud-p.on .paud-n { color: var(--action); }

/* Results card */
.share-results { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 10px; z-index: 60; border: 0; border-radius: 999px; padding: 10px 16px;
  background: var(--action); color: var(--action-ink); font: inherit; font-size: 14px; font-weight: 900; box-shadow: 0 4px 0 var(--action-deep); }
/* Room for the pill so it never sits on a game's own header (team score bars). */
body.has-share #screen { padding-top: calc(max(20px, env(safe-area-inset-top)) + 44px); }
.rcard-sheet { position: fixed; inset: 0; z-index: 100; background: rgba(11, 11, 16, 0.92); display: flex; align-items: center; justify-content: center; padding: 16px; }
.rcard-box { width: 100%; max-width: 420px; max-height: 100%; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.rcard-img { width: 100%; border-radius: 16px; display: block; }
.rcard-actions { display: flex; flex-direction: column; gap: 8px; }
.rcard-actions a.btn { text-align: center; text-decoration: none; }

/* ---- phone remote (/r/<code>): arrows round a big OK, Back underneath ---- */
.premote { justify-content: space-between; }
.premote-top { text-align: center; }
.premote-title { font-size: 56px; line-height: 0.95; margin: 8px 0 6px; }
.premote-sub { color: var(--ink-dim); font-size: 17px; font-weight: 600; margin: 0; text-align: center; }
.dpad { position: relative; width: min(86vw, 360px); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; background: var(--panel); box-shadow: inset 0 0 0 3px var(--panel-2); }
.dp { position: absolute; border: 0; background: transparent; color: var(--ink); display: grid; place-items: center; touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer; user-select: none; -webkit-user-select: none; }
.dp svg { width: 44px; height: 44px; }
.dp-up, .dp-down { left: 32%; width: 36%; height: 32%; }
.dp-left, .dp-right { top: 32%; width: 32%; height: 36%; }
.dp-up { top: 0; }
.dp-down { bottom: 0; } .dp-down svg { transform: rotate(180deg); }
.dp-left { left: 0; } .dp-left svg { transform: rotate(-90deg); }
.dp-right { right: 0; } .dp-right svg { transform: rotate(90deg); }
.dp-ok { left: 30%; top: 30%; width: 40%; height: 40%; border-radius: 50%; background: var(--action); color: var(--action-ink); font-family: var(--display); font-size: 40px; box-shadow: 0 6px 0 var(--action-deep); }
.dp.hit { animation: dp-hit 0.18s ease; }
.dp:not(.dp-ok).hit { color: var(--action); }
@keyframes dp-hit { 50% { transform: scale(0.9); } }
.premote-back { font-size: 20px !important; }
.premote-link { align-self: center; border: 0; background: none; color: var(--ink-dim); font: inherit; font-size: 16px; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; padding: 8px; cursor: pointer; }
.premote-note .premote-sub { text-align: left; font-size: 18px; }

/* Options: rarely changed settings behind "More options" */
.popts-more { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 16px 20px; border: 0; border-radius: 16px; background: var(--panel); color: var(--ink); font: inherit; font-size: 17px; font-weight: 900; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.popts-more-x { font-size: 26px; color: var(--ink-dim); transition: transform 0.2s ease; }
.popts-more.open .popts-more-x { transform: rotate(45deg); }
.poptions [data-done] { position: static; margin-top: auto; }
