:root {
  --paper: #f7f3e8;
  --paper-strong: #fffdf6;
  --ink: #14232b;
  --ink-soft: #425563;
  --blue: #173f58;
  --green: #2f7d5c;
  --red: #c74437;
  --gold: #d49b39;
  --line: rgba(20, 35, 43, 0.14);
  --shadow: 0 18px 40px rgba(30, 37, 34, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background:
    linear-gradient(rgba(20, 35, 43, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 35, 43, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Trebuchet MS", Verdana, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 246, 0.88);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 8px 24px rgba(20, 35, 43, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background:
    radial-gradient(circle at 52% 43%, var(--green) 0 23%, transparent 24%),
    linear-gradient(135deg, transparent 0 43%, var(--red) 44% 54%, transparent 55%),
    var(--paper-strong);
  box-shadow: inset 0 0 0 4px rgba(212, 155, 57, 0.22);
}

.mode-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.mode-pill,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  background: #ffffff;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.mode-pill:hover,
.ghost-link:hover {
  border-color: rgba(23, 63, 88, 0.44);
  color: var(--blue);
}

.mode-pill.is-active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.game-grid,
.quiz-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(360px, 1.8fr) minmax(220px, 0.9fr);
  gap: 18px;
  align-items: stretch;
  padding-top: 18px;
}

.quiz-grid {
  grid-template-columns: minmax(360px, 1.8fr) minmax(240px, 0.8fr);
}

.challenge-panel,
.board-panel,
.result-panel,
.quiz-stage,
.seo-card,
.related-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 246, 0.94);
  box-shadow: var(--shadow);
}

.challenge-panel,
.result-panel {
  padding: 20px;
}

.board-panel,
.quiz-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.kicker {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.08;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.6rem);
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2.35rem);
}

h3 {
  font-size: 1.2rem;
}

.challenge-panel p,
.result-panel p {
  color: var(--ink-soft);
}

.target-card {
  display: grid;
  gap: 2px;
  margin: 22px 0;
  padding: 14px;
  border: 1px solid rgba(47, 125, 92, 0.28);
  border-radius: var(--radius);
  background: rgba(47, 125, 92, 0.08);
}

.target-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
}

.target-card span {
  color: var(--ink-soft);
}

.daily-challenge-button {
  width: 100%;
  min-height: 42px;
  margin: -10px 0 18px;
  border: 1px solid rgba(212, 155, 57, 0.54);
  border-radius: var(--radius);
  background: rgba(212, 155, 57, 0.12);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.daily-challenge-button:hover,
.daily-challenge-button.is-active {
  border-color: var(--gold);
  background: var(--gold);
  color: #14232b;
}

.target-label {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.target-search {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.target-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.target-search input:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(23, 63, 88, 0.18);
  outline-offset: 1px;
}

.challenge-count {
  margin: 8px 0 10px;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.mini-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: 302px;
  overflow: auto;
  padding-right: 3px;
}

.mini-list button,
.tool-row button,
.answer-grid button,
.share-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.mini-list button {
  min-height: 38px;
  padding: 8px 10px;
  text-align: left;
}

.mini-list button:hover,
.mini-list button.is-selected {
  border-color: rgba(199, 68, 55, 0.6);
  background: rgba(199, 68, 55, 0.08);
}

.empty-search {
  margin: 0;
  padding: 10px 0;
  font-size: 0.9rem;
}

.board-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
}

.score-chip {
  min-width: 112px;
  border: 1px solid rgba(212, 155, 57, 0.42);
  border-radius: var(--radius);
  background: rgba(212, 155, 57, 0.13);
  padding: 8px 10px;
  color: var(--ink);
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.draw-board,
.silhouette-card {
  position: relative;
  width: calc(100% - 40px);
  max-width: 920px;
  margin: 0 auto;
  border: 2px solid rgba(20, 35, 43, 0.8);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(23, 63, 88, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 63, 88, 0.08) 1px, transparent 1px),
    #f8fbf8;
  background-size: 28px 28px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.draw-board::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px dashed rgba(20, 35, 43, 0.24);
  pointer-events: none;
}

.target-svg,
#draw-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.target-svg {
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.target-svg path {
  fill: rgba(47, 125, 92, 0.12);
  stroke: var(--green);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.draw-board.has-result .target-svg {
  opacity: 1;
}

.draw-board.has-result #draw-canvas {
  cursor: default;
  pointer-events: none;
}

#draw-canvas {
  touch-action: none;
  cursor: crosshair;
}

.board-message {
  min-height: 24px;
  margin: 10px 20px 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 20px 20px;
}

