/* Servisch leren — mobile-first, rustig en fris */

:root {
  --bg: #0f172a;
  --bg-2: #111c33;
  --surface: #1a2540;
  --surface-2: #243250;
  --border: #2d3a5c;
  --text: #f8fafc;
  --text-dim: #94a3b8;
  --text-mute: #64748b;
  --accent: #ef4444;      /* Servische rood */
  --accent-2: #3b82f6;    /* blauw, koel contrast */
  --accent-3: #facc15;    /* warm geel voor XP/streak */
  --good: #22c55e;
  --bad: #f43f5e;
  --revi: #60a5fa;
  --sjertsje: #f472b6;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  --shadow-soft: 0 2px 8px rgba(0,0,0,.2);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(circle at 18% 0%, rgba(239,68,68,.10), transparent 45%),
    radial-gradient(circle at 88% 5%, rgba(59,130,246,.10), transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(250,204,21,.06), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(72px + var(--safe-bot));
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
}

.hidden { display: none !important; }

/* === TOPBAR === */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  background: linear-gradient(180deg, var(--bg) 70%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.profiles {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-radius: 999px;
  padding: 4px;
  border: 1px solid var(--border);
  max-width: calc(100vw - 100px);
  overflow-x: auto;
  scrollbar-width: none;
}
.profiles::-webkit-scrollbar { display: none; }

.profile-add .avatar {
  background: var(--surface-2) !important;
  color: var(--text-dim) !important;
}
.profile-add .name { display: none; }
.profile-add { padding: 4px !important; }

.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  transition: background .15s, color .15s;
}

.profile-btn[aria-selected="true"] {
  background: var(--bg);
  color: var(--text);
}

.profile-btn .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--surface-2);
  font-size: 13px;
}

.profile-btn[data-profile="revi"][aria-selected="true"] .avatar {
  background: var(--revi);
  color: #0a1228;
}
.profile-btn[data-profile="sjertsje"][aria-selected="true"] .avatar {
  background: var(--sjertsje);
  color: #2a0a1a;
}

.script-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  padding: 3px;
}

.script-opt {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  color: var(--text-dim);
  transition: background .15s, color .15s;
}

.script-opt.active {
  background: var(--accent-2);
  color: white;
}

/* === STATS === */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px 16px 12px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  min-width: 0;
}

.stat-icon { font-size: 20px; line-height: 1; }

.stat-body { min-width: 0; flex: 1; }

.stat-value {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-mute);
  font-weight: 600;
}

.stat-label {
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 2px;
}

.goal-ring {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  pointer-events: none;
}

.goal-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.ring-bg, .ring-fg {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
}

.ring-bg { stroke: var(--border); }
.ring-fg {
  stroke: var(--accent-3);
  stroke-dasharray: 100.5;
  stroke-dashoffset: 100.5;
  transition: stroke-dashoffset .5s ease;
}

/* === LEVEL PICKER (vervangt tabs) === */
.level-picker-row {
  padding: 0 16px 12px;
}

.level-picker-btn {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background .15s, border-color .15s;
  text-align: left;
}

.level-picker-btn:active { background: var(--surface-2); }
.level-picker-btn.lezen {
  background: linear-gradient(135deg, rgba(239,68,68,.12), rgba(239,68,68,.04));
  border-color: rgba(239,68,68,.35);
}

.lp-label {
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  flex-shrink: 0;
}

.lp-current {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.lp-arrow {
  font-size: 14px;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* Level picker modal */
.level-modal-card {
  text-align: left;
  max-width: 380px;
  width: 100%;
}

.level-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--surface-2);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  text-align: left;
}

.level-option:active { background: var(--bg-2); }
.level-option.active { border-color: var(--accent-2); background: rgba(59,130,246,.12); }
.level-option.lezen.active { border-color: var(--accent); background: rgba(239,68,68,.12); }

.level-option-code {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--bg);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
  flex-shrink: 0;
}

.level-option.active .level-option-code { background: var(--accent-2); color: white; }
.level-option.lezen.active .level-option-code { background: var(--accent); }

.level-option-text { flex: 1; min-width: 0; }
.level-option-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.level-option-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}
.level-option-check {
  font-size: 18px;
  color: var(--accent-2);
  flex-shrink: 0;
  opacity: 0;
}
.level-option.active .level-option-check { opacity: 1; }

/* === VIEW: PATH === */
.path-intro {
  padding: 16px 20px 24px;
}

.path-intro h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 6px;
}

.path-sub {
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
}

.lesson-path {
  list-style: none;
  margin: 0;
  padding: 0 16px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
}

.lesson-node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  width: 100%;
  max-width: 460px;
}

.lesson-node.right { flex-direction: row-reverse; }

.lesson-node::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -14px;
  width: 3px;
  height: 28px;
  background: var(--border);
  transform: translateX(-50%);
  border-radius: 999px;
}

.lesson-node:first-child::before { display: none; }

.lesson-bubble {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--surface);
  border: 4px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 32px;
  flex-shrink: 0;
  position: relative;
  transition: transform .15s;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0,0,0,.35), 0 10px 24px rgba(0,0,0,.25);
}

.lesson-bubble:hover:not(.locked) { transform: translateY(-2px); }
.lesson-bubble:active:not(.locked) { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.35), 0 4px 12px rgba(0,0,0,.2); }

.lesson-bubble:active { transform: scale(.94); }

.lesson-bubble.done {
  background: var(--good);
  border-color: #16a34a;
}

.lesson-bubble.skipped {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #b45309;
  opacity: .85;
}

