:root {
  --background: #ecefe8;
  --paper: #ffffff;
  --paper-soft: #f6f7f2;
  --ink: #182522;
  --muted: #62706b;
  --line: #c8d0c8;
  --line-strong: #8c9991;
  --accent: #b84528;
  --accent-dark: #84321e;
  --accent-soft: #f3ded6;
  --green: #24715d;
  --green-soft: #dcece5;
  --amber: #b97812;
  --amber-soft: #f4e8c9;
  --blue: #2d6e91;
  --blue-soft: #dce9f0;
  --danger: #a53228;
  --danger-soft: #f5dedb;
  --ocean: #dce8e5;
  --land: #d7d4bf;
  --land-line: #7d877d;
  --shadow: 0 15px 45px rgb(27 45 38 / 10%);
}

html[data-theme="dark"] {
  --background: #151a18;
  --paper: #202724;
  --paper-soft: #1a211f;
  --ink: #d6d3ca;
  --muted: #989f9a;
  --line: #39443f;
  --line-strong: #596760;
  --accent: #d97755;
  --accent-dark: #b85b3d;
  --accent-soft: #3d2923;
  --green: #65b49b;
  --green-soft: #1f3931;
  --amber: #d5a44a;
  --amber-soft: #3c321e;
  --blue: #70a9c4;
  --blue-soft: #203640;
  --violet: #ae8eb3;
  --violet-soft: #352d38;
  --danger: #e1786b;
  --danger-soft: #442725;
  --ocean: #1b302f;
  --land: #39413b;
  --land-line: #758079;
  --shadow: 0 18px 50px rgb(0 0 0 / 28%);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--background);
  color-scheme: light;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--background);
  background-image:
    linear-gradient(rgb(74 96 85 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(74 96 85 / 5%) 1px, transparent 1px);
  background-size: 24px 24px;
  font-family: Bahnschrift, Candara, "Trebuchet MS", sans-serif;
  letter-spacing: 0;
}

button, input, select { font: inherit; letter-spacing: 0; }
button { touch-action: manipulation; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
[role="slider"]:focus-visible,
.map-svg:focus-visible {
  outline: 3px solid rgb(45 110 145 / 38%);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.skip-link:focus { transform: translateY(0); }

.app-header {
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 91%);
  backdrop-filter: blur(10px);
}

.header-inner,
.app-main,
.app-footer {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  min-height: 126px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 20px 0;
}

.brand-block h1 {
  margin: 2px 0;
  font-family: Rockwell, Cambria, Georgia, serif;
  font-size: clamp(31px, 5vw, 48px);
  line-height: 1;
}

.brand-block p { margin: 0; color: var(--muted); font-size: 15px; }

.eyebrow,
.session-label,
.question-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr)) 44px;
  min-width: 350px;
  border: 1px solid var(--line);
  background: var(--paper-soft);
}

.score-item { min-width: 0; padding: 12px 14px; border-right: 1px solid var(--line); }
.score-item strong { display: block; font-size: 23px; font-variant-numeric: tabular-nums; line-height: 1; }
.score-item span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }

.icon-button {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
}

.icon-button:hover { background: #e4e8e2; color: var(--ink); }

.header-tools {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.theme-toggle {
  display: grid;
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  place-items: center;
  align-self: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper-soft);
  color: var(--ink);
  cursor: pointer;
  font-size: 22px;
}

.theme-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }

.game-navigation {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(12px);
}

.tabs-inner {
  display: flex;
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.game-tab {
  position: relative;
  display: flex;
  min-width: 250px;
  min-height: 68px;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
}

.game-tab:first-child { border-left: 1px solid var(--line); }
.game-tab::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 4px; background: transparent; }
.game-tab:hover { background: var(--paper-soft); color: var(--ink); }
.game-tab.is-active { background: var(--paper); color: var(--ink); }
.game-tab.is-active::after { background: var(--accent); }
.game-tab strong, .game-tab small { display: block; }
.game-tab strong { font-size: 14px; }
.game-tab small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.tab-index {
  color: var(--accent);
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 800;
}

.app-main { padding: 26px 0 46px; }

.session-strip {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
}

