:root {
  --bg: #07111f;
  --ink: #f8fbff;
  --muted: #a8b6ca;
  --country: #36506e;
  --country-hover: #4f6f94;
  --ui-surface: rgba(10,24,40,.84);
  --ui-border: rgba(255,255,255,.14);
  --ui-shadow: 0 8px 24px rgba(0,0,0,.28);
  --ui-radius: 16px;
  --done: #65d99b;
  --retry: #c99a16;
  --retry-dark: #8f6810;
  --mastered: #ffd84d;
  --target: #ffe879;
  --accent: #5d7cff;
}

* {
  box-sizing: border-box;
}

html,body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

.app {
  width: 100vw;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  touch-action: none;
}

.map-card {
  contain: paint;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 20% 15%,rgba(93,124,255,.18),transparent 32%),radial-gradient(circle at 80% 70%,rgba(0,214,170,.12),transparent 34%),linear-gradient(160deg,#07111f 0%,#0c1d31 55%,#0d2740 100%);
}

#map {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.land-bg {
  fill: #22374f;
  stroke: rgba(255,255,255,.32);
  stroke-width: .75;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.country {
  fill: var(--country);
  stroke: rgba(255,255,255,.84);
  stroke-width: .8;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill .16s ease;
}

.country.done {
  fill: var(--done);
}

.country.retry {
  fill: var(--retry) !important;
}

.country.retry-dark {
  fill: var(--retry-dark) !important;
  filter: drop-shadow(0 0 7px rgba(143,104,16,.5));
}

.country.mastered {
  fill: var(--done) !important;
}

.country.hinted,.country.hinted:hover {
  fill: url(#hintStripes) !important;
}

.country.target,.country.target:hover,.country.done.target,.country.done.target:hover,.country.retry.target,.country.retry.target:hover {
  fill: var(--target) !important;
}

.country.hinted.target,.country.hinted.target:hover {
  fill: url(#hintStripes) !important;
}

.country.wrong {
  fill: url(#retryStripes) !important;
  animation: wrongPulse .38s ease;
}

.island-marker,.capital-marker {
  fill: var(--country);
  stroke: rgba(255,255,255,.95);
  stroke-width: 1.15;
  cursor: pointer;
  vector-effect: non-scaling-stroke;
  transition: fill .16s ease;
}

.island-marker.done,.capital-marker.done {
  fill: var(--done);
}

.island-marker.retry,.capital-marker.retry {
  fill: var(--retry) !important;
}

.island-marker.retry-dark,.capital-marker.retry-dark {
  fill: var(--retry-dark) !important;
  filter: drop-shadow(0 0 7px rgba(143,104,16,.5));
}

.island-marker.mastered,.capital-marker.mastered {
  fill: var(--done) !important;
}

.island-marker.hinted,.capital-marker.hinted {
  fill: url(#hintStripes) !important;
}

.island-marker.target,.capital-marker.target {
  fill: url(#hintStripes) !important;
}

.island-marker.wrong,.capital-marker.wrong {
  fill: url(#retryStripes) !important;
  animation: wrongPulse .38s ease;
}

.island-hit {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
  cursor: pointer;
}

.country.territory-feature.territory-off {
  cursor: default;
}

.island-marker.territory-feature.territory-off,.island-hit.territory-off {
  display: none !important;
}

@keyframes wrongPulse {
  0% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.45);
  }

  100% {
    filter: brightness(1);
  }
}

.stats-cluster {
  position: absolute;
  left: 18px;
  bottom: 48px !important;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 7px;
}

.score,.timer {
  min-width: 58px;
  min-height: 46px;
  height: 46px;
  padding: 0 12px;
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  color: var(--ink);
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow);
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.timer {
  min-width: 68px;
}

.bottom-control {
  position: absolute;
  bottom: 46px !important;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.bottom-control button {
  pointer-events: auto;
}

.explore-control {
  right: 82px;
}

.show-control {
  right: 18px;
}

.explore-bottom-button,.show-button {
  width: 52px;
  height: 46px;
  min-height: 46px;
  border-radius: var(--ui-radius);
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: var(--ui-shadow);
  cursor: pointer;
}

.explore-bottom-button {
  border: 1px solid var(--ui-border);
  background: var(--ui-surface);
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 800;
}

.explore-bottom-button.active {
  background: var(--accent);
  color: #fff;
}

.show-button {
  border: 1px solid rgba(255,255,255,.18);
}

.show-button:disabled,.show-button.disabled {
  opacity: .38;
  filter: grayscale(.7);
  cursor: not-allowed;
  box-shadow: none;
}

.show-control.disabled {
  opacity: .65;
}

.show-icon {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.test-end-button {
  position: absolute;
  z-index: 8;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255,79,100,.42);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  color: #ff8b99;
  font: inherit;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--ui-shadow);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 750;
  cursor: pointer;
  user-select: none;
}

.settings-row+ .settings-row {
  border-top: 1px solid rgba(255,255,255,.08);
}

.settings-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-switch {
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: #445364;
  position: relative;
  flex: none;
  transition: .15s;
}

.settings-switch:after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: .15s;
}

.settings-row input:checked+.settings-switch {
  background: var(--accent);
}

.settings-row input:checked+.settings-switch:after {
  transform: translateX(12px);
}

.zoom-hint {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  color: var(--muted);
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow);
  display: flex;
  align-items: center;
  font-size: .82rem;
  pointer-events: none;
  transition: opacity .25s;
}

.zoom-hint.hidden {
  opacity: 0;
}

.explore-badge {
  position: absolute;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--ui-radius);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  box-shadow: var(--ui-shadow);
}

.finish-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4,10,18,.78);
}

.finish-screen[hidden] {
  display: none;
}

.finish-panel {
  width: min(92vw,420px);
  padding: 34px 28px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 24px;
  background: rgba(10,24,40,.95);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.42);
}

.finish-title {
  font-size: clamp(2.2rem,8vw,4rem);
  font-weight: 900;
  letter-spacing: -.03em;
  color: #fff;
}

