/* Dyslexia-first: warm cream (less glare than white), high-legibility font, generous
   spacing, big touch targets, calm colours, no clutter, no timers. OpenDyslexic from a
   CDN; degrades to other reader-friendly fonts if it fails. */
@import url('https://fonts.cdnfonts.com/css/opendyslexic');

:root {
  --cream: #FBF3E3;
  --ink: #2B2B2B;
  --green: #2E7D32;
  --warm: #C0612B;
  --navy: #2E5090;
  --soft: #E9DCC2;
}
* { box-sizing: border-box; }
/* the hidden attribute must win over the flex display below, so the two screens
   (main menu vs reading) are truly separate pages. */
[hidden] { display: none !important; }
html, body {
  margin: 0; height: 100%;
  background: var(--cream); color: var(--ink);
  font-family: 'OpenDyslexic', 'Comic Sans MS', 'Trebuchet MS', Verdana, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body { display: flex; flex-direction: column; min-height: 100dvh; user-select: none; }

/* ---------- profile picker ---------- */
.kies {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2rem; padding: 1.5rem; text-align: center;
}
.kies-titel { font-size: clamp(1.6rem, 6vw, 2.6rem); color: var(--warm); margin: 0; line-height: 1.4; }
.kies-titel .sub { font-size: 0.62em; color: #8a7c5f; }
.kaarte { display: flex; flex-wrap: wrap; gap: 1.4rem; justify-content: center; }
.kaart {
  font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  background: #fff; border: 3px solid var(--soft); border-radius: 1.6rem;
  padding: 1.4rem 1.6rem; min-width: 9.5rem;
  box-shadow: 0 4px 0 rgba(0,0,0,0.1);
}
.kaart:active { transform: translateY(2px); }
.naam { font-size: 1.6rem; color: var(--ink); }
.graad { font-size: 1rem; color: #8a7c5f; }

.avatar {
  position: relative; width: 6rem; height: 6rem; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden; color: #fff;
}
.avatar .letter { font-size: 2.6rem; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }

/* ---------- reading screen ---------- */
.speel { flex: 1; display: flex; flex-direction: column; min-height: 100dvh; }
.top {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem 1rem; color: var(--warm);
}
.kind { display: flex; align-items: center; gap: 0.5rem; font-size: 1.25rem; flex: 1; }
.mini-av { width: 2.4rem; height: 2.4rem; }
.mini-av .letter { font-size: 1.1rem; }
.mini {
  font-family: inherit; font-size: 1.6rem; width: 2.6rem; height: 2.6rem;
  border: none; border-radius: 0.7rem; background: var(--soft); color: var(--ink); cursor: pointer;
}
.taal { display: flex; gap: 0.4rem; }
.taalknop {
  font-family: inherit; font-size: 1rem; padding: 0.4rem 0.7rem;
  border: 2px solid var(--soft); border-radius: 0.7rem; background: transparent; color: #8a7c5f; cursor: pointer;
}
.taalknop.aktief { background: var(--navy); color: #fff; border-color: var(--navy); }

.stage {
  flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 1rem; gap: 1.1rem; overflow: hidden;
}
.woord {
  margin: 0; font-size: clamp(2.4rem, 13vw, 8rem);
  letter-spacing: 0.1em; word-spacing: 0.3em; line-height: 1.3; font-weight: 700;
  max-width: 94vw; overflow-wrap: anywhere; /* never spill off the page */
}
/* sentences: smaller + wrap so they always fit */
.woord.sin { font-size: clamp(1.6rem, 6.2vw, 3.4rem); letter-spacing: 0.04em; line-height: 1.4; }
.klanke { margin: 0; font-size: clamp(1.2rem, 5vw, 2rem); letter-spacing: 0.25em; color: var(--warm); min-height: 1.4em; }
.praise { margin: 0; font-size: clamp(1.4rem, 6vw, 2.6rem); color: var(--green); min-height: 1.4em; transition: transform 0.2s ease; }
.praise.pop { transform: scale(1.18); }

.knoppies { display: flex; flex-wrap: wrap; gap: 0.8rem; padding: 0.6rem 1rem 1rem; justify-content: center; }
.knop {
  font-family: inherit; font-size: clamp(1.1rem, 4.5vw, 1.5rem); min-height: 4rem; padding: 0 1.3rem;
  border: none; border-radius: 1.1rem; background: var(--soft); color: var(--ink);
  cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,0.12);
}
.knop:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.12); }
.knop.gedoen { background: #bfe3c0; color: var(--green); flex: 1 1 100%; max-width: 30rem; }
.knop.weer { background: #f3d6cf; color: var(--warm); }
.knop.luister { background: #cfe0f3; color: var(--navy); }

.voet {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  padding: 0.5rem 1.1rem 1rem; font-size: 0.92rem; color: #7a6f57; flex-wrap: wrap;
}
.tip { flex: 1; min-width: 11rem; }
.sterre { font-size: 1.1rem; }
.vlakke { display: flex; align-items: center; gap: 0.4rem; }
.vlak {
  font-family: inherit; width: 2.5rem; height: 2.5rem; border-radius: 0.7rem;
  border: 2px solid var(--soft); background: transparent; color: #7a6f57; cursor: pointer; font-size: 1.1rem;
}
.vlak.aktief { background: var(--warm); color: #fff; border-color: var(--warm); }

/* gentle time-bar (calm green, never red — it's a nudge, not a fail) */
.tydbalk { height: 0.7rem; margin: 0 1.2rem 0.5rem; background: var(--soft); border-radius: 1rem; overflow: hidden; }
.tydvul { height: 100%; width: 100%; background: #7bc47f; border-radius: 1rem; }
.tyd { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; color: #7a6f57; }
.tyd input[type='range'] { width: 6.5rem; accent-color: var(--navy); }
.tydlees { min-width: 2.6rem; }

/* Short / landscape screens (tablets held sideways): compress vertical space so
   everything still fits on one page without scrolling. */
@media (max-height: 600px) {
  .stage { gap: 0.5rem; padding: 0.5rem; }
  .woord { font-size: clamp(2rem, 11vh, 5rem); }
  .knop { min-height: 3.2rem; }
  .top { padding-top: 0.4rem; padding-bottom: 0.4rem; }
  .voet { padding-top: 0.3rem; padding-bottom: 0.5rem; }
  .kaart { padding: 1rem 1.2rem; }
  .avatar { width: 4.5rem; height: 4.5rem; }
}
