/* Culirit 2026 — "De Verdwenen Gang".
   Gedeeld door index.html, results.html en qr.html: de generieke klassen
   (.btn, .result, .table, .pill, .row, .muted, .small, .mono) blijven werken. */

:root {
  /* basis (namen liggen vast: results.html en qr.html gebruiken ze) */
  --bg: #f5efe2;
  --card: #fffdf7;
  --ink: #16292c;
  --muted: #5a6e72;
  --line: #e2d8c3;
  --brand: #0e3a3e;
  --accent: #d0900d;
  --ok: #1d7a4d;
  --warn: #a4670b;
  --bad: #ad3324;

  /* uitbreidingen voor de app */
  --coral: #d8542f;
  --hi: #0e3a3e;                     /* kleur voor actieve UI-accenten */
  --paper-1: #fffdf6;
  --paper-2: #f8f0dd;
  --frame: rgba(14, 58, 62, .20);
  --tint: rgba(208, 144, 13, .12);
  --tint-strong: rgba(208, 144, 13, .22);
  --ok-tint: rgba(29, 122, 77, .12);
  --on-accent: #241700;
  --shadow-s: 0 1px 2px rgba(20, 35, 35, .06);
  --shadow-m: 0 6px 18px rgba(20, 35, 35, .10);
  --shadow-l: 0 14px 40px rgba(10, 25, 25, .22);
  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;
  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, 'Times New Roman', serif;
  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: ui-monospace, Menlo, Consolas, 'Roboto Mono', monospace;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1a1d;
    --card: #142b2f;
    --ink: #edf3f0;
    --muted: #9db3b5;
    --line: #26454c;
    --brand: #081b1e;
    --accent: #e3ab33;
    --ok: #3fb47b;
    --warn: #d69a35;
    --bad: #e0705c;

    --coral: #ef7f5e;
    --hi: #e3ab33;
    --paper-1: #173236;
    --paper-2: #112a2e;
    --frame: rgba(227, 171, 51, .26);
    --tint: rgba(227, 171, 51, .12);
    --tint-strong: rgba(227, 171, 51, .20);
    --ok-tint: rgba(63, 180, 123, .14);
    --shadow-s: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-m: 0 6px 18px rgba(0, 0, 0, .35);
    --shadow-l: 0 14px 40px rgba(0, 0, 0, .55);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 60% at 100% 0%, var(--tint), transparent 60%),
    radial-gradient(90% 50% at 0% 100%, rgba(14, 58, 62, .07), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font: 16px/1.5 var(--font-ui);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; font-variation-settings: 'SOFT' 20, 'WONK' 1; }
