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

:root {
  --purple-600:   #7c3aed;
  --purple-700:   #6d28d9;
  --purple-500:   #8b5cf6;
  --purple-100:   #ede9fe;
  --purple-50:    #f5f3ff;
  --slate-800:    #1e293b;
  --slate-700:    #334155;
  --slate-600:    #475569;
  --slate-400:    #94a3b8;
  --slate-200:    #e2e8f0;
  --slate-100:    #f1f5f9;
  --slate-50:     #f8fafc;
  --white:        #ffffff;
  --red-500:      #ef4444;
  --transition:   all .2s ease;
}

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--slate-50);
  color: var(--slate-800);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }

/* ════════════════════════════════════════
   SCREENS
════════════════════════════════════════ */
.screen { display: none; height: 100vh; width: 100vw; position: fixed; inset: 0; }
.screen.active { display: flex; }

/* ════════════════════════════════════════
   LOGIN
════════════════════════════════════════ */
#loginScreen {
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  overflow: hidden;
}

.login-blobs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .45; }
.blob-1 { width: 500px; height: 500px; background: #c4b5fd; top: -150px; left: -100px; }
.blob-2 { width: 400px; height: 400px; background: #f5d0fe; bottom: -100px; right: -80px; }
.blob-3 { width: 300px; height: 300px; background: #a5f3fc; bottom: 80px; left: 20%; }

.login-card {
  position: relative; z-index: 1;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(124,58,237,.12);
  padding: 44px 40px 36px;
  width: 100%; max-width: 440px;
  text-align: center;
  animation: fadeUp .4s ease both;
}

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

.login-brand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 8px;
}
.login-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: none; 
  display: flex; align-items: center; justify-content: center;
}
.login-title { font-size: 1.75rem; font-weight: 800; color: var(--slate-800); }
.login-sub { color: var(--slate-600); font-size: .95rem; margin-bottom: 28px; }

.form-group { text-align: left; margin-bottom: 20px; }
.form-label {
  display: block; font-size: .8rem; font-weight: 600; color: var(--slate-600);
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em;
}

.form-input {
  width: 100%; padding: 13px 16px;
  border: 1.5px solid var(--slate-200);
  border-radius: 12px; background: var(--slate-50);
  color: var(--slate-800); font-size: 1rem; outline: none;
  transition: var(--transition);
}
.form-input:focus { border-color: var(--purple-600); box-shadow: 0 0 0 3px rgba(124,58,237,.1); background: #fff; }
.code-input { text-transform: uppercase; letter-spacing: .25em; font-weight: 700; font-size: 1.1rem; text-align: center; font-family: ui-monospace, Menlo, monospace; }
.code-input::placeholder { letter-spacing: normal; font-weight: 400; font-family: inherit; text-transform: none; }

/* Pincode-stap */
.pin-lock {
  width: 56px; height: 56px; margin: 4px auto 14px;
  border-radius: 16px; background: var(--purple-50); color: var(--purple-600);
  display: flex; align-items: center; justify-content: center;
}
.pin-title { font-size: 1.25rem; font-weight: 800; color: var(--slate-800); margin-bottom: 6px; text-align: center; }
.pin-sub { font-size: .88rem; color: var(--slate-600); margin-bottom: 18px; text-align: center; line-height: 1.5; }
.pin-input {
  text-align: center; letter-spacing: .6em; padding-left: .6em;
  font-size: 1.6rem; font-weight: 700; font-family: ui-monospace, Menlo, monospace;
  margin-bottom: 8px;
}
.pin-input::placeholder { letter-spacing: .3em; padding-left: 0; }

.group-pill-grid { display: grid; grid-template-columns: repeat(8,1fr); gap: 8px; }
.group-pill {
  padding: 12px 4px; border: 1.5px solid var(--slate-200);
  border-radius: 10px; background: var(--slate-50);
  color: var(--slate-800); font-weight: 700; font-size: .9rem;
  cursor: pointer; transition: var(--transition);
}
.group-pill:hover  { border-color: var(--purple-600); background: var(--purple-50); color: var(--purple-600); }
.group-pill.selected { background: var(--purple-600); color: #fff; border-color: var(--purple-600); box-shadow: 0 4px 12px rgba(124,58,237,.3); }

.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 15px; border: none; border-radius: 12px;
  background: var(--purple-600); color: #fff;
  font-weight: 700; font-size: 1rem; cursor: pointer;
  transition: var(--transition); margin-top: 4px;
  box-shadow: 0 8px 24px rgba(124,58,237,.3);
}
.btn-primary:hover:not(:disabled) { background: var(--purple-700); transform: translateY(-1px); box-shadow: 0 12px 32px rgba(124,58,237,.4); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-big { padding: 20px; font-size: 1.15rem; border-radius: 16px; margin-top: 8px; }
.btn-big svg { width: 22px; height: 22px; }

.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 15px; border-radius: 12px;
  background: var(--white); color: var(--purple-700);
  border: 1.5px solid var(--purple-100);
  font-weight: 700; font-size: 1rem; cursor: pointer;
  transition: var(--transition); margin-top: 10px;
}
.btn-secondary:hover { background: var(--purple-50); border-color: var(--purple-500); transform: translateY(-1px); }
.btn-secondary svg { color: var(--purple-600); }

.back-step {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  margin-bottom: 14px; padding: 4px 0;
  font-size: .9rem; font-weight: 600; color: var(--slate-400);
  transition: color .2s;
}
.back-step:hover { color: var(--purple-600); }

.login-error { margin-top: 12px; color: var(--red-500); font-size: .9rem; }
.hidden { display: none !important; }

.teacher-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 20px; font-size: .85rem; color: var(--slate-400);
  text-decoration: none; transition: color .2s;
}
.teacher-link:hover { color: var(--purple-600); }

/* ════════════════════════════════════════
   CHAT LAYOUT — SPLIT PANE
════════════════════════════════════════ */
#chatScreen { flex-direction: column; }

.chat-layout { display: flex; flex-direction: column; width: 100%; height: 100%; }

/* ── TOP BAR ── */
.topbar {
  height: 56px; flex-shrink: 0;
  background: var(--purple-600); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; z-index: 30;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.hamburger {
  display: none; border: none; background: none; cursor: pointer;
  color: #fff; padding: 6px; border-radius: 8px;
  transition: background .15s;
}
.hamburger:hover { background: rgba(255,255,255,.15); }

.topbar-brand { display: flex; align-items: center; gap: 10px; background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: 10px; transition: background .2s; }
.topbar-brand:hover { background: rgba(124,58,237,.08); }
.topbar-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: none; 
  display: flex; align-items: center; justify-content: center;
}
.topbar-name { font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; color: #fff; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-group-badge {
  font-size: .82rem; font-weight: 600;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px; padding: 4px 14px;
  letter-spacing: .01em;
}
.topbar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.25); border: 2px solid rgba(255,255,255,.4);
  color: #fff; font-weight: 700; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
}

