/* =====================================================================
   Mijn11Tal: huisstijl
   Mobiel eerst. Alles boven 900px is een uitbreiding, geen uitgangspunt.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@100..125,400..800&display=swap');

:root {
  /* Kleur */
  --veld:        #0F2018;  /* diep grasgroen, de inkt van de app */
  --veld-op:     #1B3025;  /* iets lichter, voor vlakken op donker */
  --veld-rand:   #2C4536;
  --papier:      #F1F3EE;  /* ondergrond */
  --wit:         #FFFFFF;
  --lijn:        #DFE4DA;  /* krijtlijn: randen */
  --gras:        #157F4A;  /* acties */
  --gras-diep:   #10633A;
  --gras-licht:  #E8F2EB;
  --licht:       #F2B01E;  /* lichtmast: het enige dat schreeuwt */
  --licht-zacht: #FFF6E0;
  --kaart:       #C93A2B;  /* rood: kaarten en openstaand */
  --kaart-zacht: #FBEDEA;
  --tekst:       #14211A;
  --zacht:       #5C6B60;
  --flauw:       #8E9C91;

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --nav-h: 62px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; overflow-x: hidden; }

body {
  font-family: 'Archivo', system-ui, -apple-system, sans-serif;
  font-variation-settings: 'wdth' 100;
  background: var(--papier);
  color: var(--tekst);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  /* Alleen verticaal laten scrollen, anders "wiebelt" het scherm bij
     een niet-helemaal-recht vingerbeweging op mobiel. */
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

/* Uitgerekt en zwaar: koppen, cijfers, scores. */
.uit {
  font-variation-settings: 'wdth' 122;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.cijfer {
  font-variation-settings: 'wdth' 118;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 { margin: 0; font-variation-settings: 'wdth' 122; font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p  { margin: 0; }

button, input, select { font-family: inherit; font-size: 15px; }
button { cursor: pointer; }

:focus-visible { outline: 2px solid var(--gras); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- merk */
.merk {
  font-variation-settings: 'wdth' 122;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 18px;
  color: var(--wit);
}
.merk b { color: var(--licht); font-weight: 800; }

/* -------------------------------------------------------------- balken */
.bovenbalk {
  background: var(--veld);
  color: var(--wit);
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.bovenbalk .titel { font-size: 16px; font-variation-settings: 'wdth' 122; font-weight: 700; }
.bovenbalk .sub { font-size: 12px; color: #93A899; margin-top: 1px; }

.terug {
  background: none; border: none; color: #B9C9BE; padding: 4px;
  display: flex; align-items: center; gap: 6px; font-size: 14px;
}

.icoonknop {
  background: rgba(255,255,255,.08); border: none; color: var(--wit);
  width: 34px; height: 34px; border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.icoonknop:hover { background: rgba(255,255,255,.16); }

/* ------------------------------------------------------------ inhoud */
main { padding: 18px 16px 28px; max-width: 720px; margin: 0 auto; }
.sectiekop { margin-bottom: 14px; }
.sectiekop p { color: var(--zacht); font-size: 14px; margin-top: 3px; }

/* ------------------------------------------------------- wedstrijdkaart */
.matchday {
  background: var(--veld);
  color: var(--wit);
  border-radius: var(--r-l);
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
}
/* Krijtlijn in de hoek: verwijzing naar het veld, geen versiering zonder reden. */
.matchday::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 170px; height: 170px;
  border: 2px solid rgba(242,176,30,.16);
  border-radius: 50%;
}
.matchday .wanneer {
  font-size: 13px; color: var(--licht); font-weight: 600;
  text-transform: none; margin-bottom: 8px;
}
.matchday .tegen { font-size: 27px; line-height: 1.12; }
.matchday .plek { font-size: 14px; color: #93A899; margin-top: 6px; }
.matchday .beurten {
  display: flex; flex-direction: column; gap: 8px; margin-top: 20px;
  border-top: 1px solid var(--veld-rand); padding-top: 16px;
}
.matchday .beurt { min-width: 0; }
.matchday .beurt .wat { font-size: 12px; color: #93A899; }
.matchday .beurt .wie {
  font-size: 15px; font-weight: 600;
}
.matchday.leeg { background: var(--veld-op); }

/* Op de wedstrijdenpagina is de eerstvolgende wedstrijd een hele kaart: een
   donkere kop met daaronder de gewone regels, zodat alles blijft werken. */
.kaart.volgende { border: 2px solid var(--gras); box-shadow: 0 4px 18px rgba(21,127,74,.14); }
.kaart.laatste { border: 2px solid var(--veld); box-shadow: 0 4px 18px rgba(15,32,24,.14); }
.matchday .uitslag { font-size: 29px; line-height: 1.1; flex-shrink: 0; }
/* Bij een gespeelde wedstrijd is de uitslag de hoofdzaak, dus staat de
   tegenstander daar iets kleiner naast. */
.kaart.laatste .tegen { font-size: 23px; }
.matchday.kop { border-radius: 0; padding: 18px 18px 20px; }
.matchday .etiket {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: #8DA79A; margin-bottom: 9px;
}

/* De wedstrijden daarna staan als compacte regel in de lijst en klappen open
   als je erop tikt. Zo blijft de pagina kort en scan je op datum. */
.wrij > summary {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; cursor: pointer; list-style: none;
}
.wrij > summary::-webkit-details-marker { display: none; }
.wrij > summary:hover { background: #F7F9F5; }
.wrij-mid { flex: 1; min-width: 0; }
.wrij-mid .hoofd { display: flex; align-items: baseline; gap: 6px; font-size: 15px; }
.wrij-mid .hoofd .naam {
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wrij-mid .hoofd .streep { color: var(--flauw); font-weight: 400; flex-shrink: 0; }
.wrij-mid .hoofd .plek { color: var(--zacht); white-space: nowrap; flex-shrink: 0; }
.wrij[open] > summary { border-bottom: 1px solid var(--lijn); }
.wrij[open] > summary > .vouw-pijl { transform: rotate(90deg); }
.statvouw[open] .vouw-pijl { transform: rotate(90deg); }

/* Kalenderblaadje links van elke wedstrijd. */
.datumblok {
  flex-shrink: 0; width: 46px; padding: 5px 0; border-radius: 10px;
  background: #F2F5EF; text-align: center; line-height: 1.2;
}
.datumblok .dag, .datumblok .maand {
  display: block; font-size: 10px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--zacht);
}
.datumblok .nr {
  display: block; font-size: 17px; font-weight: 700;
  font-variation-settings: 'wdth' 118;
}

/* Waar jouw eigen naam staat, is die dikgedrukt. */
.eigen { font-weight: 800; }

/* De keuze tussen komend en gespeeld blijft bij het scrollen in beeld. De
   afstand tot boven wordt in team.html opgemeten, want de bovenbalk is niet
   overal even hoog. */
.keuze.plak {
  position: sticky; top: 0; z-index: 20;
  background: var(--papier); padding: 10px 0; margin-bottom: 4px;
}

/* --------------------------------------------------------------- kaart */
.kaart {
  background: var(--wit);
  border: 1px solid var(--lijn);
  border-radius: var(--r-m);
  overflow: hidden;
}
.kaart + .kaart { margin-top: 12px; }
.kaartkop {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--lijn);
}
.kaartkop h3 { font-size: 15px; }

.regel {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 13px 16px; border-bottom: 1px solid #EDF0EA;
}
.regel:last-child { border-bottom: none; }
.regel.klik { cursor: pointer; }
.regel.klik:active { background: #F7F9F5; }
.regel.mijn { background: var(--gras-licht); }

.links { display: flex; align-items: center; gap: 11px; min-width: 0; }
.hoofd { font-size: 15px; font-weight: 600; }
.bij { font-size: 13px; color: var(--zacht); margin-top: 1px; }
.leegtekst { padding: 22px 16px; color: var(--flauw); font-size: 14px; text-align: center; }

/* ---------------------------------------------------------------- bol */
.bol {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--gras-licht); color: var(--gras-diep);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; overflow: hidden; white-space: nowrap;
  font-variation-settings: 'wdth' 118; font-weight: 700;
}
.bol.donker { background: var(--veld); color: var(--wit); }
.bol.groot { width: 56px; height: 56px; border-radius: 16px; font-size: 18px; }

/* Clublogo: altijd de hele afbeelding op een witte ondergrond. Een logo
   bijsnijden tot het niet meer klopt is erger dan een randje wit. */
.bol.logo { background: var(--wit); border: 1px solid var(--lijn); padding: 3px; }
.bol.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* -------------------------------------------------------------- labels */
.merkje {
  font-size: 12px; font-weight: 600; padding: 4px 10px;
  border-radius: 20px; white-space: nowrap;
}
.merkje.gras   { background: var(--gras-licht); color: var(--gras-diep); }
.merkje.stil   { background: #EFF1EC; color: var(--zacht); }
.merkje.licht  { background: var(--licht-zacht); color: #8A6410; }
.merkje.rood   { background: var(--kaart-zacht); color: var(--kaart); }
.merkje.donker { background: var(--veld); color: #9FB3A5; }

/* ------------------------------------------------------------- knoppen */
.knop {
  background: var(--gras); color: var(--wit); border: none;
  border-radius: 10px; padding: 12px 18px; font-size: 15px; font-weight: 600;
}
.knop:hover:not(:disabled) { background: var(--gras-diep); }
.knop:disabled { opacity: .45; cursor: default; }
.knop.vol { width: 100%; }
.knop.stil { background: var(--wit); border: 1px solid var(--lijn); color: var(--tekst); }
.knop.stil:hover { background: #F7F9F5; }
.knop.lijn { background: var(--wit); border: 1px solid var(--gras); color: var(--gras); }
.knop.gevaar { background: var(--kaart); }
.knop.klein { padding: 7px 13px; font-size: 13px; border-radius: 8px; }

/* ------------------------------------------------------------ formulier */
label { display: block; font-size: 13px; font-weight: 600; color: var(--zacht); margin-bottom: 6px; }
.veld { margin-bottom: 15px; }
input, select, textarea {
  width: 100%; padding: 12px 13px; border-radius: 10px;
  border: 1px solid var(--lijn); background: var(--wit); color: var(--tekst);
  font-size: 16px; /* onder de 16px zoomt Safari op iOS automatisch in bij focus */
}
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--gras); }
/* Een datumveld heeft op iOS een eigen minimumbreedte die zich niets aantrekt
   van width:100%. Daardoor werd het veld breder dan het venster en kon je op
   de telefoon per ongeluk zijwaarts scrollen. min-width:0 haalt die bodem weg. */
input[type=date] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; }
.paar { display: flex; gap: 10px; }
.paar > * { flex: 1; min-width: 0; }

.keuze { display: flex; gap: 8px; }
.keuze button {
  flex: 1; padding: 11px; border-radius: 10px; font-weight: 600; font-size: 14px;
  border: 1px solid var(--lijn); background: var(--wit); color: var(--zacht);
}
.keuze button.aan { background: var(--gras); border-color: var(--gras); color: var(--wit); }

/* -------------------------------------------------------------- bericht */
.bericht { border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; line-height: 1.45; }
.bericht.fout  { background: var(--kaart-zacht); border: 1px solid #EBC6C0; color: #8A2E22; }
.bericht.goed  { background: var(--gras-licht); border: 1px solid #C4DECB; color: var(--gras-diep); }
.bericht.wacht { background: var(--licht-zacht); border: 1px solid #EFD79A; color: #8A6410; }

/* --------------------------------------------------------------- venster */
.overlay {
  position: fixed; inset: 0; background: rgba(15,32,24,.5);
  display: flex; align-items: flex-end; justify-content: center; z-index: 60;
}
.venster {
  background: var(--papier); width: 100%; max-width: 460px;
  border-radius: var(--r-l) var(--r-l) 0 0;
  padding: 20px 18px calc(22px + env(safe-area-inset-bottom, 0px));
  /* Staat het toetsenbord open, dan past venster() in ui.js de hoogte aan. */
  max-height: 92vh; max-height: 92dvh;
  /* overflow-y:auto zonder expliciete overflow-x wordt door de browser stilletjes
     ook overflow-x:auto (CSS-spec-quirk), daardoor kon een iets te brede rij
     het venster zijwaarts scrollbaar maken en voelde schuin scrollen op mobiel
     als "heen en weer wiebelen". overflow-x:hidden sluit dat helemaal uit. */
  overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; touch-action: pan-y;
}
.venster-kop { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.venster-kop p { font-size: 13px; color: var(--zacht); margin-top: 3px; }
.sluit {
  background: none; border: none; color: var(--flauw); font-size: 26px; line-height: 1;
  padding: 8px; margin: -8px -8px 0 0; min-width: 44px; min-height: 44px;
}

/* ------------------------------------------------------------- navigatie */
.navbalk {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--veld);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--veld-rand);
}
.navbalk button {
  flex: 1; background: none; border: none; color: #7F9686;
  height: var(--nav-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; position: relative;
}
.navbalk button.aan { color: var(--wit); }
.navbalk button.aan::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; background: var(--licht); border-radius: 0 0 3px 3px;
}
.navbalk .stip {
  position: absolute; top: 9px; right: calc(50% - 18px);
  width: 8px; height: 8px; border-radius: 50%; background: var(--licht);
}

/* --------------------------------------------------------------- breed */
@media (min-width: 900px) {
  body { padding-bottom: 0; display: flex; min-height: 100vh; }
  .navbalk {
    position: sticky; top: 0; left: auto; right: auto; bottom: auto;
    flex-direction: column; width: 216px; height: 100vh;
    padding: 16px 12px; border-top: none; border-right: 1px solid var(--veld-rand);
    align-self: flex-start;
  }
  .navbalk .navmerk { color: var(--wit); padding: 6px 10px 20px; }
  .navbalk button {
    flex: none; flex-direction: row; justify-content: flex-start;
    gap: 11px; height: auto; padding: 11px 12px; border-radius: 10px; font-size: 14.5px;
  }
  .navbalk button.aan { background: var(--gras); color: var(--wit); }
  .navbalk button.aan::before { display: none; }
  .navbalk .stip { position: static; margin-left: auto; }
  .rechterkant { flex: 1; min-width: 0; }
  .bovenbalk { padding: 16px 28px; }
  main { padding: 26px 28px 60px; max-width: 780px; margin: 0; }
  .overlay { align-items: center; }
  .venster { border-radius: var(--r-l); padding: 24px; }
}
@media (max-width: 899px) { .navmerk { display: none; } }

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

/* Invoervak voor meerdere wedstrijden tegelijk */
textarea { font-family: inherit; line-height: 1.6; }
code {
  background: #E7EBE4; padding: 1px 6px; border-radius: 5px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px;
}
