:root {
  --ink: #0b1a2c;
  --ink-2: #16304d;
  --ink-3: #24476e;
  --sea: #0e2740;
  --paper: #f5f0e6;
  --paper-2: #ebe3d3;
  --line: #d9cfbb;
  --line-2: #ece5d7;
  --text: #1c2430;
  --text-2: #3f4a58;
  --muted: #5b6573;
  --muted-2: #8b93a0;
  --side-muted: #9fb3c8;
  --side-text: #c4d2e2;
  --gold: #ffc83d;
  --gold-dark: #c99a1f;
  --coral: #ff6b4a;
  --coral-dark: #cc4f33;
  --green: #127350;
  --green-text: #0f6244;
  --radius: 14px;
  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', Consolas, 'Courier New', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body);
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- knoppen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 11px 18px;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform .12s, background .12s, box-shadow .12s, border-color .12s, color .12s;
}
.btn:active { transform: translateY(1px); }
.btn.big { padding: 14px 22px; font-size: 16px; }
.btn.grow { flex: 1; }
.btn.gold { background: var(--gold); color: var(--ink); box-shadow: 0 3px 0 var(--gold-dark); }
.btn.gold:hover { background: #ffd460; }
.btn.dark { background: var(--ink); color: #fff; box-shadow: 0 3px 0 #06101c; }
.btn.dark:hover { background: var(--ink-2); }
.btn.danger { background: var(--coral); color: var(--ink); box-shadow: 0 3px 0 var(--coral-dark); }
.btn.danger:hover { background: #ff8467; }
.btn.outline { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn.outline:hover { border-color: var(--muted); color: var(--text); }
.btn.ghost-light { background: transparent; border: 1px solid rgba(255,255,255,.28); color: var(--side-text); }
.btn.ghost-light:hover { border-color: #fff; color: #fff; }

.pill {
  display: inline-flex; background: var(--ink); color: var(--gold);
  border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 600;
}
.lead { font-size: 17px; line-height: 1.7; color: var(--text-2); margin: 14px 0 0; max-width: 62ch; text-wrap: pretty; }

.sq-btn {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
  display: grid; place-items: center; font-size: 17px; color: var(--muted);
  transition: border-color .12s, color .12s;
}
.sq-btn:hover { border-color: var(--ink); color: var(--ink); }
.sq-btn.disabled { opacity: .4; pointer-events: none; }

/* ---------- opbouw: zijbalk + inhoud ---------- */
.shell { display: flex; height: 100vh; height: 100dvh; }

.side {
  width: 300px; flex: none; position: relative; isolation: isolate;
  overflow-x: hidden; overflow-y: auto;
  background: var(--ink); color: #fff;
  padding: 24px 22px; display: flex; flex-direction: column; gap: 24px;
}
.side-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.side-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.side-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,26,44,.6), rgba(11,26,44,.74)); }

.brand { display: flex; align-items: center; gap: 10px; align-self: flex-start; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .01em; }
.brand-name b { color: var(--gold); font-weight: 800; }
.brand-globe {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,.5), transparent 40%),
    repeating-linear-gradient(90deg, transparent 0 6px, rgba(255,255,255,.22) 6px 7px),
    linear-gradient(160deg, #2ec4b6, #1c6ea4);
  background-size: auto, 28px 100%, auto;
  box-shadow: inset -4px -4px 0 rgba(0,0,0,.18);
  animation: spin 18s linear infinite;
}
@keyframes spin { to { background-position: 0 0, 28px 0, 0 0; } }

.side-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--side-muted); text-transform: uppercase; }