.lesson-bubble.skipped .lesson-emoji {
  font-size: 28px;
  color: white;
}

.lesson-bubble .skip-ico {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--surface-2);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  border: 2px solid var(--bg);
  color: var(--accent-3);
}

.lesson-meta-skipped {
  font-size: 11px;
  color: #f59e0b;
  margin-top: 4px;
  font-style: italic;
}

.lesson-node.right .lesson-meta-skipped { text-align: right; }

.lesson-bubble.current {
  background: var(--accent-2);
  border-color: #2563eb;
  box-shadow: 0 0 0 6px rgba(59,130,246,.15);
  animation: pulseRing 2s ease-in-out infinite;
}

.lesson-bubble.locked {
  background: var(--bg-2);
  border-color: var(--border);
  opacity: .5;
  cursor: not-allowed;
}

.lesson-bubble.locked .lesson-emoji { filter: grayscale(1) opacity(.5); }

.lesson-bubble .lock-ico {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--surface-2);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  border: 2px solid var(--bg);
}

.lesson-info {
  flex: 1;
  min-width: 0;
}

.lesson-node.right .lesson-info { text-align: right; }

.lesson-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 2px;
  letter-spacing: -.01em;
}

.lesson-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
}

.lesson-stars {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--accent-3);
}

.lesson-node.right .lesson-stars { justify-content: flex-end; }

@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 0 6px rgba(59,130,246,.15); }
  50% { box-shadow: 0 0 0 10px rgba(59,130,246,.05); }
}

/* === VIEW: LESSON === */
.view-lesson {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bot);
}

.lesson-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) 16px 12px;
}

.back-btn, .close-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}

.skip-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  flex-shrink: 0;
}

.script-toggle-mini {
  flex-shrink: 0;
  padding: 2px;
}
.script-toggle-mini .script-opt {
  padding: 5px 9px;
  font-size: 11px;
}

.lesson-progress {
  flex: 1;
  height: 12px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.lesson-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--good), #16a34a);
  width: 0%;
  transition: width .35s ease;
  border-radius: 999px;
}

.lesson-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 20px;
  overflow-y: auto;
}

.lesson-content.scroll {
  justify-content: flex-start;
  padding-top: 16px;
}

/* CARD (woord/zin tonen) */
.card-teach {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: cardIn .4s cubic-bezier(.2,.8,.2,1);
}

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

.card-emoji {
  font-size: 80px;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.3));
}

.card-sr {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.card-pron {
  font-size: 17px;
  color: var(--accent-3);
  font-weight: 600;
  font-style: italic;
  letter-spacing: .02em;
}

.card-nl {
  font-size: 22px;
  color: var(--text-dim);
  font-weight: 500;
}

.card-note {
  font-size: 13px;
  color: var(--text-mute);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius);
  max-width: 320px;
  line-height: 1.4;
}

/* Cyrillisch-lezen view: cyrillisch BIG, daaronder latijn + uitleg */
.card-cyr-big {
  font-size: 78px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
  background: linear-gradient(135deg, #fef3c7, #fde68a 60%, #fbbf24);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 12px rgba(250,204,21,.25));
  padding: 4px 0;
}

.card-arrow {
  font-size: 22px;
  color: var(--text-mute);
  margin: -8px 0;
  line-height: 1;
}

.card-lat-mid {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .02em;
  margin-bottom: -4px;
}

.card-teach-lezen .card-emoji { font-size: 48px; margin-bottom: -6px; }
.card-teach-lezen .card-pron { font-size: 14px; }
.card-teach-lezen .card-nl { font-size: 18px; }

.speak-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-2);
  display: grid;
  place-items: center;
  font-size: 28px;
  color: white;
  margin-top: 8px;
  transition: transform .12s, background .15s;
  box-shadow: 0 4px 14px rgba(59,130,246,.4);
}

.speak-btn:active { transform: scale(.92); }
.speak-btn.speaking { background: var(--good); animation: pulseSpeak .8s ease-in-out infinite; }

/* Audio row: speak + mic naast elkaar */
.audio-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.audio-row .speak-btn { margin-top: 0; }

.mic-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 700;
  transition: transform .12s, background .15s, border-color .15s;
}

.mic-btn:active { transform: scale(.95); }

.mic-btn.listening {
  background: var(--bad);
  color: white;
  border-color: var(--bad);
  animation: micPulse 1s ease-in-out infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.5); }
  50% { box-shadow: 0 0 0 12px rgba(244, 63, 94, 0); }
}

/* Mic-feedback popup */
.mic-feedback {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bot));
  transform: translateX(-50%) translateY(40px);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 14px 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .3s cubic-bezier(.2,.8,.3,1);
  z-index: 250;
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
  max-width: 92vw;
  min-width: 200px;
}

