/* Missie Maastricht. Eén stylesheet voor de spelpagina, de testpagina en de beheerpagina.

   Donker, omdat de site 's avonds in de kroeg open ligt en de alarmtafel rood en zwart knippert.
   De letter is Plus Jakarta Sans, dezelfde als in Jarvis, en net als daar lokaal geserveerd: een
   letter van een vreemde server is een verzoek naar buiten. Variabel van 200 tot 800. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/plus-jakarta-sans.woff2") format("woff2") tech(variations),
       url("/fonts/plus-jakarta-sans.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --canvas: #08080a;
  --ink: #f6f6f7;
  --ink-2: rgba(246, 246, 247, 0.72);
  --ink-3: rgba(246, 246, 247, 0.5);
  --ink-4: rgba(246, 246, 247, 0.3);
  --hair: rgba(255, 255, 255, 0.08);
  --hair-2: rgba(255, 255, 255, 0.15);
  --tint: rgba(255, 255, 255, 0.045);
  --tint-2: rgba(255, 255, 255, 0.085);
  --vlak: rgba(20, 20, 24, 0.74);
  --glans: rgba(255, 255, 255, 0.07);
  --lift: 0 1px 1px rgba(0, 0, 0, 0.35), 0 26px 50px -30px rgba(0, 0, 0, 0.95);
  --rood: #ff4d57;
  --rood-diep: #e5323d;
  --rood-zacht: rgba(255, 77, 87, 0.15);
  --groen: #3ddc97;
  --groen-zacht: rgba(61, 220, 151, 0.14);
  --goud: #ffc94d;
  --goud-zacht: rgba(255, 201, 77, 0.15);
  --blauw: #8ea8ff;
  --blauw-zacht: rgba(142, 168, 255, 0.15);
  --blok-basis: #141417; /* dicht, zodat de uurlijnen van de agenda niet door een blok lopen */
  --r-xl: 28px;
  --r-l: 22px;
  --r-m: 16px;
  --r-s: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--canvas); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font: 500 16px/1.5 var(--font);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(30px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

/* Drie zachte gloeden: rood bovenin, blauw rechts, goud onderin. Een vaste laag in plaats van
   background-attachment: fixed, want dat negeert iOS. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(75% 45% at 10% -6%, rgba(255, 77, 87, 0.24), transparent 70%),
    radial-gradient(55% 40% at 104% 2%, rgba(142, 168, 255, 0.17), transparent 70%),
    radial-gradient(80% 45% at 50% 112%, rgba(255, 201, 77, 0.10), transparent 70%),
    var(--canvas);
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }

.pagina { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.stapel { display: flex; flex-direction: column; gap: 14px; }

/* ---- kop ------------------------------------------------------------------------------------ */

.kop { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 4px 6px; }
.merk { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 770; letter-spacing: -0.022em; }
.tegel {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(160deg, #ff6f77, var(--rood-diep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 6px 18px -6px rgba(255, 77, 87, 0.75);
}
.tegel svg { width: 16px; height: 16px; display: block; }
.tegel.groot { width: 44px; height: 44px; border-radius: 13px; }
.tegel.groot svg { width: 28px; height: 28px; }
.merk { color: inherit; }

/* NL of EN, bovenin de balk. */
.taalknop { display: inline-flex; flex: none; padding: 3px; gap: 2px; border-radius: 999px; background: var(--tint); box-shadow: inset 0 0 0 1px var(--hair); }
.taalknop button {
  height: 30px; min-width: 40px; padding: 0 10px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-3); font: 760 12.5px var(--font); letter-spacing: 0.04em;
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background 0.2s ease, color 0.2s ease;
}
.taalknop button.aan { background: var(--ink); color: #0a0a0c; }

.pil {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  height: 28px; padding: 0 11px; border-radius: 999px;
  background: var(--tint); box-shadow: inset 0 0 0 1px var(--hair);
  font-size: 12.5px; font-weight: 650; color: var(--ink-2);
  font-variant-numeric: tabular-nums; white-space: nowrap; text-decoration: none;
}
.pil .stip { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.pil .slot { display: none; width: 12px; height: 12px; }
.pil.dicht .stip { display: none; }
.pil.dicht .slot { display: block; }
.pil.open .stip { background: var(--groen); }
.pil.live .stip { background: var(--rood); animation: puls 1.8s ease-out infinite; }
.pil.goud { color: var(--goud); box-shadow: inset 0 0 0 1px rgba(255, 201, 77, 0.35); background: var(--goud-zacht); }
.pil.goud .stip { background: var(--goud); }
@keyframes puls {
  0% { box-shadow: 0 0 0 0 rgba(255, 77, 87, 0.6); }
  70% { box-shadow: 0 0 0 7px rgba(255, 77, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 87, 0); }
}

/* ---- kaarten en tekst ----------------------------------------------------------------------- */

.kaart {
  position: relative;
  padding: 20px;
  border-radius: var(--r-l);
  background: var(--vlak);
  box-shadow: inset 0 0 0 1px var(--hair), inset 0 1px 0 var(--glans), var(--lift);
}
.kaart-kop { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.boven { font-size: 11.5px; font-weight: 720; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.boven.rood { color: var(--rood); }
.boven.goud { color: var(--goud); }
h1 { font-size: clamp(26px, 7.6vw, 33px); font-weight: 780; letter-spacing: -0.034em; line-height: 1.1; }
h2 { font-size: 17px; font-weight: 740; letter-spacing: -0.018em; line-height: 1.3; }
.klein { font-size: 14px; color: var(--ink-3); line-height: 1.5; }
.ok { color: var(--groen); font-weight: 700; }
.fout { color: #ff9aa0; font-weight: 600; font-size: 14.5px; }
.linkje { color: var(--ink-2); font-weight: 650; text-decoration: none; border-bottom: 1px solid var(--hair-2); padding-bottom: 1px; }
.voet { text-align: center; font-size: 13.5px; padding: 6px 0 0; color: var(--ink-3); }

/* ---- de held: afteller, taak, finale --------------------------------------------------------- */

.held { padding: 26px 22px 22px; border-radius: var(--r-xl); }
.afteller { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin: 16px 0 0; }
.seg { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.seg b {
  font-size: clamp(40px, 13.4vw, 62px); font-weight: 760; line-height: 0.92;
  letter-spacing: -0.05em; font-variant-numeric: tabular-nums;
}
.seg span { font-size: 11px; font-weight: 720; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-3); }
.held-onder { margin-top: 18px; font-size: 15.5px; color: var(--ink-2); line-height: 1.5; }
.held-onder b { color: var(--ink); font-weight: 720; }

.taaktekst { font-size: clamp(21px, 6vw, 25px); font-weight: 720; letter-spacing: -0.024em; line-height: 1.28; margin: 12px 0 10px; }
.bewijs { font-size: 15px; color: var(--ink-2); }
.taak-voet {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hair);
}
.volgende { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.volgende b {
  display: block; margin-top: 2px; font-size: 26px; font-weight: 760; color: var(--ink);
  letter-spacing: -0.035em; font-variant-numeric: tabular-nums; line-height: 1.1;
}

/* Wie heeft het punt: A en B, groen als het team het heeft. */
.chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 30px; height: 26px; padding: 0 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 760; background: var(--tint-2); color: var(--ink-4);
  transition: background 0.25s ease, color 0.25s ease;
}
.chip.aan { background: var(--groen); color: #04281a; }
.chip.geheim { color: var(--ink-3); font-weight: 650; }

/* ---- de stand ------------------------------------------------------------------------------- */

.stand { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.team { padding: 16px 16px 15px; border-radius: var(--r-m); background: var(--tint); box-shadow: inset 0 0 0 1px var(--hair); }
.team .naam { font-size: 13px; font-weight: 720; color: var(--ink-3); }
.team .punten {
  display: block; margin-top: 10px; font-size: 54px; font-weight: 780; line-height: 0.95;
  letter-spacing: -0.05em; font-variant-numeric: tabular-nums;
}
.team.winnaar { background: var(--groen-zacht); box-shadow: inset 0 0 0 1.5px rgba(61, 220, 151, 0.55); }
.team.winnaar .naam { color: var(--groen); }
.stand-onder { margin-top: 12px; font-size: 14px; color: var(--ink-3); line-height: 1.5; }

/* ---- de avond als agenda -------------------------------------------------------------------- */

.agenda { position: relative; }
.agenda .rij { position: absolute; left: 0; right: 0; height: 0; display: flex; align-items: center; gap: 10px; }
.agenda .rij span { width: 38px; flex: none; font-size: 11.5px; font-weight: 650; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.agenda .rij i { flex: 1; height: 1px; background: var(--hair); }
.agenda .blok {
  position: absolute; left: 48px; right: 0; overflow: hidden;
  display: flex; flex-direction: column; gap: 1px; padding: 7px 11px;
  border-radius: 10px; background: linear-gradient(var(--tint-2), var(--tint-2)), var(--blok-basis);
  box-shadow: inset 3px 0 0 var(--ink-3);
  transition: opacity 0.4s ease;
}
.agenda .blok b { font-size: 14px; font-weight: 730; letter-spacing: -0.012em; line-height: 1.25; }
.agenda .blok span { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.agenda .blok.kort { flex-direction: row; align-items: center; gap: 8px; padding-top: 0; padding-bottom: 0; white-space: nowrap; }
.agenda .blok.kort span { color: var(--ink-3); }
.agenda .blok.licht { background: linear-gradient(var(--blauw-zacht), var(--blauw-zacht)), var(--blok-basis); box-shadow: inset 3px 0 0 var(--blauw); }
.agenda .blok.start { background: linear-gradient(160deg, #8394ff, #5263ec); box-shadow: 0 8px 22px -14px rgba(82, 99, 236, 0.9); }
.agenda .blok.stad { background: linear-gradient(160deg, #ff6670, #dd2f3b); box-shadow: 0 8px 22px -14px rgba(221, 47, 59, 0.9); }
.agenda .blok.finale { background: linear-gradient(160deg, #ffd873, #f4a51c); box-shadow: 0 8px 22px -14px rgba(244, 165, 28, 0.9); color: #2a1c00; }
.agenda .blok.start span, .agenda .blok.stad span { color: rgba(255, 255, 255, 0.85); }
.agenda .blok.finale span { color: rgba(42, 28, 0, 0.7); }
.agenda .blok.daarna { background: var(--blok-basis); box-shadow: inset 0 0 0 1px var(--hair-2); }
.agenda .blok.voorbij { opacity: 0.38; }
.agenda .blok { z-index: 1; }
.agenda .blok.nu-blok { outline: 1.5px solid rgba(255, 77, 87, 0.7); outline-offset: 1px; }
.agenda .nu { position: absolute; left: 42px; right: 0; height: 1.5px; margin-top: -0.75px; border-radius: 2px; background: var(--rood); z-index: 0; box-shadow: 0 0 8px rgba(255, 77, 87, 0.6); }
.agenda .nu::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--rood); }

/* ---- lijstjes ------------------------------------------------------------------------------- */

.lijstje { list-style: none; margin: 0; padding: 0; }
.lijstje li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: center; padding: 12px 0; }
.lijstje li + li { border-top: 1px solid var(--hair); }
.lijstje b { display: block; font-size: 15.5px; font-weight: 720; letter-spacing: -0.012em; }
.lijstje span { font-size: 13.5px; color: var(--ink-3); }
.icoon {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--tint-2); box-shadow: inset 0 0 0 1px var(--hair);
}
.icoon svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }


.regels { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: regel; }
.regels li { display: grid; grid-template-columns: 22px 1fr; gap: 11px; font-size: 15px; color: var(--ink-2); line-height: 1.45; }
.regels li::before {
  counter-increment: regel; content: counter(regel);
  display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px;
  font-size: 12px; font-weight: 760; color: var(--ink-3); background: var(--tint-2);
}

.taken { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.taken li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 12px; border-radius: var(--r-m); background: var(--tint); box-shadow: inset 0 0 0 1px var(--hair); }
.taken .nr { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; font-size: 13px; font-weight: 760; color: var(--ink-2); background: var(--tint-2); }
.taken .wat { font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }
.taken .chips { margin-top: 9px; }

/* ---- telefoon klaarzetten ------------------------------------------------------------------- */

.stap { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.stap + .stap { margin-top: 18px; }
.stap .nr { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 13px; font-weight: 760; color: var(--ink-2); background: var(--tint-2); }
.stap.klaar .nr { background: var(--groen); color: #04281a; }
.stap b { display: block; font-size: 15.5px; font-weight: 720; letter-spacing: -0.012em; margin: 3px 0 3px; }
.stap p { font-size: 14px; color: var(--ink-3); line-height: 1.5; }

/* ---- knoppen en velden ---------------------------------------------------------------------- */

.knop {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px; padding: 14px 20px;
  border: 0; border-radius: var(--r-m);
  background: var(--ink); color: #0a0a0c;
  font: 720 16px/1.2 var(--font); letter-spacing: -0.012em; text-decoration: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform 0.12s ease, opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.knop:active { transform: scale(0.985); }
.knop:disabled { opacity: 0.4; cursor: default; transform: none; }
.knop.rood {
  background: linear-gradient(180deg, #ff5d66, var(--rood-diep)); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 12px 26px -14px rgba(255, 77, 87, 0.85);
}
.knop.tweede { background: var(--tint-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair); }
.knop.aan { background: var(--groen-zacht); color: var(--groen); box-shadow: inset 0 0 0 1px rgba(61, 220, 151, 0.4); }
.knoppen { display: grid; gap: 10px; }

.segmenten { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--tint); box-shadow: inset 0 0 0 1px var(--hair); }
.segmenten button {
  height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2);
  font: 720 15px var(--font); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.segmenten button.aan { background: var(--ink); color: #0a0a0c; }

.veld { display: grid; gap: 6px; margin-bottom: 12px; font-size: 13.5px; font-weight: 650; color: var(--ink-3); }
.veld input {
  width: 100%; padding: 13px 14px; border: 0; border-radius: var(--r-s);
  font: 620 16px var(--font); color: var(--ink); background: var(--tint-2);
  box-shadow: inset 0 0 0 1px var(--hair); color-scheme: dark;
}
.veld input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink-3); }

.status { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; margin: 0; font-size: 15px; }
.status dt { color: var(--ink-3); }
.status dd { margin: 0; font-weight: 720; text-align: right; font-variant-numeric: tabular-nums; }

/* ---- de beheerpagina: punten --------------------------------------------------------------- */

.totaal { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.totaal b { font-size: 28px; font-weight: 780; letter-spacing: -0.04em; line-height: 1; }
.totaal span { font-size: 13px; font-weight: 720; color: var(--ink-3); }
.zichtregel { margin: -4px 0 6px; font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }
.puntentabel { display: grid; grid-template-columns: 1fr 54px 54px; gap: 6px 8px; align-items: center; }
.puntentabel .groep { grid-column: 1 / -1; margin: 14px 0 2px; }
.puntentabel .kolom { font-size: 11.5px; font-weight: 760; letter-spacing: 0.1em; text-align: center; color: var(--ink-3); }
.rijnaam { font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.3; }
.rijnaam small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-3); }
.rijnaam.dicht { color: var(--ink-4); }
.puntknop {
  height: 44px; padding: 0; border: 0; border-radius: 12px;
  background: var(--tint-2); box-shadow: inset 0 0 0 1px var(--hair); color: var(--ink-3);
  font: 800 15px var(--font); cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.puntknop:active { transform: scale(0.94); }
.puntknop.aan { background: var(--groen); box-shadow: none; color: #04281a; }
.puntknop:disabled { opacity: 0.25; cursor: default; transform: none; }
.bonusrij { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.stapper { display: flex; align-items: center; gap: 10px; }
.stapper .puntknop { width: 44px; font-size: 19px; }
.stapper b { min-width: 34px; text-align: center; font-size: 19px; font-weight: 780; font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 50;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 999px;
  background: rgba(32, 32, 36, 0.96); box-shadow: inset 0 0 0 1px var(--hair-2), 0 14px 34px -12px rgba(0, 0, 0, 0.85);
  font-size: 14px; font-weight: 650; text-align: center;
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.toon { opacity: 1; transform: translate(-50%, 0); }
.toast.fout { color: #ff9aa0; }

/* ---- de testpagina -------------------------------------------------------------------------- */

.groot-getal { font-size: 64px; font-weight: 780; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---- de alarmtafel: het hele scherm knippert rood en zwart, twee keer per seconde ------------ */

.alarm {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; justify-content: center; gap: 22px;
  padding: max(28px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  background: var(--rood-diep); color: #fff; text-align: center;
  animation: knipper 0.5s steps(1) infinite;
}
@keyframes knipper { 50% { background: #000; } }
.alarm-kop { font-size: clamp(36px, 11vw, 56px); font-weight: 800; line-height: 1.04; letter-spacing: -0.035em; white-space: pre-line; }
.alarm-tekst { font-size: 20px; font-weight: 650; line-height: 1.38; }
.alarm-roep { font-size: 13.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.92; }
.alarm .knop { background: #fff; color: #000; }

/* ---- beweging ------------------------------------------------------------------------------- */

.verschijn { animation: verschijn 0.6s cubic-bezier(0.2, 0.75, 0.25, 1) both; }
@keyframes verschijn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .alarm, .pil.live .stip, .verschijn { animation: none; }
}