.tool-row button,
.share-button,
.ghost-link {
  min-height: 42px;
  padding: 9px 14px;
}

.primary-action,
.share-button {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #ffffff !important;
}

.tool-row button:hover,
.share-button:hover,
.answer-grid button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(20, 35, 43, 0.12);
}

.tool-row button:disabled,
.share-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.score-breakdown {
  display: grid;
  gap: 12px;
  margin: 18px 0 22px;
}

.score-detail {
  display: grid;
  gap: 6px;
}

.score-detail > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.score-detail strong {
  color: var(--ink);
}

.score-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(20, 35, 43, 0.1);
}

.score-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.metric-stack {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.metric-stack div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.metric-stack span {
  color: var(--ink-soft);
}

.silhouette-card {
  display: grid;
  place-items: center;
  width: calc(100% - 40px);
  max-height: 64svh;
}

.silhouette-card svg {
  width: 80%;
  height: 80%;
}

.silhouette-card path {
  fill: var(--ink);
  stroke: var(--ink);
  stroke-width: 2;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 20px 0;
}

.answer-grid button {
  min-height: 56px;
  padding: 10px;
  font-size: 1rem;
}

.answer-grid button.is-correct {
  background: rgba(47, 125, 92, 0.12);
  border-color: var(--green);
}

.answer-grid button.is-wrong {
  background: rgba(199, 68, 55, 0.12);
  border-color: var(--red);
}

.seo-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 18px 72px;
}

.seo-card {
  padding: clamp(22px, 4vw, 44px);
}

.seo-card h1 {
  font-size: clamp(2rem, 5vw, 4.8rem);
  max-width: 920px;
}

.seo-card p,
.seo-card li {
  color: var(--ink-soft);
  font-size: 1.03rem;
}

.seo-lead {
  max-width: 820px;
  margin: 18px 0 0;
  font-size: 1.14rem !important;
}

.content-section {
  max-width: 860px;
  margin-top: 38px;
}

.content-section h2,
.faq-section h2,
.link-directory h2 {
  font-size: clamp(1.55rem, 3vw, 2.4rem);
}

.content-section p {
  margin: 12px 0 0;
}

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

.step-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding-left: 24px;
}

.step-list strong {
  color: var(--ink);
}

.faq-section {
  margin-top: 44px;
  border-top: 1px solid var(--line);
  padding-top: 32px;
}

.faq-list {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
}

.faq-list summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.faq-list p {
  margin: 10px 0 0;
}

.seo-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 28px;
}

.link-directory {
  margin-top: 18px;
  border-block: 1px solid var(--line);
  padding: 30px 4px;
}

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