.mic-feedback.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.mic-feedback-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mic-feedback-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.mic-feedback-heard {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 2px;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* QUIZ */
.quiz {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: cardIn .4s cubic-bezier(.2,.8,.2,1);
}

.quiz-prompt {
  text-align: center;
  margin-bottom: 16px;
}

.quiz-prompt-label {
  font-size: 13px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}

.quiz-prompt-text {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.quiz-prompt-emoji { font-size: 56px; margin-bottom: 8px; line-height: 1; }

.quiz-prompt-pron {
  font-size: 15px;
  color: var(--accent-3);
  font-style: italic;
  font-weight: 600;
  margin-top: 4px;
}

.quiz-options {
  display: grid;
  gap: 10px;
}

.quiz-option {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 17px;
  font-weight: 600;
  text-align: left;
  transition: background .15s, border-color .15s, transform .12s;
}

.quiz-option:active { transform: scale(.98); }

.quiz-option.correct {
  background: rgba(34,197,94,.15);
  border-color: var(--good);
  color: var(--good);
  animation: bounceCorrect .5s cubic-bezier(.5,1.7,.5,1);
}

.quiz-option.wrong {
  background: rgba(244,63,94,.12);
  border-color: var(--bad);
  color: var(--bad);
  animation: shakeWrong .4s ease;
}

@keyframes bounceCorrect {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

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

/* Drijvende +XP popup */
.xp-pop {
  position: fixed;
  pointer-events: none;
  z-index: 250;
  font-weight: 800;
  font-size: 22px;
  color: var(--accent-3);
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
  animation: xpPop 1.2s cubic-bezier(.2,.8,.3,1) forwards;
}

@keyframes xpPop {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.7); }
  20% { opacity: 1; transform: translate(-50%, -10px) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -80px) scale(1); }
}

/* Streak vuurtje pulst alleen als streak > 0 */
.stat.streak-active .stat-icon {
  display: inline-block;
  animation: flicker 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(251,146,60,.5));
}

@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50% { transform: scale(1.12) rotate(3deg); }
}

.quiz-option.disabled { pointer-events: none; }

/* TYPE-IN */
.type-in input {
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 18px;
  color: var(--text);
  font-family: inherit;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color .15s;
}

.type-in input:focus { border-color: var(--accent-2); }
.type-in input.correct { border-color: var(--good); color: var(--good); }
.type-in input.wrong { border-color: var(--bad); color: var(--bad); }

.lesson-footer {
  padding: 16px 20px calc(16px + var(--safe-bot));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feedback {
  display: none;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  animation: cardIn .25s;
}

.feedback.show { display: block; }
.feedback.good { background: rgba(34,197,94,.15); color: var(--good); border: 1px solid rgba(34,197,94,.3); }
.feedback.bad { background: rgba(244,63,94,.12); color: var(--bad); border: 1px solid rgba(244,63,94,.3); }

.feedback-correct {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  margin-top: 4px;
}

.primary-btn {
  background: var(--accent-2);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .01em;
  transition: transform .12s, background .15s;
  box-shadow: 0 4px 14px rgba(59,130,246,.3);
}

.primary-btn:active { transform: scale(.97); }
.primary-btn:disabled { background: var(--surface-2); color: var(--text-mute); box-shadow: none; }

.secondary-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
}

/* === VIEW: PRACTICE === */
.view-practice { padding: 16px 20px; }

.practice-intro h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 8px 0 6px;
  letter-spacing: -.02em;
}

.practice-sub {
  color: var(--text-dim);
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.5;
}

.practice-session { padding: 8px 0; }

/* === VIEW: PROGRESS === */
.view-progress { padding: 16px 20px; }

.view-progress h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 8px 0 16px;
  letter-spacing: -.02em;
}

.view-progress h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 24px 0 12px;
  color: var(--text-dim);
}

.progress-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.pc-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.pc-label {
  font-size: 12px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 2px;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

.badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  position: relative;
  transition: transform .15s;
}

.badge.unlocked { background: linear-gradient(180deg, rgba(250,204,21,.1), var(--surface)); }
.badge.locked { opacity: .4; filter: grayscale(.7); }

.badge-emoji { font-size: 32px; line-height: 1; margin-bottom: 6px; }
.badge-name { font-size: 12px; font-weight: 600; }
.badge-desc { font-size: 11px; color: var(--text-mute); margin-top: 2px; }

.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.lb-row.you { border-color: var(--accent-2); }

.lb-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px;
}