.finish-label {
  margin-top: 18px;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.finish-time {
  margin-top: 6px;
  font-size: clamp(2rem,7vw,3.3rem);
  font-weight: 850;
  color: var(--mastered);
  font-variant-numeric: tabular-nums;
}

.redo-button {
  margin-top: 28px;
  min-width: 150px;
  padding: 11px 22px;
  border: 0;
  border-radius: var(--ui-radius);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

.secondary-button {
  background: #30445d;
}

.restart-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

[hidden],#accuracyRow[hidden] {
  display: none !important;
}

@media(hover:hover) and (pointer:fine) {
  .country:not(.done):not(.retry):not(.mastered):not(.hinted):not(.target):hover,.island-marker:not(.done):not(.retry):not(.mastered):not(.hinted):not(.target):hover {
    fill: var(--country-hover);
  }

  .country.done:hover {
    fill: var(--done);
  }

  .country.retry:hover {
    fill: var(--retry) !important;
  }

  .country.retry-dark:hover {
    fill: var(--retry-dark) !important;
  }

  .country.mastered:hover {
    fill: var(--done) !important;
  }

  .island-marker.done:hover {
    fill: var(--done);
  }

  .island-marker.retry:hover {
    fill: var(--retry) !important;
  }

  .island-marker.retry-dark:hover {
    fill: var(--retry-dark) !important;
  }

  .island-marker.mastered:hover {
    fill: var(--done) !important;
  }
}

@media(max-width:700px) {
  .score,.timer,.explore-bottom-button,.show-button {
    height: 44px;
    min-height: 44px;
  }

  .stats-cluster {
    left: 10px;
    bottom: 46px !important;
  }

  .bottom-control {
    bottom: 44px !important;
  }

  .zoom-hint {
    top: 10px;
    right: 10px;
  }

  .explore-control {
    right: 70px;
  }

  .show-control {
    right: 10px;
  }
}

@media(max-width:420px) {
  .score,.timer,.explore-bottom-button,.show-button {
    height: 42px;
    min-height: 42px;
  }

  .zoom-hint {
    display: none;
  }
}

.country.out-of-scope,.island-marker.out-of-scope,.capital-marker.out-of-scope {
  opacity: .28;
  filter: saturate(.45);
  cursor: default;
}

.country.out-of-scope:hover,.island-marker.out-of-scope:hover {
  fill: var(--country) !important;
}

.island-hit.out-of-scope {
  pointer-events: none;
}

.offset-marker {
  stroke-width: .9;
}

.country.explore-selected,.country.out-of-scope.explore-selected {
  fill: var(--country-hover) !important;
  opacity: 1 !important;
  filter: none !important;
}

.island-marker.explore-selected,.island-marker.out-of-scope.explore-selected,.capital-marker.explore-selected,.capital-marker.out-of-scope.explore-selected {
  fill: var(--country-hover) !important;
  opacity: 1 !important;
  filter: none !important;
}

.country.done,.country.mastered {
  fill: var(--done) !important;
  opacity: 1 !important;
  filter: none !important;
}

.island-marker.done,.island-marker.mastered,.capital-marker.done,.capital-marker.mastered {
  fill: var(--done) !important;
  opacity: 1 !important;
  filter: none !important;
}

.country.done.retry,.country.done.retry-dark,.island-marker.done.retry,.island-marker.done.retry-dark,.capital-marker.done.retry,.capital-marker.done.retry-dark {
  fill: var(--done) !important;
  opacity: 1 !important;
  filter: none !important;
}

.country.done,.country.mastered,.country.done:hover,.country.mastered:hover {
  fill: var(--done) !important;
  opacity: 1 !important;
  filter: none !important;
}

.island-marker.done,.island-marker.mastered,.island-marker.done:hover,.island-marker.mastered:hover,.capital-marker.done,.capital-marker.mastered {
  fill: var(--done) !important;
  opacity: 1 !important;
  filter: none !important;
}

.country.wrong,.country.wrong:hover {
  fill: url(#retryStripes) !important;
  opacity: 1 !important;
  filter: none !important;
}

.island-marker.wrong,.island-marker.wrong:hover,.capital-marker.wrong {
  fill: url(#retryStripes) !important;
  opacity: 1 !important;
  filter: none !important;
}

.country-prompt {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  max-width: none !important;
  padding: 0 14px !important;
  transform: none !important;
  border: none !important;
  border-top: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 0 !important;
  background: rgba(8,20,34,.94) !important;
  color: var(--ink) !important;
  box-shadow: 0 -6px 18px rgba(0,0,0,.14) !important;
  backdrop-filter: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-align: center !important;
  text-overflow: clip !important;
  font-size: clamp(2rem,3vw,2.15rem) !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  z-index: 6 !important;
}

@media(max-width:700px) {
  .country-prompt {
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 0 10px !important;
    font-size: 1.9rem !important;
  }
}

@media(max-width:420px) {
  .country-prompt {
    font-size: 1.75rem !important;
  }
}

svg,.country,.island-marker,.island-hit {
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
  -webkit-user-select: none;
  user-select: none;
}

.country:focus,.country:focus-visible,.island-marker:focus,.island-marker:focus-visible,.island-hit:focus,.island-hit:focus-visible {
  outline: none !important;
}

.top-controls {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-controls .test-end-button {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
}

@media(max-width:700px) {
  .top-controls {
    top: 10px;
    left: 10px;
    gap: 8px;
  }
}

.bottom-control>span {
  display: block !important;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  transform: translateX(-50%);
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
}

.map-card.tool-hints-visible .bottom-control>span {
  opacity: 1;
  transition-duration: 3s;
}

.country-prompt .prompt-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  max-width: 100%;
  min-width: 0;
}

.country-prompt .prompt-flag {
  display: block;
  height: 1.05em;
  width: auto;
  max-width: 2em;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.14);
}

.country-prompt .prompt-country-name {
  min-width: 0;
  white-space: nowrap;
}

.island-hit[data-id="MAF"],.island-hit[data-id="SXM"],.island-hit[data-id="VGB"],.island-hit[data-id="CUW"],.island-hit[data-id="BES"] {
  vector-effect: non-scaling-stroke;
}

.island-hit[data-id="MAF"],.island-hit[data-id="SXM"],.island-hit[data-id="VGB"],.island-hit[data-id="CUW"],.island-hit[data-id="BES"] {
  stroke: none !important;
  stroke-width: 0 !important;
  pointer-events: fill !important;
  fill: rgba(0,0,0,.001) !important;
}

.island-marker[data-id="MAF"],.island-marker[data-id="SXM"],.island-marker[data-id="VGB"],.island-marker[data-id="CUW"],.island-marker[data-id="BES"],.island-marker[data-id="VIR"],.island-marker[data-id="AIA"],.island-marker[data-id="BLM"] {
  pointer-events: none !important;
}

.island-hit[data-id="MAF"],.island-hit[data-id="SXM"],.island-hit[data-id="VGB"],.island-hit[data-id="CUW"],.island-hit[data-id="BES"],.island-hit[data-id="VIR"],.island-hit[data-id="AIA"],.island-hit[data-id="BLM"] {
  pointer-events: all !important;
  stroke: none !important;
}

.island-marker[data-id="MTQ"],.island-marker[data-id="GLP"],.island-marker[data-id="MSR"],.island-marker[data-id="DMA"],.island-marker[data-id="LCA"],.island-marker[data-id="VCT"],.island-marker[data-id="BRB"],.island-marker[data-id="ATG"],.island-marker[data-id="KNA"],.island-marker[data-id="MAF"],.island-marker[data-id="SXM"],.island-marker[data-id="VGB"],.island-marker[data-id="VIR"],.island-marker[data-id="AIA"],.island-marker[data-id="BLM"],.island-marker[data-id="CUW"],.island-marker[data-id="BES"] {
  pointer-events: none !important;
}

.island-marker[data-id="GGY"],.island-marker[data-id="JEY"] {
  pointer-events: none !important;
}

.island-hit[data-id="GGY"],.island-hit[data-id="JEY"] {
  pointer-events: all !important;
  stroke: none !important;
}

.setup-overlay {
  position: absolute;
  inset: 0;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(3,10,18,.42);
}

.setup-overlay[hidden] {
  display: none !important;
}

.setup-card {
  width: min(360px,calc(100vw - 28px));
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  background: rgba(8,20,34,.96);
  box-shadow: 0 18px 50px rgba(0,0,0,.38);
  padding: 18px;
  color: var(--ink);
}

.setup-title {
  font-size: 1.18rem;
  font-weight: 850;
  letter-spacing: .01em;
}

.setup-zone-label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.setup-zone-select {
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  box-sizing: border-box;
}

.setup-options {
  margin-top: 12px;
  border-top: 1px solid rgba(255,255,255,.10);
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.setup-options .settings-row {
  padding-left: 2px;
  padding-right: 2px;
}

.setup-start {
  width: 100%;
  height: 40px;
  margin-top: 14px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 11px;
  background: linear-gradient(180deg,rgba(88,145,255,.98),rgba(64,118,228,.98));
  color: #fff;
  font: inherit;
  font-size: .92rem;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(37,84,177,.28),inset 0 1px 0 rgba(255,255,255,.14);
}

.setup-start:hover {
  filter: brightness(1.05);
}

@media(max-width:520px) {
  .setup-overlay {
    padding: 12px;
  }

  .setup-card {
    padding: 16px;
    border-radius: 16px;
  }
}

.setup-zone-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  padding: 0 38px 0 12px !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 11px !important;
  background: linear-gradient(45deg,transparent 50%,var(--muted) 50%) calc(100% - 16px) 17px/5px 5px no-repeat,linear-gradient(135deg,var(--muted) 50%,transparent 50%) calc(100% - 11px) 17px/5px 5px no-repeat,rgba(10,24,40,.98) !important;
  color: var(--ink) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 3px 10px rgba(0,0,0,.14) !important;
  outline: none !important;
  cursor: pointer !important;
}

.setup-zone-select:hover {
  border-color: rgba(255,255,255,.24) !important;
}

.setup-zone-select:focus,.setup-zone-select:focus-visible {
  border-color: rgba(116,168,255,.72) !important;
  box-shadow: 0 0 0 2px rgba(116,168,255,.14),inset 0 1px 0 rgba(255,255,255,.035) !important;
}

.setup-zone-select option {
  background: #0a1828;
  color: #eef5ff;
  font-weight: 700;
}

.setup-zone-select {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.setup-zone-wrap {
  position: relative;
  width: 100%;
}

.island-marker[data-id="MNP"],.island-marker[data-id="GUM"],.island-marker[data-id="HKG"],.island-marker[data-id="MUS"],.island-marker[data-id="REU"],.island-marker[data-id="WSM"],.island-marker[data-id="ASM"] {
  pointer-events: none !important;
}

.island-hit[data-id="MNP"],.island-hit[data-id="GUM"],.island-hit[data-id="HKG"],.island-hit[data-id="MUS"],.island-hit[data-id="REU"],.island-hit[data-id="WSM"],.island-hit[data-id="ASM"] {
  stroke: none !important;
}

.setup-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 0 14px;
}

.setup-brand-icon {
  width: 80px;
  height: 80px;
  display: block;
  margin: 0 0 9px;
  border-radius: 20px;
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
}

.setup-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .22em;
  flex-wrap: wrap;
  text-align: center;
  margin: 0;
}

.brand-joe {
  color: #ffd84d;
  font-family: "Brush Script MT","Segoe Script","Lucida Handwriting","URW Chancery L",cursive;
  font-size: 1.42em;
  font-weight: 500;
  line-height: .9;
  letter-spacing: .01em;
  display: inline-block;
  transform: rotate(-3deg);
}

.brand-rest {
  color: var(--ink);
}

@media(max-width:520px) {
  .setup-brand-icon {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    margin-bottom: 8px;
  }
}

.finish-panel-branded {
  width: min(320px,calc(100vw - 28px));
}

.finish-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.finish-brand-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: block;
  margin-bottom: 6px;
}

