:root {
  color-scheme: light;
  --ink: #16202a;
  --muted: #5c6874;
  --line: #d6dde3;
  --panel: #ffffff;
  --page: #eef3f5;
  --accent: #167c80;
  --accent-dark: #0b5559;
  --good: #1b7b48;
  --warn: #b05a16;
  --wrong: #a73535;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--page);
  color: var(--ink);
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.landing-page {
  height: auto;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 8% 8%, rgba(22, 124, 128, 0.14), transparent 32rem),
    radial-gradient(circle at 96% 18%, rgba(240, 180, 41, 0.18), transparent 28rem),
    var(--page);
  background-repeat: no-repeat;
}

.landing-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

.landing-hero {
  min-height: 560px;
  display: grid;
  gap: 34px;
  align-content: start;
}

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

.landing-brand,
.brand-home {
  color: var(--ink);
  text-decoration: none;
}

.landing-brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 64px;
  padding-left: 44px;
  font-size: 26px;
  font-weight: 900;
}

.landing-language-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.landing-language {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 42px;
  min-height: 38px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.landing-language.is-active {
  border-color: rgba(22, 124, 128, 0.45);
  background: #e8f6f6;
  color: var(--accent-dark);
}

.landing-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.82fr);
  gap: 34px;
  align-items: center;
}

.landing-copy {
  display: grid;
  gap: 18px;
}

.landing-eyebrow {
  width: fit-content;
  padding: 7px 11px;
  border: 1px solid rgba(22, 124, 128, 0.28);
  border-radius: 999px;
  background: #e8f6f6;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 0.94;
  letter-spacing: 0;
}

.landing-copy p {
  max-width: 720px;
  margin: 0;
  color: #33414d;
  font-size: 19px;
  line-height: 1.55;
}

.landing-start {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(150px, auto);
  gap: 10px;
  align-items: end;
  margin-top: 4px;
}

.landing-start label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-start input {
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
}

.landing-start input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(22, 124, 128, 0.16);
}

.landing-start button {
  min-height: 52px;
  padding: 0 24px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.landing-map-card {
  position: relative;
  min-height: 410px;
  border: 1px solid rgba(22, 124, 128, 0.22);
  border-radius: 18px;
  overflow: hidden;
  background: #d9e7eb;
  box-shadow: 0 24px 70px rgba(22, 32, 42, 0.16);
}

.landing-map-card img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 410px;
  object-fit: cover;
}

