:root {
  color-scheme: dark;
  --bg: #0e0f12;
  --surface: #181a1f;
  --line: #2b2e35;
  --fg: #f1f2f4;
  --muted: #a3a8b2;
  --accent: #e8ddc4;
  --bad: #ff9a8a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--sans); }
main { max-width: 460px; margin: 0 auto; padding: 8px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left)); }
a { color: var(--fg); }
.top { max-width: 460px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); }
.top nav { display: flex; gap: 18px; }
.top a { text-decoration: none; color: var(--muted); padding: 10px 0; }
.link { background: none; border: 0; color: var(--muted); font: inherit; padding: 10px 0; cursor: pointer; }
.day { display: grid; gap: 16px; margin-bottom: 32px; }
.day > * { min-width: 0; }
h1 { font: 500 34px/1.15 var(--serif); margin: 0; text-wrap: balance; }
h2 { font: 500 22px/1.2 var(--serif); margin: 8px 0 0; }
.eyebrow { margin: 0 0 -10px; color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); font-weight: 400; }
.error { color: var(--bad); margin: 0; }
.error:empty { display: none; }
.state { margin: 0; padding: 12px 14px; background: var(--surface); border-radius: 8px; }
.state ul { margin: 6px 0 0; padding-left: 18px; }
.state.bad { color: var(--bad); }
.player { display: block; width: 100%; max-height: 72vh; aspect-ratio: 9 / 16; background: #000; border-radius: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); font: 500 16px var(--sans); text-decoration: none; cursor: pointer; }
.btn.solid { background: var(--accent); border-color: var(--accent); color: #17181b; }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, a:focus-visible, .link:focus-visible, label:focus-within > span { outline: 2px solid var(--accent); outline-offset: 2px; }
.reminder { margin: -6px 0 0; color: var(--accent); font-size: 15px; }
pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.5 var(--sans); padding: 12px 14px; background: var(--surface); border-radius: 8px; }
details summary { cursor: pointer; color: var(--muted); min-height: 44px; padding: 10px 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-weight: 500; }
label { font-weight: 500; }
textarea, input[type=password] { width: 100%; margin-top: 6px; padding: 12px; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; font: 16px/1.4 var(--sans); }
.feedback, .login, .upload { display: grid; gap: 14px; }
.login { padding-top: 15vh; }
.scores { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scores input, .cats input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scores span, .cats span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 400; }
.scores input:checked + span, .cats input:checked + span { background: var(--accent); border-color: var(--accent); color: #17181b; font-weight: 500; }
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.file { position: relative; overflow: hidden; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.list, .progress { list-style: none; margin: 0; padding: 0; }
.list li, .progress li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.progress:empty { display: none; }
dialog { width: min(420px, calc(100vw - 32px)); padding: 20px; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; }
dialog::backdrop { background: rgba(0, 0, 0, .65); }
dialog form { display: grid; gap: 12px; }
dialog h2 { margin: 0; }
dialog p { margin: 0; }