/* ── BODY ── */
.chat-body { display: flex; flex: 1; overflow: hidden; }

/* ── SIDEBAR ── */
.sidebar {
  width: 280px; flex-shrink: 0;
  background: var(--slate-50); border-right: 1px solid var(--slate-200);
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform .25s ease;
  z-index: 20;
}

.sidebar-inner {
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
}

.sidebar-header {
  padding: 14px 12px 10px;
  border-bottom: 1px solid var(--slate-200);
  background: #fff;
}

.btn-new-chat {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 14px;
  border: 1.5px solid var(--purple-600); border-radius: 10px;
  background: var(--purple-50); color: var(--purple-600);
  font-weight: 600; font-size: .88rem; cursor: pointer;
  transition: var(--transition);
}
.btn-new-chat:hover { background: var(--purple-100); }
.btn-new-chat svg { flex-shrink: 0; }

.sidebar-search-wrap {
  position: relative; padding: 10px 12px;
  background: var(--slate-50);
}
.search-icon {
  position: absolute; left: 22px; top: 50%; transform: translateY(-50%);
  color: var(--slate-400); pointer-events: none;
}
.sidebar-search {
  width: 100%; padding: 8px 12px 8px 32px;
  border: 1.5px solid var(--slate-200); border-radius: 999px;
  background: #fff; font-size: .85rem; color: var(--slate-800); outline: none;
  transition: var(--transition);
}
.sidebar-search:focus { border-color: var(--purple-600); box-shadow: 0 0 0 3px rgba(124,58,237,.08); }
.sidebar-search::placeholder { color: var(--slate-400); }

