:root {
  --night: #0b1518;
  --night-soft: #122226;
  --panel: #142a2d;
  --paper: #f5ead5;
  --paper-soft: #cfc4ae;
  --ink: #182025;
  --teal: #5c9a8d;
  --mint: #a8d7c7;
  --gold: #e3b85b;
  --red: #cf5a44;
  --blue: #7e9dc2;
  --rule: rgba(240, 230, 209, .18);
  --mono: "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: "Avenir Next", Avenir, "Segoe UI", Helvetica, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body {
  margin: 0; min-height: 100vh; color: var(--paper);
  background:
    radial-gradient(circle at 10% 0%, rgba(92,154,141,.16), transparent 24rem),
    radial-gradient(circle at 92% 18%, rgba(227,184,91,.07), transparent 24rem),
    linear-gradient(180deg, #102124 0%, var(--night) 65%, #070e10 100%);
  font-family: var(--sans); line-height: 1.5; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 300; pointer-events: none; opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}
a { color: inherit; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.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; }
.page { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding-bottom: 28px; }
.game-bar { min-height: 76px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; border-bottom: 1px solid var(--rule); }
.shelf-link { width: max-content; color: var(--paper-soft); text-decoration: none; font: 700 10px/1 var(--mono); letter-spacing: .16em; }
.shelf-link:hover, .shelf-link:focus-visible { color: var(--gold); }
.bar-title { margin: 0; text-align: center; font: 700 12px/1 var(--mono); letter-spacing: .2em; }
.bar-title span { color: var(--gold); }
.bar-actions { justify-self: end; display: flex; gap: 8px; }
.bar-button { min-height: 34px; padding: 0 10px; border: 1px solid var(--rule); background: transparent; color: var(--paper-soft); font: 700 9px/1 var(--mono); letter-spacing: .12em; cursor: pointer; }
.bar-button:hover, .bar-button:focus-visible { border-color: var(--gold); color: var(--gold); }
.bar-button:disabled { opacity: .35; cursor: default; }
.layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: clamp(22px,3.6vw,42px); align-items: start; padding: 30px 0 24px; }
.radio-shell { min-width: 0; }
.radio {
  position: relative; overflow: hidden; border: 1px solid rgba(240,230,209,.3);
  background: linear-gradient(180deg, #183437 0%, #0d1a1d 100%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.7), 0 26px 76px rgba(0,0,0,.5);
}
.radio::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.14) 3px 4px);
}
.radio-top { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--rule); background: rgba(5,10,11,.34); }
.radio-brand { color: var(--paper-soft); font: 700 7px/1 var(--mono); letter-spacing: .16em; }
.leds { display: flex; gap: 6px; flex-wrap: wrap; }
.led { width: 10px; height: 10px; border: 1px solid rgba(240,230,209,.3); background: #0b1417; }
.led.on { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 9px rgba(227,184,91,.55); }
.led.final { border-color: rgba(207,90,68,.5); }
.led.final.on { background: var(--red); border-color: var(--red); }
.scope-frame { position: relative; margin: 18px 18px 0; padding: 8px; border: 1px solid rgba(168,215,199,.28); background: #071010; box-shadow: inset 0 0 28px rgba(0,0,0,.65); }
#scope { display: block; width: 100%; height: auto; image-rendering: pixelated; background: #06100c; }
.scope-caption { display: flex; justify-content: space-between; gap: 10px; padding: 7px 3px 0; color: rgba(168,215,199,.62); font: 700 7px/1 var(--mono); letter-spacing: .12em; }
.dial-panel { position: relative; z-index: 2; padding: 18px; }
.frequency { display: flex; align-items: baseline; justify-content: center; gap: 8px; color: var(--gold); text-shadow: 0 0 18px rgba(227,184,91,.28); }
.frequency span { font: 700 clamp(54px,8vw,82px)/.85 var(--mono); letter-spacing: -.04em; }
.frequency small { color: var(--paper-soft); font: 700 12px/1 var(--mono); letter-spacing: .12em; }
.signal-meter { display: flex; justify-content: center; gap: 6px; margin-top: 15px; }
.signal-meter i { display: block; width: 20px; height: 8px; border: 1px solid rgba(240,230,209,.22); background: rgba(0,0,0,.25); }
.signal-meter i.on { background: var(--mint); border-color: var(--mint); }
#dial { display: block; width: 100%; margin: 22px 0 0; accent-color: var(--gold); cursor: ew-resize; }
#dial::-webkit-slider-runnable-track { height: 8px; border: 1px solid rgba(240,230,209,.25); background: linear-gradient(90deg, #203f40, #0a1417); }
#dial::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 32px; margin-top: -13px; border: 1px solid var(--gold); background: #2a3a38; box-shadow: 0 0 10px rgba(227,184,91,.24); cursor: ew-resize; }
#dial::-moz-range-track { height: 8px; border: 1px solid rgba(240,230,209,.25); background: #203f40; }
#dial::-moz-range-thumb { width: 22px; height: 30px; border: 1px solid var(--gold); background: #2a3a38; border-radius: 0; cursor: ew-resize; }
.dial-labels { display: flex; justify-content: space-between; margin-top: 6px; color: rgba(207,196,174,.48); font: 700 7px/1 var(--mono); letter-spacing: .08em; }
.tune-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.main-button, .quiet-button { min-height: 42px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--rule); background: transparent; color: var(--paper); font: 700 9px/1 var(--mono); letter-spacing: .08em; text-decoration: none; cursor: pointer; }
.main-button { border-color: rgba(227,184,91,.55); background: rgba(227,184,91,.12); color: var(--gold); }
.main-button:hover, .main-button:focus-visible, .quiet-button:hover, .quiet-button:focus-visible { border-color: var(--gold); color: var(--gold); }
.main-button:disabled { opacity: .32; cursor: default; }
.radio-foot { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--rule); background: rgba(5,10,11,.34); color: var(--paper-soft); font: 700 8px/1.3 var(--mono); letter-spacing: .06em; }
#timer { color: var(--gold); }
.overlay { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 26px 26px 30px; overflow-y: auto; text-align: center; background: radial-gradient(circle at 50% 20%, rgba(92,154,141,.2), transparent 22rem), #081112; }
.end-overlay { justify-content: center; }
.overlay h2 { max-width: 9ch; margin: 10px 0 0; color: var(--paper); font: 400 clamp(58px,9vw,98px)/.8 var(--serif); letter-spacing: -.05em; }
.overlay h2 em { color: var(--gold); font-style: italic; }
.overlay h2#end-heading { max-width: none; font-size: clamp(44px,8vw,74px); line-height: .95; }
.eyebrow { margin: 0; color: var(--gold); font: 700 8px/1.3 var(--mono); letter-spacing: .18em; }
.subtitle { margin: 18px 0 0; color: var(--paper); font: 400 16px/1.3 var(--serif); }
.intro-copy { max-width: 48ch; margin: 18px auto 0; color: var(--paper-soft); font-size: 13px; line-height: 1.55; }
.button-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 22px; }
.how { margin: 20px 0 0; color: rgba(207,196,174,.58); font: 600 8px/1.7 var(--mono); letter-spacing: .08em; }
.end-stats { display: flex; gap: 22px; margin: 22px 0 0; }
.end-stats div { display: flex; flex-direction: column; gap: 4px; }
.end-stats span { color: var(--paper-soft); font: 700 7px/1 var(--mono); letter-spacing: .12em; }
.end-stats strong { color: var(--gold); font: 700 14px/1 var(--mono); }
.log-panel { border-left: 1px solid var(--rule); padding-left: 22px; }
.log-panel h2 { margin: 5px 0 12px; font: 400 30px/.95 var(--serif); }
.log-intro { color: var(--paper-soft); font-size: 12px; line-height: 1.55; }
.log { display: grid; gap: 9px; margin-top: 18px; }
.log-entry { padding: 9px 10px; border: 1px solid var(--rule); background: rgba(240,230,209,.035); }
.log-entry header { display: flex; justify-content: space-between; gap: 8px; color: var(--gold); font: 700 7px/1 var(--mono); letter-spacing: .1em; }
.log-entry strong { display: block; margin-top: 5px; font: 700 10px/1 var(--mono); }
.log-entry p { margin: 6px 0 0; color: var(--paper-soft); font: 400 11px/1.45 var(--serif); }
.log-empty { color: rgba(207,196,174,.45); font: 600 9px/1.5 var(--mono); letter-spacing: .05em; }
.signature { margin-top: 22px; color: rgba(207,196,174,.5); font: 600 8px/1.7 var(--mono); letter-spacing: .08em; }
.help { margin: 9px 0 0; color: rgba(207,196,174,.55); font: 600 8px/1.6 var(--mono); letter-spacing: .08em; text-align: center; }
.game-foot { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--rule); padding-top: 13px; color: rgba(207,196,174,.46); font: 600 8px/1.4 var(--mono); letter-spacing: .1em; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .log-panel { border-left: 0; border-top: 1px solid var(--rule); padding: 22px 0 0; } }
@media (max-width: 700px) {
  .page { width: min(100% - 22px, 1120px); }
  .game-bar { min-height: 62px; grid-template-columns: auto 1fr auto; }
  .bar-title { font-size: 10px; }
  .bar-button { min-height: 32px; padding: 0 7px; font-size: 8px; }
  .overlay { position: fixed; z-index: 250; inset: 0; padding: 28px 18px; background: radial-gradient(circle at 50% 18%, rgba(92,154,141,.2), transparent 24rem), #081112; }
  .overlay h2 { font-size: clamp(52px,18vw,84px); }
  .overlay h2#end-heading { font-size: clamp(34px,10vw,52px); }
  .subtitle { font-size: 14px; }
  .intro-copy { font-size: 12px; }
  .radio-top { padding: 10px 11px; }
  .radio-brand { font-size: 6px; }
  .scope-frame { margin: 12px 10px 0; }
  .dial-panel { padding: 13px 12px; }
  .frequency span { font-size: clamp(52px,17vw,72px); }
  .radio-foot { padding: 10px 12px; font-size: 7px; }
  .main-button, .quiet-button { width: 100%; }
  .game-foot { flex-direction: column; gap: 4px; }
}
@media (max-width: 390px) { .bar-title span { display: none; } .shelf-link, .bar-button { font-size: 7px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
