/* Movie TRIVLE: a night at the pictures. Midnight-blue auditorium, marquee gold, sunset amber,
   cream ticket stock. Colours are taken from the splash poster (public/splash-*.webp). */
@font-face { font-family: 'Anton'; src: url('/fonts/anton-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Oswald'; src: url('/fonts/oswald-latin-500-normal.woff2') format('woff2'); font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'Lobster'; src: url('/fonts/lobster-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('/fonts/work-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('/fonts/work-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --night: #0a0f1c;
  --wall: #121a2c;
  --wall-2: #1b2640;
  --line: #2c3a5c;
  --neon: #f5c84c;            /* marquee gold: primary actions (the TRIVLE yellow) */
  --neon-glow: rgba(245, 200, 76, .40);
  --amber: #f39a4a;           /* sunset amber: links, labels, selected answers */
  --amber-glow: rgba(243, 154, 74, .40);
  --lemon: #6fd3df;           /* sci-fi teal: past days played late */
  --cream: #f4ecda;
  --cream-2: #e1d3b2;
  --ink: #1a1712;
  --ink-soft: #5c5244;
  --text: #eef0f5;
  --muted: #a9b3c6;
  --right: #3fbf73;
  --wrong: #e2483d;
  --radius: 10px;
  --display: 'Anton', 'Oswald', Impact, system-ui, sans-serif;
  --sign: 'Oswald', 'Work Sans', system-ui, sans-serif;
  --script: 'Lobster', 'Brush Script MT', cursive;
  --body: 'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--night); color: var(--text);
  font: 400 1rem/1.5 var(--body);
  background-image:
    radial-gradient(ellipse 120% 50% at 50% -10%, rgba(52, 96, 125, .35), transparent 60%),
    radial-gradient(ellipse 80% 40% at 100% 110%, rgba(243, 154, 74, .10), transparent 60%);
  background-attachment: fixed;
}
button { font: inherit; color: inherit; }
a { color: var(--amber); }
:focus-visible { outline: 3px solid var(--neon); outline-offset: 3px; }

.shop { max-width: 34rem; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- marquee ---------- */
.marquee { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 8px 0 14px; border-bottom: 1px solid var(--line); }
.reel { grid-row: 1 / span 2; width: 54px; height: 54px; animation: spin 6s linear infinite; filter: drop-shadow(0 0 10px var(--neon-glow)); }
.reel-body { fill: var(--neon); }
.reel-hole { fill: var(--night); }
@keyframes spin { to { transform: rotate(360deg); } }

.brand { margin: 0; display: flex; align-items: baseline; gap: .3em; font-weight: 400; line-height: 1; }
.brand-a { font: 400 clamp(1.7rem, 8vw, 2.5rem)/1 var(--script); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.brand-b { font: 400 clamp(1.9rem, 9vw, 2.8rem)/1 var(--display); color: var(--neon); text-transform: uppercase; letter-spacing: .04em; text-shadow: 0 3px 0 #7a5a12, 0 0 22px var(--neon-glow); }
.dateline { margin: 4px 0 0; font: 500 .85rem/1.2 var(--sign); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- screens ---------- */
.screen { flex: 1; padding: 18px 0 8px; outline: none; }
.loading { color: var(--muted); text-align: center; margin-top: 3rem; }

/* Hand-lettered sale card: today's theme */
.sign { position: relative; background: var(--cream); color: var(--ink); border-radius: 4px; padding: 14px 16px 16px; transform: rotate(-1.2deg); box-shadow: 0 10px 24px rgba(0, 0, 0, .45), inset 0 0 0 2px var(--cream-2); margin: 4px 4px 22px; }
.sign::before, .sign::after { content: ''; position: absolute; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #d9d2c4, #7c7468); box-shadow: 0 2px 3px rgba(0, 0, 0, .5); }
.sign::before { left: 14px; } .sign::after { right: 14px; }
.sign-kicker { margin: 0; font: 500 .8rem/1 var(--sign); letter-spacing: .14em; text-transform: uppercase; color: #8a4a12; }
.sign-theme { margin: 6px 0 0; font: 400 clamp(1.6rem, 7.4vw, 2.2rem)/1.1 var(--display); letter-spacing: .02em; }
.sign-sub { margin: 6px 0 0; color: var(--ink-soft); font-size: .9rem; }

.rules { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; }
.rules li { display: flex; gap: 12px; align-items: baseline; color: var(--muted); }
.rules b { color: var(--text); font-weight: 600; }
.rules .n { flex: none; width: 1.8rem; height: 1.8rem; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); font: 400 .85rem var(--sign); color: var(--amber); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer; font: 500 1.1rem/1 var(--sign); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
.btn-primary { width: 100%; background: var(--neon); color: var(--ink); box-shadow: 0 0 0 2px #ffe08a inset, 0 0 18px var(--neon-glow); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-ghost:disabled { opacity: .35; cursor: default; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1; }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--amber); text-decoration: underline; cursor: pointer; font-size: .95rem; }

/* ---------- question ---------- */
.progress { display: flex; gap: 6px; justify-content: center; margin: 0 0 16px; padding: 0; list-style: none; }
.progress li { width: 30px; height: 30px; border-radius: 50%; background: #060a14; border: 2px solid var(--line); position: relative; }
.progress li::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--wall-2); }
.progress li.done::after { background: var(--amber); }
.progress li.now { border-color: var(--neon); box-shadow: 0 0 10px var(--neon-glow); }
.progress li.now::after { background: var(--neon); }

.tab { display: inline-block; background: var(--wall-2); border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; padding: 6px 14px 5px; font: 500 .8rem/1 var(--sign); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.bin { background: var(--wall); border: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) var(--radius); padding: 16px; }
.prompt { margin: 0 0 16px; font: 600 1.18rem/1.35 var(--body); }

.options { display: grid; gap: 10px; }
.opt { display: grid; grid-template-columns: 2rem 1fr; gap: 10px; align-items: center; width: 100%; min-height: 56px; text-align: left; padding: 10px 14px; border: 0; border-radius: 6px; background: var(--cream); color: var(--ink); cursor: pointer; font: 600 1rem/1.3 var(--body); box-shadow: 0 3px 0 var(--cream-2), 0 6px 14px rgba(0, 0, 0, .35); transition: transform .08s ease; }
.opt:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cream-2); }
.opt .letter { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--ink); font: 400 .95rem var(--sign); }
.opt[aria-checked="true"] { background: var(--amber); box-shadow: 0 3px 0 #b8682a, 0 0 18px var(--amber-glow); }
.opt[aria-checked="true"] .letter { background: var(--ink); color: var(--amber); }

/* ---------- review ---------- */
.review { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.review button { width: 100%; text-align: left; display: grid; grid-template-columns: 2.2rem 1fr; gap: 10px; align-items: start; padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--wall); cursor: pointer; }
.review .q { font-size: .92rem; color: var(--muted); }
.review .a { display: block; margin-top: 4px; font-weight: 600; color: var(--text); }
.review .a.none { color: var(--wrong); }
.review .num { font: 400 1rem var(--sign); color: var(--amber); padding-top: 2px; }
.h2 { font: 400 1.4rem/1.2 var(--sign); margin: 0 0 6px; letter-spacing: .03em; }
.lede { margin: 0 0 16px; color: var(--muted); }
.hint { margin: 12px 0 0; text-align: center; font-size: .85rem; color: var(--muted); }
/* Daily 50/50: a small pill beside the "answers at the end" line, so it adds no height. */
.qfoot { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 12px; margin: 12px 0 0; }
.qfoot .hint { margin: 0; }
.fifty { min-height: 36px; padding: 6px 14px; border: 1px solid var(--amber); border-radius: 999px; background: transparent; color: var(--amber); font: 400 .95rem var(--sign); cursor: pointer; }
.fifty:hover:not(:disabled) { background: var(--wall-2); }
.fifty.used { border-color: var(--line); color: var(--muted); cursor: default; font: 600 .8rem var(--body); }
.fifty-ask { width: 100%; text-align: center; padding: 10px 12px 12px; border: 1px solid var(--amber); border-radius: var(--radius); background: var(--wall); scroll-margin-bottom: 96px; }
.fifty-ask p { margin: 0 0 10px; font-size: .92rem; color: var(--text); }
.fifty-btns { display: flex; gap: 10px; justify-content: center; }
.fifty-btns .fifty { min-height: 44px; min-width: 7.5rem; }
.fifty.fifty-use { background: var(--amber); color: var(--night); }
.fifty.fifty-use:hover:not(:disabled) { background: var(--amber); filter: brightness(1.08); }
.fifty.fifty-no { border-color: var(--line); color: var(--text); }
.opt.gone { opacity: .35; text-decoration: line-through; cursor: default; box-shadow: none; }
.opt.gone:active { transform: none; }
.review .num .bulb { display: block; font-size: .9rem; margin-top: 2px; }

/* Back and Next stay on screen while answering, however long the question. */
.nav-sticky { position: sticky; bottom: 0; z-index: 5; margin: 6px -16px 0; padding: 18px 16px max(12px, env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(10, 15, 28, 0), var(--night) 18px); }
.nav-sticky .btn-ghost { background: var(--night); }
/* Short phones (iPhone SE and similar): smaller sign and tighter spacing on question screens only. */
@media (max-height: 760px) {
  body.playing .marquee { padding: 2px 0 8px; }
  body.playing .reel { width: 38px; height: 38px; }
  body.playing .brand-a { font-size: clamp(1.3rem, 6vw, 1.8rem); }
  body.playing .brand-b { font-size: clamp(1.4rem, 6.6vw, 2rem); }
  body.playing .screen { padding-top: 10px; }
  body.playing .progress { margin-bottom: 10px; }
  body.playing .progress li { width: 24px; height: 24px; }
  body.playing .progress li::after { inset: 7px; }
  body.playing .bin { padding: 12px; }
  body.playing .prompt { margin-bottom: 12px; font-size: 1.08rem; }
  body.playing .options { gap: 8px; }
  body.playing .opt { min-height: 50px; padding: 8px 12px; }
  body.playing .hint { margin-top: 8px; }
  body.playing .qfoot { margin-top: 8px; }
  body.playing .qfoot .hint { margin: 0; }
}
.stats-wait { margin: 18px 0 0; }

/* ---------- results ---------- */
.score { text-align: center; margin: 0 0 18px; }
.score-num { font: 400 clamp(3.4rem, 19vw, 5rem)/1 var(--display); color: var(--neon); letter-spacing: .03em; text-shadow: 0 4px 0 #7a5a12, 0 0 30px var(--neon-glow); }
.score-msg { margin: 6px 0 0; font: 400 1.1rem var(--sign); color: var(--text); }
.grid { font-size: 1.6rem; margin: 8px 0 0; }
.grid .cells { display: inline-flex; gap: .12em; align-items: flex-end; }
.grid .cell { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.grid .bulb { font-size: 1.1rem; line-height: 1.2; }
.grid .bulb.none { visibility: hidden; }

.statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 18px 0; text-align: center; }
.statrow div { background: var(--wall); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 4px; }
.statrow b { display: block; font: 400 1.5rem/1.1 var(--sign); color: var(--amber); }
.statrow span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.answers { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 12px; }
.ans { background: var(--wall); border: 1px solid var(--line); border-left: 5px solid var(--wrong); border-radius: var(--radius); padding: 14px; }
.ans.ok { border-left-color: var(--right); }
.ans h3 { margin: 0 0 8px; font: 600 1rem/1.35 var(--body); }
.ans p { margin: 6px 0 0; font-size: .95rem; }
.ans .yours.bad { color: #ff9b93; text-decoration: line-through; }
.ans .right { color: #8fe3b0; font-weight: 600; }
.ans .pct { color: var(--muted); font-size: .85rem; }
.ans .why { color: var(--muted); }
.clip { margin-top: 10px; }
.clip-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #000; }
.clip-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.clip-btn { display: inline-flex; gap: 8px; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--wall-2); cursor: pointer; font-size: .9rem; text-decoration: none; color: var(--text); }

.dist { margin: 18px 0; }
.dist h3 { font: 400 1rem var(--sign); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.bar { display: grid; grid-template-columns: 1.4rem 1fr 3rem; gap: 8px; align-items: center; font-size: .85rem; margin: 4px 0; }
.bar i { display: block; height: 18px; border-radius: 3px; background: var(--wall-2); min-width: 3px; }
.bar.me i { background: var(--amber); }
.bar span:last-child { color: var(--muted); text-align: right; }

.next { text-align: center; color: var(--muted); margin: 18px 0 4px; }
.next b { display: block; font: 400 1.8rem var(--sign); color: var(--text); letter-spacing: .06em; }
.clear-history { margin: 28px 0 8px; text-align: center; }
.clear-ask { padding: 14px 14px 16px; border: 1px solid #b3261e; border-radius: var(--radius); background: var(--wall); scroll-margin-bottom: 96px; }
.clear-ask h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--text); }
.clear-ask h3:focus { outline: none; }
.clear-ask p { margin: 0 0 14px; color: var(--text); font-size: .92rem; }
.clear-ask .btn-row { margin-top: 0; }
.clear-link { background: none; border: 0; padding: 12px 8px; min-height: 44px; color: var(--muted); font: inherit; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.clear-link:hover, .clear-link:focus-visible { color: var(--text); }
.btn-danger { background: #b3261e; color: #fff; }

.closed { text-align: center; padding: 2rem 0; }
.closed .neon-sign { font: 400 2.4rem/1.2 var(--display); color: var(--neon); letter-spacing: .06em; text-shadow: 0 3px 0 #7a5a12, 0 0 30px var(--neon-glow); text-transform: uppercase; }

.preview-banner { margin: 0 0 14px; padding: 8px 12px; border: 1px dashed var(--amber); border-radius: var(--radius); color: var(--amber); font-size: .9rem; text-align: center; }
.preview-banner b { font: 400 .85rem var(--sign); letter-spacing: .12em; text-transform: uppercase; margin-right: 4px; }
#ptoken { width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--night); color: var(--text); font: 1rem ui-monospace, Menlo, monospace; }

.footer { color: var(--muted); font-size: .78rem; text-align: center; padding-top: 12px; border-top: 1px solid var(--line); }
.footer p { margin: 0; }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--cream); color: var(--ink); padding: 10px 18px; border-radius: 999px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); z-index: 10; max-width: calc(100% - 32px); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .btn-ghost.news-btn { transition: none; }
  .reel { animation: none; }
  .opt { transition: none; }
}

/* ---------- admin ---------- */
.admin .shop { max-width: 64rem; }
.admin table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin th, .admin td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin th { color: var(--muted); font-weight: 600; }
.admin .pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; background: var(--wall-2); }
.admin .pill.approved { background: #1f4d33; color: #bff0d0; }
.admin .pill.draft { background: #4d3a1f; color: #ffe0ad; }
.admin textarea, .admin input[type=password], .admin select { width: 100%; background: var(--wall); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 10px; font: .9rem/1.4 ui-monospace, Menlo, monospace; }
.admin textarea { min-height: 14rem; }
.admin .panel { background: var(--wall); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; }
.admin .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin .btn { min-height: 40px; font-size: .9rem; padding: 0 16px; }
.admin .small { font-size: .8rem; color: var(--muted); }
.admin .err { color: #ff9b93; white-space: pre-wrap; }
.admin .table-wrap { overflow-x: auto; }
.admin ol.qs { padding-left: 1.2rem; }
.admin ol.qs li { margin-bottom: 10px; }
.admin .correct { color: #8fe3b0; font-weight: 600; }
.btn-row + .h2 { margin-top: 22px; }
.admin .positions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 8px 0; }
.admin .pos { text-align: center; border: 1px solid var(--line); border-radius: 6px; padding: 8px 2px; }
.admin .pos span { display: block; font-size: .75rem; color: var(--muted); }
.admin .pos b { font: 400 1.2rem var(--sign); }
.admin .hi { color: #8fe3b0; } .admin .mid { color: var(--amber); } .admin .lo { color: #ff9b93; }
.admin td.pct { font-variant-numeric: tabular-nums; }
.admin tr.thin td { opacity: .6; }
.admin ul.feedback { padding-left: 1.2rem; }
.admin ul.feedback li { margin-bottom: 8px; }

/* ---------- pilot feedback ---------- */
.pilot { margin: 18px 0; padding: 14px; border: 1px dashed var(--amber); border-radius: var(--radius); }
.pilot h3 { margin: 0 0 4px; font: 400 1rem var(--sign); letter-spacing: .06em; text-transform: uppercase; color: var(--amber); }
.pilot p { margin: 0 0 10px; color: var(--muted); font-size: .9rem; }
.pilot .choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.pilot .choices button { min-height: 48px; border-radius: 6px; border: 1px solid var(--line); background: var(--wall); cursor: pointer; font-weight: 600; }
.pilot .choices button[aria-checked="true"] { background: var(--amber); color: var(--ink); border-color: var(--amber); }
.pilot textarea { width: 100%; min-height: 4.5rem; padding: 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--night); color: var(--text); font: 1rem/1.4 var(--body); resize: vertical; }
/* The box border wraps the textarea and a footer strip, so the counter never sits over text. */
.pilot .note-box { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 6px; background: var(--night); }
.pilot .note-box:focus-within { outline: 3px solid var(--amber); outline-offset: 3px; }
.pilot .note-box textarea { display: block; border: 0; border-radius: 6px 6px 0 0; background: transparent; padding-bottom: 4px; }
.pilot .note-box textarea:focus-visible { outline: none; }
.pilot .note-count { align-self: flex-end; padding: 0 10px 6px; font-size: .78rem; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--muted); pointer-events: none; }
.pilot .note-count.low { color: var(--amber); }
.pilot .note-count.out { color: #ff9b93; font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pilot .btn { margin-top: 10px; }
.admin .runway { margin: 10px 0 0; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--line); }
.admin .runway.good { border-color: #1f4d33; color: #bff0d0; }
.admin .runway.warn { border-color: var(--wrong); color: #ff9b93; }

/* ---------- admin: collapsible sections and jump bar ---------- */
.admin .jump { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; align-items: center; overflow-x: auto; margin: 0 0 16px; padding: 8px; background: var(--night); border: 1px solid var(--line); border-radius: var(--radius); scrollbar-width: none; }
.admin .jump a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; background: var(--wall-2); color: var(--text); text-decoration: none; font-size: .85rem; }
.admin .jump a:hover { background: var(--line); }
.admin .jump .linkish { flex: none; margin-left: auto; padding: 0 6px; font-size: .85rem; white-space: nowrap; }
.admin .jump-badge { min-width: 1.3rem; padding: 0 6px; border-radius: 999px; background: var(--amber); color: var(--ink); font-size: .72rem; font-weight: 600; line-height: 1.3rem; text-align: center; }
.admin .sec { scroll-margin-top: 72px; }
.admin .sec > summary { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; row-gap: 2px; cursor: pointer; list-style: none; border-radius: 6px; }
.admin .sec > summary::-webkit-details-marker { display: none; }
.admin .sec > summary::before { content: '\25B8'; align-self: center; color: var(--amber); font-size: .9rem; transition: transform .15s; }
.admin .sec[open] > summary::before { transform: rotate(90deg); }
.admin .sec > summary .h2 { margin: 0; }
.admin .sec[open] > summary { margin-bottom: 12px; }
.admin .sec-status { font-size: .82rem; color: var(--muted); }
.admin .sec-status.good { color: #bff0d0; }
.admin .sec-status.warn { color: #ff9b93; }
.admin .sec-status.new { color: var(--amber); font-weight: 600; }
.admin .new-tag { padding: 1px 7px; border-radius: 999px; background: var(--amber); color: var(--ink); font-size: .7rem; font-weight: 600; }
.admin .list-more { justify-content: space-between; margin-top: 10px; }
.admin .list-more [hidden] { display: none; }
.admin ul.comments li:focus { outline: none; }
.admin ul.comments li:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }

@media (max-width: 480px) {
  .admin .jump { gap: 4px; padding: 6px; }
  .admin .jump a { padding: 0 9px; font-size: .8rem; }
  .admin .jump .linkish { font-size: .8rem; }
  .admin .sec { scroll-margin-top: 60px; }
}
@media (prefers-reduced-motion: reduce) { .admin .sec > summary::before { transition: none; } }

/* ---------- admin: pilot feedback ---------- */
.admin .h3 { font: 400 1rem var(--sign); margin: 18px 0 6px; color: var(--cream-2); }
.admin .fb-filters label { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.admin .fb-filters input[type=date], .admin .fb-filters select { width: auto; background: var(--wall-2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: .85rem var(--body); color-scheme: dark; }
.admin .fb-filters .check input { accent-color: var(--amber); width: 18px; height: 18px; }
.admin .legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin: 0 0 4px; }
.admin .legend span { display: inline-flex; align-items: center; gap: 6px; }
.admin .legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.admin .legend i.line { height: 2px; border-radius: 1px; }
.admin .legend i.band { opacity: .35; }
.admin .chart { position: relative; }
.admin .chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.admin .chart .empty { font-size: .85rem; color: var(--muted); padding: 24px 0; }
.admin .k-easy { background: #3d7fd6; fill: #3d7fd6; }
.admin .k-right { background: #a89c92; fill: #a89c92; }
.admin .k-hard { background: #e2483d; fill: #e2483d; }
.admin .k-score { background: var(--amber); }
.admin .k-band { background: var(--right); fill: var(--right); }
.admin svg .grid { stroke: var(--line); stroke-width: 1; }
.admin svg .axis { fill: var(--muted); font: 11px var(--body); }
.admin svg .mark-rule { stroke: var(--cream-2); stroke-width: 1; stroke-dasharray: 4 4; opacity: .6; }
.admin svg .mark-label { fill: var(--cream-2); font: 11px var(--body); opacity: .8; }
.admin svg .band { opacity: .14; }
.admin svg .score-line { fill: none; stroke: var(--amber); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.admin svg .score-dot { fill: var(--amber); stroke: var(--wall); stroke-width: 2; }
.admin svg .hit { fill: transparent; cursor: crosshair; }
.admin svg .hit:hover, .admin svg .hit.on { fill: rgba(244, 231, 201, .06); }
.admin svg .nodata { fill: var(--line); }
.admin .tip { position: fixed; z-index: 10; pointer-events: none; background: var(--night); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: .8rem; line-height: 1.45; color: var(--text); box-shadow: 0 4px 16px rgba(0,0,0,.5); max-width: 16rem; }
.admin .tip b { font-weight: 600; }
.admin .tip i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.admin ul.comments { list-style: none; padding: 0 8px 0 0; margin: 0; max-height: 36rem; overflow-y: auto; border-bottom: 1px solid var(--line); }
.admin ul.comments li { border-top: 1px solid var(--line); padding: 10px 0; }
.admin ul.comments .meta { font-size: .8rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin ul.comments .meta i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.admin ul.comments .note { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin ul.comments .none { color: var(--muted); font-style: italic; }
.admin details summary { cursor: pointer; margin: 10px 0 4px; }

/* ---------- you vs everyone ---------- */
.compare { margin: 18px 0; }
.compare h3 { font: 400 1rem var(--sign); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.compare .range { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 0 0 10px; }
.compare .range button { min-height: 40px; padding: 0 2px; border-radius: 999px; border: 1px solid var(--line); background: var(--wall); cursor: pointer; font-size: .8rem; white-space: nowrap; }
.compare .range button[aria-checked="true"] { background: var(--amber); color: var(--ink); border-color: var(--amber); font-weight: 600; }
.cmp-summary { margin: 0 0 8px; font-size: .95rem; }
.cmp-legend { display: flex; gap: 16px; margin: 0 0 4px; font-size: .8rem; color: var(--muted); }
.cmp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cmp-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.cmp-legend .k-you { background: var(--amber); }
.cmp-legend .k-all { background: var(--cream-2); opacity: .55; }
.cmp-chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.cmp-chart .grid { stroke: var(--line); stroke-width: 1; }
.cmp-chart .axis { fill: var(--muted); font: 11px var(--body); }
.cmp-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cmp-line.you { stroke: var(--amber); stroke-width: 2.5; }
.cmp-line.all { stroke: var(--cream-2); opacity: .55; }
.cmp-dot.you { fill: var(--amber); stroke: var(--night); stroke-width: 1.5; }
.cmp-dot.all { fill: var(--cream-2); opacity: .55; }
.cmp-dot.late { fill: var(--night); stroke: var(--lemon); stroke-width: 2; }
.cmp-legend .k-late { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--lemon); background: transparent; }
.cmp-chart svg:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; border-radius: 4px; }
.cmp-readout .cmp-play { display: flex; width: fit-content; margin: 8px auto 0; min-height: 40px; padding: 0 18px; font-size: .95rem; }
.cmp-soon { display: block; margin-top: 4px; color: var(--lemon); }
.late-back { width: 100%; margin-top: 10px; }
.late-banner { border-color: var(--lemon); color: var(--lemon); }
.late-banner .linkish { color: inherit; font-size: inherit; }
.cmp-rule { stroke: var(--cream-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: .5; }
.cmp-chart .hit { fill: transparent; cursor: pointer; }
.cmp-readout { margin: 6px 0 0; min-height: 2.8em; font-size: .85rem; color: var(--muted); text-align: center; }
/* Tapped day: date and theme on the first line, the numbers below. */
.cmp-day { display: block; color: var(--text); font-weight: 600; }

/* ---------- Movie TRIVLE News ---------- */
.news-slot { margin: 18px 0 0; }
.news-btn { position: relative; width: 100%; }
/* Amber outline with a soft glow, so it reads as a button without competing with the solid
   gold Share button above it. Brighter glow when pressed. */
.btn-ghost.news-btn { border: 2px solid var(--amber); color: var(--amber); box-shadow: 0 0 10px var(--amber-glow), inset 0 0 8px rgba(243, 154, 74, .18); transition: box-shadow .15s ease; }
.btn-ghost.news-btn:hover, .btn-ghost.news-btn:focus-visible, .btn-ghost.news-btn:active { box-shadow: 0 0 18px var(--amber-glow), 0 0 32px var(--amber-glow), inset 0 0 12px rgba(243, 154, 74, .28); }
.btn-ghost.news-btn:active { transform: translateY(1px); }
/* Unread dot: neon, top right of the button. The button also says "(new posts)" to screen readers. */
.news-dot { position: absolute; top: 8px; right: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--neon); box-shadow: 0 0 0 2px var(--night), 0 0 10px var(--neon-glow); }
.news-page .news-back { min-height: 44px; padding: 0 16px; font-size: .9rem; margin: 0 0 16px; }
.news-page > .btn-primary { margin-top: 8px; }
.news-post { background: var(--wall); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 14px; }
.news-date { margin: 0 0 4px; font-size: .8rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.news-new { font: 500 .7rem/1 var(--sign); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); background: var(--neon); border-radius: 999px; padding: 4px 8px 3px; }
.news-title { margin: 0 0 8px; font: 400 1.15rem/1.3 var(--sign); color: var(--cream); letter-spacing: .02em; }
.news-quote { margin: 0 0 10px; padding: 8px 12px; border-left: 3px solid var(--amber); background: var(--wall-2); border-radius: 0 6px 6px 0; }
.news-quote p { margin: 0; font-style: italic; overflow-wrap: anywhere; }
.news-quote .news-quote-who { font-style: normal; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.news-body p { margin: 0 0 10px; overflow-wrap: anywhere; }
.news-body p:last-child { margin-bottom: 0; }

/* ---------- admin: news ---------- */
.admin input[type=text] { width: 100%; background: var(--wall); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 10px; font: 1rem var(--body); }
.admin .news-form label { display: block; font-size: .85rem; color: var(--muted); margin: 10px 0 4px; }
.admin .news-form textarea { font: 1rem/1.45 var(--body); }
.admin .news-form #newsBody { min-height: 10rem; }
.admin .news-form #newsQuoteText { min-height: 4.5rem; }
.admin .news-quote-edit { border: 1px dashed var(--amber); border-radius: 6px; padding: 4px 10px 8px; margin-top: 10px; }
.admin .news-preview, .admin .news-list { max-width: 34rem; }
.admin .news-preview .empty { font-size: .85rem; color: var(--muted); }
.admin .news-actions { display: flex; gap: 8px; margin: -6px 0 18px; align-items: center; }
.admin ul.comments .reply-btn { margin-top: 6px; min-height: 34px; font-size: .8rem; padding: 0 12px; }

/* ---------- how to play ---------- */
.howto-link { display: block; margin: 12px auto 0; padding: 10px 12px; color: var(--muted); }
.howto-link:hover, .howto-link:focus-visible { color: var(--text); }
.howto { width: min(34rem, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--wall); color: var(--text); font: 1rem/1.5 var(--body); overflow: auto; overscroll-behavior: contain; }
.howto::backdrop { background: rgba(4, 6, 12, .8); }
.howto-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 10px 10px 18px; background: var(--wall); border-bottom: 1px solid var(--line); }
.howto-head .h2 { margin: 0; color: var(--cream); }
.howto-x { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--text); font-size: 1.1rem; cursor: pointer; }
.howto-x:hover, .howto-x:focus-visible { border-color: var(--amber); color: var(--amber); }
.howto-body { padding: 14px 18px 18px; }
.howto-tag { margin: 0 0 4px; color: var(--amber); font: 400 1rem/1.3 var(--sign); letter-spacing: .03em; }
.howto-body h3 { margin: 18px 0 6px; font: 400 1.05rem/1.3 var(--sign); color: var(--cream); letter-spacing: .02em; }
.howto-body ul { margin: 0; padding-left: 1.2rem; }
.howto-body li { margin: 0 0 6px; color: var(--muted); }
.howto-body b { color: var(--text); font-weight: 600; }
.howto-end { margin: 18px 0 0; }
.howto-body .btn { width: 100%; margin-top: 14px; }
body:has(.howto[open]) { overflow: hidden; }

/* News picture pages (public/news/*.html, none yet): a chart linked from a News post. */
.picture-page .news-back { display: inline-flex; }
.picture-link { display: block; border-radius: var(--radius); }
.picture { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--night); }
.picture-tip { margin: 8px 0 14px; font-size: .85rem; color: var(--muted); }
.picture-note { margin: 0 0 18px; }
.picture-page > .btn-primary { text-align: center; line-height: 1.25; padding: 12px 22px; }

/* ---------- splash (today's game, before Play) ---------- */
/* The poster fills the screen. On phones it covers the screen edge to edge (anchored at the top
   so the title is never cropped); on wider screens it keeps its shape, centred, with the edges
   fading into a blue-to-amber backdrop. Theme, Play and How to play sit at the bottom over a
   dark fade, below the faces. The header stays in the page for screen readers only. */
body.splash-on { overflow: hidden; }
body.splash-on .marquee { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body.splash-on .footer { display: none; }
.splash { position: fixed; inset: 0; z-index: 1; display: flex; justify-content: center; overflow: hidden;
  background: linear-gradient(90deg, #142338 0%, var(--night) 50%, #2a1a12 100%); }
.splash-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
/* Phones (up to about 5:8, iPhone SE included) fill the screen; wider screens keep the shape. */
@media (min-aspect-ratio: 5/8) {
  .splash-img { width: auto; max-width: 100%; aspect-ratio: 1193 / 2576; object-fit: cover;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%); }
}
.splash-panel { position: absolute; left: 0; right: 0; bottom: 0; padding: 72px 20px max(18px, env(safe-area-inset-bottom)); text-align: center;
  background: linear-gradient(to bottom, rgba(10, 15, 28, 0) 0, rgba(10, 15, 28, .82) 34%, rgba(10, 15, 28, .96) 62%, var(--night) 100%); }
.splash-panel > * { max-width: 24rem; margin-left: auto; margin-right: auto; }
.splash-kicker { margin: 0 auto; font: 500 .85rem/1 var(--sign); letter-spacing: .18em; text-transform: uppercase; color: var(--neon); }
.splash-theme { margin: 8px auto 0; font: 400 clamp(1.8rem, 8.6vw, 2.5rem)/1.05 var(--display); letter-spacing: .02em; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.splash-sub { margin: 6px auto 16px; color: var(--muted); font-size: .95rem; }
.splash .howto-link { margin-top: 6px; color: var(--text); }
@media (max-height: 560px) {
  .splash-panel { padding-top: 40px; }
  .splash-sub { margin-bottom: 10px; }
}
