/* Basisstijl van de OJW-tools. Kleuren per tool via de variabelen in body. */
:root {
  --bg1: #e0f2fe; --bg2: #f0f9ff;
  --ink: #0f172a; --muted: #475569;
  --a: #0284c7; --a2: #0369a1; --a-licht: #e0f2fe;
  --card: #ffffff; --line: #cbd5e1;
  --good: #16a34a; --good-licht: #dcfce7;
  --bad: #dc2626; --bad-licht: #fee2e2;
  --gold: #f59e0b;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--bg2) linear-gradient(180deg, var(--bg1), var(--bg2) 360px) no-repeat; min-height: 100%; }
body {
  color: var(--ink);
  font-family: "Nunito", "Segoe UI Rounded", "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px; line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; }
.hidden { display: none !important; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px; background: var(--a); color: #fff;
  position: sticky; top: 0; z-index: 20; height: 58px; box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.logo { font-weight: 900; font-size: 23px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; }
.top-btn { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); border-radius: 12px; padding: 7px 12px; font-size: 16px; font-weight: 800; color: #fff; white-space: nowrap; }
.top-btn:hover { background: rgba(255,255,255,.3); }

main { max-width: 1000px; margin: 0 auto; padding: 16px; }

/* ---------- menu ---------- */
.intro { text-align: center; margin: 6px 0 18px; }
.intro h1 { margin: 0 0 6px; font-size: 32px; line-height: 1.15; }
.intro p { margin: 0 auto; color: var(--muted); max-width: 640px; }
.meta { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.pill { background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 3px 12px; font-size: 15px; font-weight: 800; color: var(--a2); }
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.lv {
  position: relative; display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.lv:not(.dicht):hover { transform: translateY(-2px); border-color: var(--a); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.lv.gehaald { border-color: color-mix(in srgb, var(--a) 45%, var(--line)); }
.lv.dicht { opacity: .55; }
.lv-num { flex: 0 0 46px; height: 46px; border-radius: 14px; background: var(--a); color: #fff; font-weight: 900; font-size: 22px; display: grid; place-items: center; }
.lv.dicht .lv-num { background: #94a3b8; font-size: 18px; }
.lv-txt { flex: 1; min-width: 0; }
.lv-txt b { display: block; font-size: 18px; line-height: 1.2; }
.lv-txt small { display: block; color: var(--muted); font-size: 14px; line-height: 1.25; margin-top: 2px; }
.lv-st { color: var(--gold); font-size: 20px; letter-spacing: 1px; white-space: nowrap; }
.lv-tijd { position: absolute; top: -9px; right: 10px; font-size: 16px; background: var(--card); border-radius: 99px; padding: 0 4px; }
.menu-actions { text-align: center; margin: 20px 0 8px; }
.howto { margin-top: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.howto h2 { margin: 0 0 10px; font-size: 20px; }
.howto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.howto-grid b { display: block; }
.howto-grid span { color: var(--muted); font-size: 15px; }
.note { color: var(--muted); font-size: 14px; margin: 10px 0 0; }

/* ---------- knoppen ---------- */
.big-btn {
  background: var(--a); color: #fff; border-radius: 16px; padding: 13px 26px; font-weight: 900; font-size: 20px;
  box-shadow: 0 4px 0 var(--a2); transition: transform .08s, box-shadow .08s;
}
.big-btn:hover { filter: brightness(1.06); }
.big-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--a2); }
.big-btn.ghost { background: var(--card); color: var(--a2); border: 2px solid var(--a); box-shadow: 0 4px 0 var(--line); }
.big-btn:disabled { opacity: .55; filter: grayscale(.5); }
.link-btn { color: var(--a2); text-decoration: underline; font-weight: 700; margin-top: 12px; }
.start-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 4px 18px rgba(15,23,42,.05); }

/* ---------- uitleg vooraf ---------- */
.intro-card { max-width: 860px; margin: 0 auto; }
.lv-kop { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.lv-kop h1 { margin: 0; font-size: 28px; }
.lv-badge { background: var(--a); color: #fff; border-radius: 99px; padding: 3px 12px; font-weight: 900; font-size: 15px; }
.ontdek p { margin: 8px 0; }
.ontdek .tip { background: var(--a-licht); border-left: 5px solid var(--a); border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
.ontdek .let-op { background: #fef3c7; border-left: 5px solid var(--gold); border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
.regels { display: flex; gap: 8px 18px; flex-wrap: wrap; justify-content: center; margin-top: 14px; color: var(--muted); font-weight: 700; font-size: 16px; }

/* ---------- spel ---------- */
.spel { position: relative; max-width: 900px; margin: 0 auto; }
.hud { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px 14px; }
.hud-lv { flex: 1; min-width: 0; }
.hud-lv small { display: block; color: var(--muted); font-size: 13px; font-weight: 800; }
.hud-lv b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-nr { font-weight: 900; color: var(--a2); white-space: nowrap; }
.hud-hart { font-size: 18px; white-space: nowrap; }
.hud-punt { font-weight: 900; white-space: nowrap; min-width: 92px; text-align: right; }
.progress { height: 10px; background: rgba(15,23,42,.08); border-radius: 99px; margin: 8px 2px 0; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--good); border-radius: 99px; transition: width .4s; }
.tijd { height: 8px; background: rgba(15,23,42,.08); border-radius: 99px; margin: 6px 2px 0; overflow: hidden; }
.tijd-fill { height: 100%; width: 100%; background: var(--a); border-radius: 99px; }
.tijd-fill.bijna { background: var(--bad); }
.vraag { text-align: center; font-size: 23px; font-weight: 900; margin: 14px 8px 10px; line-height: 1.25; min-height: 1.25em; }
.vraag small { display: block; font-size: 16px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.stage { position: relative; }

.opties { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 12px; }
.optie {
  background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px;
  font-weight: 800; font-size: 18px; text-align: center; box-shadow: 0 3px 0 var(--line);
  transition: border-color .1s, background .1s, transform .08s;
}
.optie:hover:not(:disabled) { border-color: var(--a); }
.optie:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.optie.goed { background: var(--good-licht); border-color: var(--good); }
.optie.fout { background: var(--bad-licht); border-color: var(--bad); }
.optie small { display: block; font-weight: 600; color: var(--muted); font-size: 14px; }

.feedback {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 30;
  width: min(680px, calc(100% - 24px)); border-radius: 18px; padding: 14px 18px;
  box-shadow: 0 10px 30px rgba(15,23,42,.25); animation: omhoog .22s ease-out;
  display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center;
}
@keyframes omhoog { from { transform: translate(-50%, 30px); opacity: 0; } }
.feedback.goed { background: var(--good-licht); border: 2px solid var(--good); }
.feedback.fout { background: #fff; border: 3px solid var(--bad); }
.fb-kop { font-weight: 900; font-size: 20px; grid-column: 1; }
.feedback.goed .fb-kop { color: #15803d; }
.feedback.fout .fb-kop { color: var(--bad); }
.fb-tekst { grid-column: 1; font-size: 17px; }
.verder { grid-column: 2; grid-row: 1 / span 3; background: var(--a); color: #fff; border-radius: 12px; padding: 10px 16px; font-weight: 900; white-space: nowrap; }
.feedback.goed .verder { background: var(--good); }

/* ---------- einde ---------- */
.einde { max-width: 560px; margin: 20px auto; text-align: center; }
.einde h1 { margin: 6px 0; }
.einde-emoji { font-size: 64px; }
.sterren-groot { color: var(--gold); font-size: 52px; letter-spacing: 6px; line-height: 1; margin: 6px 0; }

/* ---------- diploma ---------- */
.dip-bar { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.naam-in { font: inherit; font-size: 20px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; min-width: 260px; }
.diploma {
  max-width: 720px; margin: 0 auto; background: #fff; border: 10px double var(--a); border-radius: 12px;
  padding: 28px 34px; text-align: center;
}
.dip-emoji { font-size: 56px; }
.dip-titel { font-size: 46px; font-weight: 900; color: var(--a2); letter-spacing: 2px; }
.dip-sub { font-size: 22px; font-weight: 800; margin-bottom: 16px; }
.dip-naam { font-size: 34px; font-weight: 900; border-bottom: 2px dashed var(--line); margin: 6px auto 12px; max-width: 460px; min-height: 48px; }
.dip-lijst { list-style: none; padding: 0; margin: 10px auto; max-width: 460px; text-align: left; }
.dip-lijst li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid #e2e8f0; padding: 4px 0; }
.dip-lijst b { color: var(--gold); }
.dip-voet { display: flex; justify-content: space-between; margin-top: 16px; font-weight: 700; color: var(--muted); }
.dip-site { margin-top: 10px; font-size: 13px; color: var(--muted); }
@media print {
  .top, .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .diploma { border-color: #333; }
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  .top { padding: 8px 12px; height: 52px; }
  .logo { font-size: 19px; }
  .bt { display: none; }
  main { padding: 10px; }
  .intro h1 { font-size: 26px; }
  .hud { flex-wrap: wrap; gap: 4px 10px; padding: 6px 10px; }
  .hud-lv { flex-basis: 100%; }
  .hud-lv b { font-size: 15px; }
  .hud-punt { min-width: 0; margin-left: auto; }
  .vraag { font-size: 20px; }
  .opties { grid-template-columns: 1fr 1fr; }
  .optie { font-size: 16px; padding: 10px 8px; }
  .feedback { grid-template-columns: 1fr; bottom: 8px; }
  .verder { grid-column: 1; grid-row: auto; justify-self: end; }
  .dip-titel { font-size: 34px; }
  .diploma { padding: 18px 14px; }
}
/* ---------- Tijdreis ---------- */
:root { --bg1: #fde7c3; --bg2: #fff8ec; --a: #b45309; --a2: #8a3c07; --a-licht: #fef3c7; --line: #e7d3b4; }
.tijdlijn { display: grid; gap: 8px; margin-top: 14px; grid-template-columns: repeat(5, 1fr); }
.tijdlijn.n3 { grid-template-columns: repeat(3, 1fr); }
.tijdlijn.n4 { grid-template-columns: repeat(4, 1fr); }
.tv {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 10px 6px 8px;
  box-shadow: 0 3px 0 var(--line); transition: transform .08s, border-color .1s, background .1s;
}
.tv:hover { border-color: var(--a); transform: translateY(-2px); }
.tv-nr { position: absolute; top: 4px; left: 8px; font-weight: 900; color: var(--a); font-size: 15px; }
.tv-ic { font-size: 30px; line-height: 1.1; }
.tv-n { font-weight: 900; font-size: 15px; line-height: 1.15; }
.tv-j { font-size: 12px; color: var(--muted); font-weight: 700; }
.tv.goed { background: var(--good-licht); border-color: var(--good); }
.tv.fout { background: var(--bad-licht); border-color: var(--bad); }
.kaart-plek { display: flex; justify-content: center; }
.kaart {
  background: #fffdf8; border: 3px solid var(--a); border-radius: 18px; padding: 12px 16px; text-align: center;
  box-shadow: 0 6px 0 var(--line), 0 8px 24px rgba(120,60,0,.12); max-width: 360px;
}
.kaart.groot { min-width: 260px; animation: binnen .35s ease-out; }
@keyframes binnen { from { transform: translateY(-30px) scale(.8); opacity: 0; } }
.k-e { font-size: 58px; line-height: 1.1; }
.kaart.groot .k-e { font-size: 72px; }
.k-n { font-weight: 900; font-size: 20px; line-height: 1.2; }
.k-tv { margin-top: 6px; font-size: 14px; font-weight: 800; color: var(--a2); }
.kaarten { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.kaart.knop { max-width: none; padding: 10px 8px; transition: transform .1s, opacity .2s; }
.kaart.knop .k-e { font-size: 44px; }
.kaart.knop .k-n { font-size: 16px; }
.kaart.knop:hover:not(:disabled) { transform: translateY(-3px); }
.kaart.knop.goed { background: var(--good-licht); border-color: var(--good); }
.kaart.knop.fout { background: var(--bad-licht); border-color: var(--bad); }
.kaart.knop.weg { opacity: .25; transform: scale(.92); }
.volg-plekken { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; position: relative; padding-bottom: 14px; }
.volg-plekken::after { content: ''; position: absolute; left: 4%; right: 2%; bottom: 3px; height: 6px; background: linear-gradient(90deg, #d6b98c, var(--a)); border-radius: 99px; }
.plek { min-height: 108px; border: 3px dashed var(--line); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6px; background: rgba(255,255,255,.5); }
.plek.vol { border-style: solid; border-color: var(--good); background: var(--good-licht); animation: binnen .25s ease-out; }
.plek .k-e { font-size: 34px; }
.plek .k-n { font-size: 14px; }
.plek-nr { color: var(--muted); font-weight: 800; }
.tv-overzicht { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px; margin: 12px 0; }
.tvo { display: flex; gap: 10px; align-items: flex-start; background: var(--a-licht); border-radius: 12px; padding: 8px 10px; font-size: 16px; line-height: 1.3; }
.tvo-i { font-size: 30px; }
.tvo-j { color: var(--a2); font-weight: 800; font-size: 14px; white-space: nowrap; }
.tvo small { color: var(--muted); }
@media (max-width: 640px) {
  .tijdlijn, .tijdlijn.n4 { grid-template-columns: repeat(2, 1fr); }
  .tijdlijn.n3 { grid-template-columns: repeat(3, 1fr); }
  .tijdlijn.n10 { grid-template-columns: repeat(2, 1fr); }
  .tv { flex-direction: row; text-align: left; gap: 8px; padding: 8px; }
  .tijdlijn.n3 .tv { flex-direction: column; text-align: center; }
  .tv-nr { position: static; }
  .tv-ic { font-size: 22px; }
  .tv-n { font-size: 14px; }
  .tv-j { display: none; }
  .tijdlijn.n3 .tv-j { display: block; }
  .kaarten, .volg-plekken { grid-template-columns: repeat(2, 1fr); }
  .kaart.groot .k-e { font-size: 56px; }
  .volg-plekken::after { display: none; }
  .plek { min-height: 80px; }
}