.directory-links a {
  padding: 7px 0;
  color: var(--blue);
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.directory-links a:hover {
  color: var(--green);
}

.related-panel {
  margin-top: 18px;
  padding: 22px;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.related-links a {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 8px 12px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.related-links a:hover {
  border-color: var(--green);
  color: var(--green);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px 18px;
  color: var(--ink-soft);
  text-align: center;
}

.site-footer a,
.privacy-page a {
  color: var(--blue);
  font-weight: 800;
}

.footer-links {
  display: inline-flex;
  gap: 14px;
  margin-left: 12px;
}

.footer-privacy-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
}

.privacy-page {
  width: min(760px, calc(100% - 36px));
  margin: 48px auto 80px;
}

.privacy-page header {
  margin-bottom: 32px;
}

.privacy-page section {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.privacy-page p,
.privacy-page li {
  color: var(--ink-soft);
}

.privacy-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.privacy-controls button,
.consent-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 14px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.consent-panel {
  position: fixed;
  z-index: 30;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 920px;
  margin: 0 auto;
  border: 1px solid rgba(20, 35, 43, 0.28);
  border-radius: var(--radius);
  padding: 16px;
  background: #fffdf6;
  box-shadow: 0 18px 48px rgba(20, 35, 43, 0.24);
}

.consent-panel strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.consent-panel p {
  max-width: 620px;
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

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

.consent-actions .consent-accept {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.map-game-loading,
.map-game-error {
  display: grid;
  min-height: 72svh;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
}

.map-game-prerender {
  min-height: 100svh;
}

.prerender-map {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 28px;
  background: #dce4df;
  color: var(--ink-soft);
  text-align: center;
}

.prerender-map strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.prerender-map p {
  max-width: 46ch;
  margin: 0;
  font-size: 0.88rem;
}

.map-game-prerender button:disabled,
.map-game-prerender select:disabled {
  cursor: wait;
}

.map-loading-mark {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(20, 35, 43, 0.16);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: map-spin 800ms linear infinite;
}

@keyframes map-spin {
  to {
    transform: rotate(360deg);
  }
}

.map-game-error button {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  padding: 9px 16px;
  background: var(--blue);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
}

.map-game-shell {
  min-height: 100svh;
  background: #eef1ed;
  color: var(--ink);
}

.map-game-header {
  position: relative;
  z-index: 12;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  min-height: 66px;
  border-bottom: 1px solid rgba(20, 35, 43, 0.18);
  padding: 10px 18px;
  background: #fffdf6;
  box-shadow: 0 8px 22px rgba(20, 35, 43, 0.08);
}

.map-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.map-brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 45%, var(--red) 45% 55%, transparent 55%),
    linear-gradient(0deg, transparent 45%, var(--green) 45% 55%, transparent 55%),
    #fffdf6;
}

.region-tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.region-tabs button,
.mode-segment button,
.map-toolbox button,
.primary-controls button,
.challenge-switcher button {
  min-height: 40px;
  border: 1px solid rgba(20, 35, 43, 0.16);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.region-tabs button {
  padding: 7px 14px;
  white-space: nowrap;
}

.region-tabs button:hover,
.region-tabs button.is-active,
.mode-segment button.is-active,
.map-toolbox button.is-active,
.challenge-switcher > button.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.map-game-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  min-height: calc(100svh - 66px);
}

.map-stage {
  position: relative;
  align-self: start;
  height: calc(100svh - 66px);
  min-width: 0;
  min-height: 640px;
  overflow: hidden;
  background: #dce4df;
}

#country-map,
.map-drawing-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#country-map {
  z-index: 1;
}

.map-drawing-canvas {
  z-index: 4;
  touch-action: none;
}

.map-result-overlay {
  position: absolute;
  z-index: 9;
  right: 50%;
  bottom: 28px;
  width: min(760px, calc(100% - 48px));
  transform: translateX(50%);
  border: 3px solid #101617;
  border-radius: 8px;
  padding: 24px 26px 18px;
  background: rgba(29, 35, 36, 0.94);
  box-shadow: 0 18px 50px rgba(12, 20, 22, 0.28);
  color: #ffffff;
  backdrop-filter: blur(8px);
}

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

.map-result-close {
  position: absolute;
  top: 8px;
  right: 9px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font: 700 1.45rem/1 Arial, sans-serif;
}

.map-result-close:hover,
.map-result-close:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.map-result-row {
  display: grid;
  grid-template-columns: 18px 106px minmax(100px, 1fr) 52px;
  align-items: center;
  gap: 12px;
  min-height: 34px;
}

.map-result-row.is-accuracy {
  grid-template-columns: 136px minmax(100px, 1fr) 58px;
  padding-right: 32px;
}

.map-result-row strong,
.map-result-row b {
  font-size: 1rem;
}

.map-result-row b {
  text-align: right;
}

.map-result-track {
  height: 16px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.2);
}

.map-result-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 420ms ease;
}

.map-result-row.is-accuracy .map-result-track > span {
  background: #ffffff;
}

.map-result-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.map-result-dot.is-green,
.map-result-fill.is-green {
  background: #2dcc75;
}

.map-result-dot.is-red,
.map-result-fill.is-red {
  background: #f24d3f;
}

.map-result-dot.is-gold,
.map-result-fill.is-gold {
  background: #ffa617;
}

.map-result-divider {
  height: 1px;
  margin: 12px 0 10px;
  background: rgba(255, 255, 255, 0.22);
}

.map-result-metrics {
  display: grid;
  gap: 4px;
}

.map-result-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.map-result-actions button {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius);
  padding: 6px 14px;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
}

.map-result-actions button:last-child {
  border-color: #ffffff;
  background: #ffffff;
  color: #1d2324;
}

.map-result-actions button:hover,
.map-result-actions button:focus-visible {
  border-color: #77bde8;
}

.map-stage.is-showing-result .map-status {
  display: none;
}

body:has(.consent-panel) .map-result-overlay:not([hidden]) {
  bottom: 146px;
}

.map-toolbox {
  position: absolute;
  z-index: 7;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 8px;
}

.map-toolbox button {
  min-width: 70px;
  padding: 7px 12px;
  box-shadow: 0 8px 20px rgba(20, 35, 43, 0.15);
}

.map-toolbox button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.map-tool-segment {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(20, 35, 43, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 253, 246, 0.96);
  box-shadow: 0 8px 20px rgba(20, 35, 43, 0.15);
}

