@font-face {
  font-family: "Open Sans";
  src: url("assets/fonts/OpenSans-Variable.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("assets/fonts/OpenSans-Italic-Variable.woff2") format("woff2");
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("assets/fonts/Outfit-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #17181c;
  --panel: #1f2127;
  --panel-2: #26282f;
  --panel-translucent: rgba(31, 33, 39, 0.78);
  --border: #34363e;
  --text: #ececef;
  --text-dim: #9b9da5;
  --accent: #d9a441;
  --accent-2: #6fa8dc;
  --good: #6bbf7b;
  --bad: #e0665f;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 20px 40px -18px rgba(0, 0, 0, 0.55), 0 2px 10px -2px rgba(0, 0, 0, 0.35);
  --ring: 0 0 0 3px rgba(217, 164, 65, 0.28);

  --display-family: "Outfit", "Open Sans", "Segoe UI", system-ui, sans-serif;
  --font-family: "Open Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --block-spacing: 0.9rem;
  --stage-font-size: 1rem;
  font-size: 16px;
}

html[data-theme="light"] {
  --bg: #f7f5f1;
  --panel: #ffffff;
  --panel-2: #f1efe9;
  --panel-translucent: rgba(255, 255, 255, 0.78);
  --border: #ddd7cb;
  --text: #232019;
  --text-dim: #6b6459;
  --accent: #b9791f;
  --accent-2: #3f7cb5;
  --good: #2f8f45;
  --bad: #c23a32;

  --shadow-sm: 0 1px 2px rgba(80, 60, 30, 0.08);
  --shadow-md: 0 24px 48px -20px rgba(80, 60, 30, 0.16), 0 2px 10px -2px rgba(80, 60, 30, 0.07);
  --ring: 0 0 0 3px rgba(185, 121, 31, 0.22);
}

* { box-sizing: border-box; }

/* ---------- Password gate ---------- */
#app-content { display: none; }
html.unlocked #app-content { display: block; }
html.unlocked #gate-overlay { display: none; }

#gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 30% 20%, rgba(217, 164, 65, 0.12), transparent 55%),
    var(--bg);
}
.gate-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2.25rem 2rem;
  animation: fadeInUp 0.5s var(--ease) both;
}
.gate-card.shake { animation: gateShake 0.4s var(--ease); }
@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}
.gate-logo {
  height: 64px;
  width: 64px;
  object-fit: contain;
  background: #1a1812;
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.5rem;
}
.gate-title {
  margin: 0;
  font-family: var(--display-family);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.gate-sub {
  margin: 0 0 0.75rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
}
.gate-input {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  font-size: 1rem;
  text-align: center;
  letter-spacing: 0.08em;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.gate-input:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.gate-submit { width: 100%; margin-top: 0.6rem; padding: 0.7rem 1rem; font-size: 0.95rem; }
.gate-error { margin: 0.6rem 0 0; color: var(--bad); font-size: 0.85rem; }
.gate-lang-switch { margin-top: 1rem; }
.gate-credits {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.72rem;
  line-height: 1.6;
}
.gate-credits-label { display: block; margin-top: 0.5rem; font-weight: 600; color: var(--text-dim); }


html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-family);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

svg.icon { width: 1em; height: 1em; flex-shrink: 0; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.6rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel-translucent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.topbar .logo {
  height: 40px;
  width: 40px;
  object-fit: contain;
  flex-shrink: 0;
  /* logo artwork is white-on-transparent — needs a fixed dark backing plate
     so it stays visible in light mode too */
  background: #1a1812;
  border-radius: var(--radius-sm);
  padding: 4px;
  box-shadow: var(--shadow-sm);
}
.topbar h1 {
  margin: 0;
  font-family: var(--display-family);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 520px) {
  .topbar { padding: 0.6rem 0.85rem; gap: 0.5rem; }
  .topbar .logo { height: 32px; width: 32px; }
  .topbar h1 { font-size: 1.05rem; }
  .topbar .sub { display: none; }
}
.topbar .sub { color: var(--text-dim); font-weight: 400; font-family: var(--font-family); }

/* ---------- Segmented controls (theme / language) ---------- */
.lang-switch {
  position: relative;
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 2px;
  background: var(--panel-2);
}
.lang-switch::before {
  content: "";
  position: absolute;
  inset: 2px;
  width: calc(50% - 2px);
  border-radius: 6px;
  background: var(--accent);
  transition: transform 0.3s var(--ease);
  z-index: 0;
}
.lang-switch:has([data-lang="en"].active)::before { transform: translateX(100%); }
.lang-switch.theme-switch::before { background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--accent); }
.lang-switch.theme-switch:has(#theme-light.active)::before { transform: translateX(100%); }

.lang-btn {
  position: relative;
  z-index: 1;
  background: transparent;
  color: var(--text-dim);
  border: none;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s var(--ease);
}
.lang-btn.active { color: #201803; }
.lang-switch.theme-switch .lang-btn { font-size: 1rem; padding: 0.3rem 0.6rem; color: var(--text-dim); }
.lang-switch.theme-switch .lang-btn.active { color: var(--accent); }
.lang-btn:hover:not(.active) { color: var(--text); }

/* ---------- Verhoog / Musiek mode switch ---------- */
.mode-switch {
  position: relative;
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 3px;
  background: var(--panel-2);
}
.mode-switch::before {
  content: "";
  position: absolute;
  inset: 3px;
  width: calc(50% - 3px);
  border-radius: 6px;
  background: var(--accent);
  transition: transform 0.3s var(--ease);
  z-index: 0;
}
.mode-switch:has(#mode-musiek.active)::before { transform: translateX(100%); }
.mode-btn {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.mode-btn.active { color: #201803; }
.mode-btn:hover:not(.active) { color: var(--text); }

/* Music mode hides the acting-only controls (actor, game type, dialogue
   toggles, per-line color) — the song/font/spacing controls stay visible. */
.controls.mode-musiek .acting-only { display: none; }

.icon-btn {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s var(--ease), transform 0.15s var(--ease), background 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn:active { transform: scale(0.94); }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  min-height: calc(100vh - 130px);
  transition: grid-template-columns 0.3s var(--ease);
}
/* Explicit placement so hiding .controls (display:none) can't reflow
   .stage-wrap into the freed-up column-1 track via auto-placement. */
.controls { grid-column: 1; min-width: 0; }
.stage-wrap { grid-column: 2; min-width: 0; }

.layout.sidebar-collapsed { grid-template-columns: 0 1fr; }
.layout.sidebar-collapsed .controls { display: none; }

@media (max-width: 800px) {
  .layout, .layout.sidebar-collapsed { grid-template-columns: 1fr; }
  .controls, .stage-wrap { grid-column: 1; }
}

@media (max-width: 520px) {
  .layout { padding: 0.75rem; gap: 0.75rem; }
  .stage { padding: 1.1rem; }
}

.controls {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.15rem;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.field label { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); font-weight: 600; }

.field select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--panel-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239b9da5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1.1em;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 2.1rem 0.55rem 0.7rem;
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
  max-width: 100%;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field select:hover { border-color: var(--accent-2); }
.field select:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

.toggles { border-top: 1px solid var(--border); padding-top: 1rem; gap: 0.65rem; }
.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}

/* Custom toggle switch: the checkbox itself stays functional but invisible,
   sized/positioned exactly over its drawn track+thumb sibling. */
.switch-input {
  position: absolute;
  opacity: 0;
  width: 34px;
  height: 20px;
  margin: 0;
  cursor: pointer;
}
.switch-track {
  position: relative;
  flex-shrink: 0;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.switch-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-dim);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}
.switch-input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch-input:checked + .switch-track .switch-thumb { transform: translateX(14px); background: #201803; }
.switch-input:focus-visible + .switch-track { box-shadow: var(--ring); }

.font-controls { display: flex; gap: 0.4rem; }
.font-controls .btn { flex: 1; padding: 0.5rem 0.3rem; text-align: center; }

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  background: transparent;
}

.stats {
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.stats b { color: var(--text); }

.stage-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
  min-width: 0;
}

.stage {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1;
  /* A-/A+ scale ONLY this element's font-size (and anything inside it that
     uses em, or has no font-size of its own and simply inherits) — the rest
     of the UI uses rem, which stays pinned to the root's fixed 16px. */
  font-size: var(--stage-font-size);
}

.scene-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 0.75rem 1rem;
}
.scene-nav .btn { display: inline-flex; align-items: center; gap: 0.4rem; }
.scene-nav .btn:disabled { opacity: 0.35; cursor: not-allowed; }
.scene-nav .btn:disabled:hover { border-color: var(--border); transform: none; }
.scene-nav-current { color: var(--text-dim); font-size: 0.85rem; text-align: center; flex: 1; }

.scene-title {
  font-family: var(--display-family);
  font-size: 1.05em;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 1.1rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.85rem;
}
.scene-title b { color: var(--text); font-weight: 600; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.scene-title { animation: fadeInUp 0.45s var(--ease) both; }
.song-credits {
  margin-top: 0.35rem;
  font-size: 0.7em;
  font-style: italic;
  color: var(--text-dim);
  opacity: 0.8;
  line-height: 1.5;
}

/* ---------- Musiek mode: boxed lyric sheet ---------- */
.song-sheet { display: flex; flex-direction: column; gap: 1.25rem; }
.song-section {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  animation: fadeInUp 0.4s var(--ease) both;
}
.song-section-label {
  font-family: var(--display-family);
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.song-line {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.3rem 0;
  animation: fadeInUp 0.35s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 20) * 20ms);
}
.song-line + .song-line { border-top: 1px dashed var(--border); }
.song-stem {
  flex-shrink: 0;
  width: 5.5rem;
  font-weight: 600;
  color: var(--accent-2);
  font-size: 0.85em;
  letter-spacing: 0.02em;
}
.song-teks { line-height: 1.6; }

/* One rule for every guidance/direction element, wherever it's rendered
   (script view, quiz cards, reorder list, mc options) — not just inside
   .reel — so the opacity slider always reaches it. */
.inline-regie { opacity: var(--guidance-opacity, 1); }

/* .regie has its own entrance animation, so its opacity must be driven by
   the keyframe's end state (not a plain `opacity` rule) — a fill:both
   animation always wins over a static declaration for the same property,
   which is why the slider stopped reaching these blocks. */
@keyframes fadeInUpGuidance {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: var(--guidance-opacity, 1); transform: translateY(0); }
}
.regie {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.92em;
  margin: var(--block-spacing) 0;
  padding-left: 0.6rem;
  border-left: 2px solid var(--border);
  line-height: 1.5;
  animation: fadeInUpGuidance 0.4s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 20) * 20ms);
}

