:root {
  --blue: #0029D6;
  --blue-dark: #001f9e;
  --blue-light: #99ADFF;
  --blue-tint: #F3F5FF;
  --purple: #86226F;
  --purple-tint: #F9EDF7;
  --orange: #FFA203;
  --orange-tint: #FFF7EB;
  --green: #1a8f4b;
  --green-tint: #e8f6ee;
  --red: #c8321f;
  --red-tint: #fdeceb;
  --ink: #201E26;
  --ink-2: #595959;
  --line: #E6E6EA;
  --bg: #F9F9F9;
  --card: #FFFFFF;
  --radius: 20px;
  --font-head: "Montserrat", "Arial Black", Arial, sans-serif;
  --font-body: "Roboto", Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; margin: 0 0 .4em; }
h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); line-height: 1.1; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--blue); }
small, .muted { color: var(--ink-2); }
.eyebrow { font-family: var(--font-head); font-weight: 700; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }

.wrap { max-width: 640px; margin: 0 auto; padding-block: 16px 48px; padding-inline: 16px; }
.wrap.wide { max-width: 1100px; }

/* nav */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 18px; }
.nav img { height: 28px; display: block; }
.nav .who { display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--ink-2); }
.nav .who img { width: 28px; height: 28px; border-radius: 50%; }
.nav form { margin: 0; }
.linkbtn { background: none; border: 0; color: var(--blue); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* cards */
.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 2px rgba(32,30,38,.06), 0 8px 24px -16px rgba(0,41,214,.25); }
.card + .card { margin-top: 14px; }
.card.tint { background: var(--blue-tint); box-shadow: none; }
.card.warn { background: var(--orange-tint); box-shadow: none; }
.card.danger { background: var(--red-tint); box-shadow: none; }
.card.ok { background: var(--green-tint); box-shadow: none; }
.hero { background: var(--blue); color: #fff; border-radius: var(--radius); padding: 26px 22px; margin-bottom: 16px; position: relative; overflow: hidden; }
.hero .eyebrow { color: var(--blue-light); }
.hero h1 { color: #fff; }
.hero p { color: #dfe6ff; margin: 0; }
.hero .stamp { position: absolute; right: -10px; top: -14px; width: 120px; opacity: .18; transform: rotate(8deg); }

/* forms */
label { display: block; font-weight: 500; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=number], input[type=datetime-local], textarea, select {
  width: 100%; font: inherit; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--blue-light); outline-offset: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 1rem var(--font-head); background: var(--blue); color: #fff; border: 0; border-radius: 999px; padding: 13px 22px; cursor: pointer; text-decoration: none; transition: transform .2s, background .2s; }
.btn:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--blue); border: 2px solid var(--blue); }
.btn.orange { background: var(--orange); color: var(--ink); }
.btn.small { padding: 8px 14px; font-size: .85rem; }
.btn.danger { background: var(--red); }
.choices { display: grid; gap: 8px; margin-top: 6px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-tint); }
.choice input { margin-top: 4px; accent-color: var(--blue); }

/* station grid */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.tile { background: #fff; border-radius: 16px; padding: 14px; min-height: 108px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 1px 2px rgba(32,30,38,.06); border: 1.5px solid transparent; }
.tile .n { font: 800 1.6rem var(--font-head); color: var(--blue-light); }
.tile .t { font-weight: 500; font-size: .95rem; }
.tile.found { background: var(--orange-tint); border-color: var(--orange); }
.tile.found .n { color: var(--orange); }
.tile .pts { font: 700 .8rem var(--font-head); color: var(--ink-2); }
.tile:nth-child(3n+1) { transform: rotate(-1.5deg); }
.tile:nth-child(3n+2) { transform: rotate(1deg); }
.tile:nth-child(3n+3) { transform: rotate(-0.5deg); }

/* stats row */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border-radius: 16px; padding: 14px; text-align: center; }
.stat b { display: block; font: 800 1.6rem var(--font-head); color: var(--blue); font-variant-numeric: tabular-nums; }
.stat span { font-size: .75rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; }

