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

:root {
  font-family: "DM Sans", sans-serif;
  color: #1e302c;
  background: #f5f7f2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  font-weight: 400;
  --ink: #1e302c;
  --muted: #75817b;
  --green: #2c765d;
  --green-dark: #205944;
  --green-soft: #e8f2eb;
  --line: #e8ece5;
  --card: #fff;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 56px 22px;
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e9ede7;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  background: #2d785e;
  color: white;
  font-family: "Manrope", sans-serif;
  font-size: 20px;
  font-weight: 800;
}

.brand-copy,
.stat-copy {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: "Manrope", sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.1;
}

.brand-caption {
  margin-top: 3px;
  color: #859089;
  font-size: 10px;
  letter-spacing: 0.2px;
}

.topbar-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #62716a;
  font-size: 12px;
  font-weight: 600;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #74ae83;
  box-shadow: 0 0 0 3px #e7f1e6;
}

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding: 31px 0 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #468064;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.45px;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 7px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(25px, 3vw, 33px);
  font-weight: 800;
  letter-spacing: -1.25px;
  line-height: 1.15;
}

.intro-copy {
  max-width: 590px;
  margin-bottom: 0;
  color: #78837c;
  font-size: 13px;
  line-height: 1.6;
}

.round-progress {
  width: 205px;
  flex: 0 0 205px;
  padding-bottom: 3px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: #738078;
  font-size: 10px;
  font-weight: 600;
}

.progress-copy strong {
  color: #2b604b;
  font-size: 10px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #e5eae3;
}

.progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #4f9a71;
  transition: width 220ms ease;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.78fr) minmax(0, 2fr);
  gap: 22px;
  align-items: stretch;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid #e3eae2;
  border-radius: 11px;
  background: #edf2ec;
}

.mode-switch-button {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #5b6c60;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.mode-switch-button.is-active {
  border-color: #dce8dc;
  background: #fff;
  box-shadow: 0 1px 4px rgb(41 63 49 / 8%);
  color: #246346;
}

.mode-switch-button:focus-visible {
  outline: 3px solid #8fbd9b;
  outline-offset: 2px;
}

.learning-place-picker {
  position: relative;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
}

.learning-place-trigger {
  display: flex;
  width: fit-content;
  max-width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 4px 0 0;
  border: 0;
  background: transparent;
  color: #205944;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.learning-place-trigger:focus-visible {
  outline: none;
  box-shadow: inset 0 -2px #8fbd9b;
}

.learning-place-trigger span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.learning-place-trigger svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: #205944;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.learning-place-list {
  position: fixed;
  z-index: 1100;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #dce5dc;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(31 55 40 / 18%);
  overscroll-behavior: contain;
}

.learning-place-option {
  display: flex;
  min-height: 40px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  color: #205944;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.learning-place-option:hover,
.learning-place-option:focus,
.learning-place-option[aria-selected="true"] {
  outline: none;
  background: #eaf3ed;
}

.learning-place-option:focus-visible {
  box-shadow: inset 0 0 0 2px #8fbd9b;
}

.question-card,
.stats-card,
.instructions-card,
.map-panel,
.completion-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 3px 12px rgb(41 63 49 / 3%);
}