/* --block-spacing (the "Ruimte tussen akteurs" slider) controls the gap
   between actor blocks only — text inside a line always wraps at 1.5. */
.reel {
  margin: var(--block-spacing) 0;
  animation: fadeInUp 0.4s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 20) * 20ms);
}
.reel .akteur {
  font-family: var(--display-family);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent-2);
  margin-bottom: 0.2rem;
}
.reel.is-my-line .akteur { color: var(--my-line-name, var(--accent)); }
.reel .inline-regie {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.88em;
  line-height: 1.5;
}
.reel .teks { line-height: 1.5; }
.reel.is-my-line {
  background: var(--my-line-bg, rgba(217, 164, 65, 0.1));
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  margin: var(--block-spacing) -0.85rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease);
}
.reel.is-my-line .teks { color: var(--my-line-text, inherit); }
.reel.is-my-line .inline-regie { color: var(--my-line-text, inherit); }

/* Mid-line stage directions (formatTeks) get their own line with a little
   air around them, so guidance never runs on inline against speech. */
.teks-seg + .teks-seg { margin-top: 0.45em; }

/* "Voeg lyne tussen dialoog" — a real element sandwiched between blocks,
   not a border glued to one block's edge. Each side's own margin
   (--block-spacing, unchanged from the no-divider layout) collapses
   against the divider's zero margin, so the line always sits with equal
   breathing room above and below — including around the selected actor's
   bubble, whose own background never touches the line. */