h1 { font-size: 1.6rem; line-height: 1.15; margin: 0 0 .3rem; letter-spacing: -.01em; }
.lead { margin: 0 0 1.1rem; color: var(--muted); font-size: .92rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--font-mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- kopbalk ---------- */
.topbar {
  background:
    linear-gradient(135deg, var(--brand), #14504f 130%),
    var(--brand);
  color: #fff;
  padding: calc(env(safe-area-inset-top) + .55rem) 1rem .6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  box-shadow: var(--shadow-m);
  position: relative;
  z-index: 30;
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--coral) 55%, transparent);
  opacity: .85;
}
.topbar .muted { color: #a9c3c7; }
.brandblock { min-width: 0; }
.wordmark {
  font-family: var(--font-display); font-weight: 800; font-size: 1.22rem; line-height: 1.1;
  letter-spacing: .005em; display: block; color: #fff;
}
.wordmark i {
  font-style: normal; font-family: var(--font-ui); font-weight: 600; font-size: .6rem;
  letter-spacing: .2em; color: var(--accent); vertical-align: .45em; margin-left: .4rem;
}
.linklike {
  display: block; background: none; border: 0; padding: .15rem 0 0; color: #a9c3c7;
  font: inherit; font-size: .78rem; text-decoration: underline dotted; text-underline-offset: 3px;
  cursor: pointer; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: left;
}
.pills { display: flex; flex-direction: column; gap: .3rem; align-items: flex-end; }
.pill {
  font-size: .7rem; font-weight: 600; padding: .2rem .6rem; border-radius: 99px;
  background: rgba(255, 255, 255, .15); white-space: nowrap; letter-spacing: .01em;
}
.pill.ok { background: var(--ok); color: #fff; }
.pill.warn { background: var(--warn); color: #fff; }
.pill.bad { background: var(--bad); color: #fff; }

main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tab { display: none; padding: 1rem 1rem 2.5rem; max-width: 640px; margin: 0 auto; }
.tab.active { display: block; }

/* ---------- tabbalk ---------- */
.tabbar {
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 14px rgba(20, 35, 35, .07);
  position: relative;
  z-index: 25;
}
.tabbar button {
  flex: 1; border: 0; background: none; color: var(--muted);
  padding: .55rem .2rem .45rem; min-height: 56px;
  font: inherit; font-size: .68rem; font-weight: 600; letter-spacing: .02em;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .18rem;
  cursor: pointer; position: relative; -webkit-tap-highlight-color: transparent;
}
.tabbar button svg {
  width: 23px; height: 23px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.tabbar button.active { color: var(--hi); }
.tabbar button.active svg { stroke-width: 1.9; }
.tabbar button.active::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent);
}

/* ---------- generieke bouwstenen ---------- */
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .8rem 0; }
.btn {
  border: 0; border-radius: var(--r-m); padding: .72rem 1.1rem; font: inherit; font-weight: 700;
  background: var(--accent); color: var(--on-accent); cursor: pointer; min-height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  box-shadow: var(--shadow-s); -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible { outline: 3px solid var(--hi); outline-offset: 2px; }
.btn.secondary { background: var(--brand); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); box-shadow: none; font-weight: 600; }
.btn:disabled { opacity: .4; box-shadow: none; }
.btn.active { background: var(--bad); color: #fff; }
.btn.wide { width: 100%; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; font-size: 100px; cursor: pointer; }
.check { display: flex; gap: .45rem; align-items: center; font-size: .9rem; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--hi); }

.result {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); padding: .7rem .85rem;
  font-size: .9rem; margin: .6rem 0; word-break: break-word; box-shadow: var(--shadow-s);
}
.result.ok { border-color: var(--ok); border-left: 4px solid var(--ok); }
.result.bad { border-color: var(--bad); border-left: 4px solid var(--bad); }
.preview { width: 100%; border-radius: var(--r-m); margin-top: .5rem; box-shadow: var(--shadow-m); }

.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table td, .table th { padding: .5rem .35rem; border-bottom: 1px solid var(--line); text-align: left; }
.table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.table td:last-child, .table th:last-child { text-align: right; }
.table tr.in td { color: var(--ok); font-weight: 700; }

textarea, input[type="text"] {
  width: 100%; border-radius: var(--r-m); border: 1px solid var(--line); padding: .75rem .8rem; font: inherit;
  background: var(--card); color: var(--ink); min-height: 48px;
}
textarea:focus, input[type="text"]:focus { outline: 3px solid var(--tint-strong); border-color: var(--hi); }

.banner {
  background: var(--card); color: var(--ink); border: 1px solid var(--accent);
  border-left: 5px solid var(--accent);
  border-radius: var(--r-m); padding: .75rem .9rem; margin: 0 0 .9rem;
  font-weight: 600; font-size: .93rem; box-shadow: var(--shadow-m);
  animation: slideDown .25s ease both;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: .6rem;
  margin: 1.5rem 0 .55rem;
}
.section-title {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin: 0;
  letter-spacing: .01em;
}
.section-meta { color: var(--muted); font-size: .76rem; }
.helptext { margin: 1.2rem 0 0; }

/* ---------- 1. de menukaart ---------- */
.menu { margin: 0; }
.menu-paper {
  position: relative;
  background: linear-gradient(170deg, var(--paper-1), var(--paper-2));
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 1.5rem 1.15rem 1.25rem;
  box-shadow: var(--shadow-m);
  overflow: hidden;
}
.menu-paper::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--noise); opacity: .55; mix-blend-mode: multiply;
}
.menu-paper::after {
  content: ''; position: absolute; inset: 8px; pointer-events: none;
  border: 1px solid var(--frame); border-radius: 14px; opacity: .55;
}
.menu-paper > * { position: relative; z-index: 1; }
.menu-eyebrow {
  margin: 0; text-align: center; font-size: .66rem; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
}
.menu-title {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(1.9rem, 10vw, 2.5rem);
  line-height: 1.02; text-align: center; margin: .5rem 0 .1rem; letter-spacing: -.015em;
}
.menu-rule {
  display: flex; align-items: center; gap: .65rem; margin: .7rem 0 1.1rem;
  color: var(--muted); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase;
}
.menu-rule::before, .menu-rule::after {
  content: ''; flex: 1; height: 1px; background: var(--frame);
}
.menu-foot {
  margin: 1.1rem 0 0; text-align: center; color: var(--muted); font-size: .76rem; line-height: 1.5;
}