.landing-world-shape {
  position: absolute;
  inset: 34px 24px 32px;
  background:
    radial-gradient(ellipse at 32% 35%, #f9fbfb 0 18%, transparent 19%),
    radial-gradient(ellipse at 66% 32%, #f9fbfb 0 21%, transparent 22%),
    radial-gradient(ellipse at 52% 72%, #f9fbfb 0 24%, transparent 25%);
  filter: drop-shadow(0 10px 0 rgba(22, 124, 128, 0.08));
  opacity: 0.95;
}

.landing-route {
  position: absolute;
  left: 24%;
  top: 50%;
  width: 56%;
  border-top: 3px dashed #cc3f3f;
  transform: rotate(19deg);
  z-index: 2;
}

.landing-pin {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #cc3f3f;
  box-shadow: 0 0 0 3px rgba(204, 63, 63, 0.22);
  z-index: 3;
}

.landing-pin.one {
  left: 24%;
  top: 34%;
}

.landing-pin.two {
  left: 68%;
  top: 47%;
}

.landing-pin.three {
  left: 47%;
  top: 70%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 124, 128, 0.25);
}

.landing-section,
.landing-about {
  margin-top: 34px;
  padding: 28px;
  border: 1px solid rgba(22, 124, 128, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.landing-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

.landing-section h2,
.landing-about h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.landing-section-heading p,
.landing-about p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.landing-section-heading p {
  max-width: 420px;
  text-align: right;
}

.landing-mode-grid {
  display: block;
  overflow: hidden;
  padding: 18px 0 8px;
  touch-action: pan-y;
  user-select: none;
}

.landing-carousel-track {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transform: translateX(calc(-1 * var(--landing-card-step, 0px)));
  transition: transform 420ms ease;
  will-change: transform;
}

.landing-carousel-track.no-transition,
.landing-carousel-track.is-dragging {
  transition: none;
}

.landing-carousel-track.no-transition .landing-mode-card,
.landing-carousel-track.is-dragging .landing-mode-card {
  transition: none;
}

.landing-mode-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 13px;
  flex: 0 0 calc((100% - 40px) / 3);
  min-height: 0;
  padding: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.78;
  transform: scale(0.88);
  transform-origin: center center;
  transition:
    opacity 220ms ease,
    transform 420ms ease;
  -webkit-tap-highlight-color: transparent;
}

.landing-mode-card[aria-hidden="true"] {
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .landing-mode-card:hover {
    opacity: 1;
  }
}

.landing-mode-card.is-center {
  opacity: 1;
  transform: scale(1);
}

.landing-mode-card.is-far {
  opacity: 0;
  transform: scale(0.62);
}

.landing-mode-card strong {
  display: block;
  width: min(100%, 235px);
  min-height: 48px;
  justify-self: center;
  font-size: 21px;
  line-height: 1.12;
}

.landing-mode-card > span:last-child {
  display: block;
  width: min(100%, 235px);
  min-height: 58px;
  justify-self: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.38;
}

.landing-card-visual {
  position: relative;
  display: block;
  width: min(100%, 235px);
  aspect-ratio: 235 / 531;
  height: auto;
  justify-self: center;
  border-radius: 8px;
  background: #edf8f6;
  box-shadow:
    0 0 0 14px rgba(237, 248, 246, 0.92),
    0 18px 38px rgba(22, 32, 42, 0.12);
  object-fit: cover;
  object-position: center;
  overflow: hidden;
  user-select: none;
  -webkit-user-drag: none;
}

.landing-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -4px 0 12px;
}

.landing-carousel-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-dark);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.landing-carousel-button:hover {
  border-color: rgba(22, 124, 128, 0.42);
  background: #e8f6f6;
}

.landing-carousel-dots {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.landing-carousel-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 1px solid rgba(11, 85, 89, 0.36);
  border-radius: 50%;
  background: transparent;
}

.landing-carousel-dot.is-active {
  border-color: var(--accent-dark);
  background: var(--accent);
}

.landing-card-visual::before,
.landing-card-visual::after,
.landing-card-visual span::before,
.landing-card-visual span::after {
  content: "";
  position: absolute;
}

.landing-card-visual.calendar::before {
  inset: 18px 20px;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 18px 0 #0b5559;
}

.landing-card-visual.calendar::after {
  left: 38px;
  top: 50px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f0b429;
}

.landing-card-visual.compass::before {
  inset: 20px;
  border: 3px solid var(--accent);
  border-radius: 50%;
}

.landing-card-visual.compass::after {
  left: 50%;
  top: 17px;
  width: 16px;
  height: 54px;
  background: #cc3f3f;
  clip-path: polygon(50% 0, 100% 100%, 50% 78%, 0 100%);
  transform: translateX(-50%) rotate(30deg);
}

.landing-card-visual.flag::before {
  left: 24px;
  top: 18px;
  width: 4px;
  height: 58px;
  background: var(--accent-dark);
}

.landing-card-visual.flag::after {
  left: 28px;
  top: 20px;
  width: 58px;
  height: 38px;
  background: linear-gradient(#167c80 0 33%, #fff 33% 66%, #cc3f3f 66%);
  border-radius: 4px;
}

.landing-card-visual.country::before {
  left: 20px;
  top: 22px;
  width: 74px;
  height: 50px;
  background: #f9fbfb;
  clip-path: polygon(8% 42%, 28% 10%, 55% 18%, 78% 4%, 96% 34%, 72% 70%, 82% 96%, 42% 82%, 18% 94%, 0 68%);
}

.landing-card-visual.city::before,
.landing-card-visual.city::after,
.landing-card-visual.city span::before {
  bottom: 16px;
  background: var(--accent-dark);
}

.landing-card-visual.city::before {
  left: 22px;
  width: 18px;
  height: 46px;
}

.landing-card-visual.city::after {
  left: 46px;
  width: 24px;
  height: 62px;
}

.landing-card-visual.city span::before {
  left: 76px;
  width: 18px;
  height: 34px;
}

.landing-card-visual.waves::before,
.landing-card-visual.waves::after,
.landing-card-visual.waves span::before {
  left: 16px;
  right: 16px;
  height: 16px;
  border-radius: 50%;
  border-top: 4px solid var(--accent);
}

.landing-card-visual.waves::before {
  top: 30px;
}

.landing-card-visual.waves::after {
  top: 48px;
}

.landing-card-visual.waves span::before {
  top: 66px;
}

.landing-card-visual.practice::before {
  left: 24px;
  top: 22px;
  width: 52px;
  height: 52px;
  border: 3px solid #cc3f3f;
  border-radius: 50%;
}

.landing-card-visual.practice::after {
  left: 48px;
  top: 12px;
  width: 3px;
  height: 72px;
  background: #cc3f3f;
}

.landing-card-visual.practice span::before {
  left: 12px;
  top: 48px;
  width: 72px;
  height: 3px;
  background: #cc3f3f;
}

.landing-about {
  display: grid;
  gap: 14px;
}

.landing-about p {
  max-width: 900px;
}

.landing-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.landing-link-row a {
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.landing-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding: 10px 0;
}

.landing-footer > a:first-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.landing-coffee-link {
  line-height: 0;
}

.landing-coffee-link img {
  display: block;
  max-width: 148px;
  height: auto;
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(160px, auto) minmax(180px, auto);
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  z-index: 500;
}

.brand {
  min-width: 0;
}

.brand > div {
  position: relative;
  width: max-content;
  max-width: 100%;
  padding: 4px 0 4px 40px;
  z-index: 0;
}

.brand-mark {
  position: absolute;
  left: 0;
  top: 50%;
  width: 58px;
  height: 58px;
  border: 2px solid rgba(22, 124, 128, 0.55);
  border-radius: 50%;
  opacity: 0.9;
  transform: translateY(-50%);
  z-index: 0;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span::before,
.brand-mark span::after {
  content: "";
  position: absolute;
  background: var(--accent);
}

.brand-mark::before {
  left: 27px;
  top: -7px;
  width: 2px;
  height: 70px;
}

.brand-mark::after {
  left: -7px;
  top: 27px;
  width: 70px;
  height: 2px;
}

.brand-mark span::before {
  left: 18px;
  top: 18px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent-dark);
  border-radius: 50%;
  background: transparent;
}

.brand-mark span::after {
  left: 25px;
  top: 25px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 0 0 2px var(--accent-dark);
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  position: relative;
  z-index: 1;
  font-size: 24px;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: 0;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 10px rgba(255, 255, 255, 0.75);
}

.brand p {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 14px;
  margin-top: 3px;
}

.score-strip {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.score-strip {
  overflow: visible;
}

.score-strip > div {
  min-width: 78px;
  padding: 8px 12px;
  border-left: 1px solid var(--line);
}

.score-strip > div:first-child {
  border-left: 0;
}

.score-label,
.result-label,
.challenge-kicker {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-strip strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}

.round-progress {
  display: grid;
  grid-template-columns: repeat(10, 10px);
  align-items: center;
  gap: 5px;
  min-height: 22px;
  margin-top: 2px;
}

.round-dot {
  width: 10px;
  height: 10px;
  border: 2px solid #a8b4bd;
  border-radius: 50%;
  background: #fff;
  box-sizing: border-box;
}

.round-dot.completed {
  border-color: var(--accent);
  background: var(--accent);
}

.round-dot.current {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(27, 123, 72, 0.18);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.top-control-field,
.top-name-field {
  display: grid;
  gap: 5px;
}

.top-controls {
  display: flex;
  align-items: end;
  justify-self: end;
  gap: 10px;
  min-width: 0;
  grid-column: 3;
  grid-row: 1;
}

.score-strip {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

.mode-field {
  flex: 0 1 170px;
  min-width: 126px;
}

.name-field {
  flex: 0 1 170px;
  min-width: 124px;
}

.menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.menu-button-icon {
  display: grid;
  gap: 4px;
}

.menu-button-icon span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 99px;
  background: var(--ink);
}

.menu-button-label {
  line-height: 1;
}

.menu-button:focus,
.menu-close-button:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(22, 124, 128, 0.16);
}

.top-control-field input,
.top-control-field select,
.top-name-field input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.top-control-field input:focus,
.top-control-field select:focus,
.top-name-field input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(22, 124, 128, 0.16);
}

.top-control-field select {
  cursor: pointer;
}

.language-picker {
  position: relative;
}

.language-button,
.language-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.language-button {
  width: 100%;
  padding: 8px 10px;
}

.language-button:focus,
.language-option:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(22, 124, 128, 0.16);
}

.language-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  width: 100%;
  min-width: 54px;
  display: grid;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
  z-index: 900;
}