.finish-brand-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .2em;
  flex-wrap: wrap;
  font-size: .86rem;
  font-weight: 800;
  text-align: center;
}

.finish-area {
  margin: 2px 0 10px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 750;
  text-align: center;
}

.finish-time-primary {
  margin-bottom: 12px;
}

.finish-mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin: 0 0 13px;
}

.finish-mini-stat {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 9px;
  background: rgba(255,255,255,.028);
  text-align: center;
}

.finish-mini-label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.finish-mini-value {
  display: block;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 850;
}

.finish-panel-branded .finish-title {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  font-size: clamp(1.45rem,4.5vw,2rem);
  line-height: 1.05;
}

.finish-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.finish-repeat-primary {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.finish-secondary-row {
  display: grid;
  gap: 5px;
  width: 100%;
}

.finish-secondary-button {
  min-height: 32px;
  padding: 5px 8px;
  font-size: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.finish-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  line-height: 1;
  font-size: 1.05em;
  font-weight: 900;
}

.finish-actions,.finish-secondary-row,.finish-secondary-button {
  box-sizing: border-box;
}

.finish-actions {
  max-width: 100%;
}

.finish-secondary-row {
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  max-width: 100%;
  overflow: hidden;
}

.finish-secondary-button {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
}

.setup-settings-divider {
  height: 1px;
  width: 100%;
  margin: 5px 0 4px;
  background: rgba(255,255,255,.11);
}

/* Stronger Show Me visibility without changing zoom or quiz logic */

.country.hinted {
  stroke: #ffe879 !important;
  stroke-width: 5 !important;
  vector-effect: non-scaling-stroke;
  paint-order: stroke fill;
}

.island-marker.hinted,.capital-marker.hinted {
  stroke: #ffe879 !important;
  stroke-width: 5 !important;
  vector-effect: non-scaling-stroke;
}

.show-me-beacon {
  fill: none;
  stroke: #ffe879;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.show-me-beacon.fire {
  animation: showMeBeacon .82s ease-out 0s 1;
}

@keyframes showMeBeacon {
  0% {
    opacity: .95;
    transform: scale(.45);
  }

  62% {
    opacity: .52;
  }

  100% {
    opacity: 0;
    transform: scale(2.5);
  }
}

.setup-card {
  position: relative;
}

.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4,10,22,.68);
}

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