/* scoreboard */
.board { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.board th { text-align: left; font: 700 .72rem var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.board td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.board tr:first-child td { border-top: 0; }
.board .rank { font: 800 1.2rem var(--font-head); color: var(--blue-light); width: 44px; }
.board tr.top .rank { color: var(--orange); }
.board .pts { font: 800 1.3rem var(--font-head); color: var(--blue); text-align: right; }
.board .bar { height: 8px; background: var(--blue-tint); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.board .bar i { display: block; height: 100%; background: var(--blue); border-radius: 99px; transition: width .6s; }
.big .board td { padding: 18px 12px; font-size: 1.25rem; }
.big .board .pts { font-size: 2rem; }
.big .board .rank { font-size: 1.8rem; }
.big h1 { font-size: 3rem; }
.timer { font: 800 clamp(2rem, 8vw, 4rem) var(--font-head); color: var(--blue); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.timer.over { color: var(--red); }

/* pills */
.pill { display: inline-block; font: 700 .72rem var(--font-head); letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--blue-tint); color: var(--blue); }
.pill.orange { background: var(--orange-tint); color: #a76500; }
.pill.green { background: var(--green-tint); color: var(--green); }
.pill.red { background: var(--red-tint); color: var(--red); }
.pill.purple { background: var(--purple-tint); color: var(--purple); }
.pill.grey { background: var(--line); color: var(--ink-2); }

/* admin */
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.admin-nav a { padding: 8px 14px; border-radius: 999px; background: #fff; text-decoration: none; color: var(--ink); font-weight: 500; border: 1.5px solid var(--line); }
.admin-nav a.active { background: var(--purple); color: #fff; border-color: var(--purple); }
.two { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 800px) { .two { grid-template-columns: 1fr 1fr; } }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font: 700 .7rem var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.scroll { overflow-x: auto; }
details { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 16px; background: #fff; }
details + details { margin-top: 10px; }
summary { cursor: pointer; font-weight: 700; font-family: var(--font-head); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.msg { background: var(--green-tint); color: var(--green); padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; }

/* debrief */
.reveal { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 800px) { .reveal { grid-template-columns: 1fr 1fr; } }
.reveal .card h2 { color: var(--blue); }
.reveal .rule { background: var(--orange-tint); border-radius: 12px; padding: 12px 14px; font-weight: 500; }
.meter { display: flex; gap: 14px; margin: 10px 0; }
.meter div { flex: 1; }
.meter b { display: block; font: 800 1.4rem var(--font-head); color: var(--blue); }
.meter span { font-size: .75rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }

/* qr print */
.qr-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.qr-card { background: #fff; border: 2px solid var(--ink); border-radius: 20px; padding: 24px; text-align: center; page-break-inside: avoid; }
.qr-card img.qr { display: block; margin: 0 auto; width: 100%; max-width: 320px; height: auto; }
.qr-card .qr-note { margin: 16px auto 0; max-width: 34em; font-size: .85rem; line-height: 1.4; color: var(--ink); }
.qr-card .n { font: 800 3rem var(--font-head); color: var(--blue); line-height: 1; }
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .qr-grid { grid-template-columns: 1fr; }
  .qr-card { border-radius: 0; border-width: 3px; margin: 0; min-height: 95vh; display: flex; flex-direction: column; justify-content: center; page-break-after: always; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* station 9: tetris */
/* Breedte responsief (I4): min(200px,46vw) past op een telefoon zonder te
   scrollen; aspect-ratio houdt de 10-op-18 verhouding vast terwijl JS de
   werkelijke pixelbreedte in canvas.width/height en `cel` zet. */
#veld { display:block; margin:12px auto; width:min(200px, 46vw); aspect-ratio:10 / 18; height:auto; border-radius:8px; border:2px solid var(--line); background:#faf9f7; touch-action:manipulation }
.letters { text-align:center; font-family:Montserrat,sans-serif; font-weight:800; font-size:22px; letter-spacing:4px }
.quiz .prompt { font-weight:500; margin:12px 0 8px }
.choice { font: inherit; } /* .choice stond op een <label>, een <button> erft het paginalettertype niet vanzelf */
.pad { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin:12px 0 }
/* touch-action houdt de dubbeltik-zoom tegen, maar niet het selectie- en
   deelmenu dat iOS bij snel tikken over de besturing legt. Daarvoor zijn
   -webkit-user-select en -webkit-touch-callout nodig. */
.pad button { padding:16px 0; font-size:20px; border:0; border-radius:8px; background:#201E26; color:#fff; touch-action:manipulation; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none }
.pad button:active { background:#6C4AE2 }

/* station 10: het zoekplaatje */
/* .btn zet display, en dat wint van het hidden-attribuut. */
.btn[hidden] { display:none }
.zoek-bar { display:flex; align-items:center; gap:10px; margin:8px 0 12px; flex-wrap:wrap }
.zoekveld { overflow:auto; max-height:60vh; border:2px solid var(--line); border-radius:8px; -webkit-overflow-scrolling:touch }
.zoekplaat { position:relative; width:max-content }
.zoekplaat img { display:block; max-width:none; cursor:crosshair; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none }
.zoekplaat img.klaar { cursor:grab }
.zoekveld.sleept, .zoekveld.sleept img { cursor:grabbing }
.zoekveld.klein .zoekplaat { width:100% }
.zoekveld.klein .zoekplaat img { width:100%; height:auto }
.stip { position:absolute; width:28px; height:28px; margin:-14px 0 0 -14px; border-radius:50%; border:3px solid; pointer-events:none; box-sizing:border-box }
.stip.wacht { border-color:var(--blue) }
.stip.mis { border-color:var(--red); opacity:.8 }
.stip.plek { width:56px; height:56px; margin:-28px 0 0 -28px; border-radius:8px; border-width:4px; border-style:dashed; border-color:var(--green); box-shadow:0 0 0 3px #fff }
.stip.raak { width:44px; height:44px; margin:-22px 0 0 -22px; border-width:4px; border-color:var(--green); box-shadow:0 0 0 3px #fff }

/* station 11: het sprookje */
.sleutels { font-size: 1.3rem; letter-spacing: 4px; margin: 6px 0 10px; }
.sleutels span { filter: grayscale(1); opacity: .3; }
.sleutels span.heb { filter: none; opacity: 1; }
.verhaal p { margin: 0 0 10px; }
.brief { font: 700 1.25rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; text-align: center; background: #faf9f7; border: 2px dashed var(--line); border-radius: 14px; padding: 16px 10px; word-break: break-word; }
.wiel { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 12px 0 16px; }
.wiel b { font: 800 1.6rem var(--font-head); color: var(--blue); font-variant-numeric: tabular-nums; }
.tegels { display: flex; flex-wrap: wrap; gap: 8px; }
.tegel { font: 500 1rem var(--font-body); padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; touch-action: manipulation; }
.tegel:disabled { opacity: .35; cursor: default; }
.formule { font: 700 1.1rem ui-monospace, Menlo, Consolas, monospace; background: var(--blue-tint); border-radius: 12px; padding: 12px 14px; margin: 14px 0 4px; word-break: break-all; }
.formule.klein { display: inline-block; font-size: .95rem; padding: 6px 10px; margin: 0; }
.panelen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.panelen .card { margin: 0; padding: 14px; }
.bestand { font: .78rem ui-monospace, Menlo, Consolas, monospace; margin-top: 6px; overflow-wrap: anywhere; }