.courses { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.course-label {
  margin: 0 0 .1rem; font-size: .63rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted);
}
.course-line { display: flex; align-items: baseline; gap: .45rem; margin: 0; }
.course-name {
  font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; line-height: 1.25;
  flex: 0 1 auto; min-width: 0;
}
.leader {
  flex: 1 1 1.5rem; min-width: 1.2rem; height: 0; align-self: center;
  border-bottom: 1.5px dotted var(--frame);
}
.course-find {
  flex: 0 0 auto; font-size: .82rem; font-weight: 700; color: var(--muted);
  max-width: 45%; text-align: right; line-height: 1.3;
}
.course.is-done .course-find { color: var(--ok); }
.course.is-done .course-find::before { content: '✓ '; }

/* de verdwenen gang: uitgescheurd stukje papier */
.course.is-missing .course-body {
  border: 1.5px dashed var(--accent);
  border-radius: var(--r-s);
  padding: .55rem .65rem .6rem;
  background:
    repeating-linear-gradient(135deg, transparent 0 7px, var(--tint) 7px 14px);
  position: relative;
}
.course.is-missing .course-name {
  font-size: 1.5rem; font-weight: 800; letter-spacing: .12em; color: var(--muted);
  opacity: .8;
}
.course.is-missing .course-find { color: var(--coral); font-style: italic; font-weight: 600; }
.course.is-revealed .course-body {
  border: 1.5px solid var(--ok); border-radius: var(--r-s); padding: .55rem .65rem .6rem;
  background: var(--ok-tint);
}
.course.is-revealed .course-name { font-size: 1rem; font-style: italic; }
.course.is-locked { opacity: .78; }

/* ---------- 2. voorraadkast ---------- */
.slots {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(66px, 1fr)); gap: .5rem;
}
.slot { display: grid; justify-items: center; gap: .35rem; text-align: center; }
.token {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  border: 2px dashed var(--line); background: var(--card); font-size: 1.6rem; line-height: 1;
  filter: grayscale(1); opacity: .45; position: relative;
  transition: transform .3s cubic-bezier(.2, 1.4, .4, 1), opacity .3s ease, filter .3s ease;
}
.slot.filled .token {
  border: 2px solid var(--accent); filter: none; opacity: 1;
  background: radial-gradient(circle at 35% 28%, #fff8e6, var(--paper-2));
  box-shadow: 0 0 0 4px var(--tint), var(--shadow-s);
}
.slot-name { font-size: .68rem; color: var(--muted); line-height: 1.25; }
.slot.filled .slot-name { color: var(--ink); font-weight: 700; }

/* ---------- 3. bij een stop ---------- */
.nearcard {
  position: sticky; top: 0; z-index: 20;
  display: grid; gap: .6rem;
  background: linear-gradient(140deg, var(--brand), #16575a);
  color: #fff; border-radius: var(--r-l); padding: .85rem .9rem .9rem;
  margin: 0 0 .9rem; box-shadow: var(--shadow-l);
  border: 2px solid var(--accent);
}
.nearcard-eyebrow {
  margin: 0; font-size: .66rem; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent);
}
.nearcard-name {
  margin: .1rem 0 0; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700;
  line-height: 1.15;
}
.nearcard-btn { background: var(--accent); color: var(--on-accent); font-size: 1.02rem; min-height: 54px; }
.nearcard::before {
  content: ''; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 0 var(--accent); animation: ping 1.8s ease-out infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(208, 144, 13, .55); }
  70%, 100% { box-shadow: 0 0 0 14px rgba(208, 144, 13, 0); }
}