.about-card {
  width: min(92vw,390px);
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  background: #0b1730;
  color: var(--ink);
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
  padding: 24px;
  text-align: center;
}

.about-card h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.about-card p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: .94rem;
}

.about-card .about-version {
  margin: -4px 0 12px;
  color: #d7e4f5;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .035em;
}

.about-close {
  width: 100%;
  margin-top: 18px;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}

.about-card #aboutCloseBtn {
  margin-top: 8px;
}

.about-contact-link {
  color: #7db7ff;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 650;
}

.about-contact-link:hover,.about-contact-link:focus-visible {
  color: #a9ceff;
}

.about-email-reveal {
  display: inline;
  margin-left: 6px;
  color: var(--ink);
  font-weight: 650;
}

.about-email-reveal[hidden] {
  display: none;
}

.changelog-card {
  width: min(92vw,440px);
  max-height: min(86vh,680px);
  text-align: left;
  display: flex;
  flex-direction: column;
}

.changelog-card h2 {
  text-align: center;
  flex: none;
}

.changelog-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 2px 7px 2px 0;
  overscroll-behavior: contain;
  scrollbar-color: rgba(168,182,202,.55) transparent;
}

.changelog-scroll section+section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.changelog-scroll h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 1rem;
}

.changelog-intro {
  margin: 0 0 12px !important;
  color: #d7e4f5 !important;
  font-size: .9rem !important;
}

.changelog-group {
  padding: 11px 12px 12px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}

.changelog-group+.changelog-group {
  margin-top: 10px;
}

.changelog-scroll h4 {
  margin: 0 0 7px;
  color: #fff;
  font-size: .9rem;
}

.changelog-scroll ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.42;
}

.changelog-scroll li+li {
  margin-top: 7px;
}

.about-card .changelog-build {
  margin: 12px 0 0;
  text-align: center;
  font-size: .74rem;
  font-weight: 750;
  letter-spacing: .025em;
  flex: none;
}

.changelog-card .about-close {
  flex: none;
}

#zoomLayer {
  will-change: transform;
}

/* Start-card quiz chooser: keep the main regions visible instead of hiding them in a dropdown. */

.setup-zone-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
  width: 100%;
}

.setup-zone-choice {
  min-width: 0;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid var(--ui-border);
  border-radius: 11px;
  background: rgba(10,24,40,.98);
  color: var(--ink);
  font: inherit;
  font-size: .84rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 3px 10px rgba(0,0,0,.12);
}

.setup-zone-choice:hover,.setup-zone-choice:focus-visible {
  border-color: rgba(116,168,255,.72);
  background: rgba(116,168,255,.09);
  outline: none;
}

.setup-zone-choice.active {
  border-color: rgba(116,168,255,.9);
  background: rgba(116,168,255,.2);
  box-shadow: 0 0 0 2px rgba(116,168,255,.12),inset 0 1px 0 rgba(255,255,255,.05);
  color: #fff;
}

.setup-zone-world {
  grid-column: 1/-1;
  min-height: 38px;
  margin-top: 2px;
}

.setup-zone-world.active {
  color: #fff;
}

.setup-start:disabled {
  opacity: .42;
  cursor: not-allowed;
  filter: none;
}

@media(max-width:380px) {
  .setup-zone-grid {
    gap: 6px;
  }

  .setup-zone-choice {
    min-height: 40px;
    padding: 6px 7px;
    font-size: .79rem;
  }
}

.prompt-style-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 6px 0;
}

.prompt-style-label {
  font-size: .82rem;
  font-weight: 750;
  color: var(--ink);
  flex: 0 0 auto;
}

.prompt-style-segment {
  display: flex;
  min-width: 0;
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  overflow: hidden;
  background: rgba(5,15,26,.45);
}

