:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #f2f5e8;
  background: #111711;
  --muted: #a7b3a4;
  --border: #354136;
  --accent: #d9fe81;
  --accent-rgb: 217, 254, 129;
  --panel: #19221b;
  --mono: "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
body { min-width: 290px; margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { cursor: default; opacity: .65; }
.station[data-track="edge"] { --accent: #fea898; --accent-rgb: 254, 168, 152; }
.station[data-track="time"] { --accent: #b8c9ff; --accent-rgb: 184, 201, 255; }
.station { width: min(1080px, calc(100% - 44px)); margin: 0 auto; padding: 24px 0 32px; }
.station-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 0 17px; }
.station-brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.station-brand a { color: var(--muted); font-size: .79rem; text-decoration: none; border-right: 1px solid var(--border); padding-right: 12px; }
.station-brand a:hover { color: var(--accent); }
h1 { margin: 0; font-size: clamp(1.1rem, 3vw, 1.5rem); font-weight: 780; letter-spacing: -.045em; }
.station-name p { margin: .2rem 0 0; color: var(--muted); font-size: .79rem; line-height: 1.2; }
.daily-date { display: flex; align-items: center; gap: 8px; color: var(--muted); font: .8rem var(--mono); white-space: nowrap; }
.daily-date span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(var(--accent-rgb), .6); }
.station-grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.receiver { display: flex; flex-direction: column; min-width: 0; min-height: 445px; padding: 24px; border-right: 1px solid var(--border); background: radial-gradient(ellipse at 45% 60%, rgba(var(--accent-rgb), .12), transparent 68%), #101912; position: relative; isolation: isolate; }
.receiver::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: radial-gradient(circle, rgba(var(--accent-rgb), .18) 1px, transparent 1px); background-size: 8px 8px; mask-image: linear-gradient(to bottom, transparent 15%, #000 54%, transparent 92%); }
.receiver-head, .receiver-readout { display: flex; justify-content: space-between; gap: 12px; color: var(--accent); font: .75rem var(--mono); letter-spacing: .05em; }
.receiver-head span + span, .receiver-readout span { color: var(--muted); }
.scope { --signal-level: 0; flex: 1; display: grid; place-items: center; min-height: 230px; }
.plot { position: relative; width: min(92%, 275px); aspect-ratio: 1; overflow: hidden; border-radius: 50%; border: 1px solid rgba(var(--accent-rgb), .48); background: linear-gradient(transparent 49.75%, rgba(var(--accent-rgb), .20) 50%, transparent 50.25%), linear-gradient(90deg, transparent 49.75%, rgba(var(--accent-rgb), .20) 50%, transparent 50.25%), radial-gradient(circle, rgba(var(--accent-rgb), .12), transparent 65%); box-shadow: 0 0 50px rgba(var(--accent-rgb), .07), inset 0 0 36px rgba(var(--accent-rgb), .08); }
.ring, .origin { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); border-radius: 50%; }
.ring { border: 1px solid rgba(var(--accent-rgb), .25); aspect-ratio: 1; }
.ring-inner { width: 27%; }
.ring-middle { width: 51%; }
.ring-outer { width: 76%; }
.origin, .signal { width: 6px; height: 6px; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.scope-sweep { position: absolute; inset: 0; background: conic-gradient(from 0deg, rgba(var(--accent-rgb), 0) 0 79%, rgba(var(--accent-rgb), .27) 100%); animation: sweep 10s linear infinite; }
.origin { scale: calc(1 + .9 * var(--signal-level)); transition: scale 340ms ease-out; }
.signal { position: absolute; opacity: calc(.45 + .55 * var(--signal-level)); border-radius: 50%; transition: opacity 340ms ease-out; }
.signal-a { top: 22%; left: 64%; }
.signal-b { top: 58%; left: 29%; }
.signal-c { top: 74%; left: 60%; }
.signal-d { top: 35%; left: 39%; width: 4px; height: 4px; }
.scope.is-received .plot { animation: received 620ms ease-out; }
.station[data-phase="quiz"] .scope-sweep { animation-duration: 6s; }
.station[data-phase="done"] .plot { border-color: var(--accent); }
@keyframes sweep { to { transform: rotate(1turn); } }
@keyframes received { 25% { filter: brightness(1.8); transform: scale(1.025); } }
.receiver-readout { padding-top: 18px; border-top: 1px solid var(--border); align-items: end; }
.receiver-readout strong { display: block; font-size: 2.2rem; margin-top: 4px; line-height: 1; }
.meters { display: grid; grid-template-columns: repeat(6, 10px); gap: 5px; align-items: end; }
.meters i { height: 18px; border-radius: 3px; background: rgba(var(--accent-rgb), .12); }
.meters i.filled { background: var(--accent); }
.meters i.current { border: 1px solid var(--accent); }
.console { min-width: 0; padding: clamp(22px, 4vw, 42px); background: var(--panel); }
.console h2 { margin: 0; font-size: clamp(1.7rem, 4.6vw, 3rem); line-height: 1.03; letter-spacing: -.055em; overflow-wrap: anywhere; }
.console p { color: var(--muted); line-height: 1.5; margin: 11px 0 0; }
.console .round-meta { font: .83rem var(--mono); color: var(--accent); letter-spacing: .06em; }
.tracks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 25px 0 17px; }
.track { min-height: 68px; text-align: left; padding: 10px; color: inherit; border: 1px solid var(--border); border-radius: 9px; background: #1e2b21; }
.track strong, .track small { display: block; }
.track strong { font-size: .94rem; }
.track small { color: var(--muted); font-size: .76rem; margin-top: 4px; }
.track[aria-pressed="true"] { border-color: var(--accent); background: rgba(var(--accent-rgb), .12); color: var(--accent); }
.track:hover, .secondary:hover { background: rgba(var(--accent-rgb), .18); }
.play-modes { display: flex; gap: 7px; margin-top: 21px; }
.mode { min-height: 44px; padding: 7px 13px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: #101812; font-weight: 650; }
.mode:hover { color: #f2f5e8; }
.mode[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.time-goals { display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; padding: 0; margin: 12px 0 0; border: 0; }
.time-goals legend { padding: 0 0 6px; color: var(--muted); font-size: .88rem; }
.time-goals:not([hidden]) + .play-modes { margin-top: 13px; }
.archive-date { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.archive-date label { color: var(--muted); font-size: .9rem; }
.archive-date select { min-height: 42px; appearance: none; padding: 5px 30px 5px 9px; border: 1px solid #697865; border-radius: 7px; color: #f2f5e8; background: linear-gradient(45deg, transparent 50%, var(--accent) 50%) calc(100% - 13px) center / 5px 5px no-repeat, linear-gradient(135deg, var(--accent) 50%, transparent 50%) calc(100% - 8px) center / 5px 5px no-repeat, #101812; }
.primary, .secondary, .text-button { min-height: 44px; border-radius: 8px; padding: 9px 14px; font-weight: 700; }
.primary { border: 1px solid var(--accent); color: #141b12; background: var(--accent); }
.primary:hover { filter: brightness(1.11); }
.secondary { border: 1px solid var(--border); color: #edf1e3; background: transparent; }
.text-button { border: 0; color: var(--muted); background: transparent; }
.text-button:hover { color: var(--accent); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.start-button { width: 100%; margin-top: 13px; }
.console .note { font-size: .84rem; }
.station-details { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.station-details > summary { padding: 4px 0; color: #e2e9da; font-size: .9rem; cursor: pointer; }
.station-details > summary:hover { color: var(--accent); }
.station-details > p { font-size: .92rem; }
.stats-table { width: 100%; margin-top: 9px; border-collapse: collapse; font-size: .84rem; text-align: left; }
.stats-table th, .stats-table td { padding: 6px 5px; border-bottom: 1px solid var(--border); }
.stats-table thead th { color: var(--muted); }
.round-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.time { color: var(--accent); font: 1rem var(--mono); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; }
.time.is-low { color: #ffa995; border-color: #a96c62; }
.time-track { height: 5px; border: none; border-radius: 10px; margin: 0 0 16px; background: #39473b; overflow: hidden; }
.time-track div { height: 100%; width: 100%; background: var(--accent); transition: width 160ms linear; }
.time-track div.is-low { background: #ffa995; }
.console .question-goal { margin: 10px 0 7px; color: var(--accent); font: .86rem var(--mono); }
.quiz h2 { font-size: clamp(1.55rem, 3.9vw, 2.5rem); }
.answer-form { margin-top: 20px; }
.answer-form label { display: block; margin-bottom: 6px; color: #e2eadb; font-weight: 660; }
.input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.input-row input { min-width: 0; padding: 10px; color: #f6f8ed; border: 1px solid #697865; border-radius: 8px; background: #101812; }
.input-row input::placeholder { color: #a1aea1; }
.status { min-height: 1.3em; color: #ffb3a3; margin: 8px 0 0; font-size: .87rem; }
.round-result { margin-top: 20px; padding: 12px; border-left: 2px solid var(--accent); background: #101812; border-radius: 0 7px 7px 0; }
.round-result strong { color: var(--accent); }
.console .round-result p { margin-top: 5px; font-size: .93rem; }
.feedback-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.feedback-head span { padding: 5px 7px; border-radius: 5px; color: var(--accent); background: rgba(var(--accent-rgb), .15); font: .88rem var(--mono); white-space: nowrap; }
.score-line { height: 4px; margin: 8px 0; border-radius: 5px; background: #39473b; }
.score-line span { display: block; width: var(--fill); height: 100%; border-radius: inherit; background: var(--accent); transform-origin: left; animation: score-line 360ms ease-out; }
@keyframes score-line { from { transform: scaleX(0); } }
.board { display: grid; margin: 13px 0 0; }
.review { border-top: 1px solid var(--border); }
.review summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 9px 0; cursor: pointer; font-size: .9rem; list-style: none; }
.review summary > span::before { content: "＋"; display: inline-block; width: 1.1em; margin-right: 5px; color: var(--accent); }
.review[open] summary > span::before { content: "−"; }
.review summary strong, .answer-list strong { color: var(--accent); font: .87rem var(--mono); }
.review summary small { display: block; margin-top: 2px; color: var(--muted); }
.review[open] > p { margin: 1px 0 7px; font-size: .88rem; }
.answer-list { margin: 0 0 10px; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.answer-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 9px; background: #101812; font-size: .89rem; }
.answer-list li + li { border-top: 1px solid var(--border); }
.answer-list .your-answer { background: rgba(var(--accent-rgb), .13); }
.your-answer small { margin-left: 4px; color: var(--muted); white-space: nowrap; }
[hidden] { display: none !important; }

@media (max-width: 710px) {
  .station { width: calc(100% - 22px); padding-top: 13px; }
  .station-header { padding-bottom: 12px; }
  .station-brand { gap: 6px; }
  .station-brand a { padding-right: 6px; }
  .station-grid { grid-template-columns: 1fr; border-radius: 13px; }
  .receiver { display: grid; grid-template-columns: minmax(0, 1fr) 59px; grid-template-rows: auto auto; column-gap: 12px; min-height: 0; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--border); }
  .receiver-head { grid-row: 1; align-self: center; }
  .receiver-head span + span { display: none; }
  .scope { grid-area: 1 / 2 / 3 / 3; min-height: 0; }
  .receiver-readout { border: 0; padding: 0; align-items: center; }
  .receiver-readout strong { display: inline; font-size: 1rem; margin-left: 5px; }
  .meters { grid-template-columns: repeat(6, 6px); gap: 3px; }
  .meters i { height: 10px; }
  .tracks { margin-top: 18px; }
  .console { padding: 18px 14px 20px; }
}

@media (max-width: 365px) {
  .station-header { align-items: start; }
  .daily-date { font-size: .69rem; margin-top: 4px; }
  .station-name p { font-size: .72rem; }
  .mode { padding-inline: 9px; }
  .actions { gap: 5px; }
  .primary, .secondary, .text-button { padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