.lb-avatar.revi { background: var(--revi); color: #0a1228; }
.lb-avatar.sjertsje { background: var(--sjertsje); color: #2a0a1a; }

.lb-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-xp { font-weight: 700; color: var(--accent-3); font-size: 14px; flex-shrink: 0; }
.lb-medal { font-size: 18px; flex-shrink: 0; }
.lb-edit {
  background: none;
  border: none;
  color: var(--text-mute);
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.lb-edit:hover { background: var(--surface-2); }

/* === VIEW: TUTOR (AI chat) === */
.view-tutor {
  display: flex;
  flex-direction: column;
  padding: 0;
  height: calc(100vh - 280px);
  min-height: 480px;
}

.tutor-header {
  padding: 14px 20px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.tutor-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), #6366f1);
  display: grid; place-items: center;
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(59,130,246,.4);
}

.tutor-meta { flex: 1; min-width: 0; }
.tutor-meta h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.tutor-meta p { margin: 2px 0 0; font-size: 12px; color: var(--text-mute); }

.tutor-clear {
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

.chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 85%;
  padding: 11px 14px;
  border-radius: 18px;
  line-height: 1.4;
  font-size: 15px;
  animation: cardIn .25s cubic-bezier(.2,.8,.2,1);
  position: relative;
  word-wrap: break-word;
}

.msg.user {
  background: var(--accent-2);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.msg.assistant {
  background: var(--surface);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg-sr {
  font-weight: 600;
  font-size: 16px;
}

.msg-translate-btn {
  font-size: 11px;
  margin-top: 6px;
  color: var(--accent-2);
  font-weight: 600;
  background: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.msg.assistant .msg-translate-btn { color: var(--accent-3); }

.msg-translation {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
}

.msg-speak {
  font-size: 14px;
  margin-left: 6px;
  opacity: .6;
  cursor: pointer;
  display: inline-block;
}

.typing {
  display: flex;
  gap: 4px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
}

.typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-mute);
  animation: typing 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }

@keyframes typing {
  0%,60%,100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 10px 14px calc(10px + var(--safe-bot));
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.chat-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  min-width: 0;
}

.chat-input:focus { border-color: var(--accent-2); }

.chat-send {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent-2);
  color: white;
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(59,130,246,.4);
}

.chat-send:disabled { opacity: .5; background: var(--surface-2); box-shadow: none; }

.chat-suggestions {
  display: flex;
  gap: 6px;
  padding: 8px 14px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-suggestions::-webkit-scrollbar { display: none; }

.chat-suggestion {
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.chat-suggestion:active { background: var(--surface-2); }

.tutor-setup {
  padding: 40px 24px;
  text-align: center;
}

.tutor-setup .tutor-avatar { margin: 0 auto 16px; width: 64px; height: 64px; font-size: 30px; }
.tutor-setup h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 8px; }
.tutor-setup p { color: var(--text-dim); font-size: 14px; line-height: 1.5; margin: 0 0 20px; }
.tutor-setup code { background: var(--surface); padding: 2px 8px; border-radius: 6px; font-size: 13px; color: var(--accent-3); }

/* === BOTTOM NAV === */
.bottom-nav {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding-bottom: var(--safe-bot);
  z-index: 40;
  backdrop-filter: blur(20px);
}

/* === REISGIDS-VIEW === */
.view-guide { padding: 16px 0 0; }

.guide-header {
  padding: 4px 20px 12px;
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, var(--bg) 75%, transparent);
  z-index: 10;
}

.guide-header h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 4px 0 12px;
}

#guideSearch {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
#guideSearch:focus { border-color: var(--accent-2); }

.guide-categories {
  display: flex;
  gap: 8px;
  padding: 0 20px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.guide-categories::-webkit-scrollbar { display: none; }

.guide-cat-pill {
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.guide-cat-pill.active {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: white;
}

.guide-content {
  padding: 0 20px 24px;
}

.guide-section {
  margin-bottom: 24px;
}

.guide-section-title {
  font-size: 13px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 16px 0 10px;
  font-weight: 700;
}

.guide-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background .15s, transform .12s;
}

.guide-row:active { transform: scale(.98); background: var(--surface-2); }

.guide-row-emoji { font-size: 24px; flex-shrink: 0; }

.guide-row-text {
  flex: 1;
  min-width: 0;
}

.guide-row-nl {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.3;
}

.guide-row-sr {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.3;
  margin-top: 2px;
}

.guide-row-pron {
  font-size: 12px;
  color: var(--accent-3);
  font-style: italic;
  font-weight: 600;
  margin-top: 2px;
}

.guide-row-speak {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-2);
  display: grid;
  place-items: center;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
  transition: transform .12s, background .15s;
  border: none;
}
.guide-row-speak:active { transform: scale(.9); }
.guide-row-speak.speaking { background: var(--good); animation: pulseSpeak .8s ease-in-out infinite; }

.guide-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-mute);
  font-size: 14px;
}

.guide-verbs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-verb-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background .15s;
}

.guide-verb-row:active { background: var(--surface-2); }

.guide-verb-inf {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.guide-verb-nl {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}

.guide-verb-arrow { color: var(--text-mute); font-size: 16px; }

/* Werkwoord-popover (zelfde overlay als letter-popover, eigen content) */
.verb-popover-content {
  text-align: left;
  max-width: 380px;
}

.verb-popover-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-align: center;
  margin: 0 0 4px;
}

.verb-popover-cyr {
  font-size: 18px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 4px;
}

.verb-popover-nl {
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 14px;
  font-style: italic;
}

.verb-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
}

.verb-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-mute);
  text-align: left;
  padding: 6px 8px;
  font-weight: 700;
  background: var(--surface-2);
}

.verb-table td {
  padding: 8px 8px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.verb-table td:first-child {
  color: var(--text-mute);
  font-weight: 600;
  width: 70px;
}

.verb-table td:nth-child(2) {
  font-weight: 700;
}

.verb-table-section {
  font-size: 12px;
  color: var(--accent-3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 16px 0 4px;
}

.verb-table-note {
  font-size: 12px;
  color: var(--text-mute);
  margin: 10px 0 0;
  line-height: 1.5;
  background: var(--surface-2);
  padding: 8px 10px;
  border-radius: 8px;
}

/* Tutor scenarios */
.scenarios-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 14px 8px;
  scrollbar-width: none;
}
.scenarios-row::-webkit-scrollbar { display: none; }

.scenario-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.scenario-pill:active { background: var(--surface-2); }

.tutor-scenario-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
}
.tutor-scenario-btn:active { background: var(--surface-2); }

.nav-btn {
  padding: 10px 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-mute);
  font-weight: 600;
  transition: color .15s;
}

.nav-btn.active { color: var(--accent-2); }

.nav-ico { font-size: 22px; line-height: 1; }
.nav-label { font-size: 11px; }

/* === TOAST === */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bot));
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 200;
  box-shadow: var(--shadow);
  white-space: nowrap;
  max-width: 90vw;
  text-overflow: ellipsis;
  overflow: hidden;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.xp { background: linear-gradient(135deg, var(--accent-3), #f59e0b); color: #1a1206; border-color: transparent; }

/* === SETTINGS OVERLAY === */
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  animation: slideUp .3s cubic-bezier(.2,.8,.3,1);
  padding-bottom: var(--safe-bot);
  overflow-y: auto;
}

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

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + var(--safe-top)) 20px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}