.prompt-style-segment button {
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid var(--ui-border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .69rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.prompt-style-segment button:last-child {
  border-right: 0;
}

.prompt-style-segment button:hover,.prompt-style-segment button:focus-visible {
  background: rgba(255,255,255,.07);
  color: var(--ink);
  outline: none;
}

.prompt-style-segment button.active {
  background: rgba(116,168,255,.2);
  color: #fff;
}

.setup-options .prompt-style-row {
  padding-left: 2px;
  padding-right: 2px;
}

@media(max-width:420px) {
  .prompt-style-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    padding: 7px 0;
  }

  .prompt-style-segment {
    width: 100%;
  }

  .prompt-style-segment button {
    flex: 1;
    padding: 0 5px;
    font-size: .67rem;
  }
}

/* First-run quiz instruction: brief cue above the country prompt. */

.quiz-onboarding-hint {
  position: absolute;
  left: 50%;
  bottom: 78px;
  z-index: 7;
  transform: translateX(-50%);
  padding: 6px 11px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: rgba(10,24,40,.90);
  color: var(--muted);
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
  font-size: .88rem;
  font-weight: 750;
  white-space: nowrap;
  pointer-events: none;
}

@media(max-width:700px) {
  .quiz-onboarding-hint {
    bottom: 82px;
    font-size: .82rem;
    padding: 6px 10px;
  }
}

@media(max-width:420px) {
  .quiz-onboarding-hint {
    bottom: 104px;
    max-width: calc(100% - 20px);
    font-size: .8rem;
    white-space: normal;
    text-align: center;
  }
}

/* Oceania-only cue showing where the Pacific map wraps. */

.oceania-seam-indicator {
  stroke: rgba(255,255,255,.40);
  stroke-width: 1.4;
  stroke-dasharray: 7 7;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

/* Start-card More page. */

.setup-zone-main-view[hidden],.setup-more-view[hidden] {
  display: none !important;
}

.setup-zone-bottom-row {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.setup-zone-bottom-row .setup-zone-choice {
  min-height: 38px;
}

.setup-zone-bottom-row .setup-zone-world {
  grid-column: auto;
  margin-top: 0;
}

.setup-zone-more {
  background: rgba(255,255,255,.035);
  color: var(--muted);
}

.setup-zone-more:hover,.setup-zone-more:focus-visible {
  color: #fff;
}

.setup-more-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.setup-more-back {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  background: rgba(255,255,255,.045);
  color: var(--muted);
  font: inherit;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}

.setup-more-back:hover,.setup-more-back:focus-visible {
  background: rgba(255,255,255,.08);
  color: #fff;
  outline: none;
}

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

.setup-more-choice {
  min-width: 0;
  min-height: 58px;
  padding: 8px 9px;
  border: 1px solid var(--ui-border);
  border-radius: 11px;
  background: rgba(10,24,40,.98);
  color: var(--ink);
  font: inherit;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 3px 10px rgba(0,0,0,.12);
}

.setup-more-choice span {
  display: block;
  font-size: .79rem;
  font-weight: 850;
  line-height: 1.15;
}

.setup-more-choice small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 650;
  line-height: 1.2;
}

.setup-more-choice:disabled {
  opacity: .58;
  cursor: default;
}

@media(max-width:380px) {
  .setup-zone-bottom-row,.setup-more-grid {
    gap: 6px;
  }

  .setup-more-choice {
    min-height: 54px;
    padding: 7px;
  }

  .setup-more-choice span {
    font-size: .75rem;
  }
}

.setup-more-choice:not(:disabled) {
  cursor: pointer;
}

.setup-more-choice:not(:disabled):hover,.setup-more-choice:not(:disabled):focus-visible {
  border-color: rgba(116,168,255,.72);
  background: rgba(116,168,255,.09);
  outline: none;
}

.setup-more-choice.active {
  border-color: rgba(116,168,255,.9);
  background: rgba(116,168,255,.2);
  box-shadow: 0 0 0 2px rgba(116,168,255,.12),inset 0 1px 0 rgba(255,255,255,.05);
  color: #fff;
}

.setup-special-quiz-choice {
  text-align: center;
}

/* States/capitals settings. */

.capital-target {
  cursor: pointer;
}

.capital-hit {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
}

/* Capital markers use the same visual rules as the normal point-style
   geography dots. Only their interaction geometry remains capital-specific.
 */

.capital-marker {
  pointer-events: none;
}

.state-content-row {
  padding-top: 6px;
  padding-bottom: 6px;
}

.state-content-segment {
  flex: 1 1 auto;
}

.state-content-segment button {
  flex: 1 1 auto;
  height: 36px;
  padding: 3px 7px;
  line-height: 1.05;
  white-space: normal;
  overflow: hidden;
}

/* Unified prompt-style control; hidden compatibility inputs are intentionally preserved. */

.quiz-settings-unified-btn {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  background: rgba(5,15,26,.72);
  color: var(--ink);
  font: inherit;
  font-size: .72rem;
  font-weight: 850;
  cursor: pointer;
}

.quiz-settings-unified-btn:hover,.quiz-settings-unified-btn:focus-visible {
  background: rgba(255,255,255,.07);
  outline: none;
}

/* Shared visual system for every generated subdivision map. */

.subdivision-division {
  fill: var(--country);
  stroke: rgba(255,255,255,.86);
  stroke-width: .72;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill .16s ease;
}

.subdivision-division.done,.subdivision-division.mastered {
  fill: var(--done) !important;
}

.subdivision-division.retry {
  fill: var(--retry) !important;
}

.subdivision-division.retry-dark {
  fill: var(--retry-dark) !important;
}

.subdivision-division.hinted,.subdivision-division.hinted:hover {
  fill: url(#hintStripes) !important;
  stroke: #ffe879 !important;
  stroke-width: 3 !important;
  paint-order: stroke fill;
}

.subdivision-division.target,.subdivision-division.target:hover {
  fill: var(--target) !important;
}

.subdivision-division.hinted.target,.subdivision-division.hinted.target:hover {
  fill: url(#hintStripes) !important;
}

.subdivision-division.wrong,.subdivision-division.wrong:hover {
  fill: url(#retryStripes) !important;
  animation: wrongPulse .38s ease;
}

.subdivision-division.state-context-only {
  fill: #22374f !important;
  stroke: rgba(255,255,255,.42) !important;
  opacity: 1;
  cursor: default !important;
  pointer-events: none !important;
}

.subdivision-hit {
  fill: rgba(0,0,0,.001);
  stroke: none;
  pointer-events: all;
  cursor: pointer;
}

.subdivision-inset-frame {
  pointer-events: none;
}

.subdivision-inset-frame rect {
  fill: rgba(7,17,31,.22);
  stroke: rgba(255,255,255,.42);
  stroke-width: .7;
  stroke-dasharray: 3 2;
  vector-effect: non-scaling-stroke;
}

#embeddedUsStatesLayer .state-inset-copy {
  opacity: .98;
}

@media(hover:hover) and (pointer:fine) {
  .subdivision-division:not(.done):not(.retry):not(.mastered):not(.hinted):not(.target):hover {
    fill: var(--country-hover);
  }
}

/* Integrated subdivision-map cleanup. */

/* Alaska/Hawaii inset indicators. */

#embeddedUsStatesLayer .state-inset-frame {
  pointer-events: none;
}

#embeddedUsStatesLayer .state-inset-frame rect {
  fill: rgba(7,17,31,.22);
  stroke: rgba(255,255,255,.42);
  stroke-width: .7;
  stroke-dasharray: 3 2;
  vector-effect: non-scaling-stroke;
}

/* Inset usability. */

#embeddedUsStatesLayer .state-inset-hit {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
  cursor: pointer;
}

/* U.S. States Mexico-side border-gap fill. */

#embeddedUsStatesLayer .mexico-gap-fill {
  fill: var(--country) !important;
  stroke: none !important;
  opacity: 1 !important;
  pointer-events: none !important;
}

/* Microstate and small-country dots become part of the subdued world context. */

/* iPhone/iOS safe areas: keep top quiz controls clear of the status bar,
   Dynamic Island/notch, and landscape sensor housing.
 */

@supports (top: env(safe-area-inset-top)) {
  .top-controls {
    top: calc(14px + env(safe-area-inset-top)) !important;
    left: calc(14px + env(safe-area-inset-left)) !important;
  }

  .zoom-hint {
    top: calc(14px + env(safe-area-inset-top)) !important;
    right: calc(14px + env(safe-area-inset-right)) !important;
  }

  @media(max-width:700px) {
    .top-controls {
      top: calc(10px + env(safe-area-inset-top)) !important;
      left: calc(10px + env(safe-area-inset-left)) !important;
    }

    .zoom-hint {
      top: calc(10px + env(safe-area-inset-top)) !important;
      right: calc(10px + env(safe-area-inset-right)) !important;
    }
  }
}

/* Explore mode status: centered on its own row above the bottom HUD. */