.language-menu[hidden] {
  display: none;
}

.language-option {
  padding: 7px;
}

.language-option[aria-selected="true"] {
  border-color: var(--accent);
  background: rgba(22, 124, 128, 0.08);
}

.flag-icon {
  display: inline-block;
  width: 30px;
  height: 20px;
  border-radius: 3px;
  box-shadow: none;
}

.high-score-link-cell {
  min-width: 104px;
}

.high-score-link-cell a {
  display: block;
  margin-top: 3px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.high-score-link-cell a:hover {
  text-decoration: underline;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  z-index: 800;
}

.menu-backdrop[hidden],
.app-menu[hidden] {
  display: none;
}

.app-menu {
  position: fixed;
  top: 0;
  right: 0;
  display: grid;
  align-content: start;
  gap: 18px;
  width: min(340px, calc(100vw - 24px));
  height: 100vh;
  height: 100dvh;
  padding: 18px;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: -18px 0 44px rgba(22, 32, 42, 0.18);
  z-index: 900;
}

.app-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-menu-header strong {
  font-size: 20px;
}

.menu-close-button {
  display: grid;
  place-items: center;
  position: relative;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 0;
  line-height: 1;
}

.menu-close-button::before,
.menu-close-button::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.menu-close-button::before {
  transform: rotate(45deg);
}

.menu-close-button::after {
  transform: rotate(-45deg);
}

.menu-name-field,
.menu-mode-field,
.menu-language-field {
  display: grid;
  gap: 6px;
}

.menu-name-field input,
.menu-mode-field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.menu-name-field input:focus,
.menu-mode-field select:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(22, 124, 128, 0.16);
}

.menu-personal-best {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.menu-personal-best strong {
  display: block;
  margin-top: 3px;
  font-size: 20px;
}

.menu-language-field .language-picker {
  width: 72px;
}

.menu-links {
  display: grid;
  gap: 8px;
}

.menu-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.menu-links a::after {
  content: "›";
  color: var(--accent-dark);
  font-size: 22px;
  line-height: 1;
}

.menu-links a:hover {
  border-color: rgba(22, 124, 128, 0.35);
  background: #f0f8f8;
}

.menu-links a[aria-current="page"] {
  border-color: var(--line);
  background: #edf1f2;
  color: var(--muted);
  cursor: default;
}

.menu-links a[aria-current="page"]::after {
  content: "";
}

.menu-install-button {
  display: inline-block;
  width: fit-content;
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.menu-install-button:hover {
  color: var(--accent);
}

.menu-install-button[hidden] {
  display: none;
}

.install-app-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 32, 0.36);
}

.install-app-dialog-backdrop[hidden] {
  display: none;
}

.install-app-dialog {
  position: relative;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid rgba(22, 124, 128, 0.24);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 24px 60px rgba(22, 32, 42, 0.22);
}

.install-app-dialog h2 {
  margin: 0 36px 10px 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.install-app-dialog p {
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.install-app-dialog ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--ink);
  line-height: 1.5;
}