.settings-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.settings-body {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.settings-card-label {
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
  font-weight: 700;
}

.settings-card-value {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.settings-card-sub {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.settings-logout {
  margin-top: 8px;
  background: none;
  border: 1px solid var(--bad);
  color: var(--bad);
  border-radius: 12px;
  padding: 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.settings-logout:active { background: rgba(244,63,94,.08); }

/* === AUTH OVERLAY === */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background:
    radial-gradient(circle at 30% 10%, rgba(239,68,68,.12), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(59,130,246,.12), transparent 50%),
    var(--bg);
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 24px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.auth-flag {
  font-size: 56px;
  text-align: center;
  line-height: 1;
  margin-bottom: 10px;
}

.auth-logo {
  display: block;
  width: 84px;
  height: 84px;
  border-radius: 22px;
  margin: 0 auto 12px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, .25);
}

.auth-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-align: center;
  margin: 0 0 20px;
}

.auth-tabs {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 18px;
}

.auth-tab {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
  background: none;
  border: none;
  transition: background .15s, color .15s;
}

.auth-tab.active {
  background: var(--accent-2);
  color: white;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-form input {
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  transition: border-color .15s;
  width: 100%;
  box-sizing: border-box;
}

.auth-form input:focus { border-color: var(--accent-2); }

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 20px;
  padding: 8px 10px;
  cursor: pointer;
  line-height: 1;
  opacity: .75;
  transition: opacity .15s;
}

.password-toggle:hover { opacity: 1; }
.password-toggle:active { transform: translateY(-50%) scale(.92); }

.auth-form .primary-btn {
  margin-top: 4px;
}

.auth-error {
  color: var(--bad);
  font-size: 13px;
  font-weight: 600;
  margin: 4px 0 0;
  min-height: 16px;
}

.auth-error.success { color: var(--good); }

.auth-link {
  text-align: center;
  margin: 8px 0 0;
}

.auth-link button {
  background: none;
  border: none;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 4px 8px;
}

.auth-hint {
  font-size: 13px;
  color: var(--text-mute);
  text-align: center;
  margin: 0 0 6px;
  line-height: 1.5;
}

/* === OFFLINE-BAR === */
.offline-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: linear-gradient(90deg, #d97706, #f59e0b);
  color: #1a1206;
  padding: 6px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  z-index: 700;
  animation: slideDown .35s cubic-bezier(.2,.8,.3,1);
}

.update-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: linear-gradient(90deg, var(--accent-2), #6366f1);
  color: white;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  z-index: 710;
  animation: slideDown .35s cubic-bezier(.2,.8,.3,1);
  padding-top: calc(8px + var(--safe-top));
}

.update-banner .ub-yes {
  background: white;
  color: var(--accent-2);
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.update-banner .ub-info {
  background: rgba(255,255,255,.18);
  border: none;
  color: white;
  border-radius: 50%;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}
.update-banner .ub-info:hover { background: rgba(255,255,255,.28); }

.update-banner .ub-no {
  background: rgba(255,255,255,.15);
  border: none;
  color: white;
  border-radius: 50%;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  font-size: 12px;
  cursor: pointer;
}

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

/* "Wat is nieuw"-modal */
.changelog-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 800;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn .25s ease-out;
}
.changelog-modal.hidden { display: none; }
.changelog-card {
  background: linear-gradient(180deg, #1e293b, #0f172a);
  border: 1px solid rgba(99, 102, 241, .35);
  border-radius: 22px;
  padding: 28px 22px 20px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(99, 102, 241, .25);
  animation: popIn .35s cubic-bezier(.2,.8,.3,1.05);
}
.changelog-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 6px 20px rgba(250, 204, 21, .35));
}
.changelog-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.changelog-date {
  color: var(--text-mute);
  font-size: 12px;
  margin-bottom: 18px;
}
.changelog-list {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  text-align: left;
}
.changelog-list li {
  padding: 10px 4px;
  border-bottom: 1px solid rgba(99, 102, 241, .12);
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
}
.changelog-list li:last-child { border-bottom: none; }
.changelog-btn {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 6px 18px rgba(99, 102, 241, .35);
}
@keyframes popIn {
  from { transform: scale(.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === PRACTICE v2 (4 modes + hard cluster) === */
.practice-hard-block {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(244,63,94,.08), rgba(244,63,94,.04));
  border: 1px solid rgba(244,63,94,.25);
}
.practice-hard-title { font-size: 14px; font-weight: 700; color: var(--bad); margin-bottom: 4px; }
.practice-hard-sub { font-size: 12px; color: var(--text-mute); margin-bottom: 10px; line-height: 1.35; }

.practice-card-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  text-align: center;
}
.practice-progress { font-size: 13px; color: var(--text-mute); }
.practice-reason {
  font-size: 12px;
  color: var(--text-mute);
  opacity: .85;
  font-style: italic;
}

.practice-mc { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.practice-mode-label {
  font-size: 13px;
  color: var(--text-mute);
  margin: 8px 0 4px;
  text-align: center;
}
.card-nl-big {
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  margin: 8px 0 4px;
  line-height: 1.2;
}
.practice-listen-big {
  width: 88px !important;
  height: 88px !important;
  font-size: 38px !important;
  margin: 12px 0 !important;
}

.practice-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  margin-top: 14px;
}
.practice-opt {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  text-align: center;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
  font-weight: 500;
}
.practice-opt:hover:not(:disabled) { background: var(--surface-2); border-color: var(--accent); }
.practice-opt:active:not(:disabled) { transform: scale(.98); }
.practice-opt:disabled { cursor: default; opacity: .85; }
.practice-opt-correct {
  background: rgba(34,197,94,.18) !important;
  border-color: var(--good) !important;
  color: var(--good) !important;
  font-weight: 700;
}
.practice-opt-wrong {
  background: rgba(244,63,94,.18) !important;
  border-color: var(--bad) !important;
  color: var(--bad) !important;
}

.practice-reveal {
  margin: 20px auto 0;
  max-width: 420px;
  padding: 18px 18px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(244,63,94,.10), rgba(244,63,94,.04));
  border: 1px solid rgba(244,63,94,.30);
  text-align: center;
  animation: revealIn .25s ease-out;
}
@keyframes revealIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.practice-reveal-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--bad);
  margin-bottom: 8px;
  font-weight: 700;
}
.practice-reveal-sr {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.practice-reveal-pron {
  font-size: 13px;
  color: var(--text-mute);
  font-style: italic;
  margin-bottom: 6px;
}
.practice-reveal-nl {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 14px;
}
.practice-reveal-next {
  width: 100%;
}

/* === MODAL (gedeeld door feedback) === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 200;
  padding: 16px;
  animation: fadeIn .18s ease-out;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .22s ease-out;
}
@keyframes modalIn { from { transform: translateY(20px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  color: var(--text-mute);
  font-size: 16px;
  cursor: pointer;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 16px 20px 20px; }

/* === FEEDBACK === */
.feedback-stars {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 8px 0 14px;
}
.fb-star {
  width: 40px;
  height: 40px;
  background: transparent;
  border: 0;
  font-size: 28px;
  color: var(--border);
  cursor: pointer;
  transition: color .12s, transform .12s;
  padding: 0;
}
.fb-star:hover { transform: scale(1.15); }
.fb-star.active { color: var(--warn, #fbbf24); }

#feedbackText {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  /* 16px MINIMAAL — onder die waarde zoomt iOS Safari automatisch in op focus.
     Met 16px blijft de viewport rustig. */
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
}

/* iOS auto-zoom voorkomen: ALLE inputs/textareas die in een modal kunnen
   verschijnen krijgen 16px font-size. */
.modal-box input,
.modal-box textarea {
  font-size: 16px;
}

.feedback-shot { margin: 12px 0; }
.fb-shot-btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  color: var(--text-mute);
  cursor: pointer;
  font-size: 13px;
}
.fb-shot-btn:hover { background: var(--surface); color: var(--text); }
#feedbackShotPreview {
  position: relative;
  margin-top: 10px;
}
#feedbackShotPreview img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}
.fb-shot-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,.7);
  color: #fff;
  border: 0;
  cursor: pointer;
}
.feedback-status { margin: 10px 0; font-size: 13px; min-height: 18px; }

