:root {
  --cw-navy: var(--ds-primary-dark, #203f53);
  --cw-blue: var(--ds-primary, #315d74);
  --cw-gold: var(--ds-accent, #a47b4c);
  --cw-cream: var(--ds-bg, #f4efe4);
  --cw-paper: var(--ds-surface, #fbf8f1);
  --cw-line: var(--ds-line, #d9d0c1);
  --cw-text: var(--ds-text, #26343d);
  --cw-muted: var(--ds-muted, #67737a);
  --cw-green: #587760;
  --cw-red: #a45d57;
}

* { box-sizing: border-box; }
body.cold-war-page {
  min-height: 100vh;
  margin: 0;
  color: var(--cw-text);
  font-family: var(--ds-font-body, Georgia, serif);
  background:
    radial-gradient(circle at 8% 0%, rgba(164, 123, 76, .13), transparent 28%),
    radial-gradient(circle at 92% 2%, rgba(49, 93, 116, .10), transparent 25%),
    linear-gradient(180deg, var(--cw-cream), #ece5d8);
}

.cold-war-shell { width: min(1660px, calc(100% - 32px)); margin: 0 auto; padding: 16px 0 40px; }
.global-nav { margin-bottom: 14px; }
.pilot-badge { display: inline-flex; padding: 8px 13px; border: 1px solid var(--cw-line); border-radius: 999px; color: var(--cw-muted); font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }

.map-panel, .story-panel {
  border: 1px solid rgba(83, 91, 93, .16);
  border-radius: var(--ds-radius-lg, 22px);
  background: rgba(251, 248, 241, .94);
  box-shadow: var(--ds-shadow-md, 0 14px 34px rgba(47, 54, 57, .09));
}
.cold-war-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 92px; margin-bottom: 14px; padding: 14px clamp(20px, 2.2vw, 30px); border: 1px solid rgba(83, 91, 93, .16); border-radius: var(--ds-radius-lg, 22px); background: rgba(251, 248, 241, .94); box-shadow: var(--ds-shadow-md, 0 14px 34px rgba(47, 54, 57, .09)); }
h1, h2, h3 { margin: 0; color: var(--cw-navy); font-family: var(--ds-font-display, Georgia, serif); }
h1 { font-size: clamp(2rem, 3vw, 3rem); line-height: .98; letter-spacing: -.025em; }
.hero-eyebrow { margin: 0 0 6px; color: var(--cw-blue); font-size: .73rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.cold-war-hero > div > p:last-child { max-width: 67ch; margin: 5px 0 0; color: var(--cw-muted); font-size: clamp(.9rem, 1vw, 1rem); line-height: 1.38; }
.difficulty-switch { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 4px; padding: 4px; border: 1px solid rgba(49, 93, 116, .18); border-radius: 14px; background: rgba(25, 78, 120, .06); }
.difficulty-button { min-height: 38px; padding: 8px 11px; border: 0; border-radius: 9px; color: var(--cw-blue); background: transparent; font: inherit; font-size: .78rem; font-weight: 850; cursor: pointer; }
.difficulty-button.is-active { color: #fff; background: var(--cw-navy); }
.difficulty-button:focus-visible { outline: 3px solid rgba(164, 123, 76, .72); outline-offset: 2px; }

.overview-view { padding: clamp(22px, 3vw, 38px); border: 1px solid rgba(83, 91, 93, .16); border-radius: var(--ds-radius-lg, 22px); background: rgba(251, 248, 241, .94); box-shadow: var(--ds-shadow-md, 0 14px 34px rgba(47, 54, 57, .09)); }
.overview-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.overview-heading h2 { font-size: clamp(2rem, 3vw, 3rem); line-height: 1; }
.overview-heading p { max-width: 66ch; margin: 8px 0 0; color: var(--cw-muted); font-size: .94rem; line-height: 1.5; }
.secondary-button { min-height: 42px; padding: 9px 14px; border: 1px solid rgba(49, 93, 116, .25); border-radius: 11px; color: var(--cw-navy); background: #fff; font: inherit; font-weight: 850; cursor: pointer; white-space: nowrap; }
.secondary-button:hover { transform: translateY(-1px); }
.timeline-list { position: relative; display: grid; gap: 10px; max-width: 1060px; margin: 0 auto; padding: 5px 0 5px 90px; }
.timeline-list::before { position: absolute; top: 0; bottom: 0; left: 34px; width: 2px; background: rgba(164, 123, 76, .48); content: ""; }
.timeline-event { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 16px; width: 100%; align-items: center; padding: 15px 17px; border: 1px solid var(--cw-line); border-radius: 15px; color: var(--cw-text); background: rgba(255, 255, 255, .76); box-shadow: 0 5px 13px rgba(35, 49, 61, .05); font: inherit; text-align: left; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.timeline-event::before { position: absolute; top: 50%; left: -65px; width: 15px; height: 15px; border: 4px solid #fbf8f1; border-radius: 50%; background: var(--cw-gold); box-shadow: 0 0 0 2px rgba(164, 123, 76, .45); content: ""; transform: translateY(-50%); }
.timeline-event:hover, .timeline-event:focus-visible { border-color: rgba(49, 93, 116, .48); box-shadow: 0 10px 22px rgba(35, 49, 61, .11); outline: none; transform: translateY(-2px); }
.timeline-period { color: var(--cw-blue); font-size: .78rem; font-weight: 950; letter-spacing: .045em; }
.timeline-copy { display: grid; gap: 4px; min-width: 0; }
.timeline-copy strong { color: var(--cw-navy); font-family: var(--ds-font-display, Georgia, serif); font-size: 1.28rem; line-height: 1.05; }
.timeline-copy small { color: var(--cw-muted); font-size: .77rem; font-weight: 750; }
.timeline-detail { color: var(--cw-gold); font-size: .72rem; font-weight: 900; white-space: nowrap; }
.event-dialog { width: min(930px, calc(100% - 28px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto; border: 0; border-radius: 22px; background: var(--cw-paper); color: var(--cw-text); box-shadow: 0 28px 80px rgba(22, 34, 43, .34); }
.event-dialog::backdrop { background: rgba(27, 35, 41, .56); backdrop-filter: blur(4px); }
.event-dialog-close { position: fixed; top: max(16px, calc(50vh - 440px)); right: max(18px, calc(50vw - 465px)); z-index: 2; width: 40px; height: 40px; border: 1px solid var(--cw-line); border-radius: 50%; color: var(--cw-blue); background: rgba(255,255,255,.94); font-size: 1.6rem; cursor: pointer; box-shadow: 0 3px 8px rgba(35,49,61,.12); }
.event-dialog-card { min-height: 390px; }
.event-dialog-card.has-image { display: grid; grid-template-columns: minmax(280px, 40%) minmax(0, 1fr); }
.event-dialog-figure { min-height: 390px; margin: 0; background: #e7e0d4; }
.event-dialog-figure img { display: block; width: 100%; height: 100%; min-height: 390px; background: #e7e0d4; filter: saturate(.78) contrast(.94); }
.event-dialog-copy { padding: clamp(26px, 4vw, 43px); }
.event-dialog-copy h2 { margin: 5px 0 8px; font-size: clamp(2rem, 3vw, 2.7rem); line-height: 1; }
.event-dialog-kicker { margin: 0; color: var(--cw-blue); font-size: .78rem; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.event-dialog-place { margin: 0 0 17px; color: var(--cw-gold); font-size: .8rem; font-weight: 850; }
.event-dialog-copy > p:not(.event-dialog-kicker):not(.event-dialog-place) { color: var(--cw-muted); font-size: .94rem; line-height: 1.58; }
.event-dialog-significance { margin-top: 17px; padding: 12px 14px; border-left: 3px solid var(--cw-gold); border-radius: 10px; background: #f4ede1; }
.event-dialog-significance h3 { font-size: 1rem; }
.event-dialog-significance p { margin: 5px 0 0; color: #57666e; font-size: .88rem; line-height: 1.45; }

.game-layout { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(340px, .85fr); gap: 18px; align-items: stretch; }
.map-panel { min-width: 0; padding: 4px; }
.map-frame { display: grid; place-items: center; width: 100%; min-height: clamp(560px, calc(100vh - 300px), 720px); overflow: hidden; border: 1px solid #b9c5c9; border-radius: 17px; background: #dce9ee; }
.map-loading { color: var(--cw-muted); font-weight: 700; }
.world-map { display: block; width: 100%; height: 100%; }
.world-country { fill: #eee8db; stroke: #7d8c91; stroke-width: .75; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill 160ms ease, stroke 160ms ease, filter 160ms ease; }
.world-country:hover { fill: #e1d4bd; stroke: var(--cw-blue); }
.world-country:focus-visible { outline: none; stroke: #173f5b; stroke-width: 3; filter: drop-shadow(0 0 4px rgba(255,255,255,.95)); }
.world-country.is-wrong { fill: var(--cw-red); animation: wrong-flash 520ms ease; }
.world-country.is-correct { fill: #79937d; stroke: #365b43; stroke-width: 1.8; }
.world-country.is-historical-peer { fill: #96a99a; stroke: #496b53; stroke-width: 1.3; }
.historical-marker { fill: var(--cw-gold); stroke: #fffaf0; stroke-width: 2; opacity: 0; pointer-events: none; }
.historical-marker.is-visible { opacity: 1; }

/* Source SVG uses its own inline paint. These rules keep the historical
   1980s borders while preserving the visual feedback of the activity. */
.historical-world-map .landxx,
.historical-world-map .landxx * {
  fill: #eee8db !important;
  stroke: #7d8c91 !important;
  stroke-width: .75 !important;
  vector-effect: non-scaling-stroke;
}
.historical-world-map .world-country,
.historical-world-map .world-country * {
  fill: #eee8db !important;
  stroke: #7d8c91 !important;
  stroke-width: .75 !important;
  vector-effect: non-scaling-stroke;
}
.historical-world-map .world-country:hover,
.historical-world-map .world-country:hover * { fill: #e1d4bd !important; stroke: var(--cw-blue) !important; }
.historical-world-map .world-country.is-wrong,
.historical-world-map .world-country.is-wrong * { fill: var(--cw-red) !important; }
.historical-world-map .world-country.is-correct,
.historical-world-map .world-country.is-correct * { fill: #79937d !important; stroke: #365b43 !important; stroke-width: 1.8 !important; }
.historical-world-map .world-country.is-historical-peer,
.historical-world-map .world-country.is-historical-peer * { fill: #96a99a !important; stroke: #496b53 !important; stroke-width: 1.3 !important; }
.historical-world-map .world-country.is-basic-candidate,
.historical-world-map .world-country.is-basic-candidate * { fill: #c3ad86 !important; stroke: #80643e !important; stroke-width: 1.05 !important; }
.historical-world-map .world-country.is-correct,
.historical-world-map .world-country.is-correct * { fill: #79937d !important; stroke: #365b43 !important; stroke-width: 1.8 !important; }
body[data-difficulty="basic"] .historical-world-map .world-country:not(.is-basic-candidate) { cursor: default; pointer-events: none; }

.story-panel { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; min-height: clamp(560px, calc(100vh - 300px), 720px); padding: clamp(18px, 1.45vw, 22px); overflow: hidden; }
.status-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding-bottom: 11px; border-bottom: 1px solid var(--cw-line); color: var(--cw-muted); font-size: clamp(.64rem, .7vw, .72rem); font-weight: 900; letter-spacing: .055em; text-transform: uppercase; }
.status-row strong { color: var(--cw-navy); font-weight: 950; }
.panel-content { min-height: 0; padding-top: clamp(16px, 1.6vw, 23px); }
.panel-content h2 { font-size: clamp(1.3rem, 1.55vw, 1.65rem); line-height: 1.08; }
.question-kicker { margin: 0 0 12px; color: var(--cw-muted); font-size: .78rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.question-title { max-width: 19ch; margin: 0 0 14px; font-size: clamp(1.55rem, 2vw, 2.08rem) !important; line-height: 1.05 !important; }
.event-prompt { max-width: 44ch; margin: 0; font-size: clamp(1rem, 1.05vw, 1.12rem); font-weight: 500; line-height: 1.58; }
.feedback { margin: 15px 0 0; color: #8e4945; font-size: .92rem; font-weight: 800; }
.hint-figure { margin: 16px 0 0; }
.hint-label { display: inline-block; margin-bottom: 7px; color: var(--cw-gold); font-size: .7rem; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.event-image { display: block; width: 100%; aspect-ratio: var(--image-aspect, 3 / 2); border-radius: 12px; object-fit: var(--image-fit, cover); object-position: var(--image-position, 50% 50%); background: #e7e0d4; filter: saturate(.76) contrast(.94); }
.hint-figure .event-image { max-height: 225px; }
.hint-figure figcaption, .result-figure figcaption { margin-top: 7px; color: var(--cw-muted); font-size: .78rem; line-height: 1.35; }
.hint-placeholder { margin-top: 16px; padding: 15px; border: 1px dashed var(--cw-line); border-radius: 12px; background: rgba(238, 230, 215, .42); }
.hint-placeholder p { margin: 2px 0 0; color: var(--cw-muted); font-size: .88rem; line-height: 1.45; }
.text-hint { margin: 13px 0 0; padding-left: 11px; border-left: 3px solid var(--cw-gold); color: var(--cw-navy); font-size: .9rem; line-height: 1.45; }
.panel-footer { align-self: end; padding-top: 14px; }
.map-instruction { margin: 0; color: var(--cw-muted); font-size: .88rem; font-weight: 750; }
.result-card h2 { margin-top: 7px; }
.result-status { margin: 0; color: var(--cw-green); font-size: .74rem; font-weight: 950; letter-spacing: .09em; text-transform: uppercase; }
.event-meta { justify-content: flex-start; flex-wrap: wrap; }
.event-meta { display: flex; gap: 7px; margin-top: 9px; color: var(--cw-muted); font-size: .7rem; font-weight: 900; letter-spacing: .045em; text-transform: uppercase; }
.event-meta span { padding: 6px 9px; border-radius: 999px; background: #eee6d7; }
.result-summary { margin: 11px 0 0; font-size: .9rem; line-height: 1.43; }
.significance { margin-top: 10px; padding: 9px 11px; border-left: 3px solid var(--cw-gold); border-radius: 10px; background: #f4ede1; }
.significance h3 { font-size: 1rem; }
.significance p { margin: 5px 0 0; font-size: .84rem; line-height: 1.36; }
.result-figure { margin: 10px 0 0; }
.result-figure .event-image { max-height: 230px; border-radius: 10px; filter: saturate(.78) contrast(.94); }
#activeResultTitle:focus { outline: none; }
.primary-button { width: 100%; min-height: 44px; margin-top: 8px; padding: 9px 18px; border: 0; border-radius: 12px; color: #fff; background: var(--cw-navy); font: inherit; font-weight: 900; cursor: pointer; }
.primary-button:hover { background: var(--cw-blue); }
.primary-button:focus-visible { outline: 3px solid rgba(164, 123, 76, .8); outline-offset: 3px; }
.result-kicker { color: var(--cw-gold); font-size: .78rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.finished-card { display: grid; align-content: center; height: 100%; text-align: center; }
.finished-card p:not(.result-kicker) { line-height: 1.55; }
.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; }

@keyframes wrong-flash { 0%,100% { fill: #eee8db; } 35%,70% { fill: var(--cw-red); } }
@media (prefers-reduced-motion: reduce) { .world-country { transition: none; } .world-country.is-wrong { animation: none; fill: var(--cw-red); } }

@media (max-width: 900px) {
  .game-layout { grid-template-columns: 1fr; }
  body[data-game-state="question"] .story-panel,
  body[data-game-state="imageHint"] .story-panel,
  body[data-game-state="textHint"] .story-panel { grid-row: 1; }
  body[data-game-state="question"] .map-panel,
  body[data-game-state="imageHint"] .map-panel,
  body[data-game-state="textHint"] .map-panel { grid-row: 2; }
  body[data-game-state="result"] .map-panel,
  body[data-game-state="finished"] .map-panel { grid-row: 1; }
  body[data-game-state="result"] .story-panel,
  body[data-game-state="finished"] .story-panel { grid-row: 2; }
  .map-frame { min-height: 0; height: auto; aspect-ratio: 1.95 / 1; }
  .story-panel { min-height: 0; }
  .hint-figure img { max-height: 320px; }
  .event-dialog-card.has-image { grid-template-columns: 1fr; }
  .event-dialog-figure, .event-dialog-figure img { min-height: 0; height: 280px; }
}
@media (max-width: 620px) {
  .cold-war-shell { width: min(100% - 16px, 1560px); padding-top: 12px; }
  .cold-war-hero { display: block; min-height: 0; margin-bottom: 10px; padding: 15px 18px; border-radius: 16px; }
  .difficulty-switch { width: 100%; margin-top: 12px; justify-content: flex-start; }
  .overview-view { padding: 20px 17px; border-radius: 16px; }
  .overview-heading { display: block; margin-bottom: 18px; }
  .overview-heading .secondary-button { margin-top: 14px; }
  .timeline-list { padding-left: 49px; }
  .timeline-list::before { left: 18px; }
  .timeline-event { grid-template-columns: 1fr; gap: 6px; padding: 14px; }
  .timeline-event::before { left: -39px; }
  .timeline-detail { display: none; }
  .event-dialog-copy { padding: 26px 22px; }
  .event-dialog-close { top: 14px; right: 14px; }
  h1 { font-size: clamp(1.5rem, 7vw, 2rem); }
  .game-layout { gap: 10px; }
  .story-panel, .map-panel { border-radius: 15px; }
  .story-panel { padding: 16px; }
  .status-row { justify-content: flex-start; }
  .event-prompt { font-size: 1rem; line-height: 1.55; }
  .map-frame { aspect-ratio: 1.72 / 1; }
  .result-figure .event-image { max-height: 240px; }
}
