/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --paars: #5C4AE4;
  --paars-licht: #7B6AFF;
  --paars-donker: #3D30C4;
  --rood: #FF4757;
  --groen: #2ED573;
  --groen-donker: #26B562;
  --geel: #FFD700;
  --oranje: #FF9F43;
  --bg: #F0EDF8;
  --kaart: #FFFFFF;
  --tekst: #1A1A2E;
  --tekst-licht: #6B7280;
  --radius: 16px;
  --schaduw: 0 4px 20px rgba(92, 74, 228, 0.15);
  --schaduw-groot: 0 8px 32px rgba(92, 74, 228, 0.2);
}

html {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--tekst);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SCHERMEN ===== */
.scherm {
  display: none;
  min-height: 100vh;
  padding: 0 0 env(safe-area-inset-bottom);
}
.scherm.actief { display: flex; flex-direction: column; }

/* ===== STARTSCHERM ===== */
.start-header {
  background: linear-gradient(135deg, var(--paars) 0%, var(--paars-licht) 100%);
  padding: 24px 20px 32px;
  border-radius: 0 0 28px 28px;
  color: white;
}

.app-naam {
  font-size: 28px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.stats-balk {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.2);
  padding: 8px 14px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.stat-icoon { font-size: 18px; }

.stat-item span:nth-child(2) {
  font-size: 20px;
  font-weight: 800;
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
}

/* ===== MODULE GRID ===== */
.modules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 20px 16px;
}

.module-kaart {
  background: var(--kaart);
  border-radius: var(--radius);
  padding: 18px 14px;
  box-shadow: var(--schaduw);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 2px solid transparent;
  user-select: none;
  -webkit-user-select: none;
}

.module-kaart:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.module-icoon {
  font-size: 32px;
  text-align: center;
}

.module-naam {
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  color: var(--tekst);
  line-height: 1.2;
}

.module-beschrijving {
  font-size: 11px;
  color: var(--tekst-licht);
  text-align: center;
  line-height: 1.3;
}

/* Voortgangsring */
.voortgang-ring-container {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.voortgang-ring {
  position: relative;
  width: 52px;
  height: 52px;
}

.voortgang-ring svg {
  transform: rotate(-90deg);
}

.voortgang-ring .ring-bg {
  fill: none;
  stroke: #E8E4F8;
  stroke-width: 5;
}

.voortgang-ring .ring-vul {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.voortgang-ring .ring-tekst {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
  font-size: 11px;
  font-weight: 800;
  color: var(--tekst);
}

.knop-statistieken {
  margin: 0 16px 20px;
  padding: 14px;
  background: white;
  border: 2px solid var(--paars);
  color: var(--paars);
  border-radius: var(--radius);
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  box-shadow: var(--schaduw);
}

.knop-statistieken:active {
  background: var(--paars);
  color: white;
}

/* ===== OEFENSCHERM ===== */
.oefen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.knop-terug {
  background: var(--bg);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  color: var(--tekst);
}

.voortgang-balk-container {
  flex: 1;
  height: 10px;
  background: #E8E4F8;
  border-radius: 10px;
  overflow: hidden;
}

.voortgang-balk {
  height: 100%;
  background: linear-gradient(90deg, var(--paars), var(--paars-licht));
  border-radius: 10px;
  transition: width 0.4s ease;
  width: 0%;
}

#oefen-levens {
  font-size: 18px;
  flex-shrink: 0;
}

.oefen-inhoud {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 16px;
  overflow-y: auto;
}

/* ===== VRAAGKAART ===== */
.vraag-kaart {
  background: white;
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--schaduw);
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.vraag-type-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--tekst-licht);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.vraag-tekst {
  font-size: 22px;
  font-weight: 800;
  color: var(--tekst);
  line-height: 1.3;
}

.vraag-subtekst {
  font-size: 14px;
  color: var(--tekst-licht);
  margin-top: 4px;
}

/* ===== MULTIPLE CHOICE ===== */
.opties-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.optie-knop {
  background: white;
  border: 2.5px solid #E8E4F8;
  border-radius: var(--radius);
  padding: 16px 18px;
  font-family: 'Nunito', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--tekst);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  width: 100%;
  min-height: 54px;
}

.optie-knop:active {
  transform: scale(0.98);
}

.optie-knop.correct {
  background: #E8FFF0;
  border-color: var(--groen);
  color: var(--groen-donker);
}

.optie-knop.fout {
  background: #FFF0F0;
  border-color: var(--rood);
  color: var(--rood);
}

.optie-knop:disabled {
  cursor: default;
}