.explore-badge {
  top: auto !important;
  left: 50% !important;
  right: auto !important;
  bottom: 100px !important;
  transform: translateX(-50%) !important;
  height: auto !important;
  z-index: 9 !important;
  white-space: nowrap !important;
}

@media(max-width:700px) {
  .explore-badge {
    bottom: 96px !important;
  }
}

@media(max-width:420px) {
  .explore-badge {
    bottom: 94px !important;
  }
}

/* Clear start-card navigation and a fixed-height sliding quiz chooser. */

.setup-start.setup-start-unavailable {
  opacity: .42;
  cursor: pointer;
  filter: none;
}

.setup-start.setup-start-feedback {
  opacity: .72;
}

.setup-zone-slider {
  width: 100%;
  height: 188px;
  overflow: hidden;
  position: relative;
}

.setup-zone-slider-track {
  display: grid;
  grid-template-columns: repeat(2,100%);
  width: 100%;
  height: 100%;
  transform: translateX(0);
  transition: transform .28s cubic-bezier(.22,.75,.25,1);
  will-change: transform;
}

.setup-zone-slider.show-more .setup-zone-slider-track {
  transform: translateX(calc(-100% - 2px));
}

.setup-zone-main-view,.setup-more-view {
  width: 100%;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
}

.setup-more-view {
  padding-top: 1px;
  transform: translateX(2px);
}

@media(max-width:380px) {
  .setup-zone-slider {
    height: 178px;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Exact matching heights prevent sub-pixel start-card shifts. */

.setup-options > .settings-row {
  height: 34px;
  min-height: 34px;
}

/* Small islands and territories are one group. Their separation comes only
   from the explicit divider above Small islands, not an automatic row border.
 */

.setup-options > .settings-row + .settings-row {
  border-top: none !important;
}

.setup-options .state-content-row {
  height: 72px;
  min-height: 72px;
}

.setup-about-link {
  display: block;
  margin: 8px auto 0;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 12px/1.2 system-ui,sans-serif;
  cursor: pointer;
  opacity: .82;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,.22);
  text-underline-offset: 2px;
}

.setup-about-link:hover,.setup-about-link:focus-visible {
  color: var(--ink);
  opacity: 1;
  text-decoration-color: currentColor;
}

.setup-about-link:focus-visible {
  outline: 2px solid rgba(116,168,255,.55);
  outline-offset: 2px;
  border-radius: 4px;
}

.setup-version-link {
  position: absolute;
  right: 7px;
  bottom: 5px;
  width: 48px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: 700 11px/1 system-ui,sans-serif;
  cursor: pointer;
  opacity: .72;
}

.setup-version-link:hover,.setup-version-link:focus-visible {
  color: var(--ink);
  opacity: 1;
  background: rgba(255,255,255,.055);
}

.setup-version-link:focus-visible {
  outline: 2px solid rgba(116,168,255,.55);
  outline-offset: 1px;
}

.setup-share-quiz-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  height: 30px;
  width: 30px;
  padding: 0 7px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 15px;
  background: rgba(255,255,255,.06);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  font: 700 12px/1 system-ui,sans-serif;
  z-index: 3;
  transition: width .18s ease,background .15s ease,border-color .15s ease,color .15s ease,opacity .15s ease;
}

.setup-share-quiz-icon:hover,.setup-share-quiz-icon:focus-visible,.setup-share-quiz-icon.setup-share-attention {
  width: 102px;
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.26);
}

.setup-share-quiz-icon:focus-visible {
  outline: none;
  border-color: rgba(116,168,255,.72);
  box-shadow: 0 0 0 2px rgba(116,168,255,.14);
}

.setup-share-icon-svg {
  width: 15px;
  height: 15px;
  min-width: 15px;
  overflow: visible;
}

.setup-share-icon-svg circle {
  fill: currentColor;
  stroke: none;
}

.setup-share-icon-svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.setup-share-quiz-label {
  display: inline-block;
  opacity: 0;
  transform: translateX(-2px);
  transition: opacity .12s ease,transform .12s ease;
}

.setup-share-quiz-icon:hover .setup-share-quiz-label,.setup-share-quiz-icon:focus-visible .setup-share-quiz-label,.setup-share-quiz-icon.setup-share-attention .setup-share-quiz-label {
  opacity: 1;
  transform: translateX(0);
}

@keyframes setupShareIconWiggle {
  0%,100% {
    transform: rotate(0deg);
  }

  20% {
    transform: rotate(-10deg);
  }

  40% {
    transform: rotate(8deg);
  }

  60% {
    transform: rotate(-6deg);
  }

  80% {
    transform: rotate(4deg);
  }
}

.setup-share-quiz-icon.setup-share-wiggle svg {
  transform-origin: 50% 50%;
  animation: setupShareIconWiggle .5s ease-in-out;
}

/* Show Me becomes accented only after 10 seconds unanswered. */

.show-button {
  background: var(--ui-surface);
  color: var(--ink);
  transition: background-color .12s ease,color .12s ease,border-color .12s ease,box-shadow .12s ease;
}

.show-button.show-button-attention {
  background: var(--accent);
  color: #fff;
  border-color: rgba(255,255,255,.18);
  transition-duration: 3s;
}

/* Tactile Show Me press feedback. */

.show-button {
  transform: translateY(0) scale(1);
}

.show-button:active:not(:disabled) {
  transform: translateY(1px) scale(.96);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.22);
  transition: transform .06s ease,box-shadow .06s ease,
             background-color .12s ease,color .12s ease,border-color .12s ease;
}

.finish-share-icon-svg {
  width: 1em;
  height: 1em;
  overflow: visible;
}

.finish-share-icon-svg circle {
  fill: currentColor;
  stroke: none;
}

.finish-share-icon-svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* Prevent timer text selection so the hidden 12-tap test gesture works. */

#timer {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Force Share Quiz closed after use, overriding sticky mobile :hover. */

.setup-share-quiz-icon.setup-share-force-collapse,.setup-share-quiz-icon.setup-share-force-collapse:hover,.setup-share-quiz-icon.setup-share-force-collapse:focus,.setup-share-quiz-icon.setup-share-force-collapse:focus-visible {
  width: 30px !important;
}

.setup-share-quiz-icon.setup-share-force-collapse .setup-share-quiz-label {
  opacity: 0 !important;
  transform: translateX(-2px) !important;
}

/* Completed green locations acknowledge a click/tap without scoring.
   Applied only by app.js click logic; no hover behavior is added.
 */

.country.done.completed-click-flash,.country.mastered.completed-click-flash,.island-marker.done.completed-click-flash,.island-marker.mastered.completed-click-flash,.capital-marker.done.completed-click-flash,.capital-marker.mastered.completed-click-flash {
  filter: brightness(1.45) !important;
  stroke: #fff !important;
  stroke-width: 1.6 !important;
}

