:root {
  font: 16px/1.45 "Segoe UI", Inter, sans-serif;
  color-scheme: light;
  --page: #e9e8df; --surface: #f7f5ec; --input: #fffdf5;
  --text: #223a40; --muted: #455f62; --line: #b9c8c3; --accent: #276561;
  --header: #25464b; --sea: #b8d2d5; --land: #d8d6bd; --border: #747e70;
  --context: #c1cdbe; --outer-border: #99afa2;
  --gold: #84551c; --blue: #296180; --green: #316c52; --hud: #efede1;
  color: var(--text); background: var(--page);
}
:root[data-theme=dark] {
  color-scheme: dark;
  --page: #16262c; --surface: #22363c; --input: #192e35;
  --text: #e4ebe3; --muted: #b9c9c5; --line: #52696b; --accent: #306f69;
  --header: #192e35; --sea: #264753; --land: #75877e; --border: #344944;
  --context: #4c6766; --outer-border: #3e595a;
  --gold: #f0c276; --blue: #94cbe3; --green: #91d0ac; --hud: #293e43;
}
* { box-sizing: border-box }
body, h1 { margin: 0 }
button, select, input { font: inherit; color: inherit }
button, select, input, dialog { border: 1px solid var(--line); border-radius: 6px; background: var(--input) }
button, select, summary { cursor: pointer }
button, select { padding: 8px 12px }
button:hover:enabled, summary:hover { color: var(--text); background: var(--hud) }
button:disabled { opacity: .5; cursor: default }
:focus-visible { outline: 2px solid #257d88; outline-offset: 2px }
header { color: #f3f5eb; background: var(--header); border-bottom: 1px solid var(--line) }
.bar, main { max-width: 1350px; margin: auto; padding-inline: clamp(10px,3vw,40px) }
.bar { min-height: 56px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px }
.brand { font: 600 26px/1 Georgia, serif; letter-spacing: -.04em }
.picker { position: relative; display: flex; align-items: center; border: 1px solid #658186; border-radius: 7px; background: #36585c }
.picker select { appearance: none; padding: 7px 32px 7px 38px; background: transparent; color: #fff8e6; border: 0; font-weight: 650; width: 184px }
.picker option { background: var(--input); color: var(--text) }
.picker::after { content: ''; position: absolute; right: 13px; width: 6px; height: 6px; border: solid #d2ddd4; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); pointer-events: none }
.globe { position: absolute; left: 13px; width: 16px; height: 16px; border: 1.5px solid #edc486; border-radius: 50%; font-size: 0; pointer-events: none }
.globe::before { content: ''; position: absolute; inset: 0 3px; border-inline: 1px solid #edc486; border-radius: 50% }
.globe::after { content: ''; position: absolute; inset: 50% 0 auto; border-top: 1px solid #edc486 }
.actions { justify-self: end; display: flex; gap: 8px }
.round-options { display: flex; align-items: center; gap: 12px }
#islandOption { display: flex; gap: 6px; align-items: center; min-height: 44px; font-size: 14px; cursor: pointer }
#islands { accent-color: #73b9a0; width: 16px; height: 16px }
.actions button { color: #e3eeea; background: transparent; border-color: transparent; font-size: 14px; min-height: 36px }
.actions button:hover:enabled, #theme[aria-pressed=true] { background: #395a5e; color: #fff4cf }
footer { font-size: 13px }
main { padding-block: 14px }
.console { --signal: #f2ad46; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden }
.console[data-state=right] { --signal: #55bc82 }
.console[data-state=wrong] { --signal: #e36965 }
.hud { display: flex; justify-content: center; align-items: center; background: var(--hud); padding: 10px; font-variant-numeric: tabular-nums }
.hud div { min-width: clamp(110px,15vw,190px); padding-inline: 20px; text-align: center }
.hud div + div { border-left: 1px solid var(--line) }
.hud small { display: block; color: var(--muted); font-size: 14px; font-weight: 600 }
.hud strong { font-size: clamp(23px,2.3vw,30px); line-height: 1.1; letter-spacing: -.04em }
#question { color: var(--gold) } #accuracy { color: var(--blue) } #correct { color: var(--green) }
.hud b { font-size: 15px; font-weight: 500; color: var(--muted) }
progress { display: block; width: 100%; height: 3px; appearance: none; border: 0; background: var(--line) }
progress::-webkit-progress-bar { background: var(--line) }
progress::-webkit-progress-value { background: var(--accent) }
progress::-moz-progress-bar { background: var(--accent) }
form { width: min(100%, 900px); margin-inline: auto; padding: 16px 24px 8px }
.answer-line { display: flex; align-items: stretch; gap: 8px }
#answer, #result { flex: 1; min-width: 0; align-self: center }
#answer { height: 46px; padding: 8px 14px }
#submit, #hint { min-height: 46px; padding: 8px 20px; font-weight: 600 }
#submit { color: white; background: var(--accent); border-color: var(--accent) }
#hint { min-width: 104px; margin-left: 8px; background: var(--hud); border-color: var(--gold); color: var(--gold) }
#hint:hover:enabled { background: var(--input) }
.round-status { min-height: 32px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-size: 14px }
#feedback { font-weight: 600 }
#feedback:empty, #clue:empty { display: none }
#clue { color: var(--muted) }
#skip { min-height: 46px; padding: 8px 16px; font-size: 15px; border-color: var(--muted) }
#description { text-align: center; padding: 16px }
.screen { position: relative; background: var(--sea); border-block: 1px solid var(--line); overflow: hidden }
#map { display: block; width: 100%; height: clamp(360px, calc(100svh - 268px), 850px) }
#map.zoomed { cursor: grab; touch-action: none }
#map.zoomed:active { cursor: grabbing }
.land, .context, #locator { vector-effect: non-scaling-stroke; stroke-linejoin: round }
.land { fill: var(--land); stroke: var(--border); stroke-width: 1.15px }
.context { fill: var(--context); stroke: var(--outer-border); stroke-width: .8px }
.land.target { fill: #f2ad46; stroke: #73521f; stroke-width: 1.65px }
.land.right { fill: #55bc82; stroke: #2e6449; stroke-width: 1.65px }
.land.wrong { fill: #e35452; stroke: #902d32; stroke-width: 2.2px }
#locator { pointer-events: none }
#locator circle { vector-effect: non-scaling-stroke; fill: none }
.locator-outline { stroke: #182e3c; stroke-width: 6px }
.locator-ring { stroke: #53f5ff; stroke-width: 3px; animation: locator-pulse 1.4s ease-in-out infinite }
@keyframes locator-pulse { 50% { stroke: #fff; stroke-width: 1.5px } }
.burst { stroke: #297c52; stroke-width: 2; animation: burst .5s ease-out forwards }
@keyframes burst { from { opacity: .9; transform: scale(.6) } to { opacity: 0; transform: scale(1.15) } }
.zoom { position: absolute; bottom: 12px; right: 12px; display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--input) }
.zoom button { border: 0; border-radius: 0; min-width: 36px; min-height: 36px; padding: 4px 8px; font-size: 19px }
.zoom button:focus-visible { outline-offset: -3px }
.zoom #overview { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 43px; border-inline: 1px solid var(--line) }
footer, .record { display: flex; align-items: center; justify-content: space-between; gap: 10px }

#key { font-size: 13px }
#key i { display: inline-block; background: var(--signal); width: 9px; height: 9px; border-radius: 2px; margin-right: 7px }
footer { align-items: flex-start; padding: 10px 2px; color: var(--muted) }
footer a { color: inherit }
#history { padding-block: 8px; max-height: 180px; overflow: auto }
.record { min-width: 190px; padding-block: 4px }
dialog { padding: 22px; max-width: 94vw }
dialog h2 { margin: 0 }
dialog::backdrop { background: #23332d65 }
[hidden] { display: none !important }
@media (max-width: 800px) {
  .bar { grid-template-columns: 1fr auto; padding-block: 8px; gap: 8px }
  form { padding: 12px 12px 4px }
  #hint { min-width: 68px; margin-left: 0 }
  #submit, #hint { padding-inline: 12px }
  .brand { font-size: 22px }
  .actions { grid-column: 2; grid-row: 1 }
  .actions button { padding: 6px 8px }
  .round-options { grid-row: 2; grid-column: 1/-1; flex-wrap: wrap; gap: 0 8px }
  .picker { flex: 1; min-width: 138px }
  .picker select { width: 100% }
  .hud div { min-width: 0; flex: 1; padding: 0 5px }
  main { padding-inline: 7px; padding-top: 8px }
  #map { height: clamp(340px, 57svh, 620px) }
}
@media (max-width: 500px) {
  #skip span { display: none }
  #skip, #submit, #hint { min-width: 44px; padding-inline: 9px }
  .answer-line { gap: 5px }
}
@media (prefers-reduced-motion: reduce) { .locator-ring { animation: none } }
@media (prefers-reduced-motion: reduce) { .burst { display: none } }