.reel-divider { margin: 0; border-top: 1px solid var(--border); }

/* "Wys my lyne regs" — split my lines to the right, others stay left */
.stage.split-right .reel { max-width: 74%; margin-left: 0; margin-right: auto; }
.stage.split-right .reel.is-my-line { margin-left: auto; margin-right: 0; text-align: right; }
.stage.split-right .reel.is-my-line .inline-regie,
.stage.split-right .reel.is-my-line .hidden-line { text-align: right; }
.stage.split-right .regie { max-width: 100%; }

.hidden-line {
  cursor: pointer;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  user-select: none;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}
.hidden-line:hover { border-color: var(--accent); color: var(--text); background: var(--panel-2); }

.btn {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary { background: var(--accent); color: #201803; border-color: var(--accent); font-weight: 600; box-shadow: var(--shadow-sm); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.good { border-color: var(--good); }
.btn.bad { border-color: var(--bad); }

.card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.4rem;
  max-width: 640px;
  margin: 0 auto;
  animation: fadeInUp 0.4s var(--ease) both;
}
.card .cue-label { font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-bottom: 0.4rem; font-weight: 600; }
.card .cue-text { color: var(--text-dim); font-style: italic; margin-bottom: 1rem; }
.card .your-turn { font-size: 0.85em; color: var(--accent); margin-bottom: 0.5rem; font-weight: 600; }
.card .answer { margin-top: 1rem; padding: 0.8rem; border-radius: var(--radius-sm); background: rgba(107, 191, 123, 0.1); border: 1px solid var(--good); animation: fadeInUp 0.3s var(--ease) both; }
.card .actions { display: flex; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; }

.mc-options { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.mc-option {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  font-size: 1em;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.15s var(--ease);
  animation: fadeInUp 0.35s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 20) * 30ms);
}
.mc-option:hover:not(:disabled) { border-color: var(--accent-2); transform: translateY(-1px); }
.mc-option:active:not(:disabled) { transform: translateY(0) scale(0.99); }
.mc-option.correct { border-color: var(--good); background: rgba(107, 191, 123, 0.12); }
.mc-option.incorrect { border-color: var(--bad); background: rgba(224, 102, 95, 0.12); }