/* Larger study flags for Name + Flag prompts. */

.country-prompt .prompt-content:has(.prompt-country-name) .prompt-flag {
  height: 1.04em !important;
  max-width: 2.08em !important;
}

@media(max-width:700px) {
  .country-prompt .prompt-content:has(.prompt-country-name) .prompt-flag {
    height: 1.01em !important;
    max-width: 2.03em !important;
  }
}

/* Give enlarged prompt flags enough vertical room. */

/* Name + Flag */

.country-prompt:has(.prompt-country-name):has(.prompt-flag) {
  height: 54px !important;
  min-height: 54px !important;
  max-height: 54px !important;
}

/* Keep the HUD clear of the taller prompt bar. */

.map-card:has(.country-prompt .prompt-country-name):has(.country-prompt .prompt-flag) .stats-cluster {
  bottom: 62px !important;
}

.map-card:has(.country-prompt .prompt-country-name):has(.country-prompt .prompt-flag) .bottom-control {
  bottom: 60px !important;
}

.map-card:has(.country-prompt .prompt-content > .prompt-flag:only-child) .stats-cluster {
  bottom: 76px !important;
}

.map-card:has(.country-prompt .prompt-content > .prompt-flag:only-child) .bottom-control {
  bottom: 74px !important;
}

@media(max-width:700px) {
  .country-prompt:has(.prompt-country-name):has(.prompt-flag) {
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
  }

  .country-prompt:has(.prompt-content > .prompt-flag:only-child) {
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
  }

  .map-card:has(.country-prompt .prompt-country-name):has(.country-prompt .prompt-flag) .stats-cluster {
    bottom: 60px !important;
  }

  .map-card:has(.country-prompt .prompt-country-name):has(.country-prompt .prompt-flag) .bottom-control {
    bottom: 58px !important;
  }

  .map-card:has(.country-prompt .prompt-content > .prompt-flag:only-child) .stats-cluster {
    bottom: 72px !important;
  }

  .map-card:has(.country-prompt .prompt-content > .prompt-flag:only-child) .bottom-control {
    bottom: 70px !important;
  }
}

/* Enlarged U.S. state flag preview from the quiz prompt. */

.state-flag-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3,10,18,.78);
}

.state-flag-preview-overlay[hidden] {
  display: none !important;
}

.state-flag-preview-card {
  position: relative;
  width: min(88vw,560px);
  padding: 22px;
  border: 1px solid var(--ui-border);
  border-radius: 20px;
  background: rgba(8,20,34,.98);
  box-shadow: 0 18px 50px rgba(0,0,0,.42);
  text-align: center;
}

.state-flag-preview-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(62vh,420px);
  margin: 0 auto;
  image-rendering: auto;
}

.state-flag-preview-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--ui-border);
  border-radius: 50%;
  background: rgba(10,24,40,.92);
  color: var(--ink);
  font: 700 22px/1 system-ui,sans-serif;
  cursor: pointer;
}

@media(max-width:520px) {
  .state-flag-preview-card {
    width: min(94vw,560px);
    padding: 18px;
  }
}

/* Detached top-right arrowhead cue for expandable flags.
   No shaft, badge, background, hover dependency, or tap animation.
 */

.country-prompt.state-flag-preview-available .prompt-content {
  position: relative;
}

.country-prompt.state-flag-preview-available .prompt-content::before,.country-prompt.state-flag-preview-available .prompt-content::after {
  content: "›";
  position: absolute;
  color: rgba(255,255,255,.94);
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,.85),
    0 0 2px rgba(0,0,0,.75);
  transform: rotate(-45deg);
  transform-origin: center;
}

.country-prompt.state-flag-preview-available .prompt-content::before {
  right: -4px;
  top: -10px;
  font: 800 16px/1 system-ui,sans-serif;
}

.country-prompt.state-flag-preview-available .prompt-content::after {
  right: 0;
  top: -4px;
  font: 800 12px/1 system-ui,sans-serif;
}

/* Long prompts fit the existing prompt slot instead of overflowing small screens. */

.country-prompt.prompt-auto-fit {
  font-size: var(--prompt-fit-font-size) !important;
}

.country-prompt .prompt-country-name {
  user-select: text;
  -webkit-user-select: text;
}

/* Invisible, enlarged Oceania tap targets. */

.oceania-expanded-hit {
  fill: rgba(0,0,0,.001) !important;
  stroke: none !important;
  pointer-events: all;
}

/* Special prompt/preview handling for Saint Martin & Sint Maarten. */

.country-prompt .prompt-flag-group {
  display: inline-flex;
  align-items: center;
  gap: .18em;
  vertical-align: middle;
}

.country-prompt .prompt-flag-group .prompt-flag {
  margin-left: 0;
}

.country-prompt .prompt-flag-pair .prompt-flag {
  height: .95em;
}

/* Insets and true-position references shared by subdivision maps. */

.subdivision-inset-connector {
  fill: none;
  stroke: rgba(190,218,241,.3);
  stroke-width: .7;
  stroke-dasharray: 1.5 2.2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.subdivision-true-position-context {
  fill: rgba(43,74,104,.46);
  stroke: rgba(190,218,241,.36);
  stroke-width: .6;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.subdivision-true-position-capital,.subdivision-true-position-capital * {
  opacity: .38;
  pointer-events: none !important;
}

.state-flag-preview-flags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.state-flag-preview-image-pair {
  max-width: min(40vw,260px);
}

@media(max-width:520px) {
  .state-flag-preview-flags {
    gap: 12px;
  }

  .state-flag-preview-image-pair {
    max-width: min(72vw,240px);
  }
}

/* Scrollable More catalog with category headers. */

.setup-more-view {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.setup-more-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: scroll;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}

.setup-more-scroll:focus-visible {
  outline: 1px solid rgba(116,168,255,.55);
  outline-offset: -1px;
  border-radius: 7px;
}

.setup-more-scroll::-webkit-scrollbar {
  width: 5px;
}

.setup-more-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.setup-more-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.18);
  border-radius: 8px;
}

