:root {
  --karton: #e4d8be;
  --inkt: #1c1815;
  --geel: #f2c14e;
  --accent: #a8291d;      /* wordt per team overschreven */
  --rood: #a8291d;
  --blauw: #27456f;
  --groen: #2e6b4a;
  --schaduw: 6px 6px 0 var(--inkt);
  --rand: 3px solid var(--inkt);
  --display: "Arial Black", "Helvetica Neue", Impact, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--inkt);
  font-family: "Segoe UI", system-ui, sans-serif;
  background-color: var(--karton);
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,.045) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(0,0,0,.04) 0 1px, transparent 1px),
    radial-gradient(circle at 40% 80%, rgba(0,0,0,.035) 0 1px, transparent 1px);
  background-size: 7px 7px, 11px 11px, 13px 13px;
}

button {
  font: inherit;
  cursor: pointer;
  color: var(--inkt);
  background: var(--geel);
  border: var(--rand);
  border-radius: 10px;
  padding: 14px 18px;
  font-weight: 800;
  box-shadow: var(--schaduw);
  transition: transform .05s ease;
}
button:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--inkt); }
button:focus-visible { outline: 4px solid var(--accent); outline-offset: 2px; }
button.groot { width: 100%; font-size: 1.4rem; padding: 22px; }
button.accent { background: var(--accent); color: #fff; }
button.stil { background: transparent; box-shadow: none; border-width: 2px; padding: 8px 12px; }

input, select {
  font: inherit; padding: 12px; border: var(--rand); border-radius: 8px;
  background: #fff8ea; width: 100%;
}

.kaart {
  background: #fbf3df;
  border: var(--rand);
  border-radius: 12px;
  box-shadow: var(--schaduw);
  padding: 16px;
  margin: 12px 0;
}

h1, h2, h3 { font-family: var(--display); letter-spacing: .5px; }
.mono, time, .tijd { font-family: var(--mono); }

/* Kop */
header.app {
  position: sticky; top: 0; z-index: 1100;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--accent); color: #fff;
  border-bottom: var(--rand);
}
header.app .titel { font-family: var(--display); font-size: 1.1rem; }
header.app .rechts { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.badge {
  font-family: var(--mono); font-size: .8rem; font-weight: 700;
  background: var(--geel); color: var(--inkt);
  border: 2px solid var(--inkt); border-radius: 999px; padding: 3px 10px;
}
.badge.stil { opacity: .55; }

main { max-width: 640px; margin: 0 auto; padding: 12px; padding-bottom: 90px; }

/* Tabbalk onderaan */
nav.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1100;
  display: flex; background: var(--inkt);
}
nav.tabs button {
  flex: 1; border: none; border-radius: 0; box-shadow: none;
  background: var(--inkt); color: #cfc4a8; font-size: .85rem; padding: 10px 4px;
}
nav.tabs button.actief { color: #fff; background: var(--accent); }

.scherm { display: none; }
.scherm.actief { display: block; }

/* Stempels */
.stempel {
  display: inline-block; font-family: var(--display); text-transform: uppercase;
  border: 4px solid var(--groen); color: var(--groen);
  padding: 4px 12px; border-radius: 8px; transform: rotate(-6deg);
  font-size: 1.1rem; letter-spacing: 1px;
}
.stempel.door { border-color: var(--accent); color: var(--accent); transform: rotate(4deg); }

/* Kaart (Leaflet) */
#map { height: 55vh; border: var(--rand); border-radius: 12px; box-shadow: var(--schaduw); }
.kaart-fallback { padding: 24px; text-align: center; }

/* Bierviltje / tally */
.viltje {
  display: inline-flex; flex-direction: column; align-items: center;
  background: #efe6cd; border: var(--rand); border-radius: 50%;
  width: 150px; height: 150px; justify-content: center; box-shadow: var(--schaduw);
  margin: 8px;
}
.viltje svg { width: 110px; height: 60px; }
.tally-stroke { stroke: var(--inkt); stroke-width: 4; stroke-linecap: round; }

/* Ranglijst */
.rang { display: flex; align-items: center; gap: 12px; }
.rang .kleur { width: 22px; height: 22px; border: 2px solid var(--inkt); border-radius: 6px; }
.rang .punt { margin-left: auto; font-family: var(--mono); font-size: 1.6rem; font-weight: 800; }

.timer { font-family: var(--mono); font-size: 3rem; font-weight: 800; text-align: center; }
.doel { text-align: center; font-family: var(--mono); opacity: .8; }

.rij { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.rij .naam { flex: 1; }
.klein { font-size: .85rem; opacity: .8; }
.waarschuwing { color: var(--accent); font-weight: 700; }

.foto-opdracht {
  background: var(--geel); color: var(--inkt);
  border: var(--rand); border-radius: 10px;
  padding: 14px 16px; margin: 4px 0 12px;
}
.foto-opdracht .kop { display: block; font-family: var(--mono); font-weight: 800; font-size: .8rem; letter-spacing: 1px; text-transform: uppercase; opacity: .8; }
.foto-opdracht .taak { display: block; margin-top: 4px; font-size: 1.25rem; font-weight: 700; line-height: 1.3; }

.locatie-foto {
  display: block; width: 100%; height: 190px; object-fit: cover;
  border: var(--rand); border-radius: 10px; margin-bottom: 12px;
}

/* Verbergen - geldt voor elk element, niet alleen overlays. */
.verborgen { display: none !important; }

/* Overlay (login + slot + winnaar) - boven de Leaflet-kaart (die tot ~1000 gaat). */
.overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  z-index: 2000; overflow: auto;
  background: var(--karton); padding: 20px;
}
.overlay.verborgen { display: none; }

.teamkeuze { display: flex; gap: 10px; }
.teamkeuze button { flex: 1; }
.teamkeuze button[data-team="rood"] { background: var(--rood); color: #fff; }
.teamkeuze button[data-team="blauw"] { background: var(--blauw); color: #fff; }
.teamkeuze button[data-team="groen"] { background: var(--groen); color: #fff; }
.teamkeuze button.gekozen { outline: 5px solid var(--geel); }

.balk { height: 18px; background: #fff8ea; border: var(--rand); border-radius: 999px; overflow: hidden; }
.balk > i { display: block; height: 100%; background: var(--geel); width: 0; }

/* Slotscherm */
#winnaar-overlay { display: flex; flex-direction: column; justify-content: center; text-align: center; color: #fff; }
#winnaar-overlay h1 { font-size: 3rem; margin: 4px; }
.reveal { font-size: 1.5rem; margin: 8px 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
