:root {
  /* camouflage-thema */
  --blauw-donker: #353d2a;   /* donker legergroen (headers, klok) */
  --blauw: #4d5839;          /* legergroen (primaire knoppen) */
  --blauw-mid: #6d7355;      /* olijf (accenten, focus) */
  --blauw-licht: #d9dcc2;    /* licht olijf (chips) */
  --zand: #e6e4d0;           /* kaki-achtergrond */
  --zand-donker: #cfccb0;
  --tekst: #29271e;
  --grijs: #6b6853;
  --groen: #2e7d32;
  --rood: #a63c2c;
  --oranje: #d97b29;
  --kaart-blauw: #1d4e79;    /* stekmarkers op de (blauwe) kaart */
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, 'Segoe UI', Arial, sans-serif;
  background: var(--zand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420'%3E%3Cg fill='%23dcd9c1'%3E%3Cpath d='M40 60c30-25 85-15 95 15s-20 60-60 55S10 85 40 60z'/%3E%3Cpath d='M280 300c40-20 90 5 85 45s-70 55-100 25 -15-55 15-70z'/%3E%3Cpath d='M330 90c25-18 65-5 60 28s-55 40-75 18 -5-32 15-46z'/%3E%3C/g%3E%3Cg fill='%23d0cdb3'%3E%3Cpath d='M120 260c25-30 75-20 80 10s-30 65-70 50-35-35-10-60z'/%3E%3Cpath d='M240 130c20-22 60-12 62 15s-38 45-62 30-15-28 0-45z'/%3E%3C/g%3E%3Cg fill='%23e0ddc6'%3E%3Cpath d='M60 350c22-16 58-6 56 22s-48 38-66 18-8-26 10-40z'/%3E%3C/g%3E%3C/svg%3E") fixed;
  color: var(--tekst);
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
button, a, .stek, .tabs button { touch-action: manipulation; }
input, select { font-size: 16px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--blauw-donker); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 10px calc(16px + env(safe-area-inset-left));
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; }
.topcode { font-family: ui-monospace, Menlo, monospace; letter-spacing: 2px; opacity: .85; }

.container { max-width: 860px; margin: 0 auto; padding: 12px calc(12px + env(safe-area-inset-right)) calc(80px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left)); }

