:root {
  color-scheme: light;
  --ink: #0b1b36;
  --muted: #52657b;
  --paper: #f4f7fb;
  --panel: #ffffff;
  --line: #cdd8e6;
  --red: #c8102e;
  --blue: #00549f;
  --navy: #012169;
  --navy-deep: #061a3a;
  --green: #17855c;
  --gold: #c78b24;
  --aqua: #dcecf5;
  --ice: #e8f0f8;
  --shadow: 0 20px 60px rgba(1, 33, 105, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

[id] {
  scroll-margin-top: 72px;
}

body {
  margin: 0;
  min-width: 0;
  width: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html.dialog-open,
body.dialog-open {
  overflow: hidden;
  overscroll-behavior: none;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 100;
  transform: translateY(-180%);
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  font-weight: 900;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.noscript-message {
  margin: 0;
  background: #fff3cd;
  color: #5f4600;
  padding: 12px 20px;
  text-align: center;
  font-weight: 800;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 247, 251, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.site-header::after {
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--navy) 0 57%, #ffffff 57% 60%, var(--red) 60% 100%);
  content: "";
}

.topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand > span:last-child {
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  font-weight: 900;
  overflow: hidden;
}

.brand-mark svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 37px;
  height: 39px;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.brand-map-shape {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 26;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand small {
  display: block;
  max-width: 330px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.top-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.top-links a,
.top-link-button {
  border: 0;
  background: transparent;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  font-weight: 700;
}

.top-links a:hover,
.top-link-button:hover {
  background: var(--ice);
  color: var(--ink);
}

.hero-band,
.map-band,
.gazetteer-band {
  padding: 48px 20px;
}

.hero-band {
  padding-block: 24px 30px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 48%, #0d3e7f 100%);
  color: #ffffff;
}

.hero-band::before {
  position: absolute;
  z-index: -1;
  inset: -32%;
  background:
    linear-gradient(32deg, transparent 42%, rgba(255, 255, 255, 0.1) 42% 46%, transparent 46%),
    linear-gradient(-32deg, transparent 56%, rgba(200, 16, 46, 0.2) 56% 59%, rgba(255, 255, 255, 0.09) 59% 62%, transparent 62%);
  content: "";
  transform: rotate(-2deg);
}

.hero-band::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--red) 0 31%, #ffffff 31% 34%, var(--blue) 34% 100%);
  content: "";
}

.intro,
.section-heading,
.game-shell,
.map-layout,
.place-grid {
  max-width: 1180px;
  margin: 0 auto;
}

.intro {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.hero-band .eyebrow {
  color: #ffffff;
}

.hero-band h1 {
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
}

.hero-band .lead {
  color: #dce8f5;
}

.nation-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
}

.nation-ribbon span {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-left: 3px solid var(--red);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  padding: 6px 10px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.025em;
}

.eyebrow {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.92;
}

.lead {
  max-width: 730px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}

.game-shell {
  max-width: 920px;
}

.game-panel,
.fact-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.game-panel {
  position: relative;
}

.game-panel::before {
  position: absolute;
  top: 0;
  right: 18px;
  left: 18px;
  height: 4px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, var(--red) 0 22%, #ffffff 22% 25%, var(--blue) 25% 100%);
  content: "";
}

.game-panel {
  padding: 22px;
  color: var(--ink);
}

.panel-topline,
.panel-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-topline {
  margin: 0 0 16px;
}

.puzzle-meta,
.panel-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-topline span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #edf2f7;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.panel-tools .button {
  min-height: 30px;
}

.target-card {
  margin: 0 0 16px;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fdfdfd, #e9f4f6);
  border: 1px solid var(--line);
}

.outline-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.outline-caption .small-label {
  flex: 0 0 auto;
  margin: 0;
}

.target-outline {
  position: relative;
  width: 100%;
  height: clamp(260px, 42vw, 410px);
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f8fbfd;
  border: 1px solid #d1dce7;
  color: var(--ink);
  cursor: zoom-in;
  padding: 0;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.target-outline svg {
  width: min(88%, 720px);
  height: 88%;
  display: block;
}

.target-outline::after {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(20, 33, 61, 0.14);
  color: var(--blue);
  content: "+";
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.target-outline:hover,
.target-outline:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(29, 95, 153, 0.14);
  outline: none;
  transform: translateY(-1px);
}

.target-outline:disabled {
  cursor: default;
  transform: none;
}

.target-outline:disabled::after {
  display: none;
}

.outline-shape {
  fill: #15243f;
  stroke: #15243f;
  stroke-width: 18;
  stroke-linejoin: round;
}

.outline-source {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.small-label,
.guess-form label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.target-card h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.guess-form {
  display: grid;
  gap: 8px;
}

.guess-form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.guess-form-heading label {
  margin-bottom: 0;
}

.guess-progress {
  flex: 0 0 auto;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.guess-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.guess-row .button {
  min-height: 44px;
}

.guess-row input,
.filter-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px 13px;
  color: var(--ink);
  outline: none;
}

.input-help {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.input-help.error {
  color: var(--red);
  font-weight: 800;
}

.turn-feedback {
  margin-top: 14px;
  border: 1px solid rgba(0, 84, 159, 0.28);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: #eef6fb;
  padding: 12px;
}

.turn-feedback[hidden] {
  display: none;
}

.turn-feedback-head,
.turn-feedback-clue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.turn-feedback-kicker {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.turn-feedback-result {
  display: block;
  color: var(--navy);
  font-size: 16px;
  font-weight: 900;
}

.turn-feedback-result [aria-hidden="true"],
.journey-direction {
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-variant-emoji: text;
}

.distance-basis {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.turn-feedback-clue {
  align-items: flex-start;
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 84, 159, 0.18);
}

.turn-feedback .button {
  flex: 0 0 auto;
}

.turn-feedback-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.suggestion-list {
  display: grid;
  gap: 8px;
}

.suggestion-list:empty {
  display: none;
}

.suggestion-button {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  color: var(--ink);
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.suggestion-button:hover,
.suggestion-button:focus,
.suggestion-button.active {
  border-color: var(--blue);
  background: #eef6fb;
  outline: none;
}

.suggestion-title {
  font-size: 15px;
}

.suggestion-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.guess-row input:focus,
.filter-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 95, 153, 0.16);
}

.button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 14px;
  font-weight: 900;
  cursor: pointer;
}

.button:disabled {
  opacity: 0.52;
  cursor: default;
}

.button:hover {
  border-color: #aeb9c6;
}

.button.slim {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.button.primary {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.button:focus-visible,
.top-links a:focus-visible,
.top-link-button:focus-visible,
.brand:focus-visible,
.site-footer a:focus-visible {
  outline: 3px solid rgba(29, 95, 153, 0.42);
  outline-offset: 3px;
}

.clue-section {
  margin-top: 18px;
}

.clue-heading h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.clue-heading span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: #edf2f7;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.clue-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.clue {
  min-height: 92px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.clue.locked {
  color: #778493;
  background: repeating-linear-gradient(135deg, #fbfcfe, #fbfcfe 8px, #f1f5f9 8px, #f1f5f9 16px);
}

.clue strong {
  display: block;
  margin-bottom: 6px;
}

.actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.empty {
  color: var(--muted);
}

.meter {
  margin-top: 10px;
  height: 8px;
  background: #e7edf3;
  border-radius: 999px;
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--red);
}

.meter span.warm {
  background: var(--gold);
}

.meter span.near,
.meter span.correct {
  background: var(--green);
}

.result-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(23, 133, 92, 0.38);
  border-radius: 8px;
  background: #f1faf6;
}

.result-panel[hidden] {
  display: none;
}

.result-panel h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.result-panel p {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.result-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.result-nav[hidden] {
  display: none;
}

.bonus-nav {
  margin: 12px 0 0;
}

.result-nav .primary {
  flex: 1 1 180px;
}

.result-route-prompt p {
  margin-bottom: 0;
}

.game-panel[data-result-stage="reveal"] > :is(.target-card, .panel-topline, .guess-form, .turn-feedback, .clue-section, .actions),
.game-panel[data-result-stage="bonus"] > :is(.target-card, .panel-topline, .guess-form, .turn-feedback, .game-map, .clue-section, .actions),
.game-panel[data-result-stage="complete"] > :is(.target-card, .panel-topline, .guess-form, .turn-feedback, .game-map, .clue-section) {
  display: none;
}

.game-panel[data-result-stage="reveal"] .result-panel,
.game-panel[data-result-stage="bonus"] .result-panel,
.game-panel[data-result-stage="complete"] .result-panel {
  margin-top: 0;
}

.game-panel[data-result-stage="bonus"] .result-panel {
  min-height: min(680px, calc(100dvh - 120px));
}

.game-panel[data-result-stage="complete"] > .actions {
  margin-top: 12px;
}

.game-panel[data-result-stage="complete"] > .actions #shareButton {
  display: none;
}

.result-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.result-facts div {
  padding: 10px;
  border: 1px solid rgba(23, 133, 92, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.result-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.result-facts dd {
  margin: 3px 0 0;
  font-weight: 900;
}

.result-depth {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.depth-section {
  border: 1px solid rgba(23, 133, 92, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  padding: 12px;
}

.depth-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.depth-heading h3 {
  margin-bottom: 0;
  font-size: 17px;
}

.depth-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.insight-list,
.route-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.insight-list li,
.route-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  line-height: 1.35;
}

.insight-list strong,
.route-list strong {
  color: var(--ink);
  text-align: right;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.related-place {
  display: grid;
  gap: 2px;
  min-height: 58px;
  align-content: center;
  border: 1px solid rgba(29, 95, 153, 0.22);
  border-radius: 8px;
  background: #eef6fb;
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.related-place:hover,
.related-place:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(29, 95, 153, 0.14);
}

.related-place strong {
  font-size: 13px;
}

.related-place span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bonus-section {
  background: #fffdf7;
}

.bonus-intro {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.bonus-basis {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.bonus-grid {
  display: grid;
  gap: 10px;
}

.bonus-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.bonus-card.correct {
  border-color: rgba(23, 133, 92, 0.38);
  background: #f1faf6;
}

.bonus-card.wrong {
  border-color: rgba(201, 32, 54, 0.28);
  background: #fff6f7;
}

.bonus-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.bonus-card-head strong {
  font-size: 15px;
}

.bonus-card-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.bonus-card p {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 14px;
}

.bonus-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.bonus-option {
  display: grid;
  gap: 2px;
  min-height: 56px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef6fb;
  color: var(--ink);
  padding: 8px 9px;
  text-align: left;
  cursor: pointer;
}

.bonus-option:hover,
.bonus-option:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(29, 95, 153, 0.14);
}

.bonus-option:disabled {
  cursor: default;
  opacity: 0.78;
}

.bonus-option.correct {
  border-color: rgba(23, 133, 92, 0.45);
  background: #dff7eb;
}

.bonus-option.wrong {
  border-color: rgba(201, 32, 54, 0.45);
  background: #ffe5e8;
}

.bonus-option strong {
  font-size: 13px;
}

.bonus-option span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bonus-feedback {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.bonus-resolution {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
}

.bonus-resolution div {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  border-radius: 6px;
  padding: 8px 9px;
}

.bonus-resolution .response-correct,
.bonus-resolution .correct-answer {
  background: #dff7eb;
}

.bonus-resolution .response-wrong {
  background: #ffe5e8;
}

.bonus-resolution dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bonus-resolution dd {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
}

.bonus-feedback strong {
  color: var(--ink);
}

.bonus-stage-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.bonus-stage-actions .button {
  min-height: 48px;
}

.map-band {
  background: var(--ice);
  border-block: 1px solid var(--line);
}

.game-map {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ice);
}

.game-map .eyebrow {
  color: var(--red);
}

.game-map .section-heading h2 {
  margin-bottom: 0;
  font-size: 25px;
}

.game-map .map-layout {
  margin-top: 14px;
}

.game-map .fact-panel {
  display: none;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.journey-panel {
  grid-column: 2;
  grid-row: 1;
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(1, 33, 105, 0.08);
}

.journey-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.journey-head h3 {
  margin: 0;
  font-size: 23px;
}

.journey-head > span {
  border-radius: 999px;
  background: var(--navy);
  padding: 6px 9px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.journey-kicker {
  margin: 0 0 2px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.journey-intro {
  margin: 7px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.journey-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.journey-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  border: 1px solid #d7e1ec;
  border-radius: 8px;
  background: #f7fafd;
  padding: 9px;
}

.journey-meter {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 0;
}

.journey-number {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: #ffffff;
  font-size: 17px;
  font-weight: 900;
}

.journey-step.correct .journey-number {
  background: var(--red);
}

.journey-place {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.journey-place strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journey-place small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.journey-hint {
  display: grid;
  min-width: 58px;
  justify-items: center;
  color: var(--navy);
}

.journey-direction {
  font-size: 26px;
  line-height: 0.9;
}

.journey-hint span {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.journey-empty {
  border: 1px dashed #b9c8d8;
  border-radius: 8px;
  padding: 18px 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.journey-return {
  display: block;
}

.journey-return .button {
  width: 100%;
  min-height: 48px;
}

.map-panel {
  position: relative;
  grid-column: 1;
  grid-row: 1 / span 2;
  min-height: 560px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #c7d5df;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.3), transparent 52%),
    linear-gradient(180deg, #cfe4f1, #edf5fa);
  touch-action: pan-y;
}

.uk-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-area {
  fill: #f8fbf7;
  stroke: #b6c5cd;
  stroke-width: 0.72;
  vector-effect: non-scaling-stroke;
}

.map-coastline {
  fill: none;
  stroke: #78909c;
  stroke-linejoin: round;
  stroke-width: 1.7;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.map-pin {
  pointer-events: none;
}

.map-route {
  fill: none;
  stroke: var(--navy);
  stroke-dasharray: 12 9;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 7;
  vector-effect: non-scaling-stroke;
  opacity: 0.58;
}

.pin-halo {
  fill: rgba(255, 255, 255, 0.86);
  stroke: rgba(29, 95, 153, 0.24);
  stroke-width: 6;
}

.pin-core {
  fill: var(--blue);
  stroke: #fff;
  stroke-width: 4;
}

.pin-number {
  fill: #ffffff;
  font-size: 21px;
  font-weight: 900;
  dominant-baseline: central;
  text-anchor: middle;
}

.map-pin.target .pin-halo {
  stroke: rgba(201, 32, 54, 0.28);
}

.map-pin.target .pin-core {
  fill: var(--red);
}

.map-key {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.key-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-right: 5px;
}

.key-dot.guess {
  background: var(--blue);
}

.key-dot.target {
  background: var(--red);
}

.fact-panel {
  grid-column: 2;
  grid-row: 2;
  padding: 20px;
  border-top: 4px solid var(--navy);
}

.fact-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 0;
}

.stats-grid div {
  padding: 12px;
  border-radius: 8px;
  background: #f0f4f8;
}

.stats-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stats-grid dd {
  margin: 3px 0 0;
  font-size: 20px;
  font-weight: 900;
}

.nation-ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
}

.nation-ledger span {
  border-left: 3px solid var(--red);
  border-radius: 4px;
  background: var(--ice);
  padding: 7px 8px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
}

.gazetteer-band {
  background: #f9fbfd;
}

.reference-sheet {
  width: min(900px, calc(100vw - 28px));
}

.reference-sheet .sheet-body {
  gap: 12px;
}

.reference-grid {
  width: 100%;
  margin-top: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gazetteer-status {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.gazetteer-lock {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed #aebdcd;
  border-radius: 8px;
  background: #ffffff;
  padding: 26px;
  text-align: center;
}

.gazetteer-lock strong {
  display: block;
  margin-bottom: 7px;
  color: var(--navy);
  font-size: 20px;
}

.gazetteer-lock p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.place-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.place-grid.reference-grid {
  margin-top: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.place-card {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.place-card.featured {
  border-color: rgba(29, 95, 153, 0.42);
  background: #f0f7fc;
  box-shadow: 0 0 0 4px rgba(29, 95, 153, 0.1);
}

.place-card h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.place-card p {
  color: var(--muted);
  line-height: 1.55;
}

.place-card-meta {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding: 0;
}

.place-card-meta div {
  display: grid;
  gap: 2px;
}

.place-card-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.place-card-meta dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  border-radius: 999px;
  background: #edf2f7;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.site-footer {
  padding: 30px 20px 46px;
  border-top: 5px solid var(--red);
  background: var(--navy-deep);
  text-align: center;
  color: #cbd9e9;
}

.site-footer p {
  max-width: 920px;
  margin: 0 auto;
  line-height: 1.55;
}

.site-footer p + p {
  margin-top: 8px;
}

.site-footer a {
  color: #ffffff;
  font-weight: 800;
}

.footer-small {
  font-size: 12px;
}

.legal-page {
  padding: clamp(28px, 6vw, 64px) 20px;
}

.legal-card {
  max-width: 860px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-top: 6px solid var(--red);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 52px);
}

.legal-card h1 {
  margin: 4px 0 8px;
  font-size: clamp(38px, 8vw, 64px);
  line-height: 1;
}

.legal-card h2 {
  margin: 34px 0 10px;
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1.15;
}

.legal-card h3 {
  margin: 22px 0 6px;
  font-size: 19px;
}

.legal-card p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.legal-card p + p {
  margin-top: 12px;
}

.legal-card a:not(.button) {
  color: var(--navy);
  font-weight: 800;
}

.legal-updated {
  margin-bottom: 20px !important;
  font-size: 14px !important;
  font-weight: 800;
}

.legal-return {
  margin-top: 36px !important;
}

.legal-return .button {
  display: inline-block;
  text-decoration: none;
}

@media (max-width: 420px) {
  .legal-page {
    padding-inline: 12px;
  }

  .legal-card {
    padding-inline: 20px;
  }
}

.error-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.error-page > div {
  max-width: 680px;
}

.error-page h1 {
  font-size: clamp(42px, 9vw, 82px);
  line-height: 0.98;
}

.error-page p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
}

.error-page-link {
  display: inline-block;
  text-decoration: none;
}

.modal-sheet {
  width: min(560px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  max-height: min(760px, calc(100dvh - 28px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(20, 33, 61, 0.28);
  padding: 0;
}

.modal-sheet::backdrop {
  background: rgba(20, 33, 61, 0.38);
  backdrop-filter: blur(6px);
}

.outline-sheet {
  width: min(780px, calc(100vw - 24px));
}

.outline-dialog-body {
  display: grid;
  min-height: min(68dvh, 620px);
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.outline-dialog-body svg {
  display: block;
  width: min(72vw, 580px);
  height: min(72vw, 580px);
  max-height: min(60dvh, 580px);
}

.outline-dialog-body .outline-shape {
  stroke-width: 10;
}

.outline-dialog-source {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.sheet-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.sheet-head h2 {
  margin-bottom: 0;
  font-size: 26px;
}

.sheet-body {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 18px;
  padding: 16px;
}

.rule-list {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.55;
}

.rule-list li + li {
  margin-top: 8px;
}

.taxonomy-note {
  padding: 14px;
  border-radius: 8px;
  background: #f3f7fb;
  border: 1px solid var(--line);
}

.taxonomy-note h3,
.distribution h3,
.archive-panel h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.taxonomy-note p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.stat-summary {
  display: grid;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.distribution,
.archive-panel {
  min-width: 0;
  max-width: 100%;
}

.stat-summary div {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  text-align: center;
}

.stat-summary strong {
  font-size: 24px;
}

.stat-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.distribution-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.distribution-row > span,
.distribution-row > strong {
  font-weight: 900;
}

.distribution-bar {
  height: 24px;
  overflow: hidden;
  border-radius: 6px;
  background: #e8eef5;
}

.distribution-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.archive-list {
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.archive-button {
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .map-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .journey-panel,
  .map-panel,
  .fact-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .place-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .site-header {
    background: var(--paper);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .section-heading,
  .panel-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    padding: 7px 12px;
    gap: 10px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .brand-mark svg {
    width: 37px;
    height: 39px;
  }

  .brand strong {
    font-size: 18px;
  }

  .lead {
    display: none;
  }

  .brand small {
    display: block;
    max-width: 250px;
    font-size: 12px;
    line-height: 1.2;
  }

  h1 {
    font-size: 38px;
  }

  .top-links {
    display: none;
  }

  .map-band,
  .gazetteer-band {
    padding: 24px 14px;
  }

  .game-map {
    padding: 12px;
  }

  .hero-band {
    padding: 9px 8px 18px;
  }

  .intro {
    gap: 4px;
    margin-bottom: 10px;
  }

  .hero-band .eyebrow {
    font-size: 12px;
    letter-spacing: 0.055em;
    line-height: 1.35;
  }

  .nation-ribbon {
    display: none;
  }

  .panel-tools {
    width: 100%;
  }

  .puzzle-meta {
    width: 100%;
  }

  .panel-tools .button,
  .panel-tools span {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 44px;
  }

  .fact-panel {
    padding: 14px;
  }

  .game-panel {
    padding: 10px;
  }

  .clue-grid,
  .result-facts,
  .place-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .guess-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .stat-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-panel {
    min-height: 430px;
  }

  .journey-panel {
    padding: 14px;
  }

  .journey-step {
    min-height: 68px;
  }

  .target-card {
    gap: 7px;
    margin: 0 -4px 12px;
    padding: 6px;
  }

  .target-outline {
    width: 100%;
    height: clamp(170px, 53vw, 230px);
  }

  .target-outline svg {
    width: 92%;
    height: 90%;
  }

  .target-card h2 {
    font-size: 18px;
  }

  .target-card .outline-source {
    display: none;
  }

  .outline-caption {
    align-items: center;
  }

  .turn-feedback-head,
  .turn-feedback-clue {
    align-items: flex-start;
    flex-direction: column;
  }

  .turn-feedback-actions,
  .turn-feedback .button {
    width: 100%;
  }

  .turn-feedback-actions {
    flex-direction: column;
  }

  .result-nav .button {
    flex: 1 1 140px;
    min-height: 44px;
  }

  .bonus-stage-actions,
  .bonus-stage-actions .button {
    width: 100%;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .bonus-options {
    grid-template-columns: 1fr;
  }

  .insight-list li,
  .route-list li {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .insight-list strong,
  .route-list strong {
    text-align: left;
  }

  .modal-sheet {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: 88dvh;
    margin: 0;
    border-radius: 16px 16px 0 0;
    border-inline: 0;
    border-bottom: 0;
  }

  .place-grid.reference-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sheet-head,
  .sheet-body {
    padding: 14px;
  }
}

/* Safari page zoom reduces the effective CSS viewport below normal phone widths.
   Keep the complete game usable at 200% rather than preserving a desktop-like row. */
@media (max-width: 280px) {
  .topbar {
    padding-inline: 8px;
  }

  .brand small {
    max-width: none;
    overflow-wrap: anywhere;
  }

  .hero-band {
    padding-inline: 4px;
  }

  .game-panel {
    padding: 7px;
  }

  .target-card {
    padding: 4px;
  }

  .outline-caption,
  .guess-form-heading,
  .depth-heading,
  .bonus-card-head,
  .journey-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .outline-caption {
    gap: 2px;
  }

  .guess-row,
  .actions,
  .stat-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .guess-row .button {
    width: 100%;
  }

  .result-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .journey-step {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px;
  }

  .journey-number {
    width: 36px;
    height: 36px;
  }

  .journey-hint {
    grid-column: 2;
    min-width: 0;
    grid-auto-flow: column;
    justify-content: start;
    justify-items: start;
    gap: 7px;
  }

  .journey-hint span {
    margin-top: 0;
    white-space: normal;
  }

  .journey-place strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .sheet-head,
  .sheet-body {
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