.install-app-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.install-app-dialog-action {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.menu-home-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.menu-home-link:hover {
  color: var(--accent-dark);
}

.menu-coffee-link {
  display: inline-block;
  width: fit-content;
  margin-top: 10px;
  line-height: 0;
}

.menu-coffee-link img {
  display: block;
  max-width: 148px;
  height: auto;
}

.menu-coffee-link:hover {
  opacity: 0.88;
}

.play-area {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: 0;
}

.daily-intro {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  background: rgba(238, 250, 250, 0.97);
  color: var(--ink);
  text-align: center;
  z-index: 700;
  animation: daily-intro-in 380ms ease-out both;
}

.daily-intro[hidden] {
  display: none;
}

.daily-intro.daily-intro-leave {
  animation: daily-intro-out 320ms ease-in both;
}

.daily-intro strong {
  font-size: 56px;
  line-height: 1;
}

.daily-intro p {
  margin: 0;
  color: var(--accent-dark);
  font-size: 19px;
  font-weight: 800;
}

.daily-intro-mark {
  position: relative;
  width: 58px;
  height: 58px;
  border: 2px solid var(--accent);
  border-radius: 50%;
}

.daily-intro-mark::before,
.daily-intro-mark::after,
.daily-intro-mark span {
  content: "";
  position: absolute;
  background: var(--accent);
}

.daily-intro-mark::before {
  left: 27px;
  top: -8px;
  width: 2px;
  height: 70px;
}

.daily-intro-mark::after {
  left: -8px;
  top: 27px;
  width: 70px;
  height: 2px;
}

.daily-intro-mark span {
  left: 22px;
  top: 22px;
  width: 12px;
  height: 12px;
  border: 3px solid #eefafa;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--accent-dark);
}

@keyframes daily-intro-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes daily-intro-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.challenge-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow: auto;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.daily-mode .challenge-panel {
  border-right-color: rgba(11, 85, 89, 0.45);
  background: #f3fbfa;
  box-shadow: inset 5px 0 0 #f0b429;
}

.daily-mode .topbar {
  border-bottom-color: #d99a13;
}

.daily-mode .map-frame {
  position: relative;
}

.daily-mode .map-frame::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 750;
  height: 4px;
  background: #f0b429;
  pointer-events: none;
}

.daily-mode .score-strip {
  border-color: rgba(217, 154, 19, 0.55);
  background: #fffaf0;
}

.daily-mode #restartButton {
  display: none;
}

.daily-mode .round-dot.completed {
  border-color: #d99a13;
  background: #f0b429;
}

.daily-mode .round-dot.current {
  border-color: #a66e00;
  box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.24);
}

.daily-event-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #0b5559;
  color: white;
}

.daily-event-banner[hidden] {
  display: none;
}

.daily-event-banner strong {
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.daily-event-banner time {
  color: #ffe2a0;
  font-size: 13px;
  font-weight: 800;
  text-transform: capitalize;
}

.daily-event-signal {
  width: 9px;
  height: 9px;
  border: 2px solid #fff4d6;
  border-radius: 50%;
  background: #f0b429;
  box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.2);
}

.daily-mode .challenge-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid rgba(22, 124, 128, 0.24);
  border-radius: 999px;
  background: rgba(22, 124, 128, 0.1);
  color: var(--accent-dark);
}

.challenge-panel h2 {
  min-height: 98px;
  margin: 0;
  font-size: var(--target-title-size, 42px);
  font-weight: 850;
  line-height: 1.02;
  overflow-wrap: normal;
  white-space: nowrap;
  hyphens: manual;
}

.challenge-panel h2.target-title-wrap {
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
}

.challenge-panel h2.flag-target-title {
  min-height: 0;
  line-height: 0;
}

.practice-mode .challenge-panel h2 {
  display: none;
}

.practice-mode .action-row {
  display: none;
}

.target-flag {
  display: block;
  width: min(220px, 100%);
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12), 0 10px 22px rgba(15, 23, 42, 0.12);
  line-height: 1;
}

.challenge-panel > .target-prompt {
  margin: -4px 0 2px;
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: #f0f8f8;
  color: var(--accent-dark);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.practice-type-chooser {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.practice-type-chooser[hidden] {
  display: none;
}

.practice-type-chooser button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.practice-type-chooser button.active {
  border-color: var(--accent);
  background: #e9f6f6;
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px rgba(22, 124, 128, 0.35);
}

.practice-result-flag {
  display: block;
  width: min(190px, 100%);
  max-width: 100%;
  margin-top: 10px;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.16);
  aspect-ratio: 4 / 3;
}

.question-enter .challenge-kicker {
  animation: question-enter 320ms ease-out both;
}

.question-enter #targetName {
  animation: question-enter 420ms 55ms ease-out both;
}

.question-enter .target-prompt {
  animation: question-enter 420ms 110ms ease-out both;
}

@keyframes question-enter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .question-enter .challenge-kicker,
  .question-enter #targetName,
  .question-enter .target-prompt {
    animation: none;
  }

  .daily-intro,
  .daily-intro.daily-intro-leave {
    animation: none;
  }
}

.player-name-field {
  display: grid;
  gap: 6px;
}

.player-name-field input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.player-name-field input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(22, 124, 128, 0.16);
}