.setup-more-category-title {
  margin: 0 0 6px;
  padding: 4px 2px 5px;
  background: linear-gradient(to bottom,rgba(7,17,31,.99) 78%,rgba(7,17,31,.88));
  color: var(--muted);
  font: 850 .69rem/1 system-ui,sans-serif;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.setup-direct-more-grid {
  grid-template-columns: repeat(2,minmax(0,1fr));
}

.setup-direct-more-grid .setup-more-choice {
  padding: 6px 7px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.setup-direct-more-grid .setup-more-choice span {
  font-size: .70rem;
  line-height: 1.08;
}

@media(max-width:380px) {
  .setup-more-scroll {
    padding-right: 3px;
  }

  .setup-direct-more-grid .setup-more-choice {
    padding: 5px 6px;
  }

  .setup-direct-more-grid .setup-more-choice span {
    font-size: .67rem;
  }
}

/* Subtle icon-only cue that the More catalog scrolls. */

.setup-more-scroll-cue {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.38));
}

.setup-more-scroll-cue::before,.setup-more-scroll-cue::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 2px;
  border-radius: 2px;
  background: rgba(190,200,210,.72);
}

.setup-more-scroll-cue::before {
  transform: rotate(28deg);
  transform-origin: right center;
}

.setup-more-scroll-cue::after {
  transform: rotate(-28deg);
  transform-origin: left center;
}

.setup-more-scroll-cue[hidden] {
  display: none !important;
}

/* Country subdivision maps use a more detailed geometry layer than the world
   map. Subdue the entire simplified world layer beneath it—including the base
   version of the quiz country—so minor border mismatches do not read as a
   second outline.
 */

#zoomLayer .country.subdivision-world-context {
  fill: #162a3e !important;
  stroke: rgba(255,255,255,.14) !important;
  stroke-width: .6 !important;
  opacity: 1 !important;
  filter: none !important;
  pointer-events: none !important;
}

#zoomLayer.subdivision-context-active .land-bg {
  fill: #162a3e !important;
  stroke: rgba(255,255,255,.14) !important;
  stroke-width: .6 !important;
}

/* Capital-map hierarchy: the subject country reads as one region, its
   subdivisions remain legible, and the capital dots retain visual priority.
 */

.subdivision-layer.subdivision-capitals-active .state-context-only {
  fill: #2b4a68 !important;
  stroke: rgba(190,218,241,.30) !important;
  stroke-width: .65 !important;
  vector-effect: non-scaling-stroke;
  opacity: 1 !important;
}

/* Non-quiz geography dots share the subdued world-context treatment. */

#zoomLayer .island-marker.subdivision-world-context-marker {
  fill: #162a3e !important;
  stroke: rgba(255,255,255,.14) !important;
  opacity: 1 !important;
  filter: none !important;
  pointer-events: none !important;
}

#zoomLayer .island-hit.subdivision-world-context-marker {
  pointer-events: none !important;
}

/* More catalog presentation. */

.setup-more-view {
  background: rgba(5,15,26,.62);
  padding: 7px 7px 0;
  border-radius: 10px;
}

.setup-more-scroll {
  position: relative;
  background: transparent !important;
  padding: 0 0 22px;
}

.setup-more-header {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 38px;
  margin-bottom: 0;
  padding: 0;
  background: #07111f !important;
}

@media(hover:hover) and (pointer:fine) {
  .setup-more-view {
    padding-top: 0;
  }
}

.setup-more-category {
  position: relative;
  background: transparent !important;
}

.setup-more-category + .setup-more-category {
  margin-top: 0;
}

.setup-more-category-title {
  position: sticky;
  top: 38px;
  z-index: 3;
  margin-bottom: 0;
  padding-top: 4px;
  padding-bottom: 4px;
}

.setup-more-category > .setup-more-grid {
  margin-top: 6px;
}

.setup-more-grid {
  background: transparent !important;
}

.setup-direct-more-grid {
  gap: 6px;
}

.setup-direct-more-grid .setup-more-choice {
  min-height: 37px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.setup-more-request {
  width: 100%;
  min-height: 46px;
  box-sizing: border-box;
  margin: 20px 0 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-style: dashed;
  background: rgba(255,255,255,.025);
  text-align: center;
  text-decoration: none;
}

.setup-more-request span {
  font-size: .76rem;
  line-height: 1.1;
}

.setup-more-request small {
  margin-top: 3px;
  font-size: .59rem;
  line-height: 1.05;
}

/* The optional scroll cue is currently hidden. */

.setup-more-scroll-cue {
  bottom: 1px;
  width: 38px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  touch-action: manipulation;
  pointer-events: auto !important;
  z-index: 4;
  line-height: 0;
  font-size: 0;
  display: none !important;
}

.setup-more-scroll-cue::before,.setup-more-scroll-cue::after {
  top: 13px;
  pointer-events: none;
}

.setup-more-scroll-cue::before {
  left: 5px;
}

.setup-more-scroll-cue::after {
  right: 5px;
}

.setup-more-scroll-cue:hover,.setup-more-scroll-cue:focus-visible {
  background: rgba(255,255,255,.045);
  outline: none;
  border-radius: 8px;
}

/* In regional Capitals quizzes, country polygons are map context,
   not quiz targets. Keep every country in the same subdued tone so only the
   capital markers read as active geography.
 */

#zoomLayer .country.regional-capitals-context {
  fill: #22374f !important;
  stroke: rgba(255,255,255,.42) !important;
  opacity: 1 !important;
  filter: none !important;
  pointer-events: none !important;
}

/* Capital markers intentionally share the normal point-marker
   visual system. Do not add a separate default capital color or Explore style.
 */

/* Every Explore-selected location gets a stronger outline.
   Keep the existing Explore fill; this only makes the selected geography
   easier to identify, regardless of whether it is a polygon or point marker.
 */

.country.explore-selected,.country.out-of-scope.explore-selected,.island-marker.explore-selected,.island-marker.out-of-scope.explore-selected,.capital-marker.explore-selected,.capital-marker.out-of-scope.explore-selected {
  stroke: #ffffff !important;
  stroke-width: 2.2 !important;
  vector-effect: non-scaling-stroke;
}

/* National capitals retain the normal capital-dot behavior but carry a small
   star so their additional role is visible without creating a second target.
 */

.national-capital-star {
  fill: var(--mastered);
  stroke: rgba(7,17,31,.9);
  stroke-width: .24;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.capital-marker.done ~ .national-capital-star,.capital-marker.retry ~ .national-capital-star,.capital-marker.retry-dark ~ .national-capital-star,.capital-marker.mastered ~ .national-capital-star,.capital-marker.hinted ~ .national-capital-star,.capital-marker.target ~ .national-capital-star,.capital-marker.wrong ~ .national-capital-star {
  fill: var(--bg);
  stroke: rgba(255,255,255,.72);
}

.prompt-capital-role {
  flex: 0 0 auto;
  padding-left: 9px;
  border-left: 1px solid rgba(255,255,255,.22);
  color: var(--muted);
  font-size: .52em;
  font-weight: 750;
  letter-spacing: .01em;
  white-space: nowrap;
}