/* === TAALKEUS === */
.lang-section { margin-top: 6px; }
.lang-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-mute);
  font-weight: 600;
  margin-bottom: 8px;
}
.lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.lang-opt {
  padding: 12px 8px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}
.lang-opt:hover:not(:disabled) { background: var(--surface-2); border-color: var(--accent); }
.lang-beta-badge {
  font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(236,72,153,.22); color: #f9a8d4;
  padding: 1px 6px; border-radius: 999px;
}
.lang-beta-note {
  margin: 14px 0 0;
  font-size: 12px; line-height: 1.5;
  color: var(--text-dim);
  background: linear-gradient(135deg, rgba(236,72,153,.10), rgba(139,92,246,.06));
  border: 1px solid rgba(236,72,153,.25);
  border-radius: 12px;
  padding: 12px 14px;
}
.lang-beta-note.hidden { display: none; }
.lang-opt:active:not(:disabled) { transform: scale(.97); }
.lang-opt-active {
  background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(168,85,247,.25)) !important;
  border-color: var(--accent) !important;
  font-weight: 700;
}
.lang-opt-disabled {
  opacity: .35;
  cursor: not-allowed;
}

.track-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.track-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13px;
}
.track-row.active {
  background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(168,85,247,.10));
  border: 1px solid rgba(99,102,241,.4);
}
.track-flag { font-size: 18px; }
.track-name { font-weight: 600; min-width: 80px; }
.track-meta { flex: 1; color: var(--text-mute); font-size: 12px; }
.track-active-dot { color: var(--accent); font-size: 10px; }

.settings-langs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.settings-lang-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
}
.settings-lang-arrow {
  color: var(--text-mute);
  font-size: 14px;
}

/* === TOUR / RONDLEIDING === */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
}
.tour-overlay.hidden { display: none; }
.tour-spotlight {
  position: absolute;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.72);
  pointer-events: none;
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
  animation: tourPulse 1.6s ease-in-out infinite;
}
@keyframes tourPulse {
  0%, 100% { outline: 2px solid rgba(99,102,241,.6); outline-offset: 0; }
  50% { outline: 3px solid rgba(99,102,241,1); outline-offset: 4px; }
}
.tour-tooltip {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 16px 18px;
  max-width: 320px;
  width: calc(100% - 32px);
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
  pointer-events: auto;
  z-index: 301;
  animation: tooltipIn .25s ease-out;
}
@keyframes tooltipIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.tour-tooltip-center {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}
.tour-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}
.tour-body {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 14px;
}
.tour-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tour-skip {
  background: transparent;
  border: 0;
  color: var(--text-mute);
  cursor: pointer;
  font-size: 13px;
  padding: 6px 10px;
}
.tour-skip:hover { color: var(--text); }
.tour-progress {
  font-size: 12px;
  color: var(--text-mute);
}
.tour-next {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.tour-next:hover { opacity: .92; }

body.offline .topbar { top: 30px; }
body.offline { padding-top: 30px; }

/* Tutor + mic uitgrijzen offline */
body.offline .nav-btn[data-view="tutor"] { opacity: .5; }
body.offline .mic-btn { opacity: .4; pointer-events: none; }

/* === TOPBAR-RIGHT (knoppen rechtsboven) === */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .15s, background .15s;
  padding: 0;
}
.topbar-icon-btn:hover { background: var(--surface-2); }
.topbar-icon-btn:active { transform: scale(.92); }