.question-card {
  min-height: 205px;
  padding: 18px 19px 16px;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.question-tag {
  color: #5d856a;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

.question-tag span {
  margin-right: 4px;
  color: #d49e46;
  font-size: 12px;
}

.question-number {
  color: #a0aaa3;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.question-card h2 {
  margin: 25px 0 7px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(23px, 2.4vw, 29px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.2;
}

.question-hint {
  min-height: 18px;
  margin-bottom: 17px;
  color: #87918a;
  font-size: 11px;
}

.answer-feedback {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 7px;
  background: #f5f8f4;
  color: #6a776f;
  font-size: 10px;
  line-height: 1.4;
}

.feedback-icon {
  color: #638a6e;
  font-size: 15px;
}

.answer-feedback.is-correct {
  background: #eaf5ec;
  color: #28643e;
}

.answer-feedback.is-wrong {
  background: #fff4e8;
  color: #986222;
}

.answer-feedback.is-missed {
  background: #fff0ed;
  color: #994d3c;
}

.answer-toast {
  display: none;
}

.answer-toast-close {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
  pointer-events: auto;
}

.answer-toast-close:hover {
  background: rgb(0 0 0 / 6%);
}

.answer-toast-close:focus-visible {
  outline: 3px solid #78a989;
  outline-offset: 1px;
}

.next-button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  margin-top: 11px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background 150ms ease, transform 150ms ease;
}

.next-button:hover {
  transform: translateY(-1px);
  background: var(--green-dark);
}

.next-button:focus-visible,
.restart-button:focus-visible {
  outline: 3px solid #a7d3b2;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.stats-card {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-around;
  padding: 11px 12px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 9px;
}

.stat-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 10px;
  font-size: 16px;
}

.score-icon {
  background: #fff6e5;
  color: #ca9b36;
}

.tries-icon {
  background: #edf4ef;
  color: #55906a;
}

.stat-label {
  margin-bottom: 2px;
  color: #89938d;
  font-size: 9px;
}

.stat-copy strong {
  color: #263a32;
  font-family: "Manrope", sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
}

.stat-divider {
  width: 1px;
  height: 34px;
  background: #edf0eb;
}

.instructions-card {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: #f0f5ef;
  box-shadow: none;
}

.instructions-icon {
  color: #44805e;
  font-size: 20px;
}

.instructions-card h3 {
  margin: 2px 0 4px;
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 800;
}

.instructions-card p {
  margin: 0;
  color: #75827a;
  font-size: 10px;
  line-height: 1.55;
}

.map-panel {
  position: relative;
  min-width: 0;
  min-height: 470px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.next-button.map-fullscreen-next {
  display: none;
}

.map-panel:fullscreen,
.map-panel.is-fullscreen {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  flex-direction: column;
  border: 0;
  border-radius: 0;
}

.map-panel:fullscreen #map,
.map-panel.is-fullscreen #map {
  min-height: 0;
  height: auto;
}

.map-panel:fullscreen .map-fullscreen-next,
.map-panel.is-fullscreen .map-fullscreen-next {
  position: absolute;
  z-index: 2;
  right: env(safe-area-inset-right);
  bottom: 0;
  left: env(safe-area-inset-left);
  display: flex;
  width: auto;
  min-height: calc(60px + env(safe-area-inset-bottom));
  justify-content: center;
  margin: 0 auto;
  padding: 0 16px env(safe-area-inset-bottom);
  border-radius: 0;
  font-size: 15px;
}

.map-panel:fullscreen.has-next-step .map-legend,
.map-panel.is-fullscreen.has-next-step .map-legend {
  display: none;
}

.map-panel:fullscreen .answer-toast,
.map-panel.is-fullscreen .answer-toast {
  position: absolute;
  z-index: 3;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(68px + env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  display: flex;
  max-width: 540px;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  margin: 0 auto;
  padding: 13px 16px;
  border: 1px solid #dbe6dc;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 28px rgb(30 54 38 / 22%);
  color: #43564a;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.map-panel:fullscreen .answer-toast.is-visible,
.map-panel.is-fullscreen .answer-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.map-panel:fullscreen .answer-toast .feedback-icon,
.map-panel.is-fullscreen .answer-toast .feedback-icon {
  flex: 0 0 24px;
  margin: 0;
}

.map-panel:fullscreen .answer-toast.is-correct,
.map-panel.is-fullscreen .answer-toast.is-correct {
  border-color: #c7dfcc;
  background: #eaf5ec;
  color: #28643e;
}

.map-panel:fullscreen .answer-toast.is-wrong,
.map-panel.is-fullscreen .answer-toast.is-wrong {
  border-color: #f0ddc4;
  background: #fff4e8;
  color: #80551e;
}

.map-panel:fullscreen .answer-toast.is-missed,
.map-panel.is-fullscreen .answer-toast.is-missed {
  border-color: #f0d0c9;
  background: #fff0ed;
  color: #994d3c;
}

.map-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  padding: 0 16px;
  border-bottom: 1px solid #edf0eb;
}

.map-current-question {
  display: flex;
  min-width: 0;
  flex: 1 1 0%;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  color: #53635a;
  font-size: 12px;
  line-height: 1.2;
}

.map-current-question > span {
  color: #62756a;
  font-weight: 700;
}

.map-current-question strong {
  min-width: 0;
  width: 100%;
  color: #205944;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
}

.map-current-question .learning-place-picker {
  flex: 0 1 auto;
}

.app-shell.is-learning-mode .round-progress,
.app-shell.is-learning-mode .question-number,
.app-shell.is-learning-mode .stats-card,
.app-shell.is-learning-mode .answer-feedback,
.app-shell.is-learning-mode .restart-button {
  display: none;
}

.app-shell.is-learning-mode .question-card h2 {
  margin-top: 14px;
}

.map-fullscreen-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid #e0e8e0;
  border-radius: 9px;
  background: #fff;
  color: #385a47;
  cursor: pointer;
}

.map-fullscreen-button:hover {
  border-color: #bfd4c3;
  background: #f2f7f2;
}

.map-fullscreen-button:focus-visible {
  outline: 3px solid #a7d3b2;
  outline-offset: 2px;
}

.map-fullscreen-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.map-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #596c61;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

.map-pin {
  color: #538567;
  font-size: 16px;
}

.map-instruction {
  color: #9aa39c;
  font-size: 10px;
}

.map-style-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.map-style-button {
  display: flex;
  min-height: 68px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 4px;
  border: 1px solid #e1e8e0;
  border-radius: 9px;
  background: #fff;
  color: #5b6c60;
  cursor: pointer;
  font: inherit;
}

.map-style-button.is-active {
  border-color: #43845c;
  box-shadow: 0 0 0 1px #43845c;
  color: #246346;
}

.map-style-preview {
  position: relative;
  display: block;
  width: 100%;
  height: 37px;
  overflow: hidden;
  border: 1px solid rgb(55 75 62 / 12%);
  border-radius: 5px;
}

.map-style-preview::before,
.map-style-preview::after {
  position: absolute;
  display: block;
  content: "";
}

.preview-standard {
  background:
    linear-gradient(155deg, transparent 44%, #fff 45% 50%, transparent 51%),
    linear-gradient(25deg, transparent 47%, #fff 48% 53%, transparent 54%),
    linear-gradient(90deg, #e8eddf 0 34%, #dce9e9 34% 50%, #e9eadf 50% 100%);
}

.preview-standard::before {
  inset: 0;
  background: linear-gradient(115deg, transparent 54%, rgb(197 203 192 / 80%) 55% 58%, transparent 59%);
}

.preview-road {
  background: linear-gradient(135deg, #eef0e9, #e4e9e2);
}

.preview-road::before {
  inset: -12px -4px;
  background:
    linear-gradient(34deg, transparent 43%, #d4b86e 44% 47%, #fff 48% 52%, #d4b86e 53% 56%, transparent 57%),
    linear-gradient(110deg, transparent 45%, #fff 46% 50%, #d4b86e 51% 53%, transparent 54%);
}

.preview-satellite {
  background:
    linear-gradient(145deg, transparent 42%, rgb(53 83 51 / 85%) 43% 56%, transparent 57%),
    linear-gradient(20deg, #80765b, #526d49 54%, #75845d);
}

.preview-satellite::before {
  inset: 0;
  background: linear-gradient(72deg, transparent 37%, rgb(187 172 133 / 58%) 38% 44%, transparent 45%);
}

.map-style-label {
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-style-button:focus-visible {
  outline: 3px solid #8fbd9b;
  outline-offset: 2px;
}

.map-settings-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 7px;
}

.labels-toggle {
  display: grid;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid #e7ece5;
  border-radius: 7px;
  background: white;
  color: #617269;
  cursor: pointer;
  font-size: 9px;
  font-weight: 600;
}

.labels-toggle:hover {
  border-color: #bfd4c3;
  background: #f5f8f3;
}

.labels-toggle[aria-pressed="false"] {
  border-color: #d7c99f;
  background: #fbf8ee;
  color: #796734;
}

.labels-toggle:focus-visible {
  outline: 3px solid #a7d3b2;
  outline-offset: 2px;
}

.labels-toggle-icon {
  color: #48825d;
  font-size: 14px;
  font-weight: 800;
}

#map {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 385px;
  background: #e5eee9;
  cursor: crosshair;
  touch-action: pan-x pan-y;
}

.map-legend {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 0 15px;
  color: #8b958e;
  font-size: 9px;
}

.map-attribution {
  color: #8b958e;
  font-size: 8px;
}

.legend-dot,
.legend-target {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot {
  background: #e36b54;
}

.legend-target {
  border: 2px solid #429569;
}

.legend-separator {
  margin: 0 2px;
  color: #c5ccc5;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 1px 0;
  color: #9aa39c;
  font-size: 10px;
}

.restart-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #78847b;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
}

.restart-button:hover {
  background: #eaf0e9;
  color: #355d46;
}

.completion-card {
  position: relative;
  width: min(420px, calc(100% - 32px));
  margin: 24px auto 0;
  padding: 28px;
  scroll-margin: 24px;
  text-align: center;
  box-shadow: 0 18px 65px rgb(21 44 32 / 19%);
}

.completion-star {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto 17px;
  place-items: center;
  border-radius: 15px;
  background: #edf5e9;
  color: #48825d;
  font-size: 23px;
}

.completion-card h2 {
  margin-bottom: 9px;
  font-family: "Manrope", sans-serif;
  font-size: 27px;
  font-weight: 800;
}

.completion-card > p:not(.eyebrow) {
  margin-bottom: 18px;
  color: #75817a;
  font-size: 13px;
  line-height: 1.6;
}

.completion-card .next-button {
  justify-content: center;
}

.completion-secondary {
  min-height: 44px;
  margin-top: 7px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #69776e;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.completion-secondary:hover {
  background: #f2f6f1;
  color: #355d46;
}

.completion-secondary:focus-visible,
.review-button:focus-visible {
  outline: 3px solid #a7d3b2;
  outline-offset: 3px;
}

.maplibregl-map {
  font-family: "DM Sans", sans-serif;
}

.maplibregl-canvas {
  outline: none;
}

.place-pointer-marker {
  display: grid;
  width: 40px;
  height: 46px;
  place-items: center;
  pointer-events: none;
}

.place-pointer-arrow {
  width: 38px;
  height: 44px;
  overflow: visible;
  animation: place-pointer-bob 900ms ease-in-out infinite;
  filter: drop-shadow(0 2px 3px rgb(30 46 37 / 38%));
}

@keyframes place-pointer-bob {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.guess-marker {
  width: 17px;
  height: 17px;
  border: 3px solid white;
  border-radius: 50%;
  background: #df7058;
  box-shadow: 0 1px 8px rgb(30 46 37 / 42%);
  pointer-events: none;
}

.answer-marker {
  width: 21px;
  height: 21px;
  border: 3px solid white;
  border-radius: 50%;
  background: #43a16d;
  box-shadow: 0 1px 8px rgb(30 46 37 / 42%);
  pointer-events: none;
}

.answer-marker-labeled {
  position: relative;
}

.answer-marker-labeled::after {
  position: absolute;
  bottom: 23px;
  left: 50%;
  padding: 4px 7px;
  border-radius: 5px;
  background: #286f4f;
  box-shadow: 0 1px 6px rgb(30 46 37 / 30%);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  content: attr(aria-label);
  transform: translateX(-50%);
  white-space: nowrap;
}

@media (min-width: 1200px) {
  .game-layout {
    grid-template-columns: minmax(300px, 0.73fr) minmax(0, 2fr);
  }

  #map {
    height: min(55vh, 490px);
    min-height: 385px;
  }
}

@media (max-width: 850px) {
  .answer-toast {
    position: fixed;
    z-index: 1100;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    left: max(16px, env(safe-area-inset-left));
    display: flex;
    max-width: 540px;
    min-height: 52px;
    align-items: center;
    gap: 12px;
    margin: 0 auto;
    padding: 13px 16px;
    border: 1px solid #dbe6dc;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 28px rgb(30 54 38 / 22%);
    color: #43564a;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition:
      opacity 180ms ease,
      transform 180ms ease;
  }

  .answer-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .answer-toast .feedback-icon {
    flex: 0 0 24px;
    margin: 0;
  }

  .answer-toast.is-correct {
    border-color: #c7dfcc;
    background: #eaf5ec;
    color: #28643e;
  }

  .answer-toast.is-wrong {
    border-color: #f0ddc4;
    background: #fff4e8;
    color: #80551e;
  }

  .answer-toast.is-missed {
    border-color: #f0d0c9;
    background: #fff0ed;
    color: #994d3c;
  }

  .app-shell {
    padding: 0 24px 20px;
  }

  .game-layout {
    grid-template-columns: minmax(235px, 0.85fr) minmax(0, 1.4fr);
    gap: 14px;
  }

  .question-card {
    padding: 16px 15px;
  }

  .stats-card {
    padding: 10px 8px;
  }

  .stat-item {
    gap: 6px;
  }

  .stat-icon {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
  }

  #map {
    height: 390px;
  }
}

@media (max-width: 640px) {
  .game-layout {
    grid-template-rows: auto minmax(580px, 72vh);
  }

  .app-shell {
    padding: 0 16px 18px;
  }

  .topbar {
    height: 64px;
  }

  .intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
    padding: 25px 0 19px;
  }

  .intro-copy {
    max-width: 460px;
    font-size: 12px;
  }

  .round-progress {
    width: 100%;
    flex-basis: auto;
  }

  .game-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
  }

  .sidebar {
    gap: 10px;
  }

  .question-card {
    min-height: 0;
    padding: 16px;
  }

  .question-card h2 {
    margin-top: 17px;
    font-size: 27px;
  }

  .question-hint {
    margin-bottom: 13px;
  }

  .instructions-card {
    padding: 12px 14px;
  }

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

  .map-toolbar {
    height: 44px;
  }

  .map-toolbar-actions {
    gap: 6px;
  }

  .map-instruction {
    display: none;
  }

  .labels-toggle {
    min-height: 44px;
    padding: 0;
  }

  #map {
    height: min(58vh, 440px);
    min-height: 330px;
  }

  .page-footer {
    align-items: flex-start;
    font-size: 9px;
  }

  .restart-button {
    min-height: 44px;
    margin-top: -11px;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .place-pointer-arrow {
    animation: none;
  }
}

@media (min-width: 641px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    display: grid;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 560px;
    grid-template-rows: minmax(0, 1fr);
    padding: 0;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 4;
    flex: 0 0 62px;
    height: 62px;
    min-width: 0;
    padding-right: 12px;
    background: var(--card);
  }

  .game-layout {
    min-height: 0;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
  }

  .sidebar {
    min-height: 0;
    max-height: 100%;
    gap: 11px;
    overflow-x: hidden;
    overflow-y: scroll;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 0 3px 0 22px;
  }

  .intro {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 0 2px 2px;
  }

  .intro .eyebrow {
    margin-bottom: 5px;
    font-size: 11px;
  }

  .intro h1 {
    margin-bottom: 5px;
    font-size: clamp(22px, 2vw, 28px);
  }

  .intro-copy {
    max-width: none;
    color: #59685f;
    font-size: 13px;
  }

  .round-progress {
    width: 100%;
    flex: 0 0 auto;
    padding: 0 2px;
  }

  .progress-copy,
  .progress-copy strong {
    font-size: 13px;
  }

  .question-card {
    min-height: 180px;
    flex: 0 0 auto;
    padding: 17px 18px 16px;
  }

  .question-tag,
  .question-number {
    font-size: 11px;
  }

  .question-card h2 {
    margin: 17px 0 7px;
    font-size: clamp(23px, 2vw, 28px);
  }

  .question-hint {
    margin-bottom: 13px;
    color: #59685f;
    font-size: 13px;
  }

  .answer-feedback {
    min-height: 42px;
    padding: 8px 10px;
    color: #4f6055;
    font-size: 13px;
  }

  .next-button {
    font-size: 14px;
  }

  .stats-card {
    min-height: 82px;
    padding: 11px;
  }

  .stat-label {
    color: #526258;
    font-size: 12px;
  }

  .stat-copy strong {
    font-size: 19px;
  }

  .map-settings {
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    box-shadow: 0 3px 12px rgb(41 63 49 / 3%);
  }

  .map-settings-heading {
    margin-bottom: 10px;
    color: #526359;
    font-size: 12px;
    font-weight: 700;
  }

  .map-settings-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    gap: 7px;
  }

  .labels-toggle {
    padding: 0;
    color: #43564a;
    font-size: 12px;
  }

  .labels-toggle-icon {
    font-size: 13px;
  }

  .instructions-card {
    flex: 1 0 auto;
    padding: 16px 17px;
  }

  .instructions-card h3 {
    font-size: 15px;
  }

  .instructions-card p {
    color: #4f6055;
    font-size: 13px;
    line-height: 1.65;
  }

  .page-footer {
    margin-top: auto;
    padding: 12px 3px 2px;
    color: #526258;
    font-size: 12px;
  }

  .restart-button {
    font-size: 12px;
  }

  .map-panel {
    display: block;
    min-height: 0;
    overflow: hidden;
  }

  .map-panel > .map-toolbar {
    position: absolute;
    top: 12px;
    right: 12px;
    left: 12px;
    min-height: 52px;
    padding: 4px 12px;
    border: 0;
    border-radius: 12px;
    background: rgb(255 255 255 / 92%);
    box-shadow: 0 2px 12px rgb(31 55 40 / 16%);
  }

  .map-panel > #map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    touch-action: none;
  }

  .map-panel > .map-legend {
    position: absolute;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: fit-content;
    max-width: calc(100% - 24px);
    min-height: 0;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    background: rgb(255 255 255 / 92%);
    box-shadow: 0 2px 12px rgb(31 55 40 / 16%);
    color: #43564a;
    font-size: 12px;
  }

  .map-attribution {
    color: #43564a;
    font-size: 11px;
  }
}

@media (max-width: 850px) and (min-width: 641px) {
  .app-shell {
    padding: 0;
  }

  .game-layout {
    grid-template-columns: minmax(260px, 310px) minmax(0, 1fr);
    gap: 12px;
  }

  .sidebar {
    gap: 8px;
    padding-left: 14px;
  }

  .intro h1 {
    font-size: 21px;
  }

  .question-card {
    padding: 14px;
  }

  .stats-card {
    padding: 9px 7px;
  }

  .stat-item {
    gap: 6px;
  }

  .stat-icon {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
  }

  .map-settings {
    padding: 10px;
  }

  .labels-toggle {
    font-size: 11px;
  }

  .instructions-card {
    padding: 12px;
  }

  .instructions-card p {
    font-size: 12px;
  }
}

@media (max-height: 740px) and (min-width: 641px) {
  .app-shell {
    min-height: 480px;
    padding-bottom: 0;
  }

  .sidebar {
    gap: 7px;
    padding-top: 0;
  }

  .intro {
    gap: 7px;
  }

  .intro-copy,
  .instructions-card p {
    font-size: 12px;
  }

  .question-card h2 {
    margin-top: 12px;
  }
}

@media (max-width: 640px) {
  .intro {
    gap: 12px;
    padding: 0 1px 2px;
  }

  .intro-copy,
  .instructions-card p {
    max-width: none;
    color: #4f6055;
    font-size: 14px;
  }

  .progress-copy,
  .progress-copy strong {
    color: #526258;
    font-size: 13px;
  }

  .question-hint {
    color: #59685f;
    font-size: 14px;
  }

  .answer-feedback {
    min-height: 42px;
    color: #4f6055;
    font-size: 13px;
  }

  .stat-label {
    color: #526258;
    font-size: 12px;
  }

  .map-settings {
    padding: 12px;
  }

  .map-settings-heading {
    margin-bottom: 8px;
    color: #526359;
    font-size: 12px;
    font-weight: 700;
  }

  .map-settings-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    gap: 7px;
  }

  .labels-toggle {
    padding: 0;
    color: #43564a;
    font-size: 12px;
  }

  .instructions-card h3 {
    font-size: 15px;
  }

  .map-panel {
    display: flex;
    flex-direction: column;
  }

  .map-toolbar {
    min-height: 52px;
    flex-basis: auto;
    gap: 8px;
    padding: 4px 10px;
  }

  .map-heading {
    gap: 5px;
    font-size: 10px;
    letter-spacing: 0.7px;
  }

  .map-current-question {
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-start;
    gap: 2px;
    font-size: 12px;
  }

  .map-current-question strong {
    font-size: 12px;
  }

  .map-fullscreen-button {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  #map {
    flex: 1 1 auto;
    height: auto;
    height: min(56vh, 540px);
    min-height: 380px;
    touch-action: none;
  }

  .map-legend {
    min-height: 48px;
    gap: 7px;
    padding: 8px 12px;
    color: #43564a;
    font-size: 12px;
  }

  .map-attribution {
    color: #43564a;
    font-size: 11px;
  }

  .page-footer {
    color: #526258;
    font-size: 12px;
  }
}