.stops { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.stop {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: .7rem .75rem; display: flex; align-items: center; gap: .7rem;
  box-shadow: var(--shadow-s); position: relative;
}
.stop-nr {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-display);
  font-weight: 700; font-size: .95rem;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line);
}
.stop-main { flex: 1 1 auto; min-width: 0; }
.stop-title { font-weight: 700; font-size: .95rem; line-height: 1.25; }
.stop-place { color: var(--muted); font-size: .78rem; }
.stop-sub { color: var(--muted); font-size: .78rem; line-height: 1.35; margin-top: .1rem; }
.stop-dist { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.stop.done .stop-dist { color: var(--ok); }
.stop.near .stop-dist { color: var(--warn); }
.stop-act { flex: 0 0 auto; display: flex; align-items: center; gap: .4rem; }
.stop-act .btn { padding: .5rem .75rem; min-height: 44px; font-size: .84rem; border-radius: var(--r-s); }
.stop-act .btn.ghost { font-weight: 600; }
.stop-tick {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok); color: #fff; font-weight: 800; font-size: .95rem;
}
.stop.done { border-color: var(--ok); background: linear-gradient(90deg, var(--ok-tint), var(--card) 60%); }
.stop.done .stop-nr { background: var(--ok); color: #fff; border-color: var(--ok); }
.stop.near {
  border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow-m);
  background: linear-gradient(90deg, var(--tint-strong), var(--card) 70%);
}
.stop.near .stop-nr { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.stop-flag {
  display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--on-accent); background: var(--accent);
  border-radius: 99px; padding: .1rem .45rem; margin-left: .35rem; vertical-align: 1px;
}

.dish {
  margin-top: 1.2rem; border-radius: var(--r-l); padding: 1.15rem 1rem;
  background: linear-gradient(140deg, var(--brand), #16575a); color: #fff;
  text-align: center; box-shadow: var(--shadow-m); border: 1px solid var(--frame);
}
.dish .dish-label {
  display: block; font-size: .66rem; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent);
}
.dish b {
  display: block; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600;
  font-style: italic; margin-top: .45rem; line-height: 1.3; color: #fffdf7;
}

/* ---------- diagnostiek: GPS ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: .55rem .6rem; box-shadow: var(--shadow-s); min-width: 0;
}
.stat span {
  display: block; font-size: .64rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .03em; font-weight: 700; line-height: 1.3;
  overflow-wrap: anywhere; hyphens: auto;
}
.stat b { font-size: 1.05rem; font-variant-numeric: tabular-nums; display: block; margin-top: .15rem; white-space: nowrap; }
.coords {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s);
  padding: .45rem .6rem; margin: .6rem 0; color: var(--muted); text-align: center;
}
.slider { display: block; margin: 1rem 0 .4rem; font-size: .88rem; font-weight: 600; }
.slider input { width: 100%; margin-top: .5rem; accent-color: var(--hi); height: 28px; }
#map {
  height: 300px; border-radius: var(--r-m); border: 1px solid var(--line);
  margin: .6rem 0 1rem; z-index: 0; box-shadow: var(--shadow-s);
}

/* ---------- diagnostiek: QR ---------- */
.scanner {
  position: relative; background: #07110f; border-radius: var(--r-l); overflow: hidden;
  aspect-ratio: 4 / 3; box-shadow: var(--shadow-m); border: 1px solid var(--line);
}
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-off {
  position: absolute; inset: 0; margin: 0; display: grid; place-items: center;
  color: rgba(255, 255, 255, .55); font-size: .85rem; letter-spacing: .04em;
}
.scanner.live .scanner-off { display: none; }
.reticle { position: absolute; inset: 16% 18%; pointer-events: none; }
.reticle i {
  position: absolute; width: 26px; height: 26px; border: 3px solid var(--accent);
}
.reticle i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.reticle i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.reticle i:nth-child(3) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.reticle i:nth-child(4) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.scanline { display: none; }
.scanner.live .scanline {
  display: block; position: absolute; left: 4px; right: 4px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: sweep 2.2s ease-in-out infinite;
}
@keyframes sweep { 0%, 100% { top: 4%; } 50% { top: 94%; } }

/* ---------- diagnostiek: log ---------- */
.envinfo { line-height: 1.7; font-size: .8rem; }
.envchip {
  display: inline-block; border: 1px solid var(--line); border-radius: 99px;
  padding: .1rem .55rem; margin: 0 .3rem .3rem 0; font-size: .74rem; white-space: nowrap;
}
.envchip b { font-weight: 700; }
.envchip.yes { border-color: var(--ok); color: var(--ok); }
.envchip.no { border-color: var(--bad); color: var(--bad); }
.log { list-style: none; margin: 1rem 0 0; padding: 0; font-size: .78rem; }
.log li {
  padding: .45rem 0; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: auto 1fr; gap: .1rem .5rem; word-break: break-word;
}
.log time {
  font-family: var(--font-mono); font-size: .7rem; color: var(--muted);
  grid-row: 1; grid-column: 1; white-space: nowrap;
}
.log .log-type {
  grid-row: 1; grid-column: 2; font-weight: 700; letter-spacing: .02em;
}
.log .log-data {
  grid-row: 2; grid-column: 1 / -1; font-family: var(--font-mono); font-size: .72rem;
  color: var(--muted); word-break: break-word;
}
.log li.err .log-type { color: var(--bad); }