/* === DIALOGEN VIEW === */
.dialogs-header {
  padding: 0 16px 8px;
}
.dialogs-header h2 {
  margin: 0 0 4px;
  font-size: 22px;
}
.dialogs-subtitle {
  margin: 0;
  color: var(--text-mute);
  font-size: 14px;
}

.dialogs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px 100px;
}

.dialog-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
  color: var(--text);
}
.dialog-card:hover { background: var(--surface-2); border-color: var(--accent); }
.dialog-card:active { transform: scale(.985); }

.dialog-card-emoji {
  font-size: 32px;
  flex-shrink: 0;
}
.dialog-card-body { flex: 1; min-width: 0; }
.dialog-card-title { font-weight: 700; font-size: 16px; margin-bottom: 2px; }
.dialog-card-desc { font-size: 13px; color: var(--text-mute); margin-bottom: 4px; line-height: 1.35; }
.dialog-card-meta {
  font-size: 11px;
  color: var(--text-mute);
  opacity: .75;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.dialog-card-arrow {
  font-size: 20px;
  color: var(--text-mute);
  flex-shrink: 0;
}

/* Dialog stage */
.dialog-stage {
  padding: 0 16px 120px;
}
.dialog-stage-controls {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, var(--bg) 85%, transparent);
  padding-bottom: 10px;
}
.dialog-stage-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 8px;
}
.dialog-stage-tools {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}
.dialog-back-btn {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}
.dialog-back-btn:hover { background: var(--surface-2); }

.dialog-stage-title {
  flex: 1;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
}
.dialog-stage-emoji { margin-right: 4px; }

.dialog-play-all-btn {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s;
}
.dialog-play-all-btn:disabled { opacity: .6; cursor: wait; }
.dialog-play-all-btn.dialog-play-all-stop { background: var(--bad); }

.dialog-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dialog-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 88%;
  transition: opacity .2s, transform .2s;
}
.dialog-line-andere { align-self: flex-start; }
.dialog-line-jij { align-self: flex-end; flex-direction: row-reverse; }

.dialog-bubble {
  flex: 1;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.dialog-line-jij .dialog-bubble {
  background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(168,85,247,.15));
  border-color: rgba(168,85,247,.35);
}
.dialog-bubble:hover { background: var(--surface-2); }

.dialog-speaker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-mute);
  margin-bottom: 4px;
  font-weight: 600;
}
.dialog-sr {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 4px;
}
.dialog-nl {
  font-size: 13px;
  color: var(--text-mute);
  line-height: 1.3;
}

.dialog-speak-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 4px;
  transition: transform .15s, background .15s;
  display: grid;
  place-items: center;
}
.dialog-speak-btn:hover { background: var(--accent); border-color: var(--accent); }
.dialog-speak-btn:active { transform: scale(.9); }
.dialog-speak-btn.speaking { background: var(--good); border-color: var(--good); animation: pulseSpeak .8s ease-in-out infinite; }

.dialog-line-active .dialog-bubble {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99,102,241,.25);
}

.dialog-hide-toggle {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-mute);
  cursor: pointer;
  font-size: 12px;
  transition: background .15s, color .15s;
}
.dialog-hide-toggle:hover { background: var(--surface-2); color: var(--text); }

/* === INSTALL PROMPT === */
.install-prompt {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(80px + var(--safe-bot));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 350;
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
  animation: cardIn .4s cubic-bezier(.2,.8,.3,1);
}

.ip-icon { font-size: 28px; }
.ip-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ip-text strong { font-size: 14px; font-weight: 700; }
.ip-text span { font-size: 12px; color: var(--text-dim); }

.ip-yes {
  background: var(--accent-2);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.ip-no {
  background: none;
  border: none;
  color: var(--text-mute);
  font-size: 18px;
  padding: 4px 8px;
  cursor: pointer;
}

/* === RAINBOW TEXT (verjaardag-modal) === */
.rainbow-text {
  background: linear-gradient(
    90deg,
    #ff3b30 0%,
    #ff9500 14%,
    #ffcc00 28%,
    #34c759 42%,
    #00c7be 56%,
    #007aff 70%,
    #af52de 84%,
    #ff2d92 100%
  );
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: rainbowShift 5s linear infinite;
  filter: drop-shadow(0 2px 8px rgba(255,107,180,.25));
}

@keyframes rainbowShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.rainbow-heart {
  display: inline-block;
  animation: heartHue 4s linear infinite, heartPulse 1.6s ease-in-out infinite;
  filter: hue-rotate(0deg);
}

@keyframes heartHue {
  0%   { filter: hue-rotate(0deg); }
  25%  { filter: hue-rotate(90deg); }
  50%  { filter: hue-rotate(180deg); }
  75%  { filter: hue-rotate(270deg); }
  100% { filter: hue-rotate(360deg); }
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

/* === CONFETTI === */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
}

/* === LETTER POPOVER === */
.letter-popover-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn .2s;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.letter-popover-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 24px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  animation: popIn .35s cubic-bezier(.3,1.4,.5,1);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(.85); }
  to { opacity: 1; transform: scale(1); }
}