.result-box {
  min-height: 152px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.result-box strong {
  display: block;
  margin-top: 8px;
  font-size: 21px;
  line-height: 1.2;
}

.result-box p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.result-meta {
  display: none;
}

.result-box.good {
  border-color: rgba(27, 123, 72, 0.35);
  background: #eef8f2;
}

.result-box.warn {
  border-color: rgba(176, 90, 22, 0.35);
  background: #fff5ea;
}

.result-box.wrong {
  border-color: rgba(167, 53, 53, 0.35);
  background: #fff0f0;
}

.leaderboard-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

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

.leaderboard-heading > span:last-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.leaderboard-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.leaderboard-lists strong {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}

.leaderboard-lists ol {
  display: grid;
  gap: 5px;
  min-height: 94px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 12px;
}

.leaderboard-lists li {
  padding-left: 2px;
}

.leaderboard-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.leaderboard-entry span:first-child {
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-entry span:last-child {
  color: var(--muted);
}

.high-score-prompt {
  margin: 10px 0 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.highscores-page {
  min-height: 100%;
  overflow: auto;
}

.highscores-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.highscores-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 20px;
  margin-bottom: 20px;
}

.highscores-header > div:first-child {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.highscores-mode-field {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  gap: 6px;
  width: min(760px, 100%);
}

.highscores-mode-field > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.highscores-mode-buttons {
  display: flex;
  gap: 4px;
  overflow-x: visible;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
}

.highscores-mode-select {
  display: none;
  min-height: 42px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.highscores-mode-button {
  flex: 1 1 0;
  min-width: 70px;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.highscores-mode-button:hover {
  background: rgba(22, 124, 128, 0.08);
  color: var(--accent-dark);
}

.highscores-mode-button:focus-visible {
  outline: 2px solid rgba(22, 124, 128, 0.25);
  outline-offset: 2px;
}

.highscores-mode-button.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(11, 85, 89, 0.22);
}

.highscores-header h1 {
  margin: 8px 0 4px;
  font-size: 34px;
}

.highscores-header p {
  margin: 0;
  color: var(--muted);
}

.back-link {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.page-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-links a {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.page-links a:hover {
  border-color: rgba(22, 124, 128, 0.35);
  background: #f0f8f8;
}

.static-page-menu {
  position: static;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

.static-page-menu .menu-button {
  min-width: 116px;
  background: white;
}

.page-menu {
  position: fixed;
  top: 0;
  right: 0;
  align-content: start;
  gap: 16px;
  width: min(340px, calc(100vw - 24px));
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  padding: 18px;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: -18px 0 44px rgba(22, 32, 42, 0.18);
  overflow: auto;
  z-index: 1000;
  display: grid;
}

.page-menu[hidden],
.page-menu-backdrop[hidden] {
  display: none;
}

.page-menu .menu-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.page-menu .menu-links a::after {
  content: "›";
  color: var(--accent-dark);
  font-size: 22px;
  line-height: 1;
}

.page-menu .menu-links a:hover,
.page-menu .menu-links a[aria-current="page"] {
  border-color: rgba(22, 124, 128, 0.35);
  background: #f0f8f8;
}

.page-menu .menu-links a[aria-current="page"] {
  border-color: var(--line);
  background: #edf1f2;
  color: var(--muted);
}

.highscores-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.highscores-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.highscores-card h2 {
  margin: 0 0 14px;
  font-size: 23px;
}

.highscores-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.highscores-columns h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.highscores-columns ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 24px;
  color: var(--muted);
}

.highscores-row {
  padding-left: 2px;
}

.highscores-row span {
  display: block;
}

.highscores-row span:first-child {
  color: var(--ink);
  font-weight: 800;
}

.highscores-row span:nth-child(2) {
  font-size: 13px;
}

.highscores-row span:last-child {
  font-size: 12px;
}

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

.stats-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stats-card-strengths {
  border-top: 4px solid #1b7b48;
}

.stats-card-overview {
  grid-column: 1 / -1;
  border-top: 4px solid #54727a;
}

.stats-card-weaknesses {
  border-top: 4px solid #d99a13;
}

.stats-card-global {
  grid-column: 1 / -1;
  border-top: 4px solid var(--accent-dark);
  background: #f8fbfb;
}

.stats-card-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.stats-card-heading h2 {
  margin: 0;
  font-size: 24px;
}

.stats-card-title {
  min-width: 0;
}

.stats-card-title p {
  max-width: 58ch;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.stats-card-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

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

.stats-metrics-global {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-metrics-overview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-metrics > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fbfcfd;
}

.stats-metrics strong {
  display: block;
  margin-top: 4px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.stats-missed h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.stats-missed ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 13px;
}

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

.stats-place-row span:first-child {
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 700;
}

.primary-button {
  background: var(--accent);
  color: white;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-dark);
}

.secondary-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.secondary-button:hover {
  background: #f5f7f8;
}

.map-frame {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

#map {
  height: 100%;
  width: 100%;
  background: #cfe3eb;
}

.leaflet-container {
  font-family: inherit;
  overflow: hidden;
  position: relative;
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
}

.leaflet-container img,
.leaflet-tile {
  max-width: none;
  max-height: none;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-map-pane,
.leaflet-tile-pane,
.leaflet-overlay-pane,
.leaflet-shadow-pane,
.leaflet-marker-pane,
.leaflet-tooltip-pane,
.leaflet-popup-pane {
  position: absolute;
}

.leaflet-tile {
  border: 0;
  user-select: none;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-control-zoom {
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 6px;
  overflow: hidden;
  margin: 10px;
}

.leaflet-control-zoom a {
  display: block;
  width: 30px;
  height: 30px;
  background: white;
  color: var(--ink);
  line-height: 30px;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}

.leaflet-control-zoom a + a {
  border-top: 1px solid var(--line);
}

.leaflet-control-attribution {
  margin: 0;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 11px;
}

.answer-line {
  stroke: #cc3f35;
  stroke-width: 3;
  stroke-dasharray: 8 7;
}

.country-answer {
  stroke: #0b5559;
  stroke-width: 3;
  fill: #26a69a;
  fill-opacity: 0.22;
}

.other-answer {
  stroke: #1769aa;
  stroke-width: 3;
  fill: #42a5f5;
  fill-opacity: 0.2;
}

.practice-country-layer {
  cursor: pointer;
}

.practice-other-layer {
  cursor: pointer;
}

.practice-city-dot {
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.28));
}

.practice-dot-icon {
  background: transparent;
  cursor: pointer;
}

.practice-dot-icon span {
  display: block;
  width: 12px;
  height: 12px;
  border: 1px solid #991b1b;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
}

.practice-selected-dot-icon span {
  width: 16px;
  height: 16px;
  border: 2px solid #7c2d12;
  background: #facc15;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.32);
}

.guess-crosshair {
  background: transparent;
  position: relative;
}

.guess-crosshair::before,
.guess-crosshair::after,
.guess-crosshair span::before,
.guess-crosshair span::after {
  content: "";
  position: absolute;
  background: #d62828;
}

.guess-crosshair::before {
  left: 50%;
  top: 1px;
  width: 2px;
  height: 26px;
  transform: translateX(-50%);
}

.guess-crosshair::after {
  left: 1px;
  top: 50%;
  width: 26px;
  height: 2px;
  transform: translateY(-50%);
}

.guess-crosshair span::before {
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 2px solid #d62828;
  border-radius: 50%;
  background: transparent;
  transform: translate(-50%, -50%);
}

.guess-crosshair span::after {
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 0 2px #d62828;
  transform: translate(-50%, -50%);
}

.answer-dot {
  background: transparent;
}

.answer-dot span {
  display: block;
  width: 16px;
  height: 16px;
  border: 2px solid white;
  border-radius: 50%;
  background: #1b7b48;
  box-shadow: 0 0 0 2px rgba(22, 32, 42, 0.35);
}

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: minmax(190px, 1fr) minmax(180px, auto);
    align-items: stretch;
  }

  .score-strip {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: stretch;
    justify-self: stretch;
  }

  .top-control-field,
  .top-name-field {
    width: 100%;
  }

  .top-controls {
    display: grid;
    grid-template-columns: minmax(126px, 190px) auto;
    align-items: end;
    grid-column: 2;
    grid-row: 1;
    max-width: 250px;
  }

  .mode-field {
    max-width: 220px;
  }

  .score-strip > div {
    flex: 1;
  }
}

@media (max-width: 860px) {
  .landing-hero {
    min-height: auto;
  }

  .landing-hero-grid {
    grid-template-columns: 1fr;
  }

  .landing-map-card {
    display: none;
  }

  .landing-section-heading {
    display: grid;
  }

  .landing-section-heading p {
    max-width: none;
    text-align: left;
  }

  .landing-mode-card {
    flex-basis: calc((100% - 40px) / 2);
  }

  .stats-grid,
  .highscores-grid,
  .highscores-columns {
    grid-template-columns: 1fr;
  }

  .highscores-header {
    display: grid;
    align-items: stretch;
  }

  .highscores-mode-field {
    width: 100%;
  }

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

@media (max-width: 760px) {
  .app-shell {
    min-height: 100vh;
    height: auto;
    overflow: auto;
  }

  .play-area {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(360px, 1fr);
  }

  .challenge-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .daily-mode .challenge-panel {
    box-shadow: inset 0 5px 0 #f0b429;
  }
}

@media (max-width: 620px) {
  .landing-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .landing-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .landing-language-list {
    justify-content: flex-start;
  }

  .landing-copy h1 {
    font-size: 42px;
  }

  .landing-copy p {
    font-size: 16px;
  }

  .landing-start {
    grid-template-columns: 1fr;
  }

  .landing-section,
  .landing-about {
    padding: 18px;
  }

  .landing-mode-grid {
    padding-top: 14px;
  }

  .landing-carousel-track {
    gap: 14px;
  }

  .landing-mode-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    flex-basis: calc((100% - 28px) / 2);
    min-height: 0;
  }

  .landing-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 12px;
  }

  .brand p {
    display: none;
  }

  .daily-intro strong {
    font-size: 38px;
  }

  .daily-intro p {
    font-size: 16px;
  }

  .top-controls {
    grid-template-columns: minmax(0, 1fr) 42px;
    grid-column: 1;
    grid-row: 2;
    gap: 8px;
    max-width: none;
  }

  .menu-button {
    width: 42px;
    padding: 8px;
  }

  .menu-button-label {
    display: none;
  }

  .score-strip {
    grid-column: 1;
    grid-row: 3;
  }

  .mode-field {
    min-width: 0;
    max-width: none;
  }

  .score-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    overflow: hidden;
  }

  .score-strip > div {
    min-width: 0;
    padding: 6px 8px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .highscores-mode-button {
    padding: 6px 5px;
    font-size: 13px;
  }

  .score-strip > div:nth-child(-n + 2) {
    border-top: 0;
  }

  .score-strip > div:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .score-label {
    font-size: 9px;
  }

  .score-strip strong {
    margin-top: 1px;
    font-size: 14px;
    line-height: 1.15;
  }

  .stats-card-heading {
    align-items: start;
    flex-direction: column;
  }

  .stats-card-heading span {
    white-space: normal;
  }

  .stats-metrics,
  .stats-metrics-global,
  .stats-metrics-overview {
    grid-template-columns: 1fr;
  }

  .round-progress {
    grid-template-columns: repeat(10, 8px);
    gap: 3px;
    min-height: 18px;
  }

  .round-dot {
    width: 8px;
    height: 8px;
    border-width: 1.5px;
  }

  .round-dot.current {
    box-shadow: 0 0 0 2px rgba(27, 123, 72, 0.18);
  }

  .high-score-link-cell a {
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.2;
  }

  .challenge-panel {
    padding: 16px;
    gap: 12px;
  }

  .challenge-panel h2 {
    min-height: 58px;
    font-size: 32px;
  }

  .target-flag {
    width: min(180px, 100%);
  }

  .challenge-panel > .target-prompt {
    padding: 8px 10px;
    font-size: 14px;
  }

  .result-box {
    min-height: 126px;
  }

}

@media (max-width: 760px) {
  body:has(.app-shell):not(.practice-mode) {
    overflow: hidden;
  }

  body:has(.app-shell):not(.practice-mode) .app-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
  }

  body:has(.app-shell):not(.practice-mode) .topbar {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    right: calc(env(safe-area-inset-right, 0px) + 10px);
    z-index: 850;
    display: block;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    pointer-events: none;
  }

  body:has(.app-shell):not(.practice-mode) .brand,
  body:has(.app-shell):not(.practice-mode) .mode-field,
  body:has(.app-shell):not(.practice-mode) .score-strip > div:first-child,
  body:has(.app-shell):not(.practice-mode) .challenge-panel > .target-prompt,
  body:has(.app-shell):not(.practice-mode) .daily-event-banner {
    display: none;
  }

  body:has(.app-shell):not(.practice-mode) .top-controls {
    display: block;
    max-width: none;
    pointer-events: auto;
  }

  body:has(.app-shell):not(.practice-mode) .menu-button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    border-color: rgba(15, 23, 42, 0.16);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(8px);
  }

  body:has(.app-shell):not(.practice-mode) .menu-button-label {
    display: none;
  }

  body:has(.app-shell):not(.practice-mode) .play-area {
    display: block;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  body:has(.app-shell):not(.practice-mode) .map-frame {
    position: fixed;
    inset: 0;
    z-index: 1;
  }

  body:has(.app-shell):not(.practice-mode) #map {
    height: 100vh;
    height: 100dvh;
  }

  body:has(.app-shell):not(.practice-mode) .leaflet-control-container {
    display: none;
  }

  body:has(.app-shell):not(.practice-mode) .challenge-panel {
    position: fixed;
    inset: 0;
    z-index: 820;
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
  }

  body.daily-mode:not(.practice-mode) .challenge-panel {
    box-shadow: none;
  }

  body:has(.app-shell):not(.practice-mode) .challenge-kicker,
  body:has(.app-shell):not(.practice-mode) .challenge-panel h2 {
    position: fixed;
    left: calc(env(safe-area-inset-left, 0px) + 62px);
    right: calc(env(safe-area-inset-right, 0px) + 62px);
    z-index: 830;
    text-align: center;
    text-shadow: 0 1px 10px rgba(255, 255, 255, 0.92);
    pointer-events: none;
  }

  body:has(.app-shell):not(.practice-mode) .challenge-kicker {
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    color: #0b5559;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.03em;
  }

  body:has(.app-shell):not(.practice-mode) .challenge-panel h2 {
    top: calc(env(safe-area-inset-top, 0px) + 28px);
    min-height: 0;
    margin: 0;
    color: #142129;
    font-size: min(var(--target-title-size, 30px), 30px);
    line-height: 1.04;
  }

  body:has(.app-shell):not(.practice-mode) .challenge-panel h2.flag-target-title {
    top: calc(env(safe-area-inset-top, 0px) + 34px);
  }

  body:has(.app-shell):not(.practice-mode) .target-flag {
    width: min(120px, 42vw);
    margin: 0 auto;
  }

  body:has(.app-shell):not(.practice-mode) .score-strip {
    display: contents;
    pointer-events: none;
  }

  body:has(.app-shell):not(.practice-mode) .score-strip > div:last-child {
    display: contents;
    padding: 0;
    border: 0;
    background: transparent;
  }

  body:has(.app-shell):not(.practice-mode) .score-strip .score-label,
  body:has(.app-shell):not(.practice-mode) #roundStatus {
    display: none;
  }

  body:has(.app-shell):not(.practice-mode) .round-progress {
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    z-index: 850;
    display: grid;
    grid-template-columns: repeat(10, 10px);
    gap: 5px;
    min-height: 10px;
    padding: 7px 9px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(8px);
  }

  body:has(.app-shell):not(.practice-mode).result-visible .round-progress {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  }

  body:has(.app-shell):not(.practice-mode) > .round-progress {
    position: fixed;
    left: 50%;
    right: auto;
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    z-index: 850;
    transform: translateX(-50%);
  }

  body:has(.app-shell):not(.practice-mode) .round-dot {
    width: 10px;
    height: 10px;
    border-width: 1.5px;
  }

  body:has(.app-shell):not(.practice-mode) .result-box {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 70px);
    left: calc(env(safe-area-inset-left, 0px) + 14px);
    right: calc(env(safe-area-inset-right, 0px) + 14px);
    z-index: 840;
    display: none;
    min-height: 0;
    max-height: min(42vh, 330px);
    overflow: auto;
    padding: 15px;
    transform: none;
    border-radius: 8px;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.24);
    pointer-events: auto;
  }

  body:has(.app-shell):not(.practice-mode) .challenge-panel h2.flag-target-title ~ .result-box {
    top: calc(env(safe-area-inset-top, 0px) + 164px);
    max-height: min(34vh, 280px);
  }

  body:has(.app-shell):not(.practice-mode).result-visible .result-box {
    display: block;
  }

  body:has(.app-shell):not(.practice-mode) .result-box strong {
    margin-top: 6px;
    font-size: 19px;
  }

  body:has(.app-shell):not(.practice-mode) .result-box p {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.38;
  }

  body:has(.app-shell):not(.practice-mode) .result-box .result-meta {
    display: block;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
  }

  body:has(.app-shell):not(.practice-mode) .action-row {
    position: fixed;
    left: calc(env(safe-area-inset-left, 0px) + 14px);
    right: calc(env(safe-area-inset-right, 0px) + 14px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 52px);
    z-index: 845;
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0;
    pointer-events: auto;
  }

  body:has(.app-shell):not(.practice-mode).result-visible .action-row {
    display: grid;
  }

  body:has(.app-shell):not(.practice-mode) .secondary-button {
    display: none;
  }

  body:has(.app-shell):not(.practice-mode) .high-score-prompt {
    position: fixed;
    left: calc(env(safe-area-inset-left, 0px) + 14px);
    right: calc(env(safe-area-inset-right, 0px) + 14px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 108px);
    z-index: 846;
    pointer-events: auto;
  }

  body.practice-mode {
    overflow: hidden;
  }

  body.practice-mode .app-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
  }

  body.practice-mode .topbar {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    right: calc(env(safe-area-inset-right, 0px) + 10px);
    z-index: 850;
    display: block;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    pointer-events: none;
  }

  body.practice-mode .brand,
  body.practice-mode .mode-field,
  body.practice-mode .score-strip,
  body.practice-mode .challenge-kicker,
  body.practice-mode .challenge-panel h2,
  body.practice-mode .challenge-panel > .target-prompt {
    display: none;
  }

  body.practice-mode .top-controls {
    display: block;
    max-width: none;
    pointer-events: auto;
  }

  body.practice-mode .menu-button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    border-color: rgba(15, 23, 42, 0.16);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(8px);
  }

  body.practice-mode .menu-button-label {
    display: none;
  }

  body.practice-mode .play-area {
    display: block;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  body.practice-mode .map-frame {
    position: fixed;
    inset: 0;
    z-index: 1;
  }

  body.practice-mode #map {
    height: 100vh;
    height: 100dvh;
  }

  body.practice-mode .leaflet-control-container {
    display: none;
  }

  body.practice-mode .challenge-panel {
    position: fixed;
    inset: 0;
    z-index: 820;
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
  }

  body.practice-mode .practice-type-chooser {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    left: calc(env(safe-area-inset-left, 0px) + 12px);
    right: calc(env(safe-area-inset-right, 0px) + 66px);
    z-index: 845;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    pointer-events: auto;
  }

  body.practice-mode .practice-type-chooser[hidden] {
    display: none;
  }

  body.practice-mode .practice-type-chooser button {
    min-height: 44px;
    padding: 8px 10px;
    border-color: rgba(15, 23, 42, 0.16);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(8px);
    font-size: 14px;
    line-height: 1.15;
  }

  body.practice-mode .practice-type-chooser button.active {
    border-color: var(--accent);
    background: rgba(233, 246, 246, 0.96);
  }

  body.practice-mode .result-box {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 64px);
    left: calc(env(safe-area-inset-left, 0px) + 12px);
    right: calc(env(safe-area-inset-right, 0px) + 12px);
    z-index: 840;
    display: block;
    min-height: 0;
    max-height: min(58vh, 470px);
    overflow: visible;
    padding: 12px 13px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(8px);
    pointer-events: auto;
  }

  body.practice-mode .result-box strong {
    margin-top: 4px;
    font-size: 18px;
  }

  body.practice-mode .result-box p {
    margin-top: 7px;
    font-size: 14px;
    line-height: 1.35;
  }

  body.practice-mode .practice-result-flag {
    width: min(240px, 54vw);
    max-height: min(26vh, 190px);
    object-fit: contain;
  }

  .highscores-page .highscores-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 12px;
  }

  .highscores-page .highscores-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: start;
    gap: 10px;
  }

  .highscores-page .highscores-header > div:first-child {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .highscores-page .static-page-menu {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .highscores-page .static-page-menu .menu-button {
    width: 44px;
    min-width: 44px;
    min-height: 42px;
    padding: 8px;
  }

  .highscores-page .static-page-menu .menu-button-label {
    display: none;
  }

  .highscores-page .highscores-header h1 {
    margin-top: 6px;
    font-size: 28px;
  }

  .highscores-page .highscores-mode-field {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .highscores-page .highscores-mode-buttons {
    display: none;
  }

  .highscores-page .highscores-mode-select {
    display: block;
  }

  body.highscores-page {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  body.highscores-page .highscores-shell {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
}