/* ---------- welkom / naam-sheet ---------- */
.sheetwrap { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; }
.sheetwrap-scrim { position: absolute; inset: 0; background: rgba(6, 22, 24, .55); backdrop-filter: blur(2px); }
.sheet-panel {
  position: relative; width: 100%; max-width: 480px;
  background: linear-gradient(170deg, var(--paper-1), var(--paper-2));
  color: var(--ink);
  border-radius: var(--r-l) var(--r-l) 0 0;
  border-top: 3px solid var(--accent);
  padding: .8rem 1.15rem calc(env(safe-area-inset-bottom) + 1.15rem);
  box-shadow: var(--shadow-l);
  animation: sheetUp .3s cubic-bezier(.2, .9, .3, 1) both;
  max-height: 92vh; overflow-y: auto;
}
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-grip {
  display: block; width: 42px; height: 4px; border-radius: 99px; background: var(--line);
  margin: 0 auto .9rem;
}
.sheet-title {
  font-family: var(--font-display); font-size: 1.65rem; font-weight: 800; line-height: 1.1;
  text-align: center; margin: .4rem 0 .8rem; letter-spacing: -.01em;
}
.sheet-intro { color: var(--muted); font-size: .9rem; margin-bottom: 1.1rem; }
.sheet-intro p { margin: 0 0 .6rem; }
.sheet-intro b { color: var(--ink); }
.field { display: block; margin-bottom: .5rem; }
.field-label {
  display: block; font-size: .68rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .35rem;
}
.field-hint { color: var(--muted); font-size: .78rem; margin: 0 0 1rem; line-height: 1.45; }