.letter-popover-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid; place-items: center;
  font-size: 14px;
  color: var(--text-dim);
}

.letter-popover-big {
  font-size: 84px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
  background: linear-gradient(135deg, #fef3c7, #fbbf24);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  margin-bottom: 4px;
}

.letter-popover-cyr {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: .04em;
  margin-bottom: 14px;
}

.letter-popover-speak-letter,
.letter-popover-speak-word {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-2);
  color: white;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  width: auto;
  height: auto;
  box-shadow: 0 3px 10px rgba(59,130,246,.4);
}

.letter-popover-speak-word { background: var(--good); box-shadow: 0 3px 10px rgba(34,197,94,.4); }
.letter-popover-speak-letter.speaking,
.letter-popover-speak-word.speaking { animation: pulseSpeak .8s ease-in-out infinite; }

.letter-popover-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0 16px;
}

.letter-popover-example-label {
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
}

.letter-popover-example {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.2;
  color: var(--text-mute);
  opacity: .3;
  transition: all .35s cubic-bezier(.3,1.4,.5,1);
  min-height: 36px;
  margin-bottom: 10px;
}

.letter-popover-example.revealed {
  color: var(--text);
  opacity: 1;
  transform: scale(1.05);
}

.letter-popover-example-nl {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 6px;
}

.letter-popover-pron {
  font-size: 12px;
  color: var(--text-mute);
  margin: 14px 0 0;
  line-height: 1.4;
}

/* === ALFABET SPECIAL === */
.alphabet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  padding: 8px 0;
}

.alpha-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: transform .12s, background .15s;
}

.alpha-cell:active { transform: scale(.94); }

.alpha-letter {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.alpha-lat {
  font-size: 11px;
  color: var(--accent-3);
  font-weight: 700;
  margin-top: 4px;
}

.alpha-pron {
  font-size: 10px;
  color: var(--text-mute);
  margin-top: 2px;
}

/* Desktop tweaks */
@media (min-width: 720px) {
  body { max-width: 720px; margin: 0 auto; box-shadow: 0 0 60px rgba(0,0,0,.5); min-height: 100vh; }
  .bottom-nav { left: 50%; right: auto; width: 100%; max-width: 720px; transform: translateX(-50%); }
  .lesson-node { max-width: 560px; }
  .card-emoji { font-size: 96px; }
  .card-sr { font-size: 48px; }
}

/* Custom-image-emoji: vervangt een unicode emoji. Schaalt met font-size via 1em. */
.emoji-img {
  display: inline-block;
  height: 1em;
  width: auto;
  vertical-align: -0.15em;
  object-fit: contain;
}

/* ===== PLAATSINGSTEST ===== */
.pl-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(2, 6, 23, .72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.pl-card {
  width: 100%; max-width: 460px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 20px; padding: 22px 22px 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.pl-top { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.pl-close {
  order: 3; background: transparent; border: none; color: var(--text-mute);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 4px;
}
.pl-close:hover { color: var(--text); }
.pl-bar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.pl-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s ease; }
.pl-count { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.pl-prompt-label { font-size: 13px; color: var(--text-dim); text-align: center; margin-top: 14px; }
.pl-prompt { font-size: clamp(26px, 7vw, 34px); font-weight: 800; text-align: center; margin: 6px 0 22px; color: var(--text); word-break: break-word; }
.pl-options { display: grid; gap: 10px; }
.pl-option {
  padding: 15px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; color: var(--text); font-size: 16px; font-weight: 600;
  text-align: left; cursor: pointer; transition: background .12s, border-color .12s, transform .08s;
}
.pl-option:hover:not(:disabled) { border-color: var(--accent-2); background: var(--surface-2); }
.pl-option:active:not(:disabled) { transform: scale(.99); }
.pl-option:disabled { cursor: default; }
.pl-option.good { border-color: var(--good); background: rgba(34, 197, 94, .16); color: #fff; }
.pl-option.bad { border-color: var(--bad); background: rgba(244, 63, 94, .16); }
.pl-result { text-align: center; padding: 12px 4px 4px; }
.pl-result-emoji { font-size: 58px; line-height: 1; margin-bottom: 12px; }
.pl-result-title { font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.pl-result-body { color: var(--text-dim); line-height: 1.5; margin-bottom: 22px; }
.pl-go {
  width: 100%; padding: 15px; border: none; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-size: 16px; cursor: pointer;
}
.pl-go:hover { filter: brightness(1.06); }
/* Nudge-banner op het lespad voor verse gebruikers */
.placement-banner {
  list-style: none; text-align: center;
  background: linear-gradient(135deg, rgba(59, 130, 246, .14), rgba(250, 204, 21, .10));
  border: 1px solid var(--border); border-radius: 16px;
  padding: 16px 18px; margin: 0 auto 20px; max-width: 340px;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.placement-banner .pb-title { font-weight: 700; color: var(--text); }
.placement-banner .pb-btn {
  background: var(--accent-2); color: #fff; border: none;
  border-radius: 999px; padding: 10px 18px; font-weight: 700; cursor: pointer;
}
.placement-banner .pb-btn:hover { filter: brightness(1.08); }