.order-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.order-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem;
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), opacity 0.2s var(--ease);
  animation: fadeInUp 0.35s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 20) * 30ms);
}
.order-item.correct-pos { border-color: var(--good); }
.order-item .handle { color: var(--text-dim); display: inline-flex; }
.order-item .move-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
  flex-shrink: 0;
}
.order-item .move-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.order-item .move-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.order-item.dragging { opacity: 0.5; }

.empty-state { color: var(--text-dim); text-align: center; padding: 3rem 1rem; }

.botbar {
  padding: 0.6rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

.progress-bar {
  height: 6px;
  background: var(--panel-2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1.1rem;
}
.progress-bar .fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s var(--ease); }

/* ---------- Agtergrond (background info) modal ---------- */
#agtergrond-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}
#agtergrond-overlay[hidden] { display: none; }
.agtergrond-panel {
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.35s var(--ease) both;
  overflow: hidden;
}
.agtergrond-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0.75rem;
}
.agtergrond-head h2 {
  margin: 0;
  font-family: var(--display-family);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}
.agtergrond-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0 1.5rem 0.9rem;
  border-bottom: 1px solid var(--border);
}
.agtergrond-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.2rem;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.agtergrond-tab:hover { color: var(--text); }
.agtergrond-tab.active { color: var(--accent); border-color: var(--accent); }
.agtergrond-body {
  padding: 1.25rem 1.5rem 1.75rem;
  overflow-y: auto;
}
.agtergrond-text {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-line;
}
.karakter-kaart { margin-bottom: 1.1rem; }
.karakter-kaart:last-child { margin-bottom: 0; }
.karakter-naam {
  font-family: var(--display-family);
  font-weight: 600;
  color: var(--accent-2);
  margin-bottom: 0.2rem;
}
.karakter-rol { color: var(--text-dim); font-weight: 400; font-size: 0.85em; }