.card {
  background: #fff; border-radius: 14px; padding: 16px;
  margin: 12px 0; box-shadow: 0 1px 4px rgba(42,39,33,.08);
}
.hero { background: linear-gradient(150deg, #2c331f, #4d5839 55%, #6d7355); color: #fff; }
.hero h1 { margin: 4px 0 8px; font-size: 26px; line-height: 1.2; }
.hero .sub { margin: 0; opacity: .9; }

h1 { font-size: 22px; margin: 0 0 6px; color: inherit; }
h2 { font-size: 17px; margin: 0 0 10px; color: var(--blauw-donker); }
.muted { color: var(--grijs); }
.klein { font-size: 13px; }
.fout { color: var(--rood); font-weight: 600; }
.ok { color: var(--groen); font-weight: 600; }

input, select, button { font: inherit; }
input, select {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--zand-donker);
  border-radius: 10px; background: #fff; color: var(--tekst);
}
input:focus, select:focus { outline: 2px solid var(--blauw-mid); border-color: var(--blauw-mid); }
label { display: block; margin: 0 0 10px; font-weight: 600; font-size: 14px; color: var(--blauw-donker); }
label input, label select { margin-top: 5px; font-weight: 400; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.btn {
  padding: 10px 16px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--zand-donker); color: var(--blauw-donker); font-weight: 700;
  min-height: 44px;
}
.btn.primary { background: var(--blauw); color: #fff; }
.btn.gevaar { background: #f3ded9; color: var(--rood); }
.btn.breed { width: 100%; padding: 14px; font-size: 17px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.klein-btn { padding: 4px 10px; font-size: 12px; }

.recente { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.recente a {
  background: var(--zand); border-radius: 8px; padding: 6px 10px;
  text-decoration: none; color: var(--blauw-donker); font-size: 13px; font-weight: 600;
}

/* klok */
.klok-card { text-align: center; }
.w-kop { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.chip {
  background: var(--blauw-licht); color: var(--blauw-donker);
  border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 700;
}
.chip.live { background: #dcedc8; color: var(--groen); }
.chip.voorbij { background: var(--zand-donker); color: var(--grijs); }
.klok {
  font-family: ui-monospace, Menlo, monospace; font-size: 44px; font-weight: 700;
  color: var(--blauw-donker); margin: 6px 0 2px; letter-spacing: 2px;
}
.klok.bijna { color: var(--rood); }

/* tabs */
.tabs {
  position: sticky; top: 46px; z-index: 15;
  display: flex; gap: 4px; overflow-x: auto;
  background: var(--zand); padding: 8px 0;
}
.tabs button {
  flex: 1; white-space: nowrap; border: none; border-radius: 999px;
  padding: 9px 12px; background: #fff; color: var(--grijs); font-weight: 700; cursor: pointer;
  box-shadow: 0 1px 3px rgba(42,39,33,.08); font-size: 13.5px;
  min-height: 42px;
}
.tabs button.actief { background: var(--blauw); color: #fff; }

/* kaart */
.kaart-houder { width: 100%; overflow-x: auto; border-radius: 10px; -webkit-overflow-scrolling: touch; }
.kaart-houder svg { min-width: 700px; width: 100%; height: auto; display: block; }
.kaart-legenda { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--grijs); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--kaart-blauw); vertical-align: -1px; }
.dot.vrij { background: #fff; }
.dot.bezet { background: var(--kaart-blauw); }
.dot.mijn { background: var(--groen); border-color: var(--groen); }
.dot.keuze { background: var(--oranje); border-color: var(--oranje); }
.melding {
  background: #fdf3e3; border: 1.5px solid var(--oranje); color: #8a5313;
  border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-weight: 600;
}
.melding.groen { background: #eaf5e9; border-color: var(--groen); color: var(--groen); }
#stek-actie { margin-top: 10px; }

/* stek-status via klassen op de svg-groepen (alleen de zichtbare stip) */
.stek.bezet .stek-dot { fill: var(--kaart-blauw); }
.stek.bezet text { fill: #fff; }
.stek.mijn .stek-dot { fill: var(--groen); stroke: var(--groen); }
.stek.mijn text { fill: #fff; }
.stek.keuze .stek-dot { fill: var(--oranje); stroke: var(--oranje); }
.stek.keuze text { fill: #fff; }
.stek.kiesbaar .stek-dot { stroke-width: 2.2; stroke: var(--oranje); }

/* loting */
.loting-rij {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px;
  border-bottom: 1px solid var(--zand); font-size: 15px;
}
.loting-rij:last-child { border-bottom: none; }
.lotnr {
  background: var(--zand); border-radius: 8px; min-width: 30px; text-align: center;
  font-weight: 800; color: var(--blauw-donker); padding: 4px 0;
}
.loting-rij.beurt { background: #fdf3e3; border-radius: 8px; }
.loting-rij .stekjes { margin-left: auto; font-weight: 700; color: var(--blauw); white-space: nowrap; }

/* klassement */
.schakel { display: flex; gap: 6px; margin-bottom: 12px; }
.schakel button {
  flex: 1; border: none; border-radius: 10px; padding: 9px; font-weight: 700;
  background: var(--zand); color: var(--grijs); cursor: pointer;
}
.schakel button.actief { background: var(--blauw); color: #fff; }
table.klassement { width: 100%; border-collapse: collapse; }
table.klassement th { text-align: left; font-size: 12px; color: var(--grijs); padding: 6px 8px; border-bottom: 2px solid var(--zand-donker); }
table.klassement td { padding: 9px 8px; border-bottom: 1px solid var(--zand); font-size: 15px; }
table.klassement td.r { text-align: right; font-variant-numeric: tabular-nums; }
table.klassement th.r { text-align: right; }
.rank { font-weight: 800; color: var(--blauw-donker); }
.rank.goud { color: #b8860b; }
.rank.zilver { color: #7d7d7d; }
.rank.brons { color: #a0522d; }
td .thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; cursor: pointer; display: block; }

/* vangstenfeed */
.vangst-kaart {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--zand);
}
.vangst-kaart:last-child { border-bottom: none; }
.vangst-kaart img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; cursor: pointer; }
.vangst-kaart .info { flex: 1; }
.vangst-kaart .gewicht { font-size: 18px; font-weight: 800; color: var(--blauw-donker); }
.vangst-kaart .wie { font-weight: 600; }
.vangst-kaart .tijd { color: var(--grijs); font-size: 12.5px; }

/* foto-invoer */
.fotoknop input[type=file] { display: none; }
.fotoknop span {
  display: block; text-align: center; padding: 14px; border: 2px dashed var(--blauw-mid);
  border-radius: 10px; color: var(--blauw-mid); font-weight: 700; cursor: pointer; margin-top: 5px;
}
.preview { max-width: 100%; border-radius: 10px; margin: 4px 0 10px; max-height: 260px; object-fit: contain; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(10,20,30,.92); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 95vw; max-height: 90vh; border-radius: 8px; }
.lightbox .sluit { position: absolute; top: 14px; right: 20px; color: #fff; font-size: 26px; cursor: pointer; }

.codegroot { font-family: ui-monospace, Menlo, monospace; font-size: 20px; letter-spacing: 3px; color: var(--blauw-donker); }

/* beheer-lijsten */
.b-rij { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--zand); flex-wrap: wrap; }
.b-rij:last-child { border-bottom: none; }
.b-rij .naam { flex: 1; font-weight: 600; min-width: 140px; }
.b-rij input.gewicht-edit { width: 90px; padding: 6px 8px; }

@media (max-width: 560px) {
  .klok { font-size: 36px; }
  .tabs { top: 42px; }
  .tabs button { font-size: 12px; padding: 8px 8px; }
}

textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--zand-donker);
  border-radius: 10px; font: inherit; font-size: 16px; margin-bottom: 8px; resize: vertical;
}
textarea:focus { outline: 2px solid var(--blauw-mid); border-color: var(--blauw-mid); }
.push-rij { margin-top: 8px; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--blauw-donker); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-weight: 700; z-index: 90; box-shadow: 0 4px 14px rgba(0,0,0,.3); max-width: 92vw;
}
.toast[hidden] { display: none; }
.leden { color: var(--grijs); font-weight: 400; font-size: 13px; }

/* rolkeuze op de homepagina */
.rolknoppen { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.rolknop {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 16px 18px; border: 2px solid var(--zand-donker); border-radius: 14px;
  background: #fff; cursor: pointer; font-size: 17px; text-align: left;
}
.rolknop b { color: var(--blauw-donker); }
.rolknop span { margin-left: auto; color: var(--grijs); font-size: 13px; text-align: right; }
.rolknop.actief { border-color: var(--blauw); background: var(--blauw-licht); }
.rolform { margin-top: 4px; }

/* organisatie-omgeving */
.org-w { border: 1.5px solid var(--zand-donker); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.org-w-kop { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.org-codes { margin: 6px 0; }
.klein-code { font-size: 14px; letter-spacing: 2px; }
.org-acties { margin-top: 8px; flex-wrap: wrap; }
.org-acties .btn { flex: 0 1 auto; }

/* opbouw totaalgewicht per vis */
.opbouw { color: var(--grijs); font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }
