/* Layout: one narrow column — marquee header, join, ballot (picks + poster list), results, host tools. */
:root {
  --bg: #EDEEF5; --surface: #FFFFFF; --sunk: #E3E4EE; --ink: #1B1530; --muted: #5C566F; --line: #D5D3E3;
  --accent: #9A6200; --accent-ink: #FFFFFF; --bulb: #E7A321;
  --r1: #9A6200; --r2: #23706F; --r3: #A8355F;
  --good: #2E7D4F; --bad: #B3261E;
  --display: "Limelight", "Rockwell", Georgia, serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #130E1C; --surface: #1E172B; --sunk: #191224; --ink: #F2EDFB; --muted: #A69DBB; --line: #352B48;
  --accent: #F2B33D; --accent-ink: #1B1206; --bulb: #F2B33D;
  --r1: #F2B33D; --r2: #63CBC6; --r3: #EC86AE;
  --good: #6FCF97; --bad: #FF8A80; color-scheme: dark } }

* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
[hidden] { display: none !important; }
img { max-width: 100%; }
.wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; display: grid; gap: 28px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2 { text-wrap: balance; margin: 0; }
h2 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
p { margin: 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small-text { font-size: 13px; }
section, .stack { display: grid; gap: 12px; }

/* Marquee */
.marquee { border: 2px solid var(--ink); border-radius: 14px; padding: 18px 20px 16px; position: relative; background: var(--surface); }
.marquee::before, .marquee::after { content: ""; position: absolute; left: 14px; right: 14px; height: 6px;
  background: radial-gradient(circle, var(--bulb) 2.2px, transparent 2.6px) 0 0 / 16px 6px repeat-x; }
.marquee::before { top: 6px } .marquee::after { bottom: 6px }
.marquee h1 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 8vw, 52px); line-height: 1.05; margin-top: 8px; }
.marquee .sub { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; color: var(--muted); font-size: 13px; }

.notice { border: 1px solid var(--line); background: var(--sunk); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; }
.notice.bad { border-color: var(--bad); color: var(--bad); }
.card { border: 1.5px solid var(--line); border-radius: 14px; padding: 16px; background: var(--surface); display: grid; gap: 12px; }
.join { border-color: var(--accent); }

/* Controls */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.grow { flex: 1 1 180px; min-width: 0; }
.btn { border: 1.5px solid var(--ink); background: transparent; border-radius: 999px; padding: 7px 16px; font-weight: 600; font-size: 14px; }
.btn.small { padding: 4px 12px; font-size: 13px; }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.quiet { border-color: var(--line); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn:disabled { opacity: .45; cursor: default; }
.link { background: none; border: none; padding: 0; color: var(--muted); text-decoration: underline; font-size: 13px; justify-self: start; }
.field { width: 100%; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.bar .field.grow { width: auto; }
textarea.field { min-height: 150px; resize: vertical; background: var(--bg); }
.status { font-size: 13px; }
.status:empty { display: none; }
.status.bad { color: var(--bad); } .status.good { color: var(--good); }

/* Picks */
.picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 10px 12px; min-height: 74px; display: grid; align-content: start; gap: 2px; background: var(--surface); }
.slot.filled { border-style: solid; border-color: var(--rank); }
.slot .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--rank); }
.slot .t { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.slot .t.empty { color: var(--muted); font-weight: 400; }
.r1 { --rank: var(--r1) } .r2 { --rank: var(--r2) } .r3 { --rank: var(--r3) }

/* Movie list */
.list { display: grid; gap: 8px; }
.mrow { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.mrow:hover { border-color: var(--muted); }
.mrow.on { border-color: var(--rank); box-shadow: inset 0 0 0 1px var(--rank); }
.movie { flex: 1; min-width: 0; text-align: left; display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: none; background: transparent; border-radius: var(--radius); }
.movie:disabled { cursor: default; }
.movie:disabled .info { opacity: .6; }
.mrow.on .movie:disabled .info { opacity: 1; }
.poster { flex: none; width: 46px; aspect-ratio: 2 / 3; border-radius: 5px; object-fit: cover; background: var(--sunk); }
.movie .info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.movie .name { overflow-wrap: anywhere; font-weight: 600; font-size: 16px; line-height: 1.3; }
.movie .meta { font-family: var(--mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.movie .plot { font-size: 14px; color: var(--muted); max-width: 65ch; }
.movie .warn { font-size: 12px; font-weight: 600; color: var(--bad); }
.stub { flex: none; width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; border: 1.5px dashed var(--line); color: var(--muted); }
.mrow.on .stub { border: none; background: var(--rank); color: var(--surface); font-weight: 500; }
.imdb { flex: none; display: grid; place-items: center; padding: 0 14px; border-left: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--muted); text-decoration: none; }
.imdb:hover { color: var(--accent); }

/* Results */
.winner { border: 2px solid var(--accent); border-radius: 14px; padding: 16px 18px; background: var(--surface); display: grid; gap: 4px; }
.winner .k { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.winner .w { font-family: var(--display); font-size: clamp(24px, 6vw, 34px); line-height: 1.1; overflow-wrap: anywhere; }
.round { display: grid; gap: 6px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 14px; }
.row .track { grid-column: 1 / -1; height: 6px; background: var(--sunk); border-radius: 3px; overflow: hidden; margin-top: -4px; }
.row .fill { height: 100%; background: var(--muted); border-radius: 3px; }
.row.lead .fill { background: var(--accent); }
.row.out { color: var(--muted); text-decoration: line-through; }
.row .n { text-align: right; }
details { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.rounds { display: grid; gap: 18px; margin-top: 12px; }
.rhead { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.voters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); }

/* Host */
.host { gap: 14px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 1.5px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 14px; font-size: 13px; font-weight: 600; }
.tab[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.preview { display: grid; gap: 4px; max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; background: var(--bg); }
.preview label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.preview label span { overflow-wrap: anywhere; min-width: 0; }
.admin-list { display: grid; gap: 4px; margin-top: 8px; }
.admin-row { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.admin-row span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.foot { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; }

@media (max-width: 480px) { .picks { grid-template-columns: 1fr; } .slot { min-height: 0; } .poster { width: 38px; } }
@media (prefers-reduced-motion: no-preference) { .mrow, .btn { transition: border-color .15s, background .15s; } }