.sidebar-history {
  flex: 1; overflow-y: auto; padding: 4px 8px 8px;
}

.history-empty {
  padding: 24px 16px; text-align: center;
  color: var(--slate-400); font-size: .85rem; line-height: 1.6;
}

.history-group { margin-top: 12px; }
.history-group-label {
  padding: 0 8px 6px;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--slate-400);
}

.conv-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px; border-radius: 10px;
  border: 1px solid transparent; background: none;
  color: var(--slate-700); font-size: .875rem; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: var(--transition);
  overflow: hidden;
}
.conv-item:hover  { background: #fff; border-color: var(--slate-200); box-shadow: 0 1px 4px rgba(0,0,0,.06); color: var(--purple-600); }
.conv-item.active { background: var(--purple-50); border-color: var(--purple-100); color: var(--purple-600); }
.conv-item.active .conv-item-icon { background: var(--purple-100); color: var(--purple-600); }

.conv-item-icon {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: #fff; color: var(--purple-600);
  border: 1px solid var(--slate-100);
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.conv-item:hover .conv-item-icon { background: var(--purple-50); border-color: var(--purple-100); }
.conv-item-title { truncate: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Settings */
.sidebar-settings {
  border-top: 1px solid var(--slate-200);
  padding: 8px 12px 4px;
}
.settings-toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 6px; border: none; background: none;
  color: var(--slate-600); font-size: .85rem; font-weight: 500; cursor: pointer;
  border-radius: 8px; transition: var(--transition);
}
.settings-toggle:hover { color: var(--purple-600); background: var(--purple-50); }
.settings-chevron { margin-left: auto; transition: transform .2s ease; }

.settings-panel {
  display: none; flex-direction: column; gap: 10px;
  padding: 8px 4px 4px;
}
.settings-panel.open { display: flex; }

.setting-row { display: flex; flex-direction: column; gap: 4px; }
.setting-label { font-size: .78rem; font-weight: 600; color: var(--slate-500); text-transform: uppercase; letter-spacing: .04em; }
.setting-select {
  padding: 8px 10px; border: 1.5px solid var(--slate-200); border-radius: 8px;
  background: #fff; color: var(--slate-800); outline: none; cursor: pointer;
  font-size: .85rem; transition: var(--transition);
}
.setting-select:focus { border-color: var(--purple-600); }

.btn-tts {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1.5px solid var(--slate-200); border-radius: 8px;
  background: none; color: var(--slate-600); font-size: .85rem; font-weight: 500;
  cursor: pointer; transition: var(--transition);
}
.btn-tts:hover  { border-color: var(--purple-600); color: var(--purple-600); background: var(--purple-50); }
.btn-tts.active { border-color: var(--purple-600); color: var(--purple-600); background: var(--purple-50); }

.sidebar-footer {
  padding: 8px 12px 14px;
  border-top: 1px solid var(--slate-200);
  display: flex; flex-direction: column; gap: 6px;
}
.btn-teacher {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px; border: 1.5px solid var(--slate-200);
  border-radius: 8px; background: none; color: var(--slate-600);
  font-size: .85rem; font-weight: 500; cursor: pointer;
  text-decoration: none; transition: var(--transition);
}
.btn-teacher:hover { border-color: var(--purple-600); color: var(--purple-600); background: var(--purple-50); }
.btn-teacher .kbd-hint {
  margin-left: auto; font-size: .68rem; font-weight: 600;
  color: var(--slate-400); background: var(--slate-100);
  border-radius: 5px; padding: 2px 6px; letter-spacing: .02em;
}
.btn-teacher:hover .kbd-hint { background: var(--purple-100); color: var(--purple-600); }
.btn-logout {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px; border: 1.5px solid transparent;
  border-radius: 8px; background: none; color: var(--slate-500);
  font-size: .85rem; font-weight: 500; cursor: pointer;
  transition: var(--transition);
}
.btn-logout:hover { border-color: var(--red-500); color: var(--red-500); background: #fff5f5; }

/* ── CHAT MAIN ── */
.chat-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #fff; min-width: 0; }

.chat-header {
  height: 56px; flex-shrink: 0;
  border-bottom: 1px solid var(--slate-100);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10;
}

.chat-header-left { display: flex; align-items: center; gap: 12px; }

.nicole-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--purple-600); color: #fff;
  font-weight: 700; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; ring: 2px solid var(--purple-100);
  box-shadow: 0 0 0 2px var(--purple-100);
}
.nicole-avatar.sm { width: 32px; height: 32px; font-size: .8rem; margin-top: 2px; align-self: flex-start; }

.chat-header-name { font-weight: 600; font-size: .92rem; color: var(--slate-800); }
.chat-header-sub  { font-size: .78rem; color: var(--purple-600); font-weight: 500; }

.chat-topic-badge {
  display: none; font-size: .78rem; font-weight: 500;
  background: var(--slate-100); color: var(--slate-600);
  border-radius: 999px; padding: 4px 12px;
}

/* Messages */
.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 24px max(calc((100% - 768px) / 2), 24px) 8px;
  display: flex; flex-direction: column; gap: 20px;
  scroll-behavior: smooth;
}