.prows { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.prow {
  display: flex; align-items: center; gap: 12px;
  border-radius: 10px; padding: 9px 12px; border: 1px solid transparent;
  color: var(--side-text); font-size: 15px;
  transition: background .15s, border-color .15s;
}
.prow:hover { background: rgba(22,48,77,.6); }
.pbadge {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  background: rgba(22,48,77,.85); border: 1px solid rgba(255,255,255,.08);
  color: var(--side-muted); display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.pstatus { margin-left: auto; font-size: 13px; color: var(--gold); }
.prow.solved { background: rgba(22,48,77,.85); color: #fff; font-weight: 600; }
.prow.solved .pbadge { background: var(--ink); color: var(--gold); font-family: var(--display); font-weight: 800; }
.prow.current { background: rgba(255,200,61,.12); border-color: rgba(255,200,61,.45); color: #fff; font-weight: 600; }
.prow.current .pbadge { background: var(--ink); border-color: var(--gold); color: var(--gold); }

.side-hints { border-top: 1px solid rgba(255,255,255,.1); padding-top: 18px; }
.hints-toggle {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: rgba(255,200,61,.1); border: 1px solid rgba(255,200,61,.45); border-radius: 10px;
  padding: 11px 14px; color: #fff; font-size: 15px; font-weight: 600; text-align: left;
  transition: background .12s, border-color .12s;
}
.hints-toggle:hover { background: rgba(255,200,61,.18); border-color: var(--gold); }
.ht-icon { display: grid; color: var(--gold); }
.ht-count { margin-left: auto; font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--side-muted); }
/* ingedrukt zolang de hints links open staan */
.hints-toggle[aria-expanded="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.hints-toggle[aria-expanded="true"] .ht-icon,
.hints-toggle[aria-expanded="true"] .ht-count { color: var(--ink); }

/* hintkaart in de linkerkolom, op de plek van de uitleg */
.hints-card {
  flex: none; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius);
  padding: 12px 16px; box-shadow: 0 6px 18px rgba(11,26,44,.07); animation: pop .2s ease-out;
}
.hints-head { flex: none; display: flex; align-items: center; gap: 8px; }
.hints-head .ht-icon { color: var(--gold-dark); }
.hints-head b { font-family: var(--display); font-weight: 700; font-size: 17px; }
.hints-card-count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.hints-close {
  margin-left: auto; width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  display: grid; place-items: center; font-size: 13px;
}
.hints-close:hover { border-color: var(--ink); color: var(--ink); }
/* staat onder de tabs, op de plek van de hint: zo verschuiven de tabs niet bij de eerste keuze */
.hints-pick { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 13px; line-height: 1.5; color: var(--muted); }
/* tabs: algemeen of één nummer; wie klikt, krijgt meteen die hint */
.hint-tabs { flex: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hint-tab {
  min-width: 38px; height: 32px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  font-family: var(--display); font-weight: 700; font-size: 14px;
  transition: border-color .12s, background .12s, color .12s;
}
.hint-tab:hover { border-color: var(--ink); color: var(--ink); }
/* al bekeken: licht getint · oplossing getoond: groen */
.hint-tab.seen { background: var(--paper); }
.hint-tab.sol { border-color: #9fd6bd; color: var(--green-text); background: #eef8f3; }
.hint-tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--gold); }
.hint-body { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.hint-body.new { animation: pop .25s ease-out; }
.hint-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hint-list li, .hint-view { display: flex; gap: 10px; align-items: flex-start; }
.hint-num {
  flex: none; height: 22px; min-width: 28px; padding: 0 5px; margin-top: 1px; border-radius: 6px;
  background: var(--ink); color: var(--gold); display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
}
.hint-text { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text); text-wrap: pretty; }
.hint-more { align-self: flex-start; padding: 7px 12px; font-size: 13px; white-space: normal; text-align: left; }
.sol-box {
  display: flex; flex-direction: column; gap: 2px;
  background: #eef8f3; border: 1px solid #bfe3d2; border-radius: 10px; padding: 8px 12px;
}
.sol-box .card-label { color: var(--green-text); }
.sol-box b { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.sol-box .btn { align-self: flex-start; margin-top: 6px; padding: 6px 10px; font-size: 13px; background: #fff; }
.hint-full {
  flex: none; align-self: flex-start; margin-top: 10px; padding: 0; border: 0; background: none;
  font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px;
}
.hint-full:hover { color: var(--ink); }

.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.prow.final-btn:hover { background: rgba(255,200,61,.2); border-color: var(--gold); }
.side-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.lang-pill {
  border: 1px solid rgba(255,255,255,.2); background: transparent; border-radius: 999px;
  padding: 7px 14px; color: #fff; font-weight: 600; font-size: 13px;
}
.lang-pill:hover { background: rgba(255,255,255,.1); }
.side-link { background: none; border: 0; padding: 0; font-size: 13px; color: var(--side-muted); }
.side-link:hover { color: #fff; }

.main { flex: 1; min-width: 0; overflow-y: auto; background: var(--paper); }

/* ---------- menu (5a) ---------- */
.home { padding: 44px 48px; display: flex; flex-direction: column; justify-content: center; min-height: 100%; }
.home > .pill { align-self: flex-start; }
.home-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-top: 18px; }
.home h1 { font-family: var(--display); font-weight: 800; font-size: clamp(44px, 5vw, 68px); line-height: 1.02; color: var(--ink); margin: 0; }
.steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.step-num {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: var(--ink); color: var(--gold); display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.steps b { display: block; font-family: var(--display); font-weight: 700; font-size: 16px; }
.step-text { display: block; font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ---------- raadselscherm (6a/6b) ---------- */
.main-riddle { display: flex; flex-direction: column; overflow: hidden; }
.rhead { display: flex; align-items: center; gap: 16px; padding: 22px 28px 0; }
.rhead-text { flex: 1; min-width: 0; }
.rhead h1 { font-family: var(--display); font-weight: 700; font-size: 26px; margin: 0; }
.rhead p { font-size: 14px; color: var(--muted); margin: 1px 0 0; }
/* --left: breedte van de plaatkolom; standaard iets meer dan een derde, de speler kan ze verslepen */
.rbody {
  --left: 36%;
  display: grid; grid-template-columns: clamp(300px, var(--left), calc(100% - 400px)) 20px minmax(0, 1fr);
  padding: 18px 28px 24px; flex: 1; min-height: 0;
}
.rleft { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; padding: 2px; margin: -2px; }

.splitter { position: relative; display: grid; place-items: center; cursor: col-resize; touch-action: none; outline: none; }
.splitter::before { content: ''; position: absolute; top: 8px; bottom: 8px; left: 50%; width: 2px; margin-left: -1px; border-radius: 2px; background: transparent; transition: background .15s; }
.splitter span {
  position: relative; width: 10px; height: 52px; border-radius: 999px;
  background-color: #fff; border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(11,26,44,.1);
  background-image: radial-gradient(circle, var(--muted-2) 1.3px, transparent 1.8px);
  background-size: 100% 9px; background-position: center 3px;
  transition: background-color .15s, border-color .15s;
}
.splitter:hover::before, .splitter:focus-visible::before, .resizing .splitter::before { background: var(--gold); }
.splitter:hover span, .splitter:focus-visible span, .resizing .splitter span { background-color: var(--gold); border-color: var(--gold-dark); }
.splitter:focus-visible span { box-shadow: 0 0 0 3px rgba(255,200,61,.5); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing .rleft, body.resizing .mapbox { pointer-events: none; }

.plate-card {
  position: relative; display: block; width: 100%; flex: none;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px;
  box-shadow: 0 6px 18px rgba(11,26,44,.07); cursor: zoom-in; text-align: left;
}
.plate-card svg { display: block; width: 100%; height: auto; }
/* het vak van het nummer dat in de hints gekozen is, licht op */
.num-hit { fill: none; stroke: none; pointer-events: none; }
.plate-card [data-num].focus .num-hit { fill: rgba(255,200,61,.16); stroke: #e0a91f; stroke-width: 6; }
body.dragging-num, body.dragging-num * { cursor: grabbing !important; user-select: none; }
.zoom-chip {
  position: absolute; right: 16px; bottom: 16px;
  background: rgba(11,26,44,.88); color: #fff; border-radius: 999px;
  padding: 5px 12px; font-size: 12px; font-weight: 600;
}

.info-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-size: 14px; line-height: 1.6; color: var(--text-2); }

/* compact: vraag, lettervak en knop op één rij, zodat de hints erboven de ruimte krijgen */
.answer-card {
  flex: none; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px 12px 16px; margin-top: auto; box-shadow: 0 6px 18px rgba(11,26,44,.07);
}
.answer-q { display: block; font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1.3; }
.answer-row { display: flex; align-items: center; gap: 8px; }
.answer-row .btn { font-size: 14px; padding: 10px 14px; }
.letter-box {
  width: 58px; height: 52px; flex: none; border-radius: 10px; border: 1px solid var(--line);
  background: var(--paper); text-align: center; text-transform: uppercase;
  font-family: var(--display); font-weight: 800; font-size: 28px; color: var(--ink); outline: none;
}
.letter-box::placeholder { color: #9aa5b1; }
.letter-box:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255,200,61,.45); }
.answer-status { grid-column: 1 / -1; font-size: 13px; color: var(--muted); margin: 8px 0 0; min-height: 1.4em; }
.answer-status:empty { display: none; }
.answer-status.bad { color: var(--coral-dark); }
.answer-status.good { color: var(--green-text); font-weight: 600; }

.success-card { position: relative; background: #fff; border: 2px solid var(--green); border-radius: var(--radius); padding: 20px; box-shadow: 0 10px 24px rgba(18,115,80,.16); }
.success-top { display: flex; align-items: center; gap: 14px; }
.big-letter {
  width: 62px; height: 62px; flex: none; border-radius: 14px;
  background: var(--ink); color: var(--gold); display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 32px; box-shadow: 0 4px 0 #06101c;
}
.success-title { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--green-text); }
.success-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.success-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.success-actions .btn { padding: 13px 12px; }
.success-actions .btn.gold { font-size: 15px; }
.success-actions .btn.outline { font-size: 13px; }

.places-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-top: auto; }
.card-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.places { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.places li { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.places li span {
  min-width: 24px; height: 24px; padding: 0 4px; flex: none; border-radius: 12px;
  background: var(--gold); color: var(--ink); display: grid; place-items: center; font-size: 11px; font-weight: 700;
}

/* ---------- kaart ---------- */
.mapbox { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); min-height: 0; background: var(--sea); container-type: inline-size; }
/* smalle kaart (gsm, of een brede plaatkolom): de bronvermelding loopt over twee regels, dus de knoppen schuiven op */
@container (max-width: 560px) {
  .mapbox > .map-bottom { bottom: 40px; }
  .mapbox > .map-bottom > .spacer { display: none; }
}
#map { position: absolute; inset: 0; background: var(--sea); cursor: crosshair; }
.mapbox.is-solved #map { cursor: grab; }
.leaflet-container { font-family: var(--body); }
/* zoomknoppen rechts in het midden, zodat ze nooit onder een knoppenbalk vallen */
.leaflet-top.leaflet-right { top: 50%; transform: translateY(-50%); }
.leaflet-top.leaflet-right .leaflet-control { margin-top: 0; }

.map-top {
  position: absolute; top: 16px; left: 16px; right: 16px; z-index: 500;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  pointer-events: none;
}
.map-top > *, .map-bottom > * { pointer-events: auto; }
.search { display: flex; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.3); flex: 0 1 340px; min-width: 0; }
.search input { flex: 1; min-width: 0; border: 0; padding: 12px 16px; font-size: 15px; color: var(--text); background: #fff; outline: none; }
.search input::placeholder { color: var(--muted-2); }
.search button { flex: none; width: 48px; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; }
.search button:hover { background: var(--ink-2); }
.search:focus-within { box-shadow: 0 0 0 3px rgba(255,200,61,.6), 0 4px 14px rgba(0,0,0,.3); }
.search.busy button svg { animation: blink .7s ease-in-out infinite alternate; }
@keyframes blink { to { opacity: .3; } }

.search-pin { position: relative; display: block; width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--gold); background: rgba(255,200,61,.2); box-shadow: 0 0 0 2px rgba(11,26,44,.55); cursor: pointer; }
.search-pin::after { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--gold); }
.search-pin::before { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid var(--gold); animation: ring 1.6s ease-out infinite; }
@keyframes ring { to { transform: scale(1.9); opacity: 0; } }
.search-popup .leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.search-popup .leaflet-popup-content { margin: 12px 14px; }
.search-pop { display: flex; flex-direction: column; gap: 10px; font-family: var(--body); }
.search-pop b { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); padding-right: 12px; }
.pop-label { font-size: 13px; color: var(--muted); margin-bottom: -4px; }
.pop-nums { display: flex; flex-wrap: wrap; gap: 6px; }
.pop-nums .num-chip { width: 36px; height: 36px; cursor: pointer; background: #fff; color: var(--ink); border: 2px solid var(--ink); box-shadow: none; }
.pop-nums .num-chip.placed { background: var(--paper-2); color: var(--muted); border-color: var(--line); }
.pop-nums .num-chip.suggest { background: var(--gold); color: var(--ink); border-color: var(--gold-dark); }
.pop-nums .num-chip:hover { border-color: var(--ink); color: var(--ink); }
.pin-pop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-family: var(--body); }
.pin-pop b { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--ink); white-space: nowrap; }
.pin-pop .btn { padding: 7px 12px; font-size: 13px; }

.map-bottom {
  position: absolute; left: 16px; right: 16px; bottom: 24px; z-index: 500;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; pointer-events: none;
}
/* nummerbalk: sleep een nummer naar de kaart, of klik het aan en klik dan op de kaart */
.num-tray { display: flex; gap: 6px; background: rgba(11,26,44,.9); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 6px; }
.num-chip {
  width: 38px; height: 38px; flex: none; padding: 0; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 13px; letter-spacing: .02em;
  background: #fff; color: var(--ink); border: 2px solid #fff; box-shadow: 0 2px 0 rgba(0,0,0,.35);
  cursor: grab; touch-action: none; user-select: none;
  transition: transform .12s, background .12s, border-color .12s, box-shadow .12s, opacity .12s;
}
.num-chip:hover { transform: translateY(-2px); }
/* op de kaart: zelfde kleur als het punt */
.num-chip.placed { background: var(--coral); color: #fff; box-shadow: none; }
.num-chip.ok { background: #1e9e6a; }
.num-chip.near { background: #f59e0b; }
.num-chip.miss { background: #6b7280; }
.num-chip:not(.placed) { cursor: pointer; }
/* gekozen nummer: komt op de volgende klik op de kaart */
.num-chip.chosen { background: var(--coral); color: #fff; transform: translateY(-4px) scale(1.1); box-shadow: 0 0 0 3px #fff, 0 6px 14px rgba(0,0,0,.45); }
.num-chip.dragging { opacity: .4; }

.tool-group { display: flex; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.tool-group button { border: 0; background: #fff; min-width: 44px; padding: 11px 12px; font-size: 16px; font-weight: 600; color: var(--text); white-space: nowrap; display: grid; place-items: center; }
.tool-group button + button { border-left: 1px solid #e7e1d4; }
.tool-group button:hover { background: var(--paper); }
.tool-group button:disabled { color: #bdb5a6; background: #fff; cursor: default; }
.spacer { flex: 1; }
.map-bottom .btn.gold { font-size: 15px; padding: 11px 18px; }

.pin {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--coral); color: #fff; font-family: var(--display); font-weight: 800; font-size: 12px;
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.45);
  cursor: grab; transition: transform .12s;
}
.pin:hover { transform: scale(1.12); }
.pin.ok { background: #1e9e6a; }
.pin.near { background: #f59e0b; }
.pin.miss { background: #6b7280; }
.pin.given { box-shadow: 0 0 0 3px var(--gold), 0 2px 8px rgba(0,0,0,.45); }
/* extra punt zonder nummer, om de lijn verder te trekken (gesloten letters) */
.pin.extra { width: 16px; height: 16px; font-size: 0; }
.leaflet-dragging .pin { cursor: grabbing; }
/* het nummer dat de speler versleept */
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 4000; pointer-events: none; transform: translate(-50%, -50%) scale(1.15); opacity: .92; transition: transform .1s; }
.drag-ghost.over { transform: translate(-50%, -50%) scale(1.35); }

.sol-pin {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gold); color: var(--ink); border: 2.5px solid var(--ink);
  display: grid; place-items: center; font-family: var(--mono); font-size: 13px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.solution-line { stroke-dasharray: 14 10; animation: march 1.2s linear infinite; }
@keyframes march { to { stroke-dashoffset: -24; } }
.solution-coast { stroke-linecap: round; stroke-linejoin: round; }
.sol-tip { background: var(--ink); color: #fff; border: 0; border-radius: 8px; font-weight: 600; font-size: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.sol-tip.leaflet-tooltip-right::before { border-right-color: var(--ink); }

.toast {
  position: absolute; left: 50%; top: 74px; z-index: 600;
  transform: translate(-50%, -10px); opacity: 0; pointer-events: none;
  max-width: min(560px, calc(100% - 32px));
  border-radius: 10px; padding: 13px 18px; font-size: 15px; font-weight: 500; text-align: center;
  background: rgba(11,26,44,.94); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { background: var(--green); color: #fff; font-weight: 600; }
.toast.near { background: var(--coral); color: var(--ink); font-weight: 600; }
.toast.plain { background: #fff; border: 1px solid var(--line); color: var(--text); }
.toast.error { background: #fff; border: 1px solid var(--coral); color: var(--coral-dark); }
.notice {
  position: absolute; top: 16px; left: 16px; z-index: 600; max-width: calc(100% - 32px);
  background: var(--green); color: #fff; border-radius: 10px; padding: 12px 18px;
  font-size: 15px; font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.3);
}

/* ---------- eindwoord (6c) ---------- */
.main-final { display: flex; }
.final-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px; }
.final-card {
  position: relative; width: 100%; max-width: 880px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 48px 52px; box-shadow: 0 14px 36px rgba(11,26,44,.12);
}
.final-card h1 { font-family: var(--display); font-weight: 800; font-size: clamp(38px, 4vw, 52px); line-height: 1.05; margin: 16px 0 0; }
.final-card .lead { margin-top: 10px; max-width: 60ch; }
.final-grid { display: grid; grid-template-columns: 300px 1fr; gap: 44px; margin-top: 36px; align-items: start; }
.key { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.key-row { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; border-bottom: 1px solid var(--line-2); }
.key-row:last-child { border-bottom: 0; }
a.key-row:hover { background: var(--paper); }
.key-row > span { padding: 8px 14px; }
.key-row > span:not(:first-child) { text-align: center; }
.key-head { background: var(--paper); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.key-head > span { padding: 10px 14px; }
.key-id { font-weight: 600; }
.key-pos { font-family: var(--mono); color: var(--muted); }
.key-letter {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: var(--paper-2); color: var(--muted-2); font-family: var(--display); font-size: 16px;
}
.key-letter.on { background: var(--ink); color: var(--gold); }
.final-q { display: block; font-family: var(--display); font-weight: 700; font-size: 20px; }
.big-slots { display: flex; gap: 10px; margin-top: 16px; }
.big-slot { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.big-slot span {
  width: 100%; height: 86px; border-radius: 12px;
  background: var(--ink); border: 1px dashed #2c4a6e; box-shadow: 0 5px 0 #06101c;
  display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 36px; color: var(--gold);
}
.big-slot span.filled { border: 1px solid transparent; }
.big-slot small { font-family: var(--mono); font-size: 11px; color: var(--muted-2); }
.final-row { display: flex; gap: 10px; margin-top: 22px; }
.final-row input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
  padding: 15px 18px; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 8px;
  text-transform: uppercase; color: var(--text); outline: none;
}
.final-row input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255,200,61,.45); }
.final-row .btn { font-size: 16px; padding: 14px 26px; }
.final-status { font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.final-status.bad { color: var(--coral-dark); font-weight: 600; }

/* ---------- gewonnen (6d) ---------- */
.won { position: relative; min-height: 100vh; min-height: 100dvh; background: var(--sea); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.won-art { position: absolute; inset: 0; }
.won-art svg { display: block; width: 100%; height: 100%; }
.won-art::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(11,26,44,.35), rgba(11,26,44,.9) 70%); }
.won-content { position: relative; text-align: center; padding: 40px 24px; }
.won-pill {
  display: inline-flex; background: rgba(255,200,61,.16); border: 1px solid rgba(255,200,61,.5);
  color: var(--gold); border-radius: 999px; padding: 8px 18px; font-size: 13px; font-weight: 600;
}
.won h1 { font-family: var(--display); font-weight: 800; font-size: clamp(44px, 6vw, 64px); line-height: 1.05; color: #fff; margin: 22px 0 0; }
.won p { font-size: 19px; line-height: 1.6; color: var(--side-text); margin: 12px 0 0; }
.won-letters { display: flex; gap: 14px; justify-content: center; margin-top: 40px; }
.won-letters span {
  width: clamp(54px, 8vw, 108px); aspect-ratio: 108 / 132; border-radius: 16px;
  background: var(--gold); color: var(--ink); display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: clamp(30px, 4.4vw, 60px);
  box-shadow: 0 8px 0 var(--gold-dark);
  animation: rise .5s cubic-bezier(.2,.8,.3,1.2) both; animation-delay: calc(var(--i) * 90ms);
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.won-actions { display: flex; gap: 14px; justify-content: center; margin-top: 44px; flex-wrap: wrap; }

/* ---------- plaat vergroot (6e) ---------- */
.lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(6,16,28,.86); display: grid; place-items: center; padding: 40px; }
.lb-card {
  position: relative; width: 100%; max-width: 980px; max-height: calc(100vh - 80px);
  background: #fff; border-radius: 16px; padding: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.5);
  display: flex; flex-direction: column;
}
.lb-plate { min-height: 0; display: grid; place-items: center; overflow: hidden; }
.lb-plate svg { display: block; width: 100%; height: auto; max-height: calc(100vh - 210px); }
.lb-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 6px 4px; }
.lb-title { font-family: var(--display); font-weight: 700; font-size: 18px; }
.lb-sub { font-size: 14px; color: var(--muted); }
.lb-nav { display: flex; gap: 10px; }
.lb-close {
  position: absolute; top: 24px; right: 24px; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff;
  font-size: 20px; display: grid; place-items: center;
}
.lb-close:hover { background: rgba(255,255,255,.22); }

/* ---------- dialoogvensters (6f) ---------- */
.dialog { position: fixed; inset: 0; z-index: 3000; background: rgba(6,16,28,.72); display: grid; place-items: center; padding: 24px; }
.dialog-card { width: min(440px, 100%); background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 24px 60px rgba(0,0,0,.45); animation: pop .2s ease-out; }
.dialog-title { font-family: var(--display); font-weight: 700; font-size: 22px; }
.dialog-text { font-size: 16px; line-height: 1.6; color: var(--text-2); margin-top: 8px; }
.dialog-actions { display: flex; gap: 10px; margin-top: 22px; justify-content: flex-end; flex-wrap: wrap; }
.dialog-actions .btn { padding: 14px 22px; }
.dialog-actions .btn:not(.outline) { font-size: 16px; }

/* ---------- animaties ---------- */
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.confetti { position: absolute; left: 50%; top: 40%; width: 0; height: 0; pointer-events: none; z-index: 5; }
.confetti i { position: absolute; width: 9px; height: 14px; border-radius: 2px; animation: burst var(--d) cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes burst {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--x), calc(var(--y) + 380px)) rotate(var(--r)); opacity: 0; }
}

/* ---------- kleinere schermen ---------- */
@media (max-width: 1180px) {
  .home { padding: 36px 32px; }
  .final-wrap { padding: 32px; }
  .final-card { padding: 36px; }
}
@media (max-width: 900px) {
  .shell { flex-direction: column; height: auto; min-height: 100vh; }
  .side { width: auto; overflow: hidden; padding: 16px 18px; gap: 14px; }
  .prows { flex-direction: row; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .prow { padding: 5px; gap: 6px; }
  .prow .pname, .prow .pstatus { display: none; }
  .side-bottom { margin-top: 0; }
  .prow.final-btn { padding: 9px 12px; gap: 12px; }
  .prow.final-btn .pname { display: inline; }
  .main { overflow: visible; }
  .main-riddle { overflow: visible; }
  .rhead { padding: 18px 18px 0; }
  .rbody { grid-template-columns: 1fr; row-gap: 20px; padding: 14px 18px 24px; }
  .splitter { display: none; }
  .rleft { overflow: visible; }
  .answer-card, .places-card { margin-top: 0; }
  .mapbox { height: 72vh; }
  .home { padding: 24px 18px; }
  .home-hero { flex-direction: column; align-items: flex-start; gap: 20px; }
  .steps { grid-template-columns: 1fr; }
  .final-wrap { padding: 18px; }
  .final-card { padding: 28px 22px; }
  .final-grid { grid-template-columns: 1fr; gap: 28px; }
  .map-top .search { flex-basis: 100%; }
}
@media (max-width: 600px) {
  .big-slot span { height: 64px; font-size: 28px; }
  .lightbox { padding: 12px; }
  .lb-close { top: 10px; right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