.session-label { display: block; }
.session-detail { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.session-progress { display: grid; min-width: min(280px, 42vw); gap: 6px; color: var(--muted); font-size: 12px; text-align: right; }

.progress-track {
  height: 7px;
  overflow: hidden;
  border: 1px solid #b8c1ba;
  background: #dde2dc;
}

.progress-track > span { display: block; width: 0; height: 100%; background: var(--accent); transition: width 240ms ease; }

.game-shell {
  min-height: 640px;
  border: 1px solid var(--line-strong);
  border-top: 5px solid var(--accent);
  border-radius: 0 0 7px 7px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.loading-state { display: grid; min-height: 635px; place-items: center; color: var(--muted); }

.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-soft);
}

.round-id { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; font-weight: 700; }
.round-id strong { color: var(--ink); }
.target-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

.toolbar-controls { display: flex; align-items: center; gap: 14px; }
.field-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 800; }

select {
  min-height: 42px;
  max-width: 230px;
  padding: 8px 32px 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  overflow: hidden;
}

.segment-button {
  min-height: 40px;
  padding: 7px 11px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.segment-button:last-child { border-right: 0; }
.segment-button.is-active { background: var(--ink); color: #fff; }

.game-content { padding: clamp(18px, 3vw, 34px); }

.question-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  margin-bottom: 22px;
}

.question-kicker { display: block; margin-bottom: 7px; }

.question-header h2 {
  max-width: 850px;
  margin: 0;
  font-family: Rockwell, Cambria, Georgia, serif;
  font-size: clamp(20px, 3vw, 31px);
  line-height: 1.23;
}

.destination-badge {
  min-width: 118px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-left: 5px solid var(--accent);
  background: var(--paper-soft);
  text-align: right;
}

.destination-badge strong { display: block; font-size: 17px; }
.destination-badge span { color: var(--muted); font-size: 11px; }

.band-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

.band-badge {
  min-width: 110px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-left: 5px solid var(--accent);
  background: var(--paper-soft);
  text-align: right;
}

.band-badge strong { display: block; font-size: 19px; }
.band-badge span { color: var(--muted); font-size: 11px; }

.band-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(230px, .7fr);
  gap: 28px;
  align-items: start;
}

.band-map { min-width: 0; }

.axis {
  position: relative;
  height: 38px;
  margin: 0 160px 4px 0;
  border-bottom: 2px solid var(--ink);
}

.axis::before,
.axis::after {
  content: "";
  position: absolute;
  bottom: -6px;
  width: 2px;
  height: 11px;
  background: var(--ink);
}

.axis::before { left: 0; }
.axis::after { right: 0; }

.axis-value {
  position: absolute;
  bottom: 8px;
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.axis-value:first-child { left: 0; }
.axis-value:last-child { right: 0; }
.build-rows { display: grid; gap: 9px; }

.build-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
  align-items: start;
  min-height: 52px;
}

.range-track-wrap { position: relative; min-width: 0; min-height: 61px; padding-bottom: 27px; }

.mini-track {
  position: relative;
  height: 34px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent 24.8%, color-mix(in srgb, var(--muted) 12%, transparent) 25%, transparent 25.2%, transparent 49.8%, color-mix(in srgb, var(--muted) 12%, transparent) 50%, transparent 50.2%, transparent 74.8%, color-mix(in srgb, var(--muted) 12%, transparent) 75%, transparent 75.2%),
    var(--paper-soft);
}

.range-shadow {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: var(--range-start);
  width: max(var(--range-width), 8px);
  border: 2px solid var(--tone-color, var(--line-strong));
  background: color-mix(in srgb, var(--tone-color, var(--line-strong)) 18%, var(--paper));
}

.range-shadow::before,
.range-shadow::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 1px;
  height: 32px;
  background: var(--tone-color, var(--line-strong));
}

.range-shadow::before { left: -1px; }
.range-shadow::after { right: -1px; }