.msg { display: flex; align-items: flex-start; gap: 10px; }
.msg-user { justify-content: flex-end; }
.msg-bot  { justify-content: flex-start; }

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: msgIn .22s ease both; }

.bubble {
  max-width: min(85%, 640px);
  padding: 13px 17px;
  border-radius: 16px;
  font-size: .95rem;
  line-height: 1.65;
  word-break: break-word;
}
.bubble-user {
  background: var(--purple-600); color: #fff;
  border-top-right-radius: 4px;
}
.bubble-bot {
  background: #fff; color: var(--slate-700);
  border: 1px solid var(--slate-100);
  border-top-left-radius: 4px;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
  display: flex; align-items: flex-start; gap: 10px;
}
.bubble-text { flex: 1; }

.speak-btn {
  flex-shrink: 0; margin-top: 2px;
  border: none; background: var(--purple-50); color: var(--purple-600);
  border-radius: 6px; padding: 5px 6px; cursor: pointer;
  transition: var(--transition); display: flex; align-items: center;
}
.speak-btn:hover { background: var(--purple-600); color: #fff; }

.typing-dots {
  display: flex; align-items: center; gap: 5px; padding: 6px 4px;
}
.typing-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--purple-600); opacity: .4;
  animation: blink 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink {
  0%,80%,100% { transform: scale(.8); opacity: .3; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Input */
.chat-input-wrap {
  padding: 12px 20px 20px;
  background: #fff; border-top: 1px solid var(--slate-100);
  flex-shrink: 0;
}

.input-box {
  display: flex; align-items: flex-end; gap: 8px;
  max-width: 768px; margin: 0 auto;
  background: var(--slate-50); border: 1.5px solid var(--slate-200);
  border-radius: 24px; padding: 8px 8px 8px 14px;
  transition: var(--transition);
}
.input-box:focus-within {
  border-color: var(--purple-600);
  box-shadow: 0 0 0 3px rgba(124,58,237,.10);
  background: #fff;
}

.input-icon-btn {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  border: none; background: none; color: var(--slate-400);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.input-icon-btn:hover  { color: var(--purple-600); background: var(--purple-50); }
.input-icon-btn.active { color: var(--purple-600); }
.input-icon-btn.listening {
  color: #fff; background: #ef4444;
  animation: micPulse 1.2s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.45); }
  50%      { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

.message-textarea {
  flex: 1; border: none; background: transparent; outline: none;
  resize: none; line-height: 1.55; font-size: .95rem;
  color: var(--slate-800); max-height: 130px; overflow-y: auto;
  padding: 8px 4px;
}
.message-textarea::placeholder { color: var(--slate-400); }

.send-btn {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  border: none; background: var(--purple-600); color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--transition); box-shadow: 0 4px 12px rgba(124,58,237,.3);
}
.send-btn:hover:not(:disabled) { background: var(--purple-700); transform: scale(1.05); }
.send-btn:active:not(:disabled) { transform: scale(.95); }
.send-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.send-btn.loading {
  background: var(--slate-400); color: transparent; box-shadow: none;
  cursor: wait; position: relative;
}
.send-btn.loading svg { display: none; }
.send-btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 2.5px solid rgba(255,255,255,.55); border-top-color: #fff;
  border-radius: 50%; animation: send-spin .7s linear infinite;
}
@keyframes send-spin { to { transform: rotate(360deg); } }

.input-disclaimer {
  text-align: center; font-size: .72rem; color: var(--slate-400);
  margin-top: 8px;
}
.input-thinking {
  text-align: center; font-size: .78rem; color: var(--purple-700);
  font-weight: 700; margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.thinking-spinner {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--purple-100); border-top-color: var(--purple-600);
  animation: send-spin .7s linear infinite; display: inline-block;
}

/* Mobile overlay */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.35); z-index: 19;
}
.sidebar-overlay.active { display: block; }

