@import "/assets/fonts.css";

:root {
  color-scheme: dark;
  --night: #0b1018;
  --paper: #f9efe2;
  --muted: #c6b9af;
  --soft: #aa9b92;
  --border: #3c3335;
  --card: #151720;
  --accent: #f3be79;
  --accent-dark: #281811;
  --display: Pixelify, ui-monospace, monospace;
  --body: "Barlow", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--paper); font: 400 17px/1.55 var(--body); }
body.mixed { --night: #0b141b; --card: #141f26; --paper: #eef7f3; --muted: #bacbc9; --soft: #a4bab6; --border: #34494d; --accent: #a6e3cc; --accent-dark: #12302a; }
::selection { background: var(--accent); color: var(--accent-dark); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) { position: absolute; height: 1px; width: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: 12px; left: 12px; z-index: 6; padding: 8px 12px; background: var(--night); }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: #fff6e5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .56; cursor: default; }
p, h1, h2, h3, h4 { margin: 0; }
p + p { margin-top: .8em; }
h1, h2, h3, h4 { line-height: 1.08; text-wrap: balance; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; }
h4 { font-size: 17px; }
small, .small { font-size: 14px; color: var(--muted); }
svg { flex: none; }
.site-head { background: #0b1018; border-bottom: 1px solid #31292a; }
.head-wrap { max-width: 1360px; margin: auto; padding: 0 clamp(20px,5vw,72px); min-height: 74px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #f9efe2; text-decoration: none; font-size: 18px; font-weight: 600; white-space: nowrap; }
.brand svg { color: #f3be79; width: 26px; height: 26px; }
.brand b { font-weight: 700; }
.site-head nav { display: flex; align-items: center; gap: clamp(15px,2.8vw,38px); white-space: nowrap; }
.site-head nav a, .site-footer nav a { display: inline-flex; min-height: 44px; align-items: center; color: #e2d5c9; text-decoration: none; font-size: 15px; }
.site-head nav a:hover, .site-head nav a[aria-current] { color: #facd91; }
.site-head nav a[aria-current] { text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 1px; }
.hero-title { padding-block: 10px; }
h1 { font-size: clamp(40px,7.7vw,100px); line-height: 1; }
.hero-title > p { color: var(--muted); line-height: 1.36; text-wrap: pretty; }
.breadcrumbs { display: flex; gap: 8px 11px; flex-wrap: wrap; font-size: 14px; margin-bottom: 28px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.game, .control-panel { background: var(--card); border: 1px solid var(--border); box-shadow: 0 20px 70px #0008; min-width: 0; }
.game { scroll-margin-top: max(10px,env(safe-area-inset-top)); border-radius: 12px; position: relative; overflow: hidden; }
.game::after { content: ""; position: absolute; top: 0; right: 8%; left: 8%; height: 1px; background: linear-gradient(90deg,transparent,var(--accent),transparent); opacity: .72; pointer-events: none; }
.game-chrome { border-bottom: 1px solid var(--border); min-height: 54px; padding-inline: clamp(18px,3vw,34px); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #10131bbd; font-weight: 600; }
.ticket-series, .game-tools { display: flex; align-items: center; gap: 10px; }
.ticket-series svg { color: var(--accent); }
.ticket-date { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.sound { border: 0; background: transparent; color: var(--soft); padding: 8px; display: grid; place-items: center; min-width: 44px; min-height: 44px; }
.sound[aria-pressed=true] { color: var(--accent); }
.game-body { padding: clamp(18px,3.2vw,36px); min-height: 322px; }
.game-body h2 { font-size: clamp(31px,3.6vw,46px); line-height: 1.02; margin: 12px 0 10px; overflow-wrap: anywhere; }
.rule { color: var(--muted); max-width: 58ch; margin: 0 0 19px; overflow-wrap: anywhere; }
.game-body .rule + label:not(.sr-only) { margin-top: 12px; }
.film-status { display: flex; justify-content: space-between; color: var(--accent); font-size: 14px; font-weight: 700; letter-spacing: .065em; text-transform: uppercase; gap: 10px; font-variant-numeric: tabular-nums; }
.film-leader { display: flex; gap: 6px; margin-top: 9px; }
.film-leader i { height: 5px; flex: 1; background: #34333b; border-radius: 3px; }
.film-leader i.current { background: color-mix(in srgb,var(--accent) 45%,#34333b); }
.film-leader i.passed { background: var(--accent); }
.field-label, .control-panel label { display: block; font-weight: 600; color: var(--paper); margin: 12px 0 5px; }
input:not([type=checkbox]), select, textarea { width: 100%; min-width: 0; min-height: 47px; display: block; background: #0c1018; border: 1px solid #5d4f4d; border-radius: 6px; color: var(--paper); padding: 9px 13px; font-size: 16px; caret-color: var(--accent); }
input::placeholder { color: var(--soft); opacity: 1; }
input:not([type=checkbox]):focus, textarea:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 1px var(--accent); }
.mixed input:not([type=checkbox]), .mixed select, .mixed textarea { background: #0c171e; border-color: #53716e; }
.answer-form { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.answer-form input { flex: 1 1 150px; }
.answer-form .primary { flex: 0 0 auto; }
.preview-answer + .small { margin: 7px 0 13px; }
.toggle { display: flex !important; align-items: center; gap: 9px; min-height: 44px; margin: 5px 0 8px; color: var(--muted); }
.toggle input { accent-color: var(--accent); width: 17px; height: 17px; }
.primary, .secondary, .quiet, .filter { display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 9px; min-height: 44px; padding: 9px 16px; text-decoration: none; font-weight: 700; border-radius: 6px; border: 1px solid transparent; line-height: 1.17; }
.primary { background: var(--accent); color: var(--accent-dark); }
.primary:hover { background: #ffe0af; color: var(--accent-dark); }
.mixed .primary:hover { background: #c3f3e1; }
.secondary, .filter { color: var(--paper); background: #22232b; border-color: #54494b; }
.secondary:hover, .filter:hover { border-color: var(--accent); }
.quiet { color: var(--muted); background: transparent; padding-inline: 4px; }
.quiet:hover { color: var(--accent); }
.game-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 15px; margin-top: 12px; }
.game-actions .quiet + .quiet { margin-left: 10px; }
.feedback, .hint, .status { color: var(--accent); font-size: 15px; overflow-wrap: anywhere; }
.feedback:not(:empty), .hint:not(:empty), .status:not(:empty) { margin-top: 8px; }
.feedback .suggestion { margin-top: 7px; }
.text-link { display: inline-block; min-height: 40px; padding: 7px 0; }
.clock { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; --remaining: 100%; }
.clock.urgent { color: #ffb2a4; }
.clock i { flex: 1; height: 3px; border-radius: 2px; background: linear-gradient(90deg,currentColor 0 var(--remaining), #34333b var(--remaining) 100%); }
.outcome { margin-top: 14px; padding: 18px 0 10px; animation: reveal .39s both; }
.outcome.spotlight { text-shadow: 0 3px 46px color-mix(in srgb,var(--accent) 42%,transparent); }
.outcome-up { display: flex; justify-content: space-between; align-items: center; color: var(--accent); gap: 10px; }
.outcome-up strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.outcome p { color: var(--muted); margin-bottom: 6px; }
@keyframes reveal { from { opacity: .4; transform: translateY(8px); filter: blur(2px); } }
.recap p { color: var(--muted); }
.recap h2 { color: var(--accent); margin-block: 8px; }
.recap h2 strong { font: 400 clamp(51px,7vw,87px)/.9 var(--display); }
.recap h2 span { color: var(--soft); font-size: 25px; }
.score-chart { display: flex; gap: clamp(3px,1.3vw,13px); height: 148px; margin-top: 19px; border-bottom: 1px solid var(--border); padding: 13px 0; }
.score-bar { flex: 1; display: flex; align-items: center; flex-direction: column; justify-content: flex-end; font-size: 13px; min-width: 0; }
.score-bar i { width: 62%; height: max(2px,var(--points)); background: var(--accent); border-radius: 3px 3px 0 0; margin: 3px 0 6px; }
.score-bar span { color: var(--muted); }
.reviews { margin-top: 12px; }
details { border-bottom: 1px solid var(--border); padding: 7px 0; }
summary { cursor: pointer; color: var(--paper); padding: 8px 0; min-height: 44px; overflow-wrap: anywhere; }
summary > b { margin-left: 7px; color: var(--accent); white-space: nowrap; }
details p { color: var(--muted); }
.document { padding: 59px clamp(20px,5vw,72px) 74px; max-width: 1360px; margin: auto; }
.document.simple { min-height: 52vh; }
.document.simple p { max-width: 65ch; margin: 20px 0; color: var(--muted); }
.document h2, .control-panel h2 { font-size: clamp(33px,3.5vw,52px); margin-bottom: 13px; }
.reading { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 38px clamp(34px,8vw,120px); }
.reading section:first-child { grid-column: 1 / -1; }
.reading p, .case-list p { color: var(--muted); max-width: 68ch; text-wrap: pretty; }
.reading a, .case-list a { margin-top: 9px; }
.source-link { display: inline-flex; min-height: 40px; align-items: center; gap: 5px; font-weight: 600; font-size: 14px; color: var(--accent); }
.source-link svg { width: 13px; height: 13px; }
.related { margin-top: 54px; }
.related .filters { margin-bottom: 13px; }
.related-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 36px; border-top: 1px solid var(--border); }
.route-card { min-height: 94px; display: flex; flex-direction: column; text-decoration: none; color: var(--paper); gap: 5px; padding: 15px 2px; border-bottom: 1px solid var(--border); }
.route-card h3 { display: flex; align-items: center; gap: 8px; font: 700 19px/1.2 var(--body); }
.route-card h3 svg { width: 16px; height: 16px; color: var(--accent); }
.warmup, .tier-list { margin-top: 30px; }
.tier-list dl { display: grid; grid-template-columns: repeat(5,1fr); gap: 13px; }
.tier-list dl div { padding: 13px; border-top: 1px solid var(--border); }
.tier-list dt { font-weight: 600; }
.tier-list dd { margin: 0; font-size: 26px; color: var(--accent); }
.editor-list { margin-bottom: 54px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter[aria-pressed=true] { background: var(--accent); color: var(--accent-dark); }
.case-list { padding: 0; margin: 20px 0; list-style: none; border-top: 1px solid var(--border); }
.case-list li { border-bottom: 1px solid var(--border); display: grid; grid-template-columns: minmax(0,.65fr) minmax(0,1fr); gap: 15px 38px; padding: 21px 0; }
.case-list h3 { font-size: 34px; }
.case-list .case-label { color: var(--accent); margin-top: 6px; font-size: 15px; }
.control-panel { border-radius: 12px; padding: clamp(18px,3vw,32px); }
.control-panel label > input, .control-panel label > textarea, .control-panel label > select { margin-top: 5px; }
.control-panel form .primary, .control-panel form .secondary, form.control-panel > .primary { margin-top: 10px; }
.control-panel h3 { font-size: clamp(27px,3.5vw,38px); margin-block: 10px; }
.control-panel .edition summary { display: list-item; }
.control-panel .edition summary span { color: var(--muted); margin-left: 13px; }
.edition-body { padding: 5px 0 9px; }
.edition-body > .primary, .edition-body > .secondary, .answer-edition > .primary, .answer-edition > .secondary { margin: 8px 7px 0 0; }
.answer-edition + .answer-edition { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 7px; }
.answers-list { padding-inline-start: 15px; }
.answers-list li { margin-bottom: 10px; }
.room-lobby { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.room-lobby form + form { border-left: 1px solid var(--border); padding-left: 20px; }
.room-lobby h2 { font-size: clamp(25px,3vw,40px); }
.room-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.room-top h2 { letter-spacing: .05em; }
.player-list, .room-reveal { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 12px 0; }
.player-list > div, .room-reveal article { padding: 10px; border: 1px solid var(--border); border-radius: 5px; overflow-wrap: anywhere; }
.player-list b { display: block; color: var(--accent); }
.site-footer { display: flex; justify-content: space-between; gap: 25px; flex-wrap: wrap; border-top: 1px solid var(--border); padding: 28px max(clamp(20px,5vw,72px),calc((100vw - 1216px)/2)) 38px; color: var(--muted); background: #0b1018; }
.site-footer nav { display: flex; gap: 15px 22px; flex-wrap: wrap; }
.site-footer p { font-size: 15px; margin-top: 5px; }

@media (max-width: 900px) {
  .head-wrap { gap: 5px 18px; min-height: 68px; }
  .site-head nav { gap: 14px; }
  .hero-title > p { margin-top: 16px; }
  .room-lobby { grid-template-columns: minmax(0,1fr); }
  .room-lobby form + form { border-left: 0; border-top: 1px solid var(--border); padding: 16px 0 0; }
}
@media (max-width: 640px) {
  .head-wrap { display: block; padding-top: 10px; }
  .brand { min-height: 36px; }
  .site-head nav { overflow: auto; scrollbar-width: thin; margin-right: -15px; padding-right: 15px; gap: 17px; }
  .site-head nav a { min-height: 41px; font-size: 14px; }
  .hero-title { padding: 0; }
  h1 { max-width: 20ch; font-size: clamp(48px,13vw,75px); }
  .hero-title > p { font-size: 17px; max-width: 40ch; margin-top: 13px; line-height: 1.32; }
  .breadcrumbs { margin-bottom: 14px; }
  .game-body { min-height: 253px; padding: 16px; }
  .game-chrome { min-height: 45px; padding-inline: 14px; gap: 7px; }
  .game-body h2 { margin-top: 8px; font-size: clamp(28px,7.9vw,34px); }
  .rule { margin-bottom: 12px; font-size: 15px; }
  .primary, .secondary { padding-inline: 12px; }
  .game-actions { gap: 8px 11px; }
  .document { padding-block: 42px 55px; }
  .related-grid, .reading, .case-list li { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .reading { gap: 30px; }
  .related-grid { gap: 0; }
  .related { margin-top: 36px; }
  .case-list h3 { font-size: 29px; }
  .tier-list dl { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .site-footer { padding-bottom: max(27px,env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