.map-tool-segment button {
  min-width: 64px;
  border: 0;
  box-shadow: none;
}

.map-status {
  position: absolute;
  z-index: 7;
  right: 50%;
  bottom: 18px;
  max-width: min(560px, calc(100% - 36px));
  transform: translateX(50%);
  border: 1px solid rgba(20, 35, 43, 0.22);
  border-radius: var(--radius);
  padding: 9px 14px;
  background: rgba(255, 253, 246, 0.96);
  box-shadow: 0 8px 24px rgba(20, 35, 43, 0.16);
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}

.game-control-panel {
  position: relative;
  z-index: 8;
  overflow: auto;
  border-left: 1px solid rgba(20, 35, 43, 0.18);
  padding: 24px;
  background: #fffdf6;
}

.challenge-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.map-kicker {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.challenge-heading h2 {
  max-width: 280px;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
}

.challenge-number {
  flex: 0 0 auto;
  border: 1px solid rgba(20, 35, 43, 0.16);
  border-radius: var(--radius);
  padding: 6px 8px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.game-mode-control {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.game-mode-control > span,
.challenge-switcher label span {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 900;
}

.mode-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(20, 35, 43, 0.14);
  border-radius: var(--radius);
  background: #edf0ed;
}

.mode-segment button {
  border: 0;
  box-shadow: none;
}

.clue-panel {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  border-left: 4px solid var(--gold);
  padding: 12px 14px;
  background: rgba(212, 155, 57, 0.1);
}

.clue-panel span {
  color: #86601f;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.clue-panel strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
}

.clue-panel p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.result-summary {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.result-score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.result-score span {
  color: var(--ink-soft);
  font-weight: 800;
}

.result-score strong {
  color: var(--green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.6rem;
}

.result-summary h2 {
  margin: 4px 0 16px;
  font-size: 1.55rem;
}

.area-scores {
  display: grid;
  gap: 12px;
}

.area-score-row {
  display: grid;
  gap: 5px;
}

.area-score-row > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.area-score-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.area-score-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(20, 35, 43, 0.1);
}

.area-score-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 300ms ease;
}

.area-score-dot.is-green,
.area-score-fill.is-green {
  background: var(--green);
}

.area-score-dot.is-red,
.area-score-fill.is-red {
  background: var(--red);
}

.area-score-dot.is-gold,
.area-score-fill.is-gold {
  background: var(--gold);
}

.primary-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 22px;
}

.primary-controls button,
.challenge-switcher button {
  padding: 9px 12px;
}

.primary-controls .map-primary-action,
.primary-controls [data-action="share"] {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.primary-controls button:hover,
.challenge-switcher button:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 14px rgba(20, 35, 43, 0.12);
}

.share-dialog {
  width: min(920px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100svh - 32px);
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 0;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(20, 35, 43, 0.3);
  color: var(--ink);
}

.share-dialog[open] {
  animation: share-dialog-in 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.share-dialog::backdrop {
  background: rgba(20, 35, 43, 0.66);
}

.share-dialog-shell {
  max-height: calc(100svh - 36px);
  overflow: auto;
  padding: 22px;
}

.share-dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.share-dialog-header p {
  margin: 0 0 3px;
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.share-dialog-header h2 {
  font-size: 1.65rem;
}

.share-dialog-close {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink-soft);
  cursor: pointer;
  font: 700 1.45rem/1 Arial, sans-serif;
}

.share-dialog-close:hover,
.share-dialog-close:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
}

.share-preview {
  position: relative;
  aspect-ratio: 1200 / 630;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #edf0ed;
}

.share-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.share-preview img:not([src]) {
  visibility: hidden;
}

.share-preview-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.share-preview-loading[hidden] {
  display: none;
}

.share-feedback {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.share-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.share-dialog-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 14px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 850;
}

.share-dialog-actions button:hover,
.share-dialog-actions button:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
}

.share-dialog-actions button:disabled {
  opacity: 0.52;
  cursor: wait;
}

