@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url("fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-display: swap; src: url("fonts/barlow-semi-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
  --grond: #05080D;
  --vlak: #0B1017;
  --balk: #16202C;
  --rand: #22303F;
  --tekst: #EEF4FB;
  --zacht: #8EA1B6;
  --accent: #28C9F4;
  /* verloop links donkerblauw -> rechts licht cyaan, voor balk en knop (witte tekst) */
  --accent-grad: linear-gradient(90deg, #1458CF 0%, #28C9F4 100%);
  --opaccent: #FFFFFF;
  --live: #5BD67A;
  --fout: #FF9B8A;
  --smal: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grond);
  color: var(--tekst);
  font-family: "Barlow", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
}
h1, h2, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Vaste merkbalk boven alle schermen */
.merkbalk {
  position: sticky; top: 0; z-index: 30;
  background: #15314F; border-bottom: 2px solid var(--accent);
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
}
.merkbalk-in { position: relative; max-width: 480px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }

/* Menu in de merkbalk. Mobiel: knop + uitklaplijst. Desktop: inline links. */
.merkmenu-knop {
  margin-left: 10px; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none; border: 0; border-radius: 10px;
  background: #ffffff1f; color: #e7f0fb; cursor: pointer;
}
.merkmenu {
  display: none;
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 40;
  min-width: 200px; flex-direction: column; gap: 2px;
  background: #15314F; border: 1px solid #ffffff2e; border-radius: 12px;
  padding: 6px; box-shadow: 0 16px 40px #0009;
}
.merkbalk.menu-open .merkmenu { display: flex; }
.merkmenu a { color: #e7f0fb; text-decoration: none; font-size: 15px; font-weight: 600; padding: 11px 12px; border-radius: 8px; white-space: nowrap; }
.merkmenu a:hover, .merkmenu a:focus-visible { background: #ffffff1f; }
.merkbalk .merk { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tekst); }
.merkbalk .merk-logo { flex: none; display: block; }
.merkbalk .merk-naam { font-family: var(--smal); font-size: 22px; font-weight: 700; letter-spacing: 0.01em; line-height: 1; color: #fff; }
.merkbalk .merk-naam .tld { color: var(--zacht); }
.merkbalk-sub { margin-left: auto; font-size: 12px; font-weight: 600; color: #cfe0ef; border: 1px solid #ffffff2e; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }

.scherm {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 16px max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ------------------------------------------------------------ zoekscherm */
.kop { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; }
.merk { display: flex; align-items: center; gap: 10px; }
.merk-logo { flex: none; display: block; }
.merk-tekst { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.merk-naam { font-family: var(--smal); font-size: 24px; font-weight: 700; letter-spacing: 0.01em; line-height: 1; }
.merk-naam span { color: var(--accent); }
.merk-payoff { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--zacht); }
.kop-sub { font-size: 14px; color: var(--zacht); text-align: right; }

.blok { display: flex; flex-direction: column; gap: 6px; }
.blokkop { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--zacht); margin-bottom: 2px; }
.bloktitel { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--zacht); line-height: 18px; }

.zoekrij { display: flex; gap: 8px; }
.zoekrij input, #code-invoer {
  flex: 1; min-width: 0; height: 52px; padding: 0 16px;
  border: 2px solid var(--rand); border-radius: 10px; background: var(--vlak);
  font-family: var(--smal); font-size: 22px; font-weight: 600;
}
.zoekrij input::placeholder { color: #7F8D9A; font-weight: 600; }
.zoekrij input:focus, #code-invoer:focus { outline: none; border-color: var(--accent); }
.knop-zoek {
  height: 52px; padding: 0 18px; border: 2px solid var(--rand); border-radius: 10px;
  background: var(--balk); font-family: var(--smal); font-size: 19px; font-weight: 700;
}
.knop-zoek:disabled { opacity: 0.6; cursor: progress; }
.melding { min-height: 20px; font-size: 14px; color: var(--zacht); }
.melding.is-fout { color: var(--fout); }

.keuzelijst { display: flex; flex-direction: column; gap: 6px; }
.keuze {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 6px 14px;
  border: 2px solid var(--vlak); border-radius: 10px; background: var(--vlak);
  text-align: left; font-size: 16px; font-weight: 500;
}
.keuze-naam { flex: 1; min-width: 0; }
.keuze-aantal { font-size: 14px; font-weight: 600; color: var(--zacht); }
.keuze[aria-pressed="true"] { border-color: var(--accent); background: var(--balk); font-weight: 600; }
.keuze[aria-pressed="true"] .keuze-aantal { color: var(--accent); }
.keuze-wis { font-size: 13px; font-weight: 500; color: var(--zacht); text-decoration: underline; text-underline-offset: 3px; }
.keuze-meer {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 14px;
  border: 2px dashed var(--rand); border-radius: 10px; background: transparent; color: var(--zacht); font-size: 15px;
}

.instellingen { gap: 0; border-radius: 10px; background: var(--vlak); padding: 0 14px; }
.instelling { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; font-size: 15px; }
.instelling + .instelling { border-top: 1px solid var(--balk); }
.instelling select {
  height: 36px; padding: 0 8px; border: 1px solid var(--rand); border-radius: 8px; background: var(--balk); font-size: 15px;
}
.instelling input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--accent); }
.instelling .postcode {
  width: 96px; height: 36px; padding: 0 8px; border: 1px solid var(--rand); border-radius: 8px; background: var(--balk);
  font-size: 15px; text-align: center; text-transform: uppercase;
}
.instelling .postcode::placeholder { color: #7F8D9A; }

.hervat {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; text-align: left;
  border: 2px solid var(--rand); border-radius: 10px; background: var(--vlak);
}
.hervat-label { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.hervat-tekst { font-family: var(--smal); font-size: 19px; font-weight: 600; }

.voet {
  position: sticky; bottom: 0; margin-top: auto; display: flex; flex-direction: column; gap: 10px;
  padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  background: var(--grond);
}
.telling { min-height: 20px; font-size: 14px; color: var(--zacht); text-align: center; }
.knop-primair {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 0 16px;
  border: 0; border-radius: 12px; background: var(--accent-grad); color: var(--opaccent);
  font-family: var(--smal); font-size: 21px; font-weight: 700; letter-spacing: 0.01em; text-decoration: none;
  text-shadow: 0 1px 2px rgba(6, 30, 70, 0.4);
}

/* ------------------------------------------------------------- livescherm */
.livekop {
  position: static; display: flex; flex-direction: column; gap: 6px;
  margin: -16px -20px 0; padding: 14px 20px 10px; background: var(--grond);
}
.livekop-rij { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.livekop-titel { flex: 1; min-width: 0; font-family: var(--smal); font-size: 28px; line-height: 32px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-pad { font-size: 14px; line-height: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.knop-icoon {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0;
  border: 0; border-radius: 10px; background: var(--vlak);
}
#geluid[aria-pressed="true"] .icoon-uit, #geluid[aria-pressed="false"] .icoon-aan { display: none; }
#geluid[aria-pressed="true"] { color: var(--accent); }
.livepil {
  display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; flex-shrink: 0;
  border-radius: 15px; background: var(--vlak); font-size: 14px; font-weight: 600;
}
.stip { width: 9px; height: 9px; border-radius: 50%; background: var(--live); }
.livepil.is-fout .stip { background: var(--fout); border-radius: 2px; }
.livepil.is-bezig .stip { animation: knipper 0.9s ease-in-out infinite; }
.statusregel { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; line-height: 18px; color: var(--zacht); }
.statusregel.is-fout #status-controle { color: var(--fout); }
#status-nieuw { color: var(--accent); font-weight: 600; white-space: nowrap; }

.lijst { list-style: none; margin: 0; padding: 2px; display: flex; flex-direction: column; gap: 12px; }
.kaart {
  border-radius: 12px; overflow: hidden; background: #101b27;
  border: 1.5px solid #5fc7f0;
  box-shadow: 0 0 16px rgba(95, 199, 240, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 18px rgba(0, 0, 0, 0.5);
}
.kaart-knop { display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; }
.kaart-balk { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 14px; background: var(--accent-grad); color: var(--opaccent); text-shadow: 0 1px 2px rgba(6, 30, 70, 0.4); }
.kaart-titel {
  flex: 1; min-width: 0; font-family: var(--smal); font-size: 19px; line-height: 23px; font-weight: 700;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.kaart-tijd { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; line-height: 16px; }
.kaart-uur { font-weight: 600; }
.kaart-uur:empty { display: none; }
.kaart.is-nieuw { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 0 22px rgba(40, 201, 244, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.kaart.is-nieuw .kaart-dag {
  padding: 3px 8px; border-radius: 6px; background: var(--grond); color: var(--accent);
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
}
.kaart-fotos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 10px 14px 0; }
.kaart-foto { position: relative; display: block; height: 76px; border-radius: 8px; overflow: hidden; background: var(--balk); }
.kaart-foto img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kaart-foto-betaald {
  position: absolute; left: 6px; top: 6px; padding: 1px 7px; border-radius: 6px;
  background: var(--grond); color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
}
.kaart-foto-meer {
  position: absolute; right: 6px; bottom: 6px; padding: 1px 7px; border-radius: 6px;
  background: var(--grond); color: var(--tekst); font-size: 13px; font-weight: 600;
}
.kaart.komt-binnen { animation: binnen 0.45s ease-out; }

.gegevens { display: grid; grid-template-columns: 30% minmax(0, 1fr) auto; gap: 10px; padding: 10px 14px 12px; }
.veld { display: flex; flex-direction: column; min-width: 0; }
.veld-rechts { text-align: right; }
.veld-label { font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--zacht); }
.veld-waarde { font-size: 15px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.veld-extra { font-size: 13px; line-height: 16px; color: var(--zacht); }
.veld-extra:empty { display: none; }
.veld-prijs { font-family: var(--smal); font-size: 20px; font-weight: 700; overflow: visible; }
.leeg { padding: 24px 8px; text-align: center; color: var(--zacht); }

.banner {
  display: flex; flex-direction: column; gap: 10px; margin-top: 6px; padding: 12px 14px;
  border: 2px solid var(--fout); border-radius: 12px; background: var(--vlak); font-size: 15px;
}
.banner .knop-primair { min-height: 48px; font-size: 19px; }
.statusregel #status-controle { min-width: 0; }

.hint {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--rand); border-radius: 10px;
  background: var(--vlak); font-size: 12.5px;
}
.hint p { flex: 1; min-width: 0; }
.hint .knop-zoek { height: 40px; font-size: 15px; white-space: nowrap; }
.hint p { font-size: 12.5px; line-height: 1.45; color: var(--zacht); }

.achtergrond { font-size: 14px; color: var(--zacht); }
.achtergrond.is-actief p:first-child::before {
  content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; background: var(--live);
}
.achtergrond details { margin-top: 8px; }
.achtergrond summary { min-height: 44px; display: flex; align-items: center; color: var(--accent); font-weight: 600; cursor: pointer; }
.achtergrond details p { margin-bottom: 8px; }
.achtergrond code {
  display: block; padding: 10px 12px; border-radius: 8px; background: var(--vlak); color: var(--tekst);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; user-select: all;
}

/* ------------------------------------------------------------------ popup */
.popup {
  width: min(100vw - 24px, 456px); max-height: calc(100dvh - 24px); padding: 16px;
  border: 1px solid var(--rand); border-radius: 16px; background: var(--grond); color: var(--tekst);
  overflow-y: auto; overscroll-behavior: contain;
}
/* Terwijl de popup open staat de achtergrond niet mee laten scrollen. */
body.popup-open { overflow: hidden; }
.popup[open] { display: flex; flex-direction: column; gap: 12px; }
.popup::backdrop { background: rgba(5, 8, 11, 0.78); }
.popup-kop {
  display: flex; align-items: center; gap: 10px;
  margin: -16px -16px 0; padding: 11px 12px 11px 16px;
  background: var(--accent-grad); color: var(--opaccent);
  border-radius: 16px 16px 0 0; text-shadow: 0 1px 2px rgba(6, 30, 70, 0.4);
}
.popup-kop h2 { flex: 1; min-width: 0; font-family: var(--smal); font-size: 22px; line-height: 26px; font-weight: 700; color: #fff; overflow-wrap: anywhere; }
.popup-kop .knop-icoon { background: rgba(255, 255, 255, 0.18); color: #fff; flex-shrink: 0; }
.fotos-kader { position: relative; }
.foto-pijl { position: absolute; top: 50%; margin-top: -22px; background: rgba(18, 23, 28, 0.82); }
.foto-pijl-links { left: 8px; }
.foto-pijl-rechts { right: 8px; }
.fotos {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 10px;
  background: var(--vlak); scrollbar-width: none;
}
.fotos::-webkit-scrollbar { display: none; }
.foto {
  flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center;
  height: min(52dvh, 420px); color: var(--zacht); font-size: 15px;
}
.foto img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.foto-teller { min-height: 18px; text-align: center; font-size: 13px; color: var(--zacht); }
.popup-gegevens { padding: 4px 0; }
.popup-geplaatst { font-size: 14px; font-weight: 600; }
.popup-geplaatst:empty { display: none; }
.popup-omschrijving { font-size: 15px; color: var(--zacht); overflow-wrap: anywhere; }
.popup-klein { width: min(100vw - 24px, 360px); }
.code-titel { font-family: var(--smal); font-size: 22px; font-weight: 700; margin-bottom: 6px; }
#code-invoer { flex: none; width: 100%; margin-bottom: 8px; }

@keyframes binnen { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@keyframes knipper { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) {
  .kaart.komt-binnen, .livepil.is-bezig .stip { animation: none; }
}

/* ===== Desktopweergave: live-feed als raster rondom een centraal vak ===== */
/* Mobiel blijft ongewijzigd: het centrale vak staat standaard verborgen. */
.eiland { display: none; }

@media (min-width: 1000px) {
  .merkbalk-in { max-width: 1180px; }

  /* Kop op één regel: titel + categorie links; status, geluid en Live rechts. */
  .livekop { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; padding: 7px 20px; }
  .livekop-rij { display: contents; }
  #terug { order: 1; }
  .livekop-titel { order: 2; flex: 0 1 auto; min-width: 0; font-size: 24px; line-height: 1; }
  .live-pad { order: 3; flex: 0 1 auto; min-width: 0; font-size: 13px; line-height: 1; color: var(--zacht); border-left: 1px solid var(--rand); padding-left: 12px; }
  .statusregel { order: 4; margin-left: auto; justify-content: flex-end; gap: 14px; font-size: 12px; line-height: 1; }
  #geluid { order: 5; }
  #livepil { order: 6; }
  .livekop .banner { order: 10; flex-basis: 100%; }
  #betaald-hint { margin-top: 2px; }

  /* Desktop: menu inline in de balk; de knop verdwijnt. */
  .merkmenu-knop { display: none; }
  .merkmenu {
    display: flex; position: static; flex-direction: row; align-items: center; gap: 24px;
    margin-left: auto; min-width: 0; padding: 0; background: none; border: 0; box-shadow: none;
  }
  .merkmenu a { color: #cfe0ef; font-size: 14px; font-weight: 600; padding: 6px 2px; border-radius: 0; }
  .merkmenu a:hover, .merkmenu a:focus-visible { background: none; color: #fff; }
  .merkbalk-sub { margin-left: 24px; }

  /* Live-scherm vult precies de hoogte onder de merkbalk: geen scroll. */
  body:has(#scherm-live:not([hidden])) {
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  #scherm-live {
    max-width: 1180px;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
  }

  /* De feed wordt een raster van 4 kolommen x 4 rijen die samen de hoogte vullen. */
  #lijst.lijst {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 12px;
    overflow: hidden;
  }

  /* Kaarten vullen hun rij; de fotostrip krimpt mee zodat alles past. */
  #lijst.lijst > .kaart { min-height: 0; display: flex; flex-direction: column; }
  #lijst.lijst > .kaart .kaart-knop { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  #lijst.lijst > .kaart .kaart-fotos { flex: 1 1 auto; min-height: 0; grid-auto-rows: 1fr; padding-bottom: 4px; }
  #lijst.lijst > .kaart .kaart-foto { height: auto; min-height: 0; }

  /* Centraal vak: 2 kolommen x 2 rijen in het midden; kaarten stromen eromheen. */
  .eiland {
    display: block;
    grid-column: 2 / 4;
    grid-row: 2 / 4;
    align-self: stretch;
    min-height: 0;
    border: 1px solid var(--rand);
    border-radius: 18px;
    background:
      radial-gradient(360px 220px at 50% 0, #0f2a44 0, transparent 60%),
      linear-gradient(160deg, #0c1622, #0a1016);
    box-shadow: 0 24px 60px #0008;
    overflow: hidden;
  }
  .eiland-in {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    padding: 28px;
  }
  .eiland-naam { font-family: var(--smal); font-weight: 800; font-size: 34px; line-height: 1; color: var(--tekst); }
  .eiland-naam span { color: var(--accent); }
  .eiland-sub { color: var(--zacht); font-size: 15px; max-width: 26ch; line-height: 1.45; }

  /* Subtiele sonar-animatie achter het logo. */
  .eiland-visueel { position: relative; width: 150px; height: 150px; display: grid; place-items: center; margin-bottom: 4px; }
  .eiland-visueel .ping {
    position: absolute; width: 60px; height: 60px; border-radius: 50%;
    border: 1px solid rgba(40, 201, 244, 0.55);
    opacity: 0; transform: scale(0.4);
    animation: eiland-ping 4.2s ease-out infinite;
  }
  .eiland-visueel .ping:nth-child(2) { animation-delay: 1.4s; }
  .eiland-visueel .ping:nth-child(3) { animation-delay: 2.8s; }
  .eiland-logo-wrap {
    position: relative; display: grid; place-items: center;
    width: 72px; height: 72px; border-radius: 18px;
    background: radial-gradient(circle at 50% 35%, rgba(40, 201, 244, 0.12), transparent 70%);
    animation: eiland-gloed 3.6s ease-in-out infinite;
  }
  .eiland-logo { display: block; }
}

@keyframes eiland-ping {
  0%   { opacity: 0.55; transform: scale(0.4); }
  70%  { opacity: 0; }
  100% { opacity: 0; transform: scale(2.1); }
}
@keyframes eiland-gloed {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(40, 201, 244, 0.35)); transform: scale(1); }
  50%      { filter: drop-shadow(0 0 20px rgba(40, 201, 244, 0.6)); transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .eiland-visueel .ping { animation: none; display: none; }
  .eiland-logo-wrap { animation: none; }
}
