/* Rustige, warme kleuren. Grote knoppen. Niets beweegt. */
:root {
  --achtergrond: #f7f4ef;
  --kaart: #ffffff;
  --tekst: #26323a;
  --zacht: #66727a;
  --rand: #e6e0d6;
  --accent: #4f7f8c;
  --accent-tekst: #ffffff;
  --gekozen: #e3eff1;
  --lvl1: #6cc18f;
  --lvl2: #a8d07a;
  --lvl3: #f2cf63;
  --lvl4: #f29e5c;
  --lvl5: #e5675f;
  --pil-tekst: #26323a;
  --radius: 22px;
  --schaduw: 0 1px 3px rgba(38, 50, 58, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --achtergrond: #1b2227;
    --kaart: #253038;
    --tekst: #eef2f3;
    --zacht: #a7b3b9;
    --rand: #36434c;
    --accent: #7fb3c0;
    --accent-tekst: #13202a;
    --gekozen: #2e4650;
    --schaduw: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
*, *::before, *::after { transition: none !important; animation: none !important; }

html, body {
  margin: 0;
  background: var(--achtergrond);
  color: var(--tekst);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
}
body.met-tabs #app { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

.laden { text-align: center; color: var(--zacht); margin-top: 35vh; }
h1 { font-size: 1.6rem; margin: 10px 0 6px; }
h2 { font-size: 1.05rem; margin: 26px 4px 10px; color: var(--zacht); font-weight: 700; }
h3 { font-size: 1.05rem; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.zacht { color: var(--zacht); font-size: .9rem; }
.midden { text-align: center; }

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 4px solid var(--accent);
  outline-offset: 2px;
}

/* Avatar in een gekleurd rondje (persoonlijke kleur) */
.av {
  --p: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; flex: none;
  border-radius: 50%;
  font-size: 1.6rem; line-height: 1;
  background: color-mix(in srgb, var(--p) 22%, var(--kaart));
  box-shadow: inset 0 0 0 3px var(--p);
}
.av.groot { width: 76px; height: 76px; font-size: 2.6rem; }
.av.foto { overflow: hidden; }
.av.foto img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; padding: 3px; }
.knop.bestand { cursor: pointer; margin: 0; font-weight: 700; }

/* Bovenbalk */
.balk { display: flex; align-items: center; gap: 10px; min-height: 56px; margin-bottom: 6px; }
.balk .titel { flex: 1; text-align: center; font-weight: 800; font-size: 1.2rem; }
.balk .ruimte, .terug { width: 52px; flex: none; }
.terug {
  height: 52px; border-radius: 50%;
  border: 2px solid var(--rand); background: var(--kaart);
  font-size: 1.4rem; font-weight: 700;
}

.stappen { display: flex; justify-content: center; gap: 10px; margin: 0 0 16px; }
.stappen span { width: 12px; height: 12px; border-radius: 50%; background: var(--rand); }
.stappen span.aan { background: var(--accent); }
.uitleg { text-align: center; color: var(--zacht); margin: 0 0 16px; }

/* Knoppen */
.knop {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-width: 0; min-height: 64px;
  padding: 12px 18px;
  border: 2px solid var(--rand); border-radius: var(--radius);
  background: var(--kaart); box-shadow: var(--schaduw);
  font-weight: 700; font-size: 1.05rem; text-align: center;
}
.knop .emoji { font-size: 1.7rem; line-height: 1; }
.knop.hoofd { background: var(--accent); border-color: var(--accent); color: var(--accent-tekst); }
.knop.stil { background: transparent; border-style: dashed; color: var(--zacht); box-shadow: none; }
.knop.klein { min-height: 48px; font-size: .9rem; padding: 8px 12px; }
.knop.vak { flex-direction: column; gap: 6px; min-height: 96px; }
.knop.gekozen { border-color: var(--accent); background: var(--gekozen); box-shadow: inset 0 0 0 2px var(--accent); }

.niveaus, .lijst, .acties { display: grid; gap: 12px; }
.acties { margin-top: 20px; }
.rooster { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.niveau {
  justify-content: flex-start; min-height: 80px; padding-left: 24px;
  font-size: 1.3rem; color: var(--pil-tekst);
  background: var(--kleur); border-color: var(--kleur);
}
.niveau .emoji { font-size: 2.4rem; }

.lvl-1 { --kleur: var(--lvl1); }
.lvl-2 { --kleur: var(--lvl2); }
.lvl-3 { --kleur: var(--lvl3); }
.lvl-4 { --kleur: var(--lvl4); }
.lvl-5 { --kleur: var(--lvl5); }

.pil {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 12px; border-radius: 999px;
  background: var(--kleur); color: var(--pil-tekst);
  font-weight: 700; font-size: .95rem;
}
.leeg { color: var(--zacht); font-size: .9rem; }
.nodig { font-size: .85rem; }
.tijd { font-size: .8rem; color: var(--zacht); }

/* Thuis: eigen kaart */
.ik-kaart {
  --p: var(--accent);
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--p) 30%, var(--kaart)), var(--kaart) 75%);
  box-shadow: var(--schaduw);
}
.ik-kop { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.groet { font-size: 1.35rem; font-weight: 800; }
.ik-kop .stand { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; }
.groot-knop {
  min-height: 76px; font-size: 1.25rem;
  background: color-mix(in srgb, var(--p) 78%, #1d2a31);
  border-color: transparent; color: #fff;
}
.gekregen { margin-top: 12px; text-align: center; font-weight: 700; }

/* Thuis: de anderen */
.leden { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.rij-lid {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: var(--kaart); border-radius: var(--radius); box-shadow: var(--schaduw);
  border-left: 8px solid var(--kleur, var(--rand));
}
.rij-lid .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rij-lid .naam { font-weight: 800; }
.rij-lid .stand { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.duimen { font-weight: 700; font-size: .9rem; }

.strook {
  list-style: none; margin: 0; padding: 14px 16px; display: grid; gap: 8px;
  background: var(--kaart); border-radius: var(--radius); box-shadow: var(--schaduw);
}

/* Kalmeren */
.kalm {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius); background: var(--kaart);
  border: 2px solid var(--lvl1);
  font-size: 1.1rem; font-weight: 700;
}
.kalm .emoji { font-size: 1.7rem; }

.klaar { text-align: center; padding: 50px 0 10px; }
.klaar .groot { font-size: 4.5rem; line-height: 1; }
.klaar p { font-size: 1.25rem; font-weight: 700; }

/* Inloggen */
.welkom { text-align: center; padding-top: 6vh; }
.logo { width: 76px; height: 76px; border-radius: 20px; }
.smal { max-width: 360px; margin: 20px auto 0; }
.wie { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 16px; }
.wie-knop {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 10px;
  border: 2px solid var(--rand); border-radius: var(--radius);
  background: var(--kaart); box-shadow: var(--schaduw);
  font-weight: 800; font-size: 1.1rem;
}
.pin-scherm { max-width: 340px; margin: 0 auto; text-align: center; }
.vraag { font-size: 1.35rem; font-weight: 800; margin: 8px 0 4px; }
.pin-punten { display: flex; justify-content: center; gap: 16px; margin: 14px 0 22px; }
.pin-punten span { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--p, var(--accent)); }
.pin-punten span.vol { background: var(--p, var(--accent)); }
.toetsen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.toets {
  min-height: 68px; border-radius: 50px;
  border: 2px solid var(--rand); background: var(--kaart); box-shadow: var(--schaduw);
  font-size: 1.6rem; font-weight: 700;
}
.toets.stil { background: transparent; border-style: dashed; box-shadow: none; }

/* Ik */
.kaart {
  background: var(--kaart); border-radius: var(--radius); box-shadow: var(--schaduw);
  padding: 16px 18px; margin-bottom: 12px;
}
.kaart ul { margin: 6px 0 0; padding-left: 20px; }
.kiezer { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.kiezer button {
  height: 52px; font-size: 1.7rem; border-radius: 16px;
  border: 2px solid var(--rand); background: var(--kaart);
}
.kiezer button.gekozen { border-color: var(--accent); background: var(--gekozen); box-shadow: inset 0 0 0 2px var(--accent); }
.kleuren { display: flex; flex-wrap: wrap; gap: 12px; }
.kleuren button { width: 52px; height: 52px; border-radius: 50%; border: 4px solid var(--kaart); background: var(--p); box-shadow: 0 0 0 2px var(--rand); }
.kleuren button.gekozen { box-shadow: 0 0 0 4px var(--tekst); }

/* Formulier */
label { display: block; font-weight: 700; font-size: .9rem; margin: 12px 0 6px; }
input, select, textarea {
  width: 100%; font: inherit;
  padding: 12px 14px;
  border: 2px solid var(--rand); border-radius: 14px;
  background: var(--achtergrond); color: var(--tekst);
}
textarea { min-height: 220px; }
.beheer-kop { display: flex; align-items: center; gap: 12px; }
.beheer-kop .zacht { margin-left: auto; text-align: right; }
.knoppen-rij { display: flex; gap: 10px; margin-top: 14px; }

/* Overzicht */
.weeknav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.weeknav .knop { width: 64px; min-height: 52px; flex: none; }
.weeknav .wk { flex: 1; text-align: center; font-weight: 800; }
.week-wrap { overflow-x: auto; background: var(--kaart); border-radius: var(--radius); box-shadow: var(--schaduw); padding: 6px; }
.week { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: .8rem; }
.week th { font-weight: 700; color: var(--zacht); padding: 2px; }
.week th.wie-cel { text-align: left; color: var(--tekst); white-space: nowrap; }
.week td { background: var(--achtergrond); border-radius: 8px; height: 40px; min-width: 30px; text-align: center; padding: 3px; }
.stip { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin: 1px; background: var(--kleur); }
.legende { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 10px 4px 0; font-size: .8rem; color: var(--zacht); }

/* Vaste balk onderaan */
.tabbalk {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--kaart);
  border-top: 1px solid var(--rand);
}
.tabbalk button {
  flex: 1; max-width: 128px; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 60px; padding: 6px 2px;
  border: 0; border-radius: 16px; background: transparent;
  color: var(--zacht); font-size: .72rem; font-weight: 700;
}
.tabbalk .emoji { font-size: 1.5rem; line-height: 1.1; }
.tabbalk button.actief { background: var(--gekozen); color: var(--tekst); }

#melding {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(96px + env(safe-area-inset-bottom));
  max-width: calc(100% - 32px);
  padding: 14px 20px; border-radius: 16px;
  background: var(--tekst); color: var(--achtergrond);
  font-weight: 700; z-index: 10;
}

/* Thermometer om je gevoel te kiezen: groen onderaan, rood bovenaan */
.thermo { max-width: 440px; margin: 0 auto; }
.thermo-rij {
  display: grid; grid-template-columns: 72px 1fr; align-items: stretch;
  width: 100%; min-height: 74px; padding: 0;
  border: 0; background: none; text-align: left;
}
.buis {
  position: relative; width: 44px; margin-left: 14px;
  background: var(--kaart);
  border-left: 5px solid var(--rand); border-right: 5px solid var(--rand);
}
.thermo-rij:first-child .buis { border-top: 5px solid var(--rand); border-radius: 26px 26px 0 0; }
.vulling { position: absolute; inset: 3px; background: var(--kleur); border-radius: 6px; }
.thermo-rij:first-child .vulling { border-radius: 18px 18px 6px 6px; }
.thermo-label {
  display: flex; align-items: center; gap: 12px;
  margin: 5px 0 5px 10px; padding: 0 18px;
  border: 2px solid var(--kleur); border-radius: var(--radius);
  background: color-mix(in srgb, var(--kleur) 28%, var(--kaart));
  font-size: 1.25rem; font-weight: 800;
}
.thermo-label .emoji { font-size: 2.2rem; line-height: 1; }
.bol {
  width: 72px; height: 72px; margin-top: -8px;
  border-radius: 50%; border: 5px solid var(--rand);
  background: var(--lvl1);
  box-shadow: inset 0 0 0 4px var(--kaart);
}

/* Klein metertje op Thuis */
.mini { display: inline-flex; flex-direction: column; align-items: center; flex: none; }
.mini-buis {
  position: relative; overflow: hidden;
  width: 12px; height: 38px;
  border: 2px solid var(--rand); border-bottom: 0; border-radius: 7px 7px 0 0;
  background: var(--kaart);
}
.mini-vulling { position: absolute; left: 0; right: 0; bottom: 0; background: var(--kleur, transparent); }
.mini-bol {
  width: 18px; height: 18px; margin-top: -2px;
  border-radius: 50%; border: 2px solid var(--rand);
  background: var(--kleur, var(--kaart));
}
.mini.groot .mini-buis { width: 16px; height: 58px; }
.mini.groot .mini-bol { width: 26px; height: 26px; }
.ik-kop .ik-tekst { flex: 1; min-width: 0; }

/* Foto bijsnijden */
.crop {
  position: relative; overflow: hidden;
  width: min(320px, 100%); aspect-ratio: 1; margin: 0 auto;
  border-radius: var(--radius); background: #000;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
}
.crop img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .5); border: 3px solid #fff; pointer-events: none;
}
.zoom-rij { display: flex; align-items: center; gap: 12px; max-width: 320px; margin: 18px auto 0; }
.zoom-rij input { flex: 1; padding: 0; border: 0; background: none; accent-color: var(--accent); height: 44px; }

/* Historiek aanpassen (ouders) */
.week td { padding: 0; }
.cel { width: 100%; min-height: 40px; padding: 3px; border: 0; background: none; border-radius: 8px; }
.hist-kop { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 6px; }
.knop.gevaar { background: var(--lvl5); border-color: var(--lvl5); color: #fff; }
.rooster.vijf { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.lvl-keuze { min-height: 84px; padding: 8px 2px; font-size: .68rem; overflow-wrap: anywhere; background: color-mix(in srgb, var(--kleur) 30%, var(--kaart)); border-color: var(--kleur); }
.lvl-keuze.gekozen { background: var(--kleur); color: var(--pil-tekst); }