/* ════════════════════════════════════════
   SCROLLBAR
════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-200); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; top: 56px; left: 0; bottom: 0;
    transform: translateX(-100%);
    border-right: none;
    box-shadow: 4px 0 24px rgba(0,0,0,.12);
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: flex; }
  .topbar-group-badge { display: none; }
}

@media (max-width: 480px) {
  .group-pill-grid { grid-template-columns: repeat(4,1fr); }
  .login-card { padding: 32px 24px 28px; margin: 16px; }
  .chat-messages { padding: 16px 14px 8px; }
  .chat-input-wrap { padding: 10px 14px 18px; }
  .bubble { max-width: 90%; }
}

/* ─── Flitskaartjes-knop in zijbalk ──────────────────────────────────────────── */
.btn-flash {
  display: flex; align-items: center; gap: .5rem;
  width: 100%; margin-top: .5rem;
  padding: .65rem .75rem;
  background: var(--white);
  color: var(--purple-700);
  border: 1.5px solid var(--purple-100);
  border-radius: 12px;
  font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.btn-flash:hover { background: var(--purple-50); border-color: var(--purple-500); }
.btn-flash svg { color: var(--purple-600); flex-shrink: 0; }

/* ─── Flitskaartjes-overlay & modal ──────────────────────────────────────────── */
.flash-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(30, 41, 59, .55);
  z-index: 1000; padding: 1rem;
  align-items: center; justify-content: center;
}
.flash-overlay.active { display: flex; }
.flash-modal {
  background: var(--white); border-radius: 20px;
  width: 100%; max-width: 460px;
  max-height: calc(100dvh - 2rem);
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow: hidden; animation: flashPop .18s ease;
}
@keyframes flashPop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.flash-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple-600), var(--purple-500));
  color: var(--white);
}
.flash-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.flash-close {
  background: rgba(255,255,255,.2); color: var(--white);
  border: none; border-radius: 8px;
  width: 30px; height: 30px; font-size: 1rem;
  cursor: pointer; transition: var(--transition);
}
.flash-close:hover { background: rgba(255,255,255,.35); }

