:root {
  color-scheme: light;
  --ink: #25483e;
  --muted: #576f62;
  --accent: #28694f;
  --accent-dark: #194b37;
  --line: #d5dfcb;
  --paper: #fffdf2;
  --error: #923722;
  --radius: 20px;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 10% 0%, #fff1ce, transparent 48%), #e5efdf; font: 16px/1.55 'Trebuchet MS', system-ui, sans-serif; }
button, input { font: inherit; }
button { min-height: 46px; border: 1px solid transparent; border-radius: 11px; padding: .75rem 1.1rem; color: white; background: var(--accent); font-weight: 700; line-height: 1.35; cursor: pointer; touch-action: manipulation; }
button:hover:not(:disabled) { background: var(--accent-dark); }
button:disabled { cursor: not-allowed; background: #e5e9df; color: #607064; }
button.secondary { background: var(--paper); border-color: #9eb6a2; color: var(--accent-dark); }
button.secondary:hover:not(:disabled) { background: #edf3e1; }
button:focus-visible, input:focus-visible, a:focus-visible, main:focus-visible { outline: 3px solid #a85b12; outline-offset: 5px; }
[hidden] { display: none !important; }
.page { max-width: 1200px; padding: 30px 28px; margin: auto; }
.page-header { position: relative; padding: 20px 0 26px; }
.page-header::after { content: 'N'; position: absolute; right: 30px; top: 25px; display: grid; place-items: center; width: 95px; height: 95px; border: 1px solid #9ba87e; border-radius: 50%; outline: 7px double #bfc79e; color: #58704e; font: italic 2rem Georgia, serif; transform: rotate(12deg); }
.eyebrow { font-size: .7rem; font-weight: 800; letter-spacing: .17em; color: #667d4e; margin: 0 0 10px; }
h1 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2.7rem, 5.8vw, 4.7rem); font-weight: 700; letter-spacing: -.045em; line-height: .98; margin: 0 0 20px; }
h1 span { color: #427251; }
h2 { font-size: 1.2rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.intro { max-width: 630px; color: var(--muted); font-size: 1.05rem; }
.player-panel { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; background: #fffdf3d9; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.player-panel p, .player-panel small { font-size: .82rem; color: var(--muted); }
.player-panel p { margin-bottom: 0; }
label { display: block; font-size: .85rem; font-weight: 800; margin-bottom: 6px; }
.input-row { display: flex; gap: 8px; }
input { width: 100%; min-width: 0; flex: 1; border: 1px solid #9cb29d; border-radius: 9px; background: #fffef8; padding: .65rem .8rem; }
small { display: block; margin-top: 5px; }
.notice { padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: #dce8d8; margin-bottom: 20px; font-size: .88rem; }
.notice button { margin-left: 12px; font-size: .84rem; }
.notice.error, .round-notice.error { background: #fff0e7; color: var(--error); border-color: #eac5ae; }
.notice ul { padding-left: 20px; overflow-wrap: anywhere; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 30px 0 16px; }
.section-heading h2 { font-family: Georgia, serif; font-size: 1.8rem; letter-spacing: -.03em; }
.section-heading p { margin-bottom: 0; }
#progress-summary { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.view-switch { display: flex; padding: 4px; gap: 4px; border: 1px solid #becfb7; border-radius: 14px; background: #fffdf1; flex-shrink: 0; }
.view-switch button { background: transparent; color: #476751; font-size: .83rem; padding: .6rem .8rem; }
.view-switch button[aria-pressed='true'] { background: #285f48; color: white; }
.view-switch button:hover:not([aria-pressed='true']) { background: #e8eed9; }
.legend { display: flex; flex-wrap: wrap; gap: 22px; margin: 14px 0; font-size: .8rem; color: #516950; }
.legend span { display: flex; gap: 7px; align-items: center; }
.legend b { display: inline-block; font-size: 1rem; }
.lock-icon { position: relative; display: inline-block; width: 10px; height: 8px; margin: 4px 3px 0 1px; border: 1.5px solid currentColor; border-radius: 2px; vertical-align: baseline; flex-shrink: 0; }
.lock-icon::before { content: ""; position: absolute; width: 5px; height: 5px; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 4px 4px 0 0; left: 1px; top: -6px; }
.legend-ready { color: #24684e; }.legend-locked { color: #637064; }.legend-done { color: #926614; }
.mobile-hint { display: none; }
/* De kaart groeit met het aantal games. Iedere game blijft een direct kind. */
.game-grid { position: relative; isolation: isolate; }
.world-map { aspect-ratio: 1000 / var(--map-height, 695); border: 5px solid #fffdf0; border-radius: 28px; background: #93d7d2; box-shadow: 0 12px 35px #234f3d15; }
.map-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; border-radius: 22px; }
.game-card { min-width: 0; overflow-wrap: anywhere; }
.world-map .game-card { position: absolute; left: var(--x); top: var(--y); width: 25%; transform: translate(-50%, -50%); }
.location-button { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: center; border-radius: 16px; }
.location-button:hover:not(:disabled) { background: transparent; }
.landmark { position: relative; display: block; width: 124px; height: 106px; transition: transform 160ms ease; }
.landmark::before { content: ''; position: absolute; inset: 36px 3px 0; z-index: -1; border-radius: 50%; background: #fff8d66b; }
.landmark-art { display: block; width: 100%; height: 100%; filter: drop-shadow(0 5px 1px #42683920); }
.location-button:hover .landmark { transform: translateY(-4px); }
.step-number { position: absolute; top: 14px; left: -5px; display: grid; place-items: center; width: 28px; height: 28px; background: #fff9df; border: 1px solid #a3ad78; border-radius: 50%; font-size: .7rem; font-weight: 900; }
.location-label { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 11px 10px; border: 1px solid #b1b98c; border-radius: 13px; background: #fffbea; box-shadow: 0 5px 0 #7c9c5330; }
.place-name { display: block; color: #737b54; font-size: .63rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }
.game-name { display: block; font-family: Georgia, serif; font-size: 1.1rem; line-height: 1.2; font-weight: 700; }
.badge { display: inline-block; max-width: 100%; margin-top: 8px; padding: 4px 9px; border-radius: 30px; font-size: .67rem; font-weight: 800; color: #576451; background: #e8ebde; }
.available .badge { color: #235f42; background: #dfefd1; }
.available .location-label { border-color: #598455; }
.locked .landmark-art { filter: grayscale(1) opacity(.68); }
.locked .location-label { background: #f0f0e6; border-color: #b5c2ad; }
.completed .badge { background: #f4dfa1; color: #765219; }
.completed .location-label { border: 2px solid #b88d38; background: #fff8dc; }
.completed .step-number { background: #f3d47d; border-color: #b38b39; }
.world-map .list-details { display: none; }
.empty-map { padding: 50px 24px; text-align: center; }
/* Lijst gebruikt dezelfde buttons, data-game-id en toegangsstatus. */
.world-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.world-list .map-art { display: none; }
.world-list .game-card { padding: 20px; border: 1px solid #cbd7be; border-top: 4px solid #b4c0ac; border-radius: 20px; background: var(--paper); }
.world-list .game-card.available { border-top-color: #48825a; }
.world-list .game-card.completed { border-top-color: #bc933d; }
.world-list .location-button { flex-direction: row; gap: 12px; text-align: left; align-items: center; }
.world-list .landmark { width: 90px; height: 84px; flex-shrink: 0; }
.world-list .location-label { align-items: flex-start; border: 0; box-shadow: none; background: transparent; padding: 0; }
.world-list .step-number { left: -3px; top: 4px; }
.list-details { margin-top: 14px; }
.learning-goal { color: var(--muted); font-size: .92rem; line-height: 1.6; }
.bloom-label { color: #56774f; font-size: .75rem; font-weight: 700; margin: 13px 0; }
.card-details { font-size: .87rem; }
.card-details p:last-child { margin-bottom: 0; }
.score { color: #775821; font-weight: 800; }
.conditions-label { font-weight: 700; margin-bottom: 5px; }
.conditions { padding-left: 19px; color: var(--muted); margin: 0; }
.conditions li + li { margin-top: 7px; }
footer { color: var(--muted); margin-top: 28px; padding: 16px 0; border-top: 1px solid #bdcdb1; font-size: .82rem; }
.skip-link { position: absolute; top: -100px; left: 12px; padding: 12px; background: white; z-index: 10; }
.skip-link:focus { top: 12px; }
/* Spelinformatie voor het starten. Gesloten plekken blijven aanklikbaar. */
dialog { padding: 0; border: 1px solid #c8d6bb; border-radius: 20px; max-width: 96vw; max-height: 94dvh; background: var(--paper); color: var(--ink); box-shadow: 0 20px 90px #102c3b55; }
dialog::backdrop { background: #183d38bd; }
#location-dialog { width: min(560px, 94vw); overflow-y: auto; }
.location-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.location-toolbar .eyebrow { margin: 0; font-size: .62rem; }
.location-toolbar button { font-size: .8rem; }
#location-content { padding: 10px 26px 22px; overflow-wrap: anywhere; }
#location-content .landmark-art { width: 125px; height: 100px; margin: 5px auto 10px; }
#location-title { font-family: Georgia, serif; font-size: 1.9rem; margin: 5px 0; }
.location-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 26px 24px; }
/* Bestaande game-dialog en alle iframe-/API-meldingen behouden. */
#game-dialog { width: min(1180px, 96vw); }
#game-dialog[open] { display: flex; flex-direction: column; }
.game-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.game-toolbar h2 { margin: 0; overflow-wrap: anywhere; }
.game-toolbar small { color: var(--muted); font-size: .75rem; margin: 0; }
.round-notice { padding: 12px 20px; background: #eaf3df; font-size: .9rem; }
.round-notice button { margin: 6px 0 0 10px; font-size: .85rem; }
#frame-host { min-height: 180px; flex: 1; display: flex; }
iframe { width: 100%; height: 72dvh; border: 0; display: block; background: white; }
body:has(dialog[open]) { overflow: hidden; }
@media (max-width: 950px) {
  .player-panel { grid-template-columns: 1fr; gap: 14px; }
  .game-name { font-size: 1rem; }
  .landmark { width: 100px; height: 86px; }
  .location-label { padding: 8px; }
}
@media (max-width: 760px) {
  .page { padding: 22px 14px; }
  .page-header::after { display: none; }
  h1 { font-size: clamp(1.75rem, 9.5vw, 3.6rem); }
  .intro { font-size: 1rem; }
  .player-panel { padding: 18px; }
  .input-row { flex-direction: column; }
  .section-heading { display: block; }
  .view-switch { display: none; }
  .section-heading h2 { font-size: 1.55rem; }
  .legend { gap: 15px; font-size: .75rem; }
  .mobile-hint { display: block; color: var(--muted); font-size: .8rem; }
  .world-map, .world-list { display: grid; grid-template-columns: 1fr; gap: 15px; aspect-ratio: auto; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .map-art { display: none; }
  .world-map .game-card, .world-list .game-card { position: static; transform: none; width: auto; padding: 18px; border: 1px solid #cbd7be; border-top: 4px solid #b4c0ac; border-radius: 18px; background: var(--paper); }
  .world-map .game-card.available { border-top-color: #48825a; }
  .world-map .game-card.completed { border-top-color: #bc933d; }
  .world-map .location-button, .world-list .location-button { flex-direction: row; text-align: left; gap: 12px; }
  .world-map .landmark, .world-list .landmark { width: 84px; height: 80px; flex-shrink: 0; }
  .world-map .location-label, .world-list .location-label { align-items: flex-start; background: transparent; border: 0; box-shadow: none; padding: 0; }
  .world-map .list-details { display: block; }
  .game-name { font-size: 1.15rem; }
  .badge { font-size: .7rem; }
  .notice button { display: block; margin: 10px 0 0; }
  .game-toolbar { padding: 12px; align-items: flex-start; }
  .game-toolbar button { max-width: 140px; font-size: .8rem; }
  .game-toolbar h2 { font-size: 1rem; }
  .round-notice { padding: 10px 12px; }
  .round-notice button { display: block; margin: 8px 0 0; }
  iframe { height: 67dvh; }
  .location-actions { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Versie 3: spel vult de hele browserpagina, bediening blijft erboven. */
#game-dialog {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
#game-dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
}
#game-dialog .game-toolbar {
  min-width: 0;
  min-height: 0;
  max-height: 30vh;
  overflow: auto;
  padding-top: max(10px, env(safe-area-inset-top));
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
}
#game-dialog .game-toolbar > div { min-width: 0; }
#close-game { flex-shrink: 0; }
#game-dialog .round-notice {
  min-height: 0;
  max-height: 22vh;
  overflow: auto;
  overflow-wrap: anywhere;
}
#frame-host {
  display: block;
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
#frame-host iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  border: 0;
  margin: 0;
  background: white;
}
