@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=DM+Sans:wght@400;500;600;700;800&display=swap');

:root {
  font-family: 'DM Sans', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  --page: #99d9e9;
  --panel: #fffef8;
  --ink: #203139;
  --muted: #536970;
  --border: #28434a;
  --accent: #137bb6;
  --accent-hover: #086a9f;
  --accent-text: #fff;
  --pill: #ffea75;
  --focus: #d9f2e9;
  --focus-border: #4aa98f;
  --challenge: #ffe679;
  --selected: #fff3a8;
  --shadow: #244a5428;
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  transition: background-color .2s ease, color .2s ease;
}
body[data-theme="coastal"] {
  --page: #89d7c5;
  --panel: #f8fffc;
  --ink: #173a3e;
  --muted: #4b6c6d;
  --border: #1b6568;
  --accent: #0b797b;
  --accent-hover: #07696b;
  --accent-text: #fff;
  --pill: #ffab89;
  --focus: #fff1a9;
  --focus-border: #d9a847;
  --challenge: #c7efdf;
  --selected: #e0f7ed;
  --shadow: #1c5f5627;
}
body[data-theme="night"] {
  color-scheme: dark;
  --page: #10283e;
  --panel: #1d3b53;
  --ink: #f7f9f4;
  --muted: #c2d6da;
  --border: #94cbd5;
  --accent: #ffb46d;
  --accent-hover: #f6a253;
  --accent-text: #193044;
  --pill: #74c7d2;
  --focus: #294f68;
  --focus-border: #70bfce;
  --challenge: #2d5870;
  --selected: #315e78;
  --shadow: #08172260;
}
button { font: inherit; }
.app-shell { max-width: 1440px; min-height: 100vh; margin: auto; padding: 22px; }
.topbar { display: flex; align-items: center; gap: 13px; min-height: 62px; padding: 0 4px 18px; }
.brand-mark { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border: 2px solid var(--border); border-radius: 50%; background: #ec6357; color: #fff; font-size: 26px; box-shadow: 3px 3px 0 var(--border); }
.eyebrow, .card-kicker, .stat-label { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow { color: var(--muted); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: 'Archivo Black', 'Arial Black', sans-serif; letter-spacing: -.035em; }
h1 { margin: 2px 0 0; font-size: clamp(20px, 2.1vw, 27px); line-height: 1.1; }
.theme-picker { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; margin-left: auto; }
.theme-option { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 12px; font-weight: 800; cursor: pointer; }
.theme-option[aria-pressed="true"] { background: var(--selected); box-shadow: 2px 2px 0 var(--border); }
.theme-option:hover { transform: translateY(-1px); }
.theme-option:focus-visible, .primary-button:focus-visible, .text-button:focus-visible, .map-layers input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.theme-swatches { display: inline-block; width: 27px; height: 15px; flex: none; border: 1px solid #1d323a; border-radius: 3px; }
.clearline-swatches { background: linear-gradient(90deg, #99d9e9 0 33%, #ffe679 33% 66%, #ec6357 66%); }
.coastal-swatches { background: linear-gradient(90deg, #89d7c5 0 33%, #ffab89 33% 66%, #0b797b 66%); }
.night-swatches { background: linear-gradient(90deg, #10283e 0 33%, #ffb46d 33% 66%, #74c7d2 66%); }
.game-layout { display: grid; grid-template-columns: minmax(310px, 370px) minmax(0, 1fr); gap: 18px; min-height: min(760px, calc(100vh - 116px)); }
.game-panel, .map-panel { overflow: hidden; border: 2px solid var(--border); border-radius: 16px; background: var(--panel); box-shadow: 5px 5px 0 var(--shadow); }
.game-panel { display: flex; flex-direction: column; padding: 26px; }
.pill { display: inline-block; padding: 7px 11px; border: 1.5px solid var(--border); border-radius: 99px; background: var(--pill); color: #24333a; font-size: 12px; font-weight: 800; }
.intro h2 { margin: 20px 0 9px; font-size: clamp(31px, 3vw, 39px); line-height: 1.06; }
.intro p { margin-bottom: 0; color: var(--muted); line-height: 1.5; }
.focus-banner { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding: 11px 12px; border: 1.5px solid var(--focus-border); border-radius: 10px; background: var(--focus); }
.focus-icon { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border: 1.5px solid var(--focus-border); border-radius: 50%; color: var(--ink); font-size: 22px; font-weight: 800; }
.focus-banner small { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.focus-banner strong { display: block; font-size: 13px; line-height: 1.2; }
.score-row { display: flex; justify-content: space-between; margin: 18px 0; padding: 15px 0; border-top: 1.5px solid var(--border); border-bottom: 1.5px solid var(--border); }
.score-row > div { display: flex; flex-direction: column; gap: 5px; }
.stat-label { color: var(--muted); }
.score-row strong { font-size: 26px; line-height: 1; }
.challenge-card { position: relative; min-height: 155px; padding: 20px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--challenge); }
.challenge-card::after { content: ''; position: absolute; top: 16px; right: 16px; width: 10px; height: 10px; border: 1px solid var(--border); border-radius: 50%; background: #ec6357; }
.card-kicker { padding-right: 16px; color: var(--muted); }
.challenge-card h3 { margin: 12px 0 7px; font-size: 29px; line-height: 1.1; }
.challenge-card p:last-child { margin: 0; color: var(--muted); line-height: 1.45; }
.instruction { min-height: 43px; margin: 20px 0 12px; color: var(--muted); line-height: 1.45; }
.primary-button { width: 100%; min-height: 52px; padding: 11px 16px; border: 1.5px solid var(--border); border-radius: 9px; background: var(--accent); color: var(--accent-text); font-weight: 800; cursor: pointer; box-shadow: 3px 3px 0 var(--border); }
.primary-button:hover { background: var(--accent-hover); }
.primary-button:disabled { opacity: .55; cursor: default; box-shadow: none; }
.text-button { margin: 12px auto 0; padding: 8px; border: 0; background: transparent; color: var(--ink); font-weight: 800; text-decoration: underline; cursor: pointer; }
.about { margin-top: auto; padding-top: 25px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.about summary { color: var(--ink); font-weight: 800; cursor: pointer; }
.about p { margin: 10px 0 0; }
.about a { color: var(--accent); }
.map-panel { position: relative; min-height: 610px; }
#map { width: 100%; height: 100%; min-height: 610px; background: #dce9e6; }
.map-layers { position: absolute; z-index: 500; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 145px; margin: 0; padding: 11px 13px 12px; border: 1px solid #d4dfdc; border-radius: 9px; background: #ffffffed; color: #263e43; box-shadow: 2px 2px 0 #263e4326; }
.map-layers legend { float: left; width: 100%; margin-bottom: 5px; color: #516669; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.map-layers label { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; font-weight: 700; }
.map-layers input { width: 16px; height: 16px; margin: 0; accent-color: #276e56; }
.map-layers #borders-toggle { accent-color: #aa4e49; }
.map-note { position: absolute; z-index: 500; right: 16px; bottom: 24px; max-width: calc(100% - 32px); padding: 9px 13px; border: 1px solid #d4dfdc; border-radius: 8px; background: #ffffffed; color: #355159; font-size: 12px; box-shadow: 2px 2px 0 #263e4326; pointer-events: none; }
.guess-pin, .answer-pin { display: grid; place-items: center; width: 22px; height: 22px; border: 3px solid white; border-radius: 50%; box-shadow: 0 2px 9px #0007; }
.guess-pin { background: #d9574b; }
.answer-pin { background: #217d67; }
.leaflet-container { font-family: 'DM Sans', system-ui, sans-serif; }
@media (max-width: 900px) {
  .app-shell { padding: 12px; }
  .topbar { flex-wrap: wrap; padding-bottom: 12px; }
  .theme-picker { width: 100%; justify-content: flex-start; margin-left: 0; }
  .game-layout { display: flex; flex-direction: column; gap: 12px; }
  .game-panel { padding: 20px; }
  .intro h2 { font-size: 31px; }
  .focus-banner { margin-top: 15px; }
  .score-row { margin: 14px 0; padding: 12px 0; }
  .challenge-card { min-height: 125px; padding: 17px; }
  .challenge-card h3 { font-size: 26px; }
  .instruction { min-height: 0; margin: 15px 0 11px; }
  .about { padding-top: 17px; }
  .map-panel, #map { min-height: 50vh; }
  .map-layers { top: 10px; right: 10px; }
}
