/* Puntly companion — mobile first. Rustige, hoog-contrast interface die ook
   in fel zonlicht op de baan leesbaar is. */

:root {
  color-scheme: light dark;
  --groen: #12855a;
  --groen-licht: #1faa6b;
  --koraal: #e2492c;
  --navy: #08201c;
  --bg: #f4f7f5;
  --paneel: #ffffff;
  --rand: #dfe7e3;
  --tekst: #0d1f1b;
  --zacht: #5b736c;
  --schaduw: 0 1px 2px rgba(8, 32, 28, .06), 0 6px 18px rgba(8, 32, 28, .06);
  --radius: 14px;
  --tab: 62px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #071210;
    --paneel: #0f1c19;
    --rand: #1e2f2b;
    --tekst: #eaf3f0;
    --zacht: #91a9a2;
    --schaduw: none;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--tekst);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(var(--tab) + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--groen); }

/* ------------------------------- Structuur ------------------------------- */

header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px calc(12px) 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: var(--paneel);
  border-bottom: 1px solid var(--rand);
}
.merk { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -.01em; }
.merk .stip { width: 10px; height: 10px; border-radius: 50%; background: var(--groen-licht); }
.merk small { display: block; font-weight: 500; font-size: 11px; color: var(--zacht); letter-spacing: 0; }

main { max-width: 720px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }

h1 { font-size: 22px; line-height: 1.25; letter-spacing: -.015em; }
h2 { font-size: 17px; letter-spacing: -.01em; }
h3 { font-size: 14px; color: var(--zacht); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
p.uitleg { color: var(--zacht); font-size: 14px; }

.kaart {
  background: var(--paneel);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--schaduw);
  display: grid;
  gap: 12px;
}
.rij { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kolom { display: grid; gap: 8px; }
.stapel { display: grid; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------- Knoppen -------------------------------- */

button, .knop {
  font: inherit;
  font-weight: 650;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 12px 16px;
  min-height: 46px;
  background: var(--groen);
  color: #fff;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:active, .knop:active { filter: brightness(.94); }
button[disabled] { opacity: .5; cursor: default; }
button.stil, .knop.stil { background: transparent; color: var(--tekst); border-color: var(--rand); }
button.gevaar { background: var(--koraal); }
button.klein { min-height: 38px; padding: 8px 12px; font-size: 14px; border-radius: 9px; }
button.breed, .knop.breed { width: 100%; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--groen-licht);
  outline-offset: 2px;
}

/* ------------------------------ Formulieren ------------------------------ */

label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
label .hint { font-weight: 400; color: var(--zacht); font-size: 12px; }
input[type=text], input[type=number], select {
  font: inherit;
  padding: 11px 12px;
  min-height: 46px;
  border-radius: 11px;
  border: 1px solid var(--rand);
  background: var(--bg);
  color: var(--tekst);
  width: 100%;
}
.twee { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .twee { grid-template-columns: 1fr; } }
fieldset { border: 0; display: grid; gap: 12px; }
legend { font-size: 14px; font-weight: 700; padding-bottom: 4px; }
.keuze { display: grid; gap: 8px; }
.keuze .optie {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--rand); border-radius: 11px; padding: 12px; cursor: pointer;
}
.keuze .optie[data-actief="1"] { border-color: var(--groen); box-shadow: inset 0 0 0 1px var(--groen); }
.keuze .optie span.titel { font-weight: 650; display: block; }
.keuze .optie span.sub { font-size: 13px; color: var(--zacht); }
.kleurkeuze { display: flex; gap: 8px; flex-wrap: wrap; }
.kleurkeuze button {
  width: 34px; height: 34px; min-height: 34px; border-radius: 50%; padding: 0;
  border: 2px solid transparent;
}
.kleurkeuze button[data-actief="1"] { border-color: var(--tekst); }
.fout { color: var(--koraal); font-size: 14px; }

/* ------------------------------- Navigatie ------------------------------- */

nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--paneel); border-top: 1px solid var(--rand);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
nav.tabs a {
  display: grid; place-items: center; gap: 2px;
  padding: 9px 4px; font-size: 11px; font-weight: 600;
  color: var(--zacht); text-decoration: none; min-height: var(--tab);
}
nav.tabs a[aria-current="page"] { color: var(--groen); }
nav.tabs a .icoon { font-size: 18px; line-height: 1; }

/* -------------------------------- Score --------------------------------- */

.scorepaneel { display: grid; gap: 12px; }
.scoregrid { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.teamrij {
  display: grid; grid-template-columns: 14px 1fr auto auto; gap: 12px; align-items: center;
  padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--rand);
}
.teamrij .balk { width: 6px; height: 34px; border-radius: 3px; }
.teamrij .teamnaam { font-weight: 700; }
.teamrij .spelers { font-size: 13px; color: var(--zacht); }
.teamrij .setjes { display: flex; gap: 8px; font-weight: 700; color: var(--zacht); }
.teamrij .setjes .nu { color: var(--tekst); }
.teamrij .punt { font-size: 30px; font-weight: 800; min-width: 62px; text-align: right; font-variant-numeric: tabular-nums; }
.teamrij .serv { font-size: 11px; color: var(--groen); font-weight: 700; }

.punten2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.punten2 button { min-height: 76px; font-size: 16px; flex-direction: column; gap: 2px; line-height: 1.2; }
.punten2 button small { font-weight: 500; opacity: .85; font-size: 12px; }

.statusregel { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--zacht); }
.stip-status { width: 9px; height: 9px; border-radius: 50%; background: var(--zacht); flex: 0 0 auto; }
.ok .stip-status { background: var(--groen-licht); }
.retry .stip-status { background: #d69a1c; }
.off .stip-status { background: var(--koraal); }

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 26px; font-weight: 700; letter-spacing: .22em;
  background: var(--bg); border: 1px solid var(--rand); border-radius: 11px;
  padding: 10px 12px; text-align: center;
}
.codeblok { display: grid; gap: 8px; }
.qrvak { display: grid; place-items: center; padding: 8px; }
.qrvak svg { width: 190px; height: 190px; }

/* --------------------------------- Lijst -------------------------------- */

.lijst { display: grid; gap: 10px; }
.item {
  display: grid; gap: 4px; padding: 12px; border: 1px solid var(--rand);
  border-radius: 12px; background: var(--paneel); text-decoration: none; color: inherit;
}
.item .titel { font-weight: 700; }
.item .sub { font-size: 13px; color: var(--zacht); }
.item .uitslag { font-weight: 700; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: right; padding: 9px 6px; border-bottom: 1px solid var(--rand); }
th:first-child, td:first-child { text-align: left; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--zacht); font-weight: 700; }
.tabelvak { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.leeg { text-align: center; padding: 28px 12px; color: var(--zacht); display: grid; gap: 6px; }
.leeg .groot { font-size: 20px; font-weight: 700; color: var(--tekst); }

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 700; background: var(--bg); border: 1px solid var(--rand); color: var(--zacht);
}
.badge.live { background: var(--groen); color: #fff; border-color: transparent; }
.badge.pauze { background: #d69a1c; color: #fff; border-color: transparent; }
.badge.klaar { background: var(--navy); color: #fff; border-color: transparent; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab) + 16px); transform: translate(-50%, 12px);
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 50; max-width: 90vw; text-align: center;
}
.toast--zichtbaar { opacity: 1; transform: translate(-50%, 0); }
.toast--fout { background: var(--koraal); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