/* ---------- beloningsmoment ---------- */
.reward {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: calc(env(safe-area-inset-top) + 1.2rem) 1.2rem calc(env(safe-area-inset-bottom) + 1.2rem);
  background:
    radial-gradient(110% 65% at 50% 32%, rgba(17, 66, 68, .985), rgba(4, 13, 15, .995));
  backdrop-filter: blur(6px);
  color: #fffdf7;
  animation: fadeIn .25s ease both;
  overflow: hidden;
}
@keyframes fadeIn { from { opacity: 0; } }
.reward-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.reward-inner { position: relative; text-align: center; width: 100%; max-width: 380px; }
.reward-eyebrow {
  margin: 0; font-size: .68rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: #e3ab33;
}
.reward-name {
  font-family: var(--font-display); font-size: 1.85rem; font-weight: 800; line-height: 1.12;
  margin: .4rem 0 .5rem; letter-spacing: -.01em;
  animation: riseIn .5s .35s ease both;
}
.reward-sub { margin: 0 0 1.6rem; color: #cfe0dd; font-size: .9rem; line-height: 1.5; }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } }
.reward .btn { background: #e3ab33; color: #241700; }
.reward .medal-ring circle { stroke: #e3ab33; }

.reward-ingredient, .reward-finish { display: none; }
.reward[data-kind="ingredient"] .reward-ingredient { display: block; }
.reward[data-kind="finish"] .reward-finish { display: block; }

.medal { position: relative; width: 168px; height: 168px; margin: 0 auto 1.5rem; display: grid; place-items: center; }
.medal::before {
  content: ''; position: absolute; inset: 14px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fffaf0, #f0dcab 55%, #c9a457);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
}
.medal-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.medal-ring circle { fill: none; stroke: var(--accent); stroke-width: 4; }
.medal-ring .medal-ring-thin { stroke: rgba(255, 253, 247, .45); stroke-width: 1.5; stroke-dasharray: 3 6; }
.medal-emoji { position: relative; font-size: 3.7rem; line-height: 1; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .25)); }
.medal-stamp {
  position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%) rotate(-7deg);
  font-size: .68rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase;
  color: var(--coral); border: 2px solid var(--coral); border-radius: 6px;
  padding: .2rem .5rem; background: rgba(255, 253, 247, .93); white-space: nowrap;
}
.reward[data-kind="ingredient"] .medal { animation: medalIn .6s cubic-bezier(.18, 1.5, .4, 1) both; }
.reward[data-kind="ingredient"] .medal-stamp { animation: stampIn .35s .5s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes medalIn { from { opacity: 0; transform: scale(.35) rotate(-16deg); } }
@keyframes stampIn {
  from { opacity: 0; transform: translateX(-50%) rotate(-7deg) scale(2.6); }
  to { opacity: 1; transform: translateX(-50%) rotate(-7deg) scale(1); }
}

.cloche { position: relative; width: 230px; height: 176px; margin: 0 auto 1.3rem; }
.cloche-glow {
  position: absolute; left: 50%; bottom: 14px; width: 150px; height: 60px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(227, 171, 51, .75), transparent 70%);
  opacity: 0; animation: glowIn .7s .55s ease both;
}
@keyframes glowIn { to { opacity: 1; } }
.cloche-plate { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; }
.cloche-plate ellipse { fill: #d9cba6; }
.cloche-plate .plate-inner { fill: #efe3c4; }
.cloche-dome { position: absolute; left: 4%; right: 4%; bottom: 20px; width: 92%; }
.cloche-dome .dome-body { fill: #ccd6d4; stroke: #eef3f1; stroke-width: 2; }
.cloche-dome .dome-shine { fill: none; stroke: rgba(255, 255, 255, .65); stroke-width: 5; stroke-linecap: round; }
.cloche-dome .dome-knob { fill: #cfd8d6; stroke: #eef3f1; stroke-width: 2; }
.reward[data-kind="finish"] .cloche-dome {
  animation: lift 1.05s .3s cubic-bezier(.3, .85, .25, 1) both;
  transform-origin: 50% 100%;
}
@keyframes lift {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  25% { transform: translateY(6px) scale(1.02); opacity: 1; }
  100% { transform: translateY(-165px) scale(.82); opacity: 0; }
}
.reward[data-kind="finish"] .reward-name { animation: riseIn .6s .95s ease both; }
.reward[data-kind="finish"] .reward-sub { animation: riseIn .6s 1.15s ease both; }

@media (prefers-reduced-motion: reduce) {
  .banner, .sheet-panel, .reward, .reward-name, .reward-sub,
  .medal, .medal-stamp, .cloche-glow { animation: none !important; opacity: 1 !important; }
  .medal-stamp { transform: translateX(-50%) rotate(-7deg); }
  .nearcard::before, .scanner.live .scanline { animation: none; }
  .reward[data-kind="finish"] .cloche-dome { animation: none; opacity: 0; }
  .btn { transition: none; }
  .token { transition: none; }
}

/* ---------- smalle telefoons ---------- */
@media (max-width: 374px) {
  .tab { padding-left: .75rem; padding-right: .75rem; }
  .menu-paper { padding: 1.25rem .85rem 1.1rem; }
  .grid { gap: .4rem; }
  .stat { padding: .45rem .5rem; }
  .stat b { font-size: .95rem; }
  .token { width: 52px; height: 52px; font-size: 1.4rem; }
  .stop-act .btn { padding: .5rem .55rem; font-size: .8rem; }
  .tabbar button { font-size: .64rem; }
}

/* ---------- routekaart ---------- */
.segmented {
  display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 4px; gap: 4px; margin: .4rem 0 .7rem;
}
.segmented button {
  flex: 1; border: 0; border-radius: 10px; min-height: 44px; font: inherit; font-weight: 700;
  background: transparent; color: var(--muted); cursor: pointer;
}
.segmented button.active { background: var(--brand); color: #fff; }
.routesummary { margin: 0 0 .6rem; font-weight: 600; }
#routeMap {
  height: min(56vh, 460px); border-radius: 14px; border: 1px solid var(--line); z-index: 0;
}
.routepin {
  background: var(--brand); color: #fff; border: 2px solid #fff; border-radius: 50%;
  font: 700 .85rem/26px system-ui, sans-serif; text-align: center;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .4);
}
.tablewrap { overflow-x: auto; }
.table.legs td { vertical-align: middle; }
.table.legs td:nth-child(3) { white-space: nowrap; text-align: right; }
.legdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.legdot.dashed { width: 18px; height: 6px; border-radius: 3px; -webkit-mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 8px); mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 8px); }
.table.legs tr.optional td { color: var(--muted); font-style: italic; }