/* ===== TYPEN / FILL-IN ===== */
.typ-sectie {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.accent-knoppen {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.accent-knop {
  background: white;
  border: 2px solid #E8E4F8;
  border-radius: 8px;
  padding: 6px 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  color: var(--paars);
  transition: background 0.1s;
  min-width: 36px;
  text-align: center;
}

.accent-knop:active {
  background: var(--paars);
  color: white;
}

.typ-invoer {
  width: 100%;
  padding: 16px 18px;
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 700;
  border: 2.5px solid #E8E4F8;
  border-radius: var(--radius);
  outline: none;
  color: var(--tekst);
  background: white;
  transition: border-color 0.2s;
}

.typ-invoer:focus {
  border-color: var(--paars);
  box-shadow: 0 0 0 3px rgba(92, 74, 228, 0.15);
}

.typ-invoer.correct {
  border-color: var(--groen);
  background: #E8FFF0;
  color: var(--groen-donker);
}

.typ-invoer.fout {
  border-color: var(--rood);
  background: #FFF0F0;
  animation: schud 0.4s ease;
}

@keyframes schud {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.knop-controleer {
  padding: 16px;
  background: var(--paars);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: 'Nunito', sans-serif;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
  min-height: 54px;
}

.knop-controleer:active {
  background: var(--paars-donker);
  transform: scale(0.98);
}

.knop-controleer:disabled {
  background: #C4BAF5;
  cursor: default;
}

/* ===== FEEDBACK BALK ===== */
.feedback-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  pointer-events: none;
}

.feedback-overlay.actief {
  pointer-events: auto;
}

.verborgen { display: none !important; }

.feedback-balk {
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 14px;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.feedback-balk.correct-balk {
  background: var(--groen);
}

.feedback-balk.fout-balk {
  background: var(--rood);
}

.feedback-icoon {
  font-size: 28px;
  flex-shrink: 0;
}

.feedback-tekst {
  color: white;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
}

.feedback-tekst .correct-antwoord {
  font-size: 18px;
  font-weight: 900;
  display: block;
  margin-top: 2px;
}

/* ===== RESULTAATSCHERM ===== */
.resultaat-inhoud {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
  text-align: center;
}

.resultaat-emoji {
  font-size: 72px;
  margin-bottom: 16px;
  animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

.resultaat-titel {
  font-size: 28px;
  font-weight: 900;
  color: var(--tekst);
  margin-bottom: 8px;
}

.resultaat-subtitel {
  font-size: 16px;
  color: var(--tekst-licht);
  margin-bottom: 28px;
}

.resultaat-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.resultaat-stat {
  background: white;
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--schaduw);
  min-width: 100px;
}

.resultaat-stat-getal {
  font-size: 28px;
  font-weight: 900;
  display: block;
}

.resultaat-stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--tekst-licht);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.xp-badge {
  background: linear-gradient(135deg, var(--geel), var(--oranje));
  color: white;
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 28px;
  box-shadow: 0 4px 16px rgba(255, 159, 67, 0.4);
}

.resultaat-knoppen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.knop-opnieuw, .knop-modules {
  padding: 16px;
  border-radius: var(--radius);
  font-family: 'Nunito', sans-serif;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
  min-height: 54px;
  border: none;
}

.knop-opnieuw:active, .knop-modules:active {
  transform: scale(0.97);
}

.knop-opnieuw {
  background: var(--paars);
  color: white;
}

.knop-modules {
  background: white;
  color: var(--paars);
  border: 2.5px solid var(--paars);
}

/* ===== STATISTIEKENSCHERM ===== */
.stat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stat-header h2 {
  font-size: 20px;
  font-weight: 800;
}

.stat-inhoud {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.stat-kaart {
  background: white;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--schaduw);
}

.stat-kaart h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--tekst-licht);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 14px;
}

/* Totalen grid */
.totalen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.totaal-item {
  text-align: center;
}

.totaal-getal {
  font-size: 28px;
  font-weight: 900;
  color: var(--paars);
  display: block;
}

.totaal-label {
  font-size: 12px;
  color: var(--tekst-licht);
  font-weight: 600;
}

/* XP grafiek */
.grafiek-container {
  width: 100%;
  height: 120px;
  position: relative;
}

.grafiek-bar {
  position: absolute;
  bottom: 20px;
  background: linear-gradient(180deg, var(--paars-licht), var(--paars));
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
}

.grafiek-datum {
  position: absolute;
  bottom: 0;
  font-size: 9px;
  color: var(--tekst-licht);
  font-weight: 600;
  transform: translateX(-50%);
}

/* Module voortgang */
.module-voortgang-rij {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.module-voortgang-naam {
  font-size: 14px;
  font-weight: 700;
  min-width: 80px;
}

.module-voortgang-balk-container {
  flex: 1;
  height: 10px;
  background: #E8E4F8;
  border-radius: 10px;
  overflow: hidden;
}

.module-voortgang-balk {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s ease;
}

.module-voortgang-pct {
  font-size: 13px;
  font-weight: 800;
  color: var(--paars);
  min-width: 36px;
  text-align: right;
}

/* Streak info */
.streak-info {
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.streak-getal {
  font-size: 40px;
  font-weight: 900;
  color: var(--oranje);
  display: block;
}

.streak-label {
  font-size: 13px;
  color: var(--tekst-licht);
  font-weight: 600;
}

/* ===== CONFETTI ===== */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* ===== ANIMATIES ===== */
.pulse {
  animation: pulse 0.3s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ===== VERVOEGEN / ADJECTIEF ===== */
.vraag-context {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 15px;
  color: var(--tekst-licht);
  font-weight: 600;
}

.vraag-context strong {
  color: var(--paars);
  font-weight: 800;
}

/* ===== LEGE STAAT / LAAD ===== */
.laad-tekst {
  text-align: center;
  padding: 40px 20px;
  color: var(--tekst-licht);
  font-size: 16px;
  font-weight: 600;
}

/* ===== RESPONSIEF ===== */
@media (min-width: 480px) {
  .start-header { padding: 28px 28px 36px; }
  .modules-grid { padding: 24px; gap: 16px; }
  .vraag-tekst { font-size: 24px; }
  .knop-statistieken { margin: 0 24px 24px; }
  .oefen-inhoud { padding: 24px; }
}

@media (min-width: 640px) {
  body { max-width: 480px; margin: 0 auto; }
  body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #E0DAF5;
    z-index: -1;
  }
  .scherm { box-shadow: 0 0 40px rgba(0,0,0,0.1); }
}