.share-dialog-actions .share-action-primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.share-dialog-actions .share-action-primary:hover,
.share-dialog-actions .share-action-primary:focus-visible {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

@keyframes share-dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.challenge-switcher {
  display: grid;
  gap: 9px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.challenge-switcher label {
  display: grid;
  gap: 6px;
}

.challenge-switcher select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(20, 35, 43, 0.18);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.map-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
}

.map-stat-grid div {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 9px 5px;
  background: #ffffff;
  text-align: center;
}

.map-stat-grid span {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-stat-grid strong {
  font-size: 0.95rem;
}

.capital-map-marker {
  position: relative;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 2px 10px rgba(20, 35, 43, 0.42);
}

.capital-map-marker::before {
  position: absolute;
  inset: -10px;
  border: 2px solid rgba(199, 68, 55, 0.55);
  border-radius: 50%;
  content: "";
  animation: capital-pulse 1.6s ease-out infinite;
}

.capital-map-marker span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffffff;
}

@keyframes capital-pulse {
  from {
    opacity: 1;
    transform: scale(0.55);
  }
  to {
    opacity: 0;
    transform: scale(1.25);
  }
}

.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right {
  z-index: 3;
}

.maplibregl-ctrl-attrib {
  font-size: 10px;
}

@media (max-width: 1020px) {
  .map-result-overlay {
    position: fixed;
  }

  .map-game-header {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .region-tabs {
    justify-content: start;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .map-game-workspace {
    grid-template-columns: 1fr;
  }

  .map-stage {
    position: relative;
    top: auto;
    height: auto;
    min-height: 62svh;
  }

  .game-control-panel {
    overflow: visible;
    border-top: 1px solid rgba(20, 35, 43, 0.18);
    border-left: 0;
  }

  .game-grid,
  .quiz-grid {
    grid-template-columns: 1fr;
  }

  .challenge-panel,
  .result-panel {
    order: 2;
  }

  .board-panel,
  .quiz-stage {
    order: 1;
  }

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

@media (max-width: 720px) {
  .map-game-header {
    padding: 10px;
  }

  .map-brand {
    font-size: 1.12rem;
  }

  .region-tabs button {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .map-stage {
    min-height: 58svh;
  }

  .map-toolbox {
    top: 10px;
    left: 10px;
    gap: 5px;
  }

  .map-toolbox button {
    min-width: 54px;
    min-height: 38px;
    padding: 6px 8px;
    font-size: 0.76rem;
  }

  .map-tool-segment button {
    min-width: 48px;
  }

  .map-result-overlay {
    bottom: 12px;
    width: calc(100% - 20px);
    padding: 18px 14px 14px;
  }

  body:has(.consent-panel) .map-result-overlay:not([hidden]) {
    bottom: 246px;
  }

  .map-result-close {
    top: 4px;
    right: 4px;
  }

  .map-result-row {
    grid-template-columns: 14px 66px minmax(60px, 1fr) 42px;
    gap: 8px;
  }

  .map-result-row.is-accuracy {
    grid-template-columns: 82px minmax(60px, 1fr) 46px;
    padding-right: 24px;
  }

  .map-result-row strong,
  .map-result-row b {
    font-size: 0.82rem;
  }

  .map-result-track {
    height: 12px;
  }

  .map-result-dot {
    width: 12px;
    height: 12px;
  }

  .map-result-actions {
    margin-top: 10px;
  }

  .share-dialog {
    width: calc(100% - 20px);
    max-height: calc(100svh - 20px);
  }

  .share-dialog-shell {
    max-height: calc(100svh - 24px);
    padding: 15px;
  }

  .share-dialog-header h2 {
    max-width: 260px;
    font-size: 1.3rem;
  }

  .share-preview {
    margin-top: 14px;
  }

  .share-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .share-dialog-actions .share-action-primary {
    grid-column: 1 / -1;
  }

  .share-dialog-actions button[hidden] + button {
    grid-column: auto;
  }

  .map-status {
    bottom: 10px;
    max-width: calc(100% - 20px);
    padding: 7px 10px;
    font-size: 0.76rem;
  }

  .game-control-panel {
    padding: 20px 16px 26px;
  }

  .challenge-heading h2 {
    font-size: 1.9rem;
  }

  .app-shell {
    padding: 10px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-nav {
    justify-content: stretch;
  }

  .mode-pill {
    flex: 1 1 42%;
  }

  .board-head {
    flex-direction: column;
  }

  .draw-board,
  .silhouette-card {
    width: calc(100% - 20px);
    aspect-ratio: 1 / 1;
  }

  .answer-grid,
  .seo-columns,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

  .tool-row button,
  .ghost-link {
    flex: 1 1 100%;
  }

  .mini-list {
    grid-template-columns: 1fr;
  }

  .footer-links {
    display: flex;
    justify-content: center;
    margin: 10px 0 0;
  }

  .consent-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .consent-actions button {
    flex: 1 1 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .share-dialog[open] {
    animation: none;
  }

  .map-result-track > span,
  .area-score-fill {
    transition: none;
  }
}