/* Keuzescherm */
.flash-setup { padding: 1.25rem; overflow-y: auto; min-height: 0; }
.flash-sub { font-size: .95rem; color: var(--slate-600); margin: 0 0 .9rem; font-weight: 600; }
.flash-tables {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: .5rem; margin-bottom: 1.1rem;
}
.flash-pill {
  padding: .6rem .4rem; border-radius: 10px;
  border: 1.5px solid var(--slate-200); background: var(--white);
  color: var(--slate-700); font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.flash-pill:hover { border-color: var(--purple-500); background: var(--purple-50); }
.flash-pill.selected { background: var(--purple-600); color: var(--white); border-color: var(--purple-600); }
.flash-start { width: 100%; }

/* Oefenscherm */
.flash-game { padding: 1.25rem; overflow-y: auto; min-height: 0; }
.flash-scorebar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.flash-score { font-size: .95rem; font-weight: 700; color: var(--slate-700); }
.flash-restart {
  background: none; border: none; color: var(--purple-600);
  font-size: .85rem; font-weight: 600; cursor: pointer;
}
.flash-restart:hover { text-decoration: underline; }
.flash-card {
  width: 100%; min-height: 180px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; padding: 1.5rem;
  background: linear-gradient(135deg, var(--purple-50), var(--purple-100));
  border: 2px solid var(--purple-100); border-radius: 16px;
  cursor: pointer; transition: var(--transition);
}
.flash-card:hover { border-color: var(--purple-500); }
.flash-q { font-size: 3rem; font-weight: 800; color: var(--purple-700); letter-spacing: 1px; }
.flash-a { font-size: 2.4rem; font-weight: 800; color: var(--purple-600); }
.flash-hint { font-size: .85rem; color: var(--slate-400); font-weight: 600; }
.flash-actions { display: flex; gap: .6rem; margin-top: 1rem; }
.flash-btn {
  flex: 1; padding: .7rem; border-radius: 12px;
  font-size: .95rem; font-weight: 700; cursor: pointer;
  border: none; transition: var(--transition);
}
.flash-right { background: #16a34a; color: var(--white); }
.flash-right:hover { background: #15803d; }
.flash-wrong { background: var(--slate-100); color: var(--slate-700); }
.flash-wrong:hover { background: var(--slate-200); }

/* ─── OEFENEN — DETERMINISTISCHE OPDRACHTEN ─────────────────────────────── */
.oefen-list { display: flex; flex-direction: column; gap: 18px; text-align: left; margin-top: 8px; }
.oefen-group-title {
  font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--purple-600); margin-bottom: 8px;
}
.oefen-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  text-align: left; padding: 14px 16px; margin-bottom: 8px;
  border: 1.5px solid var(--slate-200); border-radius: 14px; background: var(--white);
  color: var(--slate-800); font-size: .92rem; font-weight: 600; line-height: 1.4;
  cursor: pointer; transition: var(--transition);
}
.oefen-card:hover { border-color: var(--purple-600); background: var(--purple-50); transform: translateY(-1px); }
.oefen-card-q  { flex: 1; }
.oefen-card-groep { font-weight: 700; opacity: .65; font-size: .82em; }
.oefen-card-go { flex-shrink: 0; color: var(--purple-600); font-weight: 800; font-size: .85rem; }

.oefen-banner {
  display: flex; align-items: center; gap: 8px;
  margin: 0 auto 8px; max-width: 760px; width: 100%;
  padding: 8px 14px; border-radius: 12px;
  background: var(--purple-50); border: 1.5px solid var(--purple-100);
  color: var(--purple-700); font-size: .85rem; font-weight: 700;
}
.oefen-banner.hidden { display: none; }
.oefen-banner-stop {
  margin-left: auto; padding: 4px 12px; border: none; border-radius: 999px;
  background: var(--purple-600); color: #fff; font-size: .78rem; font-weight: 700;
  cursor: pointer; transition: var(--transition);
}
.oefen-banner-stop:hover { background: var(--purple-700); }

.oefen-opdracht { border: 1.5px solid var(--purple-100); background: var(--purple-50); }
.oefen-opdracht-tag {
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--purple-600); margin-bottom: 6px;
}
.oefen-opdracht-cta { margin-top: 8px; font-size: .82rem; color: var(--slate-600); }

.oefen-done {
  align-self: center; margin: 6px auto; padding: 8px 18px; border-radius: 999px;
  background: #dcfce7; color: #15803d; font-weight: 800; font-size: .9rem;
}
