@font-face {
  font-family: Andika;
  src: url('../fonts/Andika-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Andika;
  src: url('../fonts/Andika-Bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #264953;
  --muted: #526b73;
  --turquoise: #5ac0c8;
  --orange: #f5ac42;
  --green: #277344;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--turquoise) url('../img/expedition.svg') center top / 1200px auto repeat-y; color: var(--ink); font-family: Andika, Arial, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, label:has(input:focus-visible) { outline: 3px solid #163b90; outline-offset: 4px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 3px; font-size: clamp(30px, 5vw, 42px); letter-spacing: -1px; }
h2 { font-size: clamp(21px, 3vw, 28px); }
.app { min-height: 100svh; margin: 0; padding: 12px 12px 94px; }
.header { display: flex; align-items: center; gap: 14px; padding: 6px 6px 22px; }
.header p { margin: 0; }
.header > img { width: 64px; height: 64px; transform: rotate(-12deg); }
main { min-height: calc(100svh - 106px); background: white; border: 3px solid white; border-radius: 12px; padding: 28px; box-shadow: 0 5px 0 #258d9633; }
.intro, .muted { color: var(--muted); line-height: 1.5; }
.map-choices { padding: 0; border: 0; margin: 24px 0; min-width: 0; }
.map-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 760px; margin: 0 auto; }
.mode-choice strong, .mode-choice small { max-width: 100%; overflow-wrap: anywhere; }
.destination-preview { margin: 0 auto 20px; max-width: 320px; text-align: center; }
.selected-maps { padding: 8px; background: #eaf5fa; border: 2px solid #badbe6; border-radius: 20px; }
.selected-maps img { display: block; width: 100%; height: 160px; object-fit: contain; }
.selected-maps.mixed { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.selected-maps.mixed img { height: 72px; }
.destination-preview figcaption { margin-top: 8px; font-size: 18px; font-weight: bold; }
.mode-grid:has(#cityChoice:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mode-choice { justify-content: center; min-height: 68px; padding: 14px 12px 14px 38px; border-radius: 14px; }
#modeSetup .mode-choice input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); }
.mode-choice.unavailable { opacity: .5; cursor: not-allowed; }
.mode-choice.unavailable:hover { transform: none; box-shadow: none; }
.map-choice { --card-color: #d3ecf7; position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; border: 2px solid #b1c9d1; border-bottom-width: 5px; border-radius: 16px; background: var(--card-color); padding: 14px 10px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.map-choice:nth-child(3n + 2) { --card-color: #fce8bc; }
.map-choice:nth-child(3n) { --card-color: #e8dff7; }
.map-choice:nth-child(4n) { --card-color: #dcefd3; }
.map-choice:hover { transform: translateY(-3px); box-shadow: 0 5px 0 #26495318; }
.map-choice:has(input:checked) { background: #e5f4e3; border-color: var(--green); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--green); }
#mapChoices .map-choice { --card-color: #dcefd3; background: var(--card-color); }
#mapChoices .map-choice[data-map="nederland"] { --card-color: #fce8bc; }
#mapChoices .map-choice[data-map="europa"] { --card-color: #d3ecf7; }
#mapChoices .map-choice[data-map="all"] { --card-color: #e8dff7; }
.map-choice input { position: absolute; top: 10px; left: 10px; accent-color: var(--green); width: 18px; height: 18px; }
.map-choice img { width: 100%; height: 95px; margin-bottom: 10px; border-radius: 14px; border: 2px solid #ffffffb3; }
.map-choice strong { font-size: 17px; }
.map-choice small { margin-top: 5px; color: var(--muted); }
.setup-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
#setup .setup-bottom { justify-content: center; }
#modeButton { align-self: center; }
.setup-bottom > .button { flex-shrink: 0; white-space: nowrap; }
.setup-bottom p { margin: 8px 0 0; max-width: 650px; }
.check-option { display: flex; align-items: center; gap: 10px; font-weight: bold; cursor: pointer; }
.check-option input { width: 22px; height: 22px; accent-color: var(--green); }
.button { border: 2px solid transparent; border-radius: 16px; padding: 12px 20px; font-weight: bold; min-height: 46px; box-shadow: 0 3px 0 #26495326; }
.button:active { transform: translateY(2px); box-shadow: none; }
.primary { color: white; background: var(--green); border-color: var(--green); }
.primary:hover { background: #1c5d35; }
.secondary { color: var(--ink); background: white; border-color: #b7cfd2; }
.secondary:hover { background: #eaf5f5; }
#modeSetup .mode-choice { background: #d3ecf7; color: var(--ink); }
#capitalScope { text-align: center; }
.small { font-size: 14px; padding: 7px 12px; min-height: 40px; }
.game-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr) minmax(0, 1fr); align-items: center; gap: 10px; margin-bottom: 18px; font-weight: bold; }
.tag { border-radius: 12px 12px 12px 3px; background: #ffedb7; padding: 7px 16px; border: 2px solid #ecd596; }
#progress { padding: 7px 12px; background: #e8dff7; border-radius: 20px; }
#question { text-align: center; margin: 0; grid-column: 2; }
#progress { justify-self: start; white-space: nowrap; }
.map-area { position: relative; border: 3px solid #badbe6; border-radius: 24px; overflow: hidden; background: #eaf5fa; }
#map { width: 100%; height: clamp(260px, 49vh, 500px); display: block; }
.region { fill: #d3e2d9; stroke: #71877d; stroke-width: .8; vector-effect: non-scaling-stroke; }
.region.context { fill: #e5eae7; stroke: #a4b4ac; }
.water { fill: #eaf5fa; stroke: #71877d; stroke-width: 1.2; vector-effect: non-scaling-stroke; pointer-events: none; }
#map[data-map="nederland"] .region:not(.highlight):not(.city-region) { stroke-width: 1.2; }
.region.highlight { fill: var(--orange); stroke: #87460c; stroke-width: 2; }
.region.city-region { fill: #f7ddb3; stroke: #9c7140; stroke-width: 1.4; }
#map:not([data-map="nederland"]) .region.highlight,
#map:not([data-map="nederland"]) .region.city-region { stroke: #71877d; stroke-width: .8; }
.selected-border { fill: none; stroke: #87460c; stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
.selected-border.capital-border { stroke: #9c7140; stroke-width: 1.4; }
.marker-halo { fill: #fff; stroke: #87460c; stroke-width: 2; }
.marker-dot { fill: #b64d04; stroke: white; stroke-width: 1.8; }
.map-tools { position: absolute; top: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.answers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.answer { display: flex; align-items: center; gap: 10px; text-align: left; min-height: 74px; border: 2px solid #398e96; border-bottom-width: 5px; border-radius: 20px 20px 20px 6px; padding: 12px; background: var(--turquoise); color: var(--ink); font-size: 18px; font-weight: bold; overflow-wrap: anywhere; }
.answer { justify-content: center; text-align: center; border-radius: 16px; }
.answer:not(:disabled):hover { background: #79cdd3; }
.answer.correct { border-color: #18552e; background: #277344; }
.answer.wrong { border-color: #7e2020; background: #ae3030; }
.answer:disabled { opacity: 1; }
.answer.correct, .answer.wrong { color: white; }
#game .button.secondary { background: var(--turquoise); border-color: #398e96; color: var(--ink); }
#game .button.secondary:hover { background: #79cdd3; }
.question-bottom { min-height: 65px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
#feedback { margin: 12px 0; font-size: 18px; font-weight: bold; }
#feedback[data-correct="true"] { color: #22653a; }
#feedback[data-correct="false"] { color: #9b2929; }
.result { text-align: center; padding: 40px 10px; }
.result-score { font-size: 42px; font-weight: bold; margin-bottom: 12px; }
.result-buttons { display: flex; justify-content: center; gap: 12px; margin-top: 28px; }
.controlbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px; padding-bottom: max(14px, env(safe-area-inset-bottom)); background: var(--turquoise); }
.badge { display: block; width: 210px; max-width: 42%; flex-shrink: 0; }
.badge img { display: block; width: 100%; height: auto; }
.toolbar-controls { display: flex; gap: 10px; }
.tool-button { display: grid; place-items: center; width: 52px; height: 52px; border: 0; border-radius: 7px; background: #7b8292; color: white; padding: 10px; }
.tool-button:hover { background: #646c7d; }
.tool-button svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
#fullscreenButton { padding: 0; background: transparent; flex-shrink: 0; }
#fullscreenButton:hover { filter: brightness(1.04); }
#fullscreenButton:active { filter: brightness(.92); }
.control-icon { display: block; width: 100%; height: 100%; background-image: url('../img/timer-controls.png'); background-repeat: no-repeat; background-size: 700% 100%; background-position: calc(var(--icon-frame) * 100% / 6) 0; }
.icon-expand { --icon-frame: 5; }
.icon-collapse { --icon-frame: 6; }
.error { margin: 20px 0 0; padding: 14px; border: 2px solid #ae3030; background: #fce8e7; color: #8b2525; border-radius: 9px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 780px) {
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding: 20px; }
}
@media (max-width: 440px) {
  .mode-grid { grid-template-columns: 1fr; }
  .mode-grid:has(#cityChoice:not([hidden])) { grid-template-columns: 1fr; }
  .mode-choice { min-height: 62px; }
  .header { flex-wrap: wrap; gap: 10px; }
  .header p { font-size: 13px; }
  .header > img { width: 48px; height: 48px; }
  main { padding: 16px 12px; }
  .setup-bottom, .question-bottom, .result-buttons { align-items: stretch; flex-direction: column; }
  .question-bottom { padding: 8px 0; gap: 0; }
  .answer { font-size: 16px; padding: 10px 8px; gap: 6px; }
  .game-top { font-size: 13px; grid-template-columns: 1fr; }
  #question { grid-column: 1; }
  .tag { padding: 7px 10px; }
  .map-tools { top: 6px; right: 6px; }
  .controlbar { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .toolbar-controls { gap: 6px; }
  .tool-button { width: 44px; height: 44px; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .map-choice { transition: none; }
  .map-choice:hover, .button:active { transform: none; }
}
/* Divide the available window between the content and the persistent toolbar. */
.app { height: 100dvh; min-height: 0; padding: 10px 12px 88px; }
main { height: 100%; min-height: 0; display: flex; flex-direction: column; padding: clamp(10px, 2vh, 24px); }
.header { flex: none; padding: 0 4px 10px; }
.header > img { width: 44px; height: 44px; }
h1 { font-size: 30px; }
main > section { flex: 1; min-height: 0; }
#setup, #modeSetup { display: flex; flex-direction: column; }
#setupTitle, #modeTitle { flex: none; margin-bottom: 10px; }
.map-choices { flex: 1; min-height: 0; margin: 8px 0 16px; }
.map-grid { height: 100%; grid-template-rows: repeat(2, minmax(0, 1fr)); }
#mapChoices .map-choice { min-height: 0; justify-content: center; padding: 8px; }
#mapChoices .map-choice img { height: 0; min-height: 0; flex: 1; margin-bottom: 6px; }
#mapChoices .map-choice strong { flex: none; }
#mapChoices .map-choice small { flex: none; font-size: 12px; }
.setup-bottom { flex: none; }
.destination-preview { flex: 0 1 auto; min-height: 0; margin-bottom: 8px; width: 360px; max-width: 100%; }
.selected-maps img { height: clamp(60px, 20vh, 180px); }
.selected-maps.mixed img { height: clamp(30px, 8vh, 72px); }
#modeSetup .map-choices { flex: 0 0 auto; margin: 8px 0 16px; }
#modeSetup .setup-bottom { margin-top: auto; }
#game { display: grid; grid-template-rows: auto minmax(0, 1fr) auto 54px; gap: 10px; }
.game-top { margin: 0; }
.map-area { min-height: 0; }
#map { height: 100%; }
.answers { margin: 0; }
.answer { min-height: 58px; }
.question-bottom { min-height: 0; }
.result { padding: 12px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.result > :not(.destination-preview) { flex-shrink: 0; }
#resultMode { margin-bottom: 8px; }
@media (max-width: 780px) {
  .map-grid { grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 8px; }
  #mapChoices .map-choice strong { font-size: 14px; }
  #mapChoices .map-choice small { font-size: 11px; }
  .answer { min-height: 48px; }
}
@media (max-width: 440px) {
  .app { padding: 8px 8px 78px; }
  .header { padding-bottom: 6px; }
  .header > img { width: 32px; height: 32px; }
  h1 { font-size: 24px; }
  h2 { font-size: 19px; }
  #mapChoices .map-choice small { display: none; }
  .mode-grid, .mode-grid:has(#cityChoice:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mode-choice { min-height: 64px; padding: 8px 6px; }
  .mode-choice strong { font-size: 14px; }
  .mode-choice small { font-size: 11px; }
  .game-top { grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
  #question { grid-column: 2; font-size: 17px; }
  #progress { padding: 5px 8px; font-size: 11px; }
  .setup-bottom, .question-bottom, .result-buttons { flex-direction: row; align-items: center; }
  .button { padding: 8px 12px; }
  .answer { font-size: 14px; padding: 6px; }
}
@media (max-height: 550px) and (min-width: 650px) {
  .result { padding: 0; }
  .result .destination-preview { margin-bottom: 4px; }
  .result .selected-maps img { height: 40px; }
  .result .selected-maps.mixed img { height: 18px; }
  .result h2, .result p { margin-bottom: 8px; }
  .result-score { font-size: 30px; }
  .result-buttons { margin-top: 8px; }
  .header { display: none; }
  #mapChoices .map-choice small { display: none; }
  .destination-preview { width: 150px; }
  .destination-preview figcaption { font-size: 14px; margin-top: 2px; }
  .selected-maps { padding: 3px; }
  .selected-maps img { height: 55px; }
  .selected-maps.mixed img { height: 24px; }
  .mode-choice { min-height: 46px; padding: 8px; }
  .mode-choice strong { font-size: 14px; }
  .mode-choice small { display: none; }
  .mode-grid:has(#cityChoice:not([hidden])) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .answers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