.range-readout {
  position: absolute;
  bottom: 0;
  left: clamp(76px, var(--range-mid), calc(100% - 76px));
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  padding: 2px 6px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.range-readout::before { content: ""; position: absolute; bottom: 100%; left: 50%; height: 5px; border-left: 1px solid var(--line-strong); }

.fact-track {
  display: flex;
  height: 34px;
  align-items: center;
  padding: 0 10px;
  border: 1px dashed var(--line-strong);
  background: var(--paper-soft);
  color: var(--muted);
  font-size: 12px;
}

.drop-slot {
  display: grid;
  min-height: 44px;
  place-items: center;
  padding: 7px 9px;
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.slot-correction { display: block; margin-top: 4px; color: var(--danger); font-size: 10px; line-height: 1.2; }
.drop-slot.has-tile { border-style: solid; border-width: 2px; border-color: var(--tone-color, var(--line-strong)); background: color-mix(in srgb, var(--tone-color, var(--line-strong)) 22%, var(--paper)); color: var(--ink); }
.drop-slot.is-correct { border-color: var(--green); background: var(--green-soft); }
.drop-slot.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.drop-slot.is-target { outline: 3px solid color-mix(in srgb, var(--accent) 24%, transparent); }

.build-review-note { margin: -7px 0 24px; padding: 11px 13px; border-left: 4px solid var(--danger); background: var(--danger-soft); color: var(--ink); font-size: 12px; line-height: 1.45; }

.build-result {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin: -2px 0 8px;
  padding: 8px 11px;
  border-left: 4px solid var(--green);
  background: var(--green-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.build-result > strong { color: var(--ink); }
.build-result.is-wrong { display: grid; gap: 8px; padding: 12px 14px; border-left-color: var(--danger); background: var(--danger-soft); color: var(--ink); }
.result-status { align-self: start; width: max-content; padding: 2px 6px; background: var(--green); color: #fff; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.build-result.is-wrong .result-status { background: var(--danger); }
.answer-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.answer-comparison span { padding: 7px 9px; border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); background: color-mix(in srgb, var(--paper) 55%, transparent); color: var(--muted); }
.answer-comparison strong { display: block; margin-top: 2px; color: var(--ink); }
.official-result, .result-explanation { margin: 0; }
.official-result { font-size: 13px; }
.result-explanation { color: var(--ink); }
.result-source { color: var(--muted); font-size: 10px; }

.tile-bank { position: sticky; top: 92px; padding-left: 22px; border-left: 1px solid var(--line); }
.tile-bank h3 { margin: 0 0 11px; font-size: 13px; }
.tiles { display: grid; gap: 9px; }

.segment-tile {
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--tone-color, var(--line-strong));
  border-left: 7px solid var(--tone-color, var(--line-strong));
  border-radius: 4px;
  background: color-mix(in srgb, var(--tone-color, var(--line-strong)) 16%, var(--paper));
  color: var(--ink);
  cursor: grab;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
}

.segment-tile:hover { background: color-mix(in srgb, var(--tone-color, var(--line-strong)) 26%, var(--paper)); }
.segment-tile.is-selected { outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.segment-tile:disabled { cursor: default; opacity: .34; }
.tone-cw { --tone-color: var(--amber); }
.tone-digital { --tone-color: var(--green); }
.tone-fone { --tone-color: var(--blue); }
.tone-satellite, .tone-beacon, .tone-special { --tone-color: var(--violet); }
.tone-all, .tone-ssb { --tone-color: var(--accent); }

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, .72fr);
  gap: clamp(20px, 4vw, 38px);
  align-items: center;
}

.map-panel { min-width: 0; }

.map-frame {
  position: relative;
  width: min(100%, 680px);
  margin-inline: auto;
  aspect-ratio: 1;
}

.map-svg {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.map-ocean { fill: var(--ocean); stroke: #60746d; stroke-width: 3; }
.distance-ring { fill: none; stroke: #8ba19a; stroke-width: 1; stroke-dasharray: 5 7; opacity: .75; }
.bearing-line { stroke: #91a49e; stroke-width: 1; opacity: .65; }
.bearing-line.major { stroke: #667b74; stroke-width: 1.5; }
.land {
  fill: var(--land);
  stroke: var(--land-line);
  stroke-width: .75;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.azimuth-guide-band {
  fill: none;
  stroke: #f5f7f3;
  stroke-width: 25;
}

.azimuth-guide-ring {
  fill: none;
  stroke: #60746d;
  stroke-width: 1.5;
}

.azimuth-tick {
  stroke: #84958f;
  stroke-width: 1;
}

.azimuth-tick.medium { stroke: #5f746d; stroke-width: 1.5; }
.azimuth-tick.major { stroke: #263b35; stroke-width: 2.2; }

.azimuth-number {
  fill: #4f635c;
  font-family: Consolas, "Courier New", monospace;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--background);
  stroke-width: 3px;
}

.map-rim-label {
  fill: #263b35;
  font-size: 21px;
  font-weight: 900;
  paint-order: stroke;
  stroke: var(--ocean);
  stroke-width: 5px;
}

.distance-label { fill: #61766f; font-family: Consolas, "Courier New", monospace; font-size: 9px; }

.beam-selected { fill: rgb(184 69 40 / 25%); stroke: var(--accent); stroke-width: 2; }
.beam-correct { fill: rgb(36 113 93 / 22%); stroke: var(--green); stroke-width: 3; }
.bearing-ray { stroke: var(--accent-dark); stroke-width: 2; stroke-dasharray: 7 5; }
.bearing-ray.correct { stroke: var(--green); stroke-width: 4; stroke-dasharray: none; }

.prague-marker { fill: var(--ink); stroke: #fff; stroke-width: 3; }
.prague-label, .target-label {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 850;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 5px;
  stroke-linejoin: round;
}

.target-marker { fill: var(--accent); stroke: #fff; stroke-width: 3; }
.target-halo { fill: none; stroke: var(--accent); stroke-width: 2; opacity: .55; }
.target-group.is-revealed .target-marker { fill: var(--green); }
.target-group.is-revealed .target-halo { stroke: var(--green); }

.map-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px 16px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 22px; height: 7px; background: rgb(184 69 40 / 35%); border: 1px solid var(--accent); }
.legend-swatch.correct { background: rgb(36 113 93 / 28%); border-color: var(--green); }

.control-console {
  padding: 18px;
  border: 1px solid var(--line-strong);
  background: #eef0e9;
  box-shadow: inset 0 0 0 5px #e2e6df;
}

.azimuth-display {
  display: flex;
  min-height: 67px;
  align-items: baseline;
  justify-content: flex-end;
  padding: 10px 13px;
  border: 2px solid #344841;
  background: #dbe4cd;
  box-shadow: inset 0 3px 9px rgb(34 48 39 / 18%);
  color: #1b3228;
  font-family: Consolas, "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}

.azimuth-display strong { font-size: clamp(31px, 7vw, 43px); line-height: 1; }
.azimuth-display span { margin-left: 5px; font-size: 16px; }

.dial-wrap { position: relative; width: 200px; height: 200px; margin: 18px auto 13px; }

.dial-scale {
  position: absolute;
  inset: 0;
  border: 1px solid #82908a;
  border-radius: 50%;
  background: repeating-conic-gradient(#53645e 0 1deg, transparent 1deg 10deg);
}

.dial-cardinal {
  position: absolute;
  z-index: 2;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  pointer-events: none;
}

.dial-cardinal.n { top: 6px; left: 50%; transform: translateX(-50%); }
.dial-cardinal.e { top: 50%; right: 8px; transform: translateY(-50%); }
.dial-cardinal.s { bottom: 5px; left: 50%; transform: translateX(-50%); }
.dial-cardinal.w { top: 50%; left: 8px; transform: translateY(-50%); }

.dial {
  position: absolute;
  inset: 28px;
  border: 2px solid #263630;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #66716c 0, #333e3a 45%, #1c2522 76%);
  box-shadow: 0 8px 18px rgb(23 35 30 / 30%), inset 0 0 0 7px #434f4a;
  cursor: grab;
  touch-action: none;
  transform: rotate(var(--dial-angle, 0deg));
}

.dial:active { cursor: grabbing; }
.dial::before {
  content: "";
  position: absolute;
  top: 10px;
  left: calc(50% - 2px);
  width: 4px;
  height: 34px;
  border-radius: 2px;
  background: #f5b342;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 25%);
}

.direction-controls { display: grid; grid-template-columns: 58px minmax(0, 1fr) 58px; gap: 9px; }

.arrow-button {
  min-height: 50px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
}

.arrow-button small { display: block; color: var(--muted); font-size: 9px; }
.arrow-button:hover { background: #e2e6df; }

.angle-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper);
}

.angle-input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 8px 4px 8px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 20px;
  font-weight: 800;
  text-align: right;
}

.angle-input-wrap > span { padding: 0 11px 0 5px; font-size: 20px; font-weight: 800; }

.control-caption { margin: 10px 0 0; color: var(--muted); font-size: 11px; text-align: center; }

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 24px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.button {
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid var(--accent-dark);
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.button:hover { background: var(--accent-dark); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button.secondary { border-color: var(--line-strong); background: var(--paper); color: var(--ink); }
.button.secondary:hover { background: var(--paper-soft); }
.action-note { margin-left: auto; color: var(--muted); font-size: 11px; }

.feedback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  margin-top: 20px;
  padding: 14px 16px;
  border-left: 5px solid var(--green);
  background: var(--green-soft);
}

.feedback.is-near { border-left-color: var(--amber); background: var(--amber-soft); }
.feedback.is-wrong { border-left-color: var(--danger); background: var(--danger-soft); }

.feedback-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.feedback.is-near .feedback-mark { background: var(--amber); }
.feedback.is-wrong .feedback-mark { background: var(--danger); }
.feedback h3 { margin: 0 0 5px; font-size: 16px; }
.feedback p { margin: 0; color: #41514b; line-height: 1.45; }
.feedback-stats { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.feedback-stats strong { color: var(--ink); }

.coverage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: rgb(255 255 255 / 76%);
}

.coverage h2 { margin: 3px 0 0; font-family: Rockwell, Cambria, Georgia, serif; font-size: 19px; }
.coverage-meter { display: grid; width: min(420px, 50%); gap: 7px; }
.coverage-value { display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; }
.coverage-value strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.coverage-value span { color: var(--muted); font-size: 12px; }
.coverage-track > span { background: var(--green); }

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 0 0 max(26px, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 11px;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 15px;
  transform: translateY(130%);
  border: 1px solid var(--ink);
  border-left: 5px solid var(--accent);
  background: var(--paper);
  box-shadow: 0 10px 35px rgb(26 39 34 / 20%);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.is-visible { transform: translateY(0); opacity: 1; }

noscript { display: block; padding: 18px; background: var(--danger-soft); color: var(--ink); text-align: center; }

html[data-theme="dark"] body {
  background-image:
    linear-gradient(rgb(204 216 207 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(204 216 207 / 4%) 1px, transparent 1px);
}

html[data-theme="dark"] .app-header { background: rgb(32 39 36 / 92%); }
html[data-theme="dark"] .icon-button:hover,
html[data-theme="dark"] .arrow-button:hover { background: #2b3430; }
html[data-theme="dark"] .progress-track { border-color: #46534d; background: #29322e; }
html[data-theme="dark"] .coverage { background: rgb(32 39 36 / 78%); }
html[data-theme="dark"] .axis { border-bottom-color: #91aa9f; }
html[data-theme="dark"] .axis::before,
html[data-theme="dark"] .axis::after { background: #91aa9f; }
html[data-theme="dark"] .mini-track {
  border-color: #48655e;
  background:
    linear-gradient(90deg, transparent 24.7%, rgb(101 180 155 / 28%) 25%, transparent 25.3%, transparent 49.7%, rgb(112 169 196 / 28%) 50%, transparent 50.3%, transparent 74.7%, rgb(174 142 179 / 28%) 75%, transparent 75.3%),
    linear-gradient(180deg, #1d2b28, #18221f);
  box-shadow: inset 0 0 0 1px rgb(101 180 155 / 7%);
}
html[data-theme="dark"] .range-shadow:not([class*="tone-"]) {
  border-color: #70ad9b;
  background: rgb(70 128 111 / 32%);
  box-shadow: 0 0 10px rgb(101 180 155 / 10%);
}
html[data-theme="dark"] .range-shadow:not([class*="tone-"])::before,
html[data-theme="dark"] .range-shadow:not([class*="tone-"])::after { background: #70ad9b; }
html[data-theme="dark"] .range-shadow[class*="tone-"] {
  background: color-mix(in srgb, var(--tone-color) 34%, var(--paper));
  box-shadow: 0 0 10px color-mix(in srgb, var(--tone-color) 18%, transparent);
}
html[data-theme="dark"] .range-readout {
  border-color: #4f7067;
  background: #202d29;
  color: #b8c9c1;
}
html[data-theme="dark"] .range-readout::before { border-left-color: #63877c; }
html[data-theme="dark"] .azimuth-guide-band { stroke: #202724; }
html[data-theme="dark"] .azimuth-guide-ring,
html[data-theme="dark"] .map-ocean { stroke: #71817a; }
html[data-theme="dark"] .azimuth-number { fill: #b7c0b9; stroke: var(--background); }
html[data-theme="dark"] .map-rim-label { fill: #e8e3d7; }
html[data-theme="dark"] .distance-label { fill: #a5b5ae; }
html[data-theme="dark"] .prague-marker { stroke: #151a18; }
html[data-theme="dark"] .prague-label,
html[data-theme="dark"] .target-label { stroke: #151a18; }
html[data-theme="dark"] .target-marker { stroke: #151a18; }
html[data-theme="dark"] .control-console { background: #1a211f; box-shadow: inset 0 0 0 5px #242d29; }
html[data-theme="dark"] .azimuth-display { border-color: #68786f; background: #27372d; color: #dbe8d5; box-shadow: inset 0 3px 9px rgb(0 0 0 / 28%); }
html[data-theme="dark"] .feedback p { color: var(--ink); }

@media (max-width: 860px) {
  .header-inner { align-items: stretch; flex-direction: column; gap: 17px; }
  .header-tools { width: 100%; }
  .scoreboard { min-width: 0; width: 100%; }
  .play-layout { grid-template-columns: 1fr; }
  .control-console { width: min(460px, 100%); margin-inline: auto; }
  .band-workbench { grid-template-columns: 1fr; }
  .tile-bank { position: static; order: -1; padding: 0 0 18px; border: 0; border-bottom: 1px solid var(--line); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .axis { margin-right: 130px; }
  .build-row { grid-template-columns: minmax(0, 1fr) 120px; }
}

@media (max-width: 600px) {
  .header-inner,
  .app-main,
  .app-footer,
  .tabs-inner { width: min(100% - 24px, 1160px); }

  .header-inner { min-height: 0; padding: 16px 0; }
  .brand-block h1 { font-size: 34px; }
  .brand-block p { font-size: 13px; }
  .header-tools { display: grid; grid-template-columns: 42px minmax(0, 1fr); }
  .theme-toggle { width: 42px; min-width: 42px; min-height: 42px; }
  .scoreboard { grid-template-columns: repeat(3, 1fr) 42px; }
  .score-item { padding: 10px 8px; }
  .score-item strong { font-size: 20px; }
  .session-strip { align-items: stretch; flex-direction: column; gap: 10px; }
  .session-progress { min-width: 0; width: 100%; text-align: left; }
  .app-main { padding-top: 18px; }
  .game-tab { min-width: 0; flex: 1; padding: 9px 12px; }
  .game-tab small { display: none; }
  .tab-index { font-size: 10px; }
  .game-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-controls { align-items: stretch; flex-direction: column; }
  .field-label { justify-content: space-between; }
  .field-label select { flex: 1; max-width: none; min-width: 0; }
  .segmented { width: 100%; }
  .game-content { padding: 18px 12px 22px; }
  .question-header { grid-template-columns: 1fr; gap: 10px; }
  .question-header h2 { font-size: 21px; }
  .destination-badge { justify-self: start; min-width: 0; text-align: left; }
  .destination-badge strong, .destination-badge span { display: inline; }
  .destination-badge span { margin-left: 5px; }
  .band-badge { justify-self: start; min-width: 0; text-align: left; }
  .band-badge strong, .band-badge span { display: inline; }
  .band-badge span { margin-left: 5px; }
  .tiles { grid-template-columns: 1fr; }
  .axis { height: 34px; margin-right: 0; }
  .build-row { grid-template-columns: minmax(0, 1fr) 108px; gap: 7px; }
  .drop-slot { padding: 6px; font-size: 11px; }
  .answer-comparison { grid-template-columns: 1fr; }
  .build-result.is-wrong { padding: 11px; }
  .map-frame { width: 100%; }
  .map-rim-label { font-size: 19px; }
  .control-console { padding: 14px; }
  .dial-wrap { width: 184px; height: 184px; }
  .direction-controls { grid-template-columns: 54px minmax(0, 1fr) 54px; }
  .game-actions { align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
  .action-note { margin: 0; text-align: center; }
  .coverage { align-items: stretch; flex-direction: column; gap: 14px; }
  .coverage-meter { width: 100%; }
  .coverage-value { justify-content: flex-start; }
  .app-footer { flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}