:root {
  --hs-navy: #102a43;
  --hs-navy-dark: #071a2b;
  --hs-blue: #1f6feb;
  --hs-gold: #f4b942;
  --hs-paper: #f6f2e9;
  --hs-ink: #17212b;
  --hs-muted: #66788a;
  --hs-card: #ffffff;
  --hs-line: #c9d6e2;
}

html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--hs-ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(244,185,66,.17), transparent 28rem),
    linear-gradient(180deg, #edf4fa 0%, #f8fafc 48%, #f6f2e9 100%);
}
main { flex: 1; }
a { color: var(--hs-blue); }

.site-header {
  background: linear-gradient(135deg, var(--hs-navy-dark), var(--hs-navy));
  color: #fff;
  box-shadow: 0 .35rem 1.5rem rgba(7,26,43,.18);
}
.brand-wordmark { color: #fff; letter-spacing: -.03em; font-size: 1.25rem; }
.brand-wordmark strong { color: var(--hs-gold); }
.site-footer { color: #587083; }
.site-footer a { color: inherit; }

.screen { display: none; }
.screen.active { display: block; animation: screenIn .28s ease-out; }
@keyframes screenIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.min-vh-game { min-height: calc(100vh - 160px); }

.eyebrow {
  display: inline-flex;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .75rem;
  font-weight: 800;
  color: var(--hs-blue);
}
.hero-copy h1 { color: var(--hs-navy); letter-spacing: -.055em; }
.hero-copy h1 span { color: var(--hs-blue); }
.hero-copy .lead { max-width: 42rem; color: #526779; }
.feature-pill {
  padding: .55rem .85rem;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(16,42,67,.12);
  border-radius: 999px;
}
.start-card { border-radius: 1.5rem; background: rgba(255,255,255,.93); backdrop-filter: blur(10px); }
.best-score-box { min-width: 4.5rem; padding: .55rem .75rem; border-radius: 1rem; background: #eef5ff; }
.best-score-box strong { font-size: 1.5rem; color: var(--hs-blue); }
.form-select, .btn { border-radius: .8rem; }
.btn-primary { --bs-btn-bg: var(--hs-blue); --bs-btn-border-color: var(--hs-blue); --bs-btn-hover-bg: #185fc9; --bs-btn-hover-border-color: #185fc9; }

.game-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.score-panel { display: flex; align-items: center; gap: .7rem; background: var(--hs-navy); color: #fff; padding: .55rem .75rem .55rem 1rem; border-radius: 999px; }
.score-panel strong { display: grid; place-items: center; min-width: 2.5rem; min-height: 2.5rem; border-radius: 50%; background: var(--hs-gold); color: var(--hs-navy-dark); font-size: 1.15rem; }

.candidate-panel { top: 1rem; background: rgba(255,255,255,.82); border: 1px solid rgba(16,42,67,.1); border-radius: 1.25rem; padding: 1rem; box-shadow: 0 1rem 2.5rem rgba(16,42,67,.08); }
.candidate-label { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 800; color: var(--hs-blue); }
.event-card {
  position: relative;
  display: flex;
  gap: .9rem;
  padding: 1rem;
  border-radius: 1rem;
  background: var(--hs-card);
  border: 1px solid #dbe4ec;
  box-shadow: 0 .45rem 1.2rem rgba(16,42,67,.08);
  touch-action: pan-y;
}
.candidate-card { border: 2px dashed var(--hs-blue); background: #f7fbff; cursor: grab; }
.candidate-card:active { cursor: grabbing; }
.drag-handle { width: 1.4rem; flex: 0 0 1.4rem; display: grid; align-content: center; gap: .24rem; cursor: grab; touch-action: none; }
.drag-handle span { display: block; height: 3px; border-radius: 2px; background: #7890a5; }
.event-card-content { min-width: 0; flex: 1; }
.category-badge { display: inline-block; margin-bottom: .45rem; font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #526779; }
.hidden-year { display: inline-flex; padding: .35rem .65rem; background: var(--hs-navy); color: #fff; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.drag-instruction { color: var(--hs-muted); font-size: .9rem; }

.timeline-shell { background: rgba(255,255,255,.75); border: 1px solid rgba(16,42,67,.1); border-radius: 1.25rem; padding: 1rem; min-height: 25rem; }
.timeline-heading { padding: .25rem .25rem 1rem; }
.timeline-list { position: relative; display: grid; gap: .8rem; padding-left: 1.35rem; }
.timeline-list::before { content: ""; position: absolute; left: .42rem; top: .8rem; bottom: .8rem; width: 3px; border-radius: 3px; background: linear-gradient(var(--hs-blue), var(--hs-gold)); }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -1.43rem; top: 1.45rem; width: .85rem; height: .85rem; border: 3px solid #fff; border-radius: 50%; background: var(--hs-blue); box-shadow: 0 0 0 2px var(--hs-blue); z-index: 2; }
.timeline-item .event-card { align-items: center; }
.timeline-year { min-width: 4.2rem; font-size: 1.2rem; font-weight: 900; color: var(--hs-navy); }
.timeline-description { display: none; }
.timeline-item.reveal-description .timeline-description { display: block; }
.timeline-item.is-candidate .event-card { border: 2px solid var(--hs-blue); background: #f7fbff; }
.timeline-item.is-candidate::before { background: var(--hs-gold); box-shadow: 0 0 0 2px var(--hs-gold); }
.timeline-item.is-candidate .timeline-year { color: transparent; position: relative; }
.timeline-item.is-candidate .timeline-year::after { content: "?"; color: var(--hs-blue); position: absolute; inset: 0; }
.sortable-ghost { opacity: .25; }
.sortable-drag { transform: rotate(1deg); box-shadow: 0 1.2rem 2.5rem rgba(16,42,67,.2); }
.drop-hint { text-align: center; margin: 1rem 0 .25rem 1.35rem; padding: .9rem; border: 2px dashed #c6d4df; border-radius: .9rem; color: #738698; }
.timeline-list:not(:empty) + .drop-hint { display: none; }

.result-card { max-width: 38rem; padding: 2rem; border-radius: 1.5rem; background: rgba(255,255,255,.95); }
.result-icon { font-size: 3rem; }
.result-score { display: inline-flex; flex-direction: column; min-width: 10rem; padding: 1rem 1.5rem; border-radius: 1.2rem; background: var(--hs-navy); color: #fff; }
.result-score strong { font-size: 3rem; line-height: 1; color: var(--hs-gold); }
.how-to-list li { margin-bottom: .75rem; }

@media (max-width: 991.98px) {
  .min-vh-game { min-height: auto; }
  .candidate-panel { position: static !important; }
  .candidate-card { touch-action: pan-y; }
}
@media (max-width: 575.98px) {
  .site-header .container { padding-left: .75rem; padding-right: .75rem; }
  .brand-wordmark { font-size: 1.08rem; }
  .hero-copy h1 { font-size: clamp(3.2rem, 17vw, 4.7rem); }
  .start-card .card-body { padding: 1.25rem !important; }
  .game-topbar { align-items: flex-start; }
  .game-topbar h1 { font-size: 1.02rem; }
  .score-panel > span { display: none; }
  .timeline-shell { padding: .75rem; }
  .timeline-list { padding-left: 1.05rem; }
  .timeline-list::before { left: .25rem; }
  .timeline-item::before { left: -1.23rem; }
  .timeline-item .event-card { align-items: flex-start; padding: .85rem; }
  .timeline-year { min-width: 3.3rem; font-size: 1rem; }
  .event-card h3 { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Hand met drie keuzekaarten */
.candidate-list {
  display: grid;
  gap: .75rem;
}
.candidate-source {
  min-width: 0;
}
.candidate-source .candidate-card {
  padding: .85rem;
}
.candidate-source .candidate-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.candidate-source.is-disabled {
  opacity: .38;
  pointer-events: none;
  filter: grayscale(.45);
}
.candidate-source.is-selected {
  opacity: .62;
}
.candidate-source.is-selected .candidate-card {
  border-style: solid;
}
.timeline-year.is-hidden {
  color: var(--hs-blue);
}
.timeline-item.is-wrong .event-card {
  border: 2px solid #dc3545;
  background: #fff7f7;
}
.timeline-item.is-wrong::before {
  background: #dc3545;
  box-shadow: 0 0 0 2px #dc3545;
}
.sortable-chosen .event-card {
  border-color: var(--hs-blue);
}

@media (min-width: 992px) {
  .candidate-panel {
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }
}

/* Game interaction refinements */
.candidate-source,
.candidate-card,
.timeline-item.is-candidate,
.timeline-item.is-candidate .event-card {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.candidate-source:active,
.candidate-card:active,
.timeline-item.is-candidate:active,
.timeline-item.is-candidate .event-card:active {
  cursor: grabbing;
}

.drag-card-hint {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--hs-blue);
  font-size: .78rem;
  font-weight: 700;
}

.drag-card-hint::before {
  content: "↕";
  font-size: 1rem;
}

.timeline-list {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  min-height: 8rem;
}

.timeline-item {
  position: relative;
  margin-block: .75rem;
}

.timeline-item.is-candidate .event-card {
  border: 2px dashed var(--hs-blue);
  background: #f3f8ff;
  box-shadow: 0 .75rem 2rem rgba(31, 111, 235, .16);
}

.sortable-ghost {
  opacity: .22;
}

.sortable-drag {
  opacity: .95;
  transform: rotate(.5deg);
}

.revealed-year {
  flex: 0 0 auto;
  padding: .25rem .55rem;
  border-radius: 999px;
  background: var(--hs-navy);
  color: #fff;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.result-card {
  max-width: 58rem;
}

.result-timeline-wrap {
  padding: 1rem;
  border: 1px solid rgba(16, 42, 67, .12);
  border-radius: 1rem;
  background: rgba(246, 242, 233, .55);
}

.result-timeline {
  max-height: 36rem;
  overflow-y: auto;
  padding-inline: .5rem;
}

/* Omschrijvingen alleen tonen wanneer er voldoende ruimte is. */
.candidate-description,
.timeline-description {
  display: none;
}

@media (min-width: 768px) {
  .candidate-description,
  .timeline-description {
    display: block;
  }
}

/* Duidelijke invoegposities voor SortableJS */
.timeline-list .timeline-item {
  min-height: 1px;
}
.timeline-list .sortable-ghost {
  min-height: 5.5rem;
  border: 2px dashed var(--hs-blue);
  border-radius: 1rem;
  background: rgba(31, 111, 235, .08);
  opacity: 1;
}
.timeline-list .sortable-ghost > * {
  opacity: .18;
}

/* History edition: donker, gelaagd en geïnspireerd op oud papier en brons */
:root {
  --hs-navy: #171d2b;
  --hs-navy-dark: #080b12;
  --hs-blue: #a9782d;
  --hs-gold: #e1b866;
  --hs-paper: #eee2c8;
  --hs-ink: #251f18;
  --hs-muted: #746956;
  --hs-card: #fffaf0;
  --hs-line: #b79a67;
}

body {
  background:
    linear-gradient(rgba(255,250,240,.94), rgba(239,226,197,.96)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(80,59,30,.035) 31px 32px),
    radial-gradient(circle at 15% 10%, #f4d58d 0, transparent 34rem),
    #e7d7b7;
}

.site-header {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 75% -100%, rgba(225,184,102,.24), transparent 60%),
    linear-gradient(135deg, #090d16, #1b2437 62%, #101521);
  border-bottom: 1px solid rgba(225,184,102,.42);
}
.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--hs-gold), transparent);
}
.brand-wordmark { font-family: Georgia, 'Times New Roman', serif; letter-spacing: .01em; }
.brand-wordmark strong { color: var(--hs-gold); }
.hero-copy h1, .game-topbar h1, .timeline-heading h2, .result-card h1 { font-family: Georgia, 'Times New Roman', serif; }
.hero-copy h1 span { color: #9b6824; }
.eyebrow, .candidate-label { color: #8c6228; }
.start-card, .candidate-panel, .timeline-shell, .result-card {
  background: rgba(255,250,240,.94);
  border: 1px solid rgba(126,84,34,.28) !important;
  box-shadow: 0 1.25rem 3rem rgba(50,35,18,.16) !important;
}
.event-card {
  background:
    linear-gradient(90deg, rgba(126,84,34,.045), transparent 12%, transparent 88%, rgba(126,84,34,.04)),
    #fffaf0;
  border-color: rgba(126,84,34,.28);
  box-shadow: 0 .5rem 1.25rem rgba(54,39,20,.11);
}
.candidate-card {
  border: 1px solid rgba(169,120,45,.65);
  box-shadow: inset 0 0 0 2px rgba(225,184,102,.18), 0 .65rem 1.4rem rgba(54,39,20,.12);
  background: linear-gradient(145deg, #fffdf6, #f5e8cc);
}
.category-badge { color: #7d5728; }
.btn-primary {
  --bs-btn-bg: #8c6228;
  --bs-btn-border-color: #8c6228;
  --bs-btn-hover-bg: #6f4b1d;
  --bs-btn-hover-border-color: #6f4b1d;
}
.score-panel { background: #151b28; border: 1px solid rgba(225,184,102,.35); }
.score-panel strong { background: var(--hs-gold); }
.timeline-list::before { background: linear-gradient(#8c6228, #d4ae60, #7b5727); }
.timeline-item::before { background: #9b6824; box-shadow: 0 0 0 2px #9b6824; }
.timeline-item.is-candidate .event-card { border-color: #9b6824; background: #fff7e4; }
.drag-card-hint { color: #82591f; }
.mobile-swipe-hint { display: none; font-size: .72rem; color: var(--hs-muted); }
.candidate-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }

/* Mobiel: tijdlijn eerst, keuzekaarten als compacte horizontale lade. */
@media (max-width: 767.98px) {
  #gameScreen .container { padding-inline: .65rem; padding-bottom: 13rem; }
  #gameScreen .row { display: flex; flex-direction: column; gap: .75rem !important; }
  #gameScreen .col-lg-8 { order: 1 !important; }
  #gameScreen .col-lg-4 { order: 2 !important; }
  .game-topbar { position: sticky; top: 0; z-index: 1015; margin-inline: -.65rem; padding: .55rem .75rem; background: rgba(255,250,240,.95); border-bottom: 1px solid rgba(126,84,34,.2); backdrop-filter: blur(8px); }
  .timeline-shell { min-height: 18rem; padding: .65rem; border-radius: .9rem; }
  .timeline-heading { padding-bottom: .35rem; }
  .timeline-list { gap: .35rem; padding: .45rem 0 .45rem .95rem; }
  .timeline-item { margin-block: .25rem; }
  .timeline-item .event-card { padding: .65rem .72rem; border-radius: .72rem; }
  .timeline-item h3 { font-size: .93rem; line-height: 1.2; margin-top: .3rem !important; }
  .timeline-item .category-badge { font-size: .58rem; margin-bottom: 0; }
  .timeline-item::before { top: 1.05rem; width: .65rem; height: .65rem; left: -1.03rem; }
  .timeline-list::before { left: .2rem; width: 2px; }

  .candidate-panel {
    position: fixed !important;
    z-index: 1030;
    left: .5rem;
    right: .5rem;
    bottom: .5rem;
    top: auto;
    padding: .65rem;
    border-radius: 1rem;
    max-height: none;
    overflow: visible;
    box-shadow: 0 -1rem 2.5rem rgba(23,29,43,.24) !important;
  }
  .candidate-panel-heading { margin-bottom: .45rem; }
  .mobile-swipe-hint { display: inline; }
  .candidate-list {
    display: flex;
    gap: .55rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    padding: .1rem .1rem .45rem;
    scrollbar-width: thin;
  }
  .candidate-source { flex: 0 0 min(76vw, 20rem); scroll-snap-align: center; }
  .candidate-source .candidate-card { min-height: 5.9rem; padding: .65rem .72rem; }
  .candidate-source h2 { font-size: .9rem; line-height: 1.2; }
  .candidate-source .category-badge { font-size: .58rem; margin-bottom: 0; }
  .drag-card-hint { margin-top: .25rem !important; font-size: .68rem; }
  .drag-instruction { display: none; }
  #confirmButton { padding-block: .6rem; font-size: .95rem; }
  .candidate-description, .timeline-description { display: none !important; }
  .sortable-drag { max-width: min(82vw, 22rem); }
}

@media (min-width: 768px) {
  .event-card h2, .event-card h3 { font-family: Georgia, 'Times New Roman', serif; }
  .candidate-description, .timeline-description { color: #746956 !important; }
}

/* v3: uitsluitend het historische brons/sepia-palet */
:root {
  --hs-navy: #2a2118;
  --hs-navy-dark: #120e0a;
  --hs-blue: #9b6824;
  --hs-gold: #e1b866;
  --hs-paper: #eee2c8;
  --hs-ink: #251f18;
  --hs-muted: #746956;
  --hs-card: #fffaf0;
  --hs-line: #b79a67;
}

.text-primary { color: #8c6228 !important; }
.text-secondary, .text-secondary-emphasis { color: #746956 !important; }
a { color: #7c521f; }
a:hover { color: #5f3d16; }
.btn-outline-primary {
  --bs-btn-color: #8c6228;
  --bs-btn-border-color: #8c6228;
  --bs-btn-hover-bg: #8c6228;
  --bs-btn-hover-border-color: #8c6228;
  --bs-btn-active-bg: #6f4b1d;
  --bs-btn-active-border-color: #6f4b1d;
}
.form-select:focus, .form-check-input:focus {
  border-color: #b88943;
  box-shadow: 0 0 0 .25rem rgba(169,120,45,.18);
}
.form-check-input:checked { background-color: #8c6228; border-color: #8c6228; }
.hero-copy .lead, .category-badge { color: #746956; }
.feature-pill { border-color: rgba(126,84,34,.28); }
.candidate-panel, .timeline-shell { border-color: rgba(126,84,34,.24); }
.event-card { border-color: rgba(126,84,34,.28); }
.drag-handle span { background: #9b815e; }
.drop-hint { border-color: #c6ad82; color: #806f57; }
.timeline-item.is-candidate .event-card,
.candidate-card { background: linear-gradient(145deg, #fffdf6, #f5e8cc); }
.timeline-list .sortable-ghost {
  border-color: #9b6824;
  background: rgba(169,120,45,.12);
}
.sortable-drag { box-shadow: 0 1.2rem 2.5rem rgba(54,39,20,.25); }
.test-mode-switch {
  padding: .85rem 1rem .85rem 3.25rem;
  border: 1px solid rgba(126,84,34,.22);
  border-radius: .9rem;
  background: rgba(225,184,102,.10);
}
.test-mode-switch .form-check-input { margin-left: -2.25rem; }

/* De bevestigknop bestaat pas visueel zodra er iets te bevestigen is. */
#confirmButton.d-none { display: none !important; }

/* Mobiel: geen zijwaartse carrousel, maar drie compacte kaarten onder elkaar. */
@media (max-width: 767.98px) {
  #gameScreen .container { padding-bottom: 19rem; }
  .candidate-panel {
    left: .4rem;
    right: .4rem;
    bottom: .4rem;
    max-height: 48vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .candidate-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: .38rem;
    overflow: visible;
    padding: 0;
  }
  .candidate-source {
    width: 100%;
    min-width: 0;
  }
  .candidate-source .candidate-card {
    min-height: 0;
    padding: .52rem .65rem;
  }
  .candidate-source h2 {
    margin-top: .15rem !important;
    margin-bottom: 0 !important;
    font-size: .84rem;
    line-height: 1.15;
  }
  .candidate-source .category-badge { font-size: .54rem; }
  .drag-card-hint { display: none; }
  .mobile-swipe-hint::before { content: "Sleep een kaart omhoog · "; }
  #confirmButton:not(.d-none) { margin-top: .5rem; }
}


/* v4: definitieve historische kleurlaag en mobiele keuzelade */
:root {
  --hs-accent: #8a5a22;
  --hs-accent-dark: #5f3914;
  --hs-accent-light: #d7b06a;
  --hs-surface-dark: #24180f;
}

.badge.text-bg-light,
.best-score-box,
.score-panel,
.form-check-input,
.form-check-input:not(:checked) {
  --bs-bg-opacity: 1;
  border-color: rgba(111,72,27,.35) !important;
}
.badge.text-bg-light { background: #ead9b7 !important; color: #4a3016 !important; }
.best-score-box { background: #ead9b7 !important; }
.best-score-box strong { color: var(--hs-accent-dark) !important; }
.score-panel { background: var(--hs-surface-dark) !important; }
.form-check-input { background-color: #d8c6a3; }
.form-check-input:checked { background-color: var(--hs-accent) !important; border-color: var(--hs-accent) !important; }
.form-check-input:focus { border-color: var(--hs-accent-light) !important; box-shadow: 0 0 0 .25rem rgba(138,90,34,.2) !important; }
.sortable-chosen .event-card,
.sortable-drag .event-card,
.timeline-list .sortable-ghost {
  border-color: var(--hs-accent) !important;
  box-shadow: 0 1.1rem 2.4rem rgba(64,39,16,.28) !important;
}
.sortable-drag { box-shadow: none !important; }
.candidate-card-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.candidate-card-actions .btn { position: relative; z-index: 5; }
.candidate-panel-heading { width: 100%; border: 0; background: transparent; padding: 0; text-align: left; }

@media (max-width: 767.98px) {
  #gameScreen .container { padding-bottom: 6rem; }
  .candidate-panel {
    max-height: min(72vh, 38rem);
    overflow: hidden;
    transition: max-height .22s ease, padding .22s ease, transform .22s ease;
  }
  .candidate-panel.is-expanded { max-height: min(72vh, 38rem); overflow-y: auto; }
  .candidate-panel.is-collapsed { max-height: 3.35rem; padding-block: .75rem; overflow: hidden; }
  .candidate-panel.is-collapsed .candidate-list,
  .candidate-panel.is-collapsed .drag-instruction,
  .candidate-panel.is-collapsed #confirmButton { display: none !important; }
  .candidate-panel.is-collapsed .candidate-panel-heading { margin-bottom: 0; }
  .candidate-panel.is-collapsed .mobile-swipe-hint { font-weight: 700; color: var(--hs-accent-dark); }
  .candidate-panel.is-expanded .candidate-list { display: grid; }
  .candidate-source .candidate-card { padding: .75rem; }
  .candidate-source h2 { font-size: .94rem; }
  .candidate-card-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .timeline-item.is-candidate .event-card { padding-bottom: .8rem; }
}

/* v6 — stabiele mobiele drag-and-drop en volledig historisch palet */
:root {
  --hs-navy: #332317;
  --hs-navy-dark: #1a110b;
  --hs-blue: #8b5a23;
  --hs-gold: #d6aa5e;
  --hs-paper: #f2e7d2;
  --hs-ink: #2b2118;
  --hs-muted: #786a57;
  --hs-card: #fffaf0;
  --hs-line: #c4a36e;
  --hs-accent: #8b5a23;
  --hs-accent-dark: #5f3814;
  --hs-accent-soft: #ead7b4;
  --hs-success: #50633e;
  --hs-error: #7a3f32;
}

/* Bootstrap-accenten consequent neutraliseren. */
.text-primary, .link-primary { color: var(--hs-accent) !important; }
.btn-primary {
  --bs-btn-bg: var(--hs-accent);
  --bs-btn-border-color: var(--hs-accent);
  --bs-btn-hover-bg: #70451b;
  --bs-btn-hover-border-color: #70451b;
  --bs-btn-active-bg: #5f3814;
  --bs-btn-active-border-color: #5f3814;
  --bs-btn-focus-shadow-rgb: 139, 90, 35;
}
.btn-outline-primary {
  --bs-btn-color: var(--hs-accent);
  --bs-btn-border-color: var(--hs-accent);
  --bs-btn-hover-bg: var(--hs-accent);
  --bs-btn-hover-border-color: var(--hs-accent);
  --bs-btn-active-bg: #5f3814;
  --bs-btn-active-border-color: #5f3814;
  --bs-btn-focus-shadow-rgb: 139, 90, 35;
}
.form-select:focus, .btn:focus-visible, .btn-close:focus {
  border-color: #b78642 !important;
  box-shadow: 0 0 0 .22rem rgba(139,90,35,.2) !important;
}
.badge.text-bg-light { background: #ead8b5 !important; color: #513317 !important; }
.best-score-box { background: #ead8b5 !important; }
.best-score-box strong { color: #5f3814 !important; }

/* Eigen switch: geen Bootstrap-afbeelding, geen scheve thumb en geen blauw. */
.test-mode-switch {
  padding: .95rem 1rem;
  border: 1px solid rgba(112,69,27,.25);
  border-radius: 1rem;
  background: rgba(234,215,180,.42);
}
.test-mode-label {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin: 0;
  cursor: pointer;
}
.test-mode-label > span:last-child { min-width: 0; }
.test-mode-label strong { display: block; font-size: 1.05rem; line-height: 1.2; }
.test-mode-label small { display: block; margin-top: .18rem; color: var(--hs-muted); }
.test-mode-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}
.test-mode-track {
  position: relative;
  flex: 0 0 3.15rem;
  width: 3.15rem;
  height: 1.72rem;
  border: 1px solid #a87b3d;
  border-radius: 999px;
  background: #d9c39d;
  box-shadow: inset 0 1px 2px rgba(63,39,17,.15);
  transition: background-color .18s ease, border-color .18s ease;
}
.test-mode-thumb {
  position: absolute;
  top: 50%;
  left: .18rem;
  width: 1.28rem;
  height: 1.28rem;
  border-radius: 50%;
  background: #fff9ed;
  box-shadow: 0 2px 5px rgba(52,32,13,.28);
  transform: translateY(-50%);
  transition: transform .18s ease;
}
.test-mode-input:checked + .test-mode-label .test-mode-track {
  background: var(--hs-accent);
  border-color: var(--hs-accent-dark);
}
.test-mode-input:checked + .test-mode-label .test-mode-thumb {
  transform: translate(1.42rem, -50%);
}
.test-mode-input:focus-visible + .test-mode-label .test-mode-track {
  outline: 3px solid rgba(139,90,35,.22);
  outline-offset: 2px;
}

/* Geheime ontwikkelaarsknop rechtsonder op het startscherm. */
#startScreen { position: relative; }
.test-mode-unlock {
  position: fixed;
  right: .75rem;
  bottom: .75rem;
  z-index: 20;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--hs-accent-dark);
  opacity: 0;
  transition: opacity .18s ease, background-color .18s ease, border-color .18s ease;
}
.test-mode-unlock:hover,
.test-mode-unlock:focus-visible {
  opacity: .82;
  background: rgba(234,215,180,.78);
  border-color: rgba(112,69,27,.35);
  outline: none;
}

/* Drag-staten zonder blauwe rand of schaduw. */
.sortable-chosen .event-card,
.sortable-drag .event-card,
.timeline-list .sortable-ghost,
.timeline-item.is-candidate .event-card {
  border-color: #9a641f !important;
  background: linear-gradient(145deg, #fffaf0, #f0ddb8) !important;
  box-shadow: 0 .9rem 2rem rgba(67,40,16,.25) !important;
}
.timeline-list .sortable-ghost {
  border-style: dashed !important;
  background: rgba(154,100,31,.13) !important;
}
.sortable-drag { box-shadow: none !important; }

/* Feedback als toast in dezelfde historische stijl. */
.history-toast-container { z-index: 1090; }
.history-toast {
  overflow: hidden;
  border: 1px solid rgba(93,56,20,.34);
  border-radius: 1rem;
  background: #fff8e9;
  color: var(--hs-ink);
  box-shadow: 0 1rem 2.6rem rgba(45,28,13,.28);
}
.history-toast .toast-header {
  padding: .7rem .85rem;
  border-bottom: 1px solid rgba(93,56,20,.18);
  background: #ead7b4;
  color: #3f2814;
}
.history-toast .toast-body { padding: .9rem; }
.toast-seal {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  margin-right: .55rem;
  border-radius: 50%;
  background: var(--hs-accent);
  color: #fff8e9;
}
.history-toast.toast-success { border-left: .38rem solid var(--hs-success); }
.history-toast.toast-error { border-left: .38rem solid var(--hs-error); }
.history-toast.toast-neutral { border-left: .38rem solid var(--hs-accent); }

/* Uitlegmodal als onderdeel van de gamewereld. */
.history-modal {
  overflow: hidden;
  border: 1px solid rgba(100,63,24,.3) !important;
  border-radius: 1.35rem;
  background:
    linear-gradient(rgba(255,250,240,.97), rgba(244,231,205,.98)),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(85,57,27,.035) 27px 28px);
  color: var(--hs-ink);
}
.history-modal-header {
  padding: 1.35rem 1.5rem;
  border-bottom: 1px solid rgba(100,63,24,.22);
  background: linear-gradient(135deg, #332317, #5b3a1c);
  color: #fff6e4;
}
.modal-eyebrow {
  display: block;
  margin-bottom: .2rem;
  color: #dfbd7b;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.history-modal-header .btn-close { filter: sepia(1) brightness(2.5); opacity: .8; }
.history-rule-intro {
  margin-bottom: 1.25rem;
  padding: .9rem 1rem;
  border-left: .28rem solid var(--hs-accent);
  background: rgba(234,215,180,.42);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.05rem;
}
.history-rule-list { counter-reset: history-rule; padding-left: 0; list-style: none; }
.history-rule-list li {
  position: relative;
  min-height: 2.25rem;
  margin-bottom: .8rem;
  padding-left: 2.7rem;
}
.history-rule-list li::before {
  counter-increment: history-rule;
  content: counter(history-rule);
  position: absolute;
  left: 0;
  top: -.15rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--hs-accent);
  color: #fff8e9;
  font-weight: 800;
}
.same-year-rule {
  margin-top: 1.3rem;
  padding: 1rem;
  border: 1px solid rgba(139,90,35,.3);
  border-radius: .9rem;
  background: #f1dfbd;
}
.same-year-rule strong { display: block; margin-bottom: .25rem; color: #633c16; }

/* Mobiel: drie kaarten groot in een vaste lade; pas na een echte drop inklappen. */
@media (max-width: 767.98px) {
  #gameScreen .container { padding-bottom: 18.5rem; }
  .candidate-panel {
    position: fixed !important;
    z-index: 1035;
    left: .45rem;
    right: .45rem;
    bottom: max(.45rem, env(safe-area-inset-bottom));
    top: auto !important;
    max-height: min(66vh, 36rem);
    padding: .8rem;
    overflow-y: auto;
    border: 1px solid rgba(104,64,24,.3);
    background: rgba(255,248,233,.98);
    box-shadow: 0 -1rem 2.6rem rgba(48,29,12,.25) !important;
    transition: max-height .2s ease, padding .2s ease;
  }
  .candidate-panel.is-expanded { max-height: min(66vh, 36rem); }
  .candidate-panel.is-collapsed { max-height: 3.35rem; overflow: hidden; }
  .candidate-panel.is-collapsed .candidate-list,
  .candidate-panel.is-collapsed .drag-instruction,
  .candidate-panel.is-collapsed #confirmButton { display: none !important; }
  .candidate-panel.is-dragging {
    max-height: min(66vh, 36rem) !important;
    overflow: visible !important;
    transition: none !important;
  }
  .candidate-panel-heading { margin-bottom: .55rem; }
  .mobile-swipe-hint { display: inline; color: #654019; font-weight: 700; }
  .candidate-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: .48rem;
    overflow: visible;
    padding: 0;
  }
  .candidate-source { width: 100%; min-width: 0; }
  .candidate-source .candidate-card {
    min-height: 0;
    padding: .62rem .72rem;
    touch-action: none;
  }
  .candidate-source h2 { margin: .12rem 0 0 !important; font-size: .9rem; line-height: 1.18; }
  .candidate-source .category-badge { margin-bottom: 0; font-size: .56rem; }
  .candidate-description { display: none !important; }
  .drag-card-hint { margin-top: .2rem !important; font-size: .67rem; }
  .drag-instruction { display: none; }
  .sortable-fallback { max-width: calc(100vw - 1.5rem) !important; }
  .timeline-item.is-candidate .event-card { padding-bottom: .8rem; }
  .candidate-card-actions { display: grid; grid-template-columns: 1fr; gap: .42rem; }
  #confirmButton { display: none !important; }
  .history-toast-container { left: 0; right: 0; bottom: 4rem !important; padding: .65rem !important; }
  .history-toast { width: 100%; }
}

/* v7 — mobiele drag-flow, exacte markeringen en toast bovenaan */
.timeline-item::before {
  /* Centreer exact op de 3px lijn op left: .42rem binnen een lijst met padding-left: 1.35rem. */
  left: calc(-1.355rem + 1.5px) !important;
}

/* Keuzekaarten hebben vóór het slepen geen tijdlijncirkel. */
.candidate-source {
  position: relative;
}
.candidate-source::before {
  content: none !important;
}

/* Alleen de echte sleepkopie krijgt tijdelijk een markering. */
.sortable-fallback.candidate-source::before,
.candidate-source.sortable-drag::before {
  content: "" !important;
  position: absolute;
  left: -.55rem;
  top: 1.35rem;
  width: .85rem;
  height: .85rem;
  border: 3px solid #fff8e9;
  border-radius: 50%;
  background: var(--hs-gold);
  box-shadow: 0 0 0 2px var(--hs-accent);
  z-index: 20;
}

/* De actieknoppen bestaan pas op de gedropte kaart en nooit op een sleepkopie. */
.sortable-fallback .candidate-card-actions,
.sortable-drag .candidate-card-actions,
.sortable-chosen .candidate-card-actions {
  display: none !important;
}

/* Toast altijd boven in beeld. */
.history-toast-container {
  top: 0 !important;
  bottom: auto !important;
  left: 50% !important;
  right: auto !important;
  width: min(34rem, calc(100vw - 1rem));
  transform: translateX(-50%);
  padding-top: max(.75rem, env(safe-area-inset-top)) !important;
}
.history-toast { width: 100%; }

@media (max-width: 767.98px) {
  #gameScreen .container {
    padding-bottom: 2rem;
  }

  /* De lade staat omhoog zolang een keuze nodig is. */
  .candidate-panel {
    max-height: min(70vh, 38rem) !important;
    overflow-y: auto !important;
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform .22s ease, opacity .18s ease, visibility 0s linear 0s !important;
    will-change: transform;
  }
  .candidate-panel.is-expanded {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  /* Zodra slepen echt start of een kaart gedropt is, verdwijnt de hele lade. */
  .candidate-panel.is-dragging,
  .candidate-panel.is-collapsed {
    max-height: min(70vh, 38rem) !important;
    transform: translateY(calc(100% + 1.25rem));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow: visible !important;
    transition: transform .22s ease, opacity .16s ease, visibility 0s linear .22s !important;
  }

  /* Geen losse inklapbalk: het paneel keert alleen terug via spelactie. */
  .candidate-panel-heading {
    pointer-events: none;
  }
  .mobile-swipe-hint {
    display: none !important;
  }

  .candidate-panel.is-collapsed .candidate-list,
  .candidate-panel.is-collapsed .drag-instruction {
    display: grid !important;
  }

  /* De fallbackkaart blijft zichtbaar en stabiel terwijl de bronlade wegschuift. */
  .sortable-fallback {
    position: fixed !important;
    z-index: 1100 !important;
    max-width: calc(100vw - 1.25rem) !important;
    pointer-events: none !important;
  }

  .history-toast-container {
    top: 0 !important;
    bottom: auto !important;
    left: 50% !important;
    right: auto !important;
    width: calc(100vw - .8rem);
    padding: max(.45rem, env(safe-area-inset-top)) 0 0 !important;
  }
}

/* v8 — foutmoment, resultaatlijn en lokaal arcade-scorebord */
.wrong-placement-card {
  max-width: 62rem;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border: 1px solid rgba(112,69,27,.28);
  border-radius: 1.5rem;
  background: rgba(255,250,240,.96);
}
.wrong-placement-heading h1 { font-family: Georgia, 'Times New Roman', serif; }

/* De marker wordt ten opzichte van exact dezelfde lijnpositie berekend. */
.timeline-list {
  --timeline-line-x: .42rem;
  --timeline-dot-size: .85rem;
}
.timeline-list::before { left: var(--timeline-line-x) !important; }
.timeline-item::before {
  left: calc(var(--timeline-line-x) - 1.35rem - (var(--timeline-dot-size) / 2) + 1.5px) !important;
  width: var(--timeline-dot-size) !important;
  height: var(--timeline-dot-size) !important;
  box-sizing: border-box;
}
.result-timeline { padding-left: 1.35rem !important; padding-right: .5rem; }
.result-timeline.timeline-list::before { left: var(--timeline-line-x) !important; }

.arcade-board {
  padding: 1.15rem;
  border: 1px solid rgba(112,69,27,.27);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(239,222,188,.62), rgba(255,250,240,.9));
}
.arcade-board-mark { color: var(--hs-gold); font-size: 1.6rem; }
.leaderboard-entry {
  margin-bottom: 1rem;
  padding: .9rem;
  border: 1px dashed rgba(139,90,35,.48);
  border-radius: .8rem;
  background: rgba(255,248,233,.75);
}
.arcade-name-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.leaderboard-list { display: grid; gap: .42rem; padding: 0; list-style: none; }
.leaderboard-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  align-items: center;
  gap: .75rem;
  padding: .58rem .7rem;
  border-bottom: 1px solid rgba(112,69,27,.15);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.leaderboard-rank { color: #8b5a23; font-weight: 800; }
.leaderboard-name { letter-spacing: .16em; font-weight: 800; }
.leaderboard-score { color: #5f3814; font-size: 1.05rem; }
.leaderboard-row.is-empty { opacity: .48; }

@media (min-width: 768px) {
  /* Desktop: een andere handkaart mag de voorlopige keuze vervangen. */
  .timeline-item.is-candidate [data-action="cancel-placement"] { display: none; }
  .candidate-list.is-locked .candidate-source { opacity: 1; pointer-events: auto; }
  .candidate-list.is-locked .candidate-source.is-disabled { opacity: 1; pointer-events: auto; }
}

@media (max-width: 767.98px) {
  .timeline-list {
    --timeline-line-x: .2rem;
    --timeline-dot-size: .65rem;
  }
  .timeline-item::before {
    left: calc(var(--timeline-line-x) - .95rem - (var(--timeline-dot-size) / 2) + 1px) !important;
  }
  .result-timeline { padding-left: .95rem !important; }
  .wrong-placement-card { padding: 1rem; border-radius: 1rem; }
}


/* v9 — bronzen focus, zichtbare kaartacties en duidelijke foutkaart */
.form-control:focus,
.arcade-name-input:focus {
  color: var(--hs-ink) !important;
  background-color: #fffaf0 !important;
  border-color: #a66a24 !important;
  box-shadow: 0 0 0 .24rem rgba(166, 106, 36, .22) !important;
}
.input-group:focus-within {
  border-radius: .7rem;
  box-shadow: 0 0 0 .18rem rgba(166, 106, 36, .16);
}
.arcade-name-input::selection { background: #ddbd7d; color: #24170c; }

/* De acties zijn na de drop altijd zichtbaar; alleen de echte sleepkopie verbergt ze. */
.timeline-item.is-candidate:not(.sortable-drag):not(.sortable-fallback) .candidate-card-actions {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.timeline-item.is-candidate .candidate-card-actions .btn { pointer-events: auto !important; }

.timeline-item.is-wrong .event-card {
  border: 2px solid #8f351f !important;
  background: linear-gradient(145deg, #fff8e9, #f3d7b9) !important;
  box-shadow: 0 0 0 .3rem rgba(143, 53, 31, .12), 0 .9rem 1.8rem rgba(63, 35, 16, .14) !important;
}
.timeline-item.is-wrong::before {
  background: #8f351f !important;
  border-color: #fff8e9 !important;
  box-shadow: 0 0 0 2px #8f351f, 0 0 0 5px rgba(143, 53, 31, .16) !important;
}
.wrong-card-badge {
  display: inline-flex;
  align-items: center;
  padding: .28rem .55rem;
  border-radius: 999px;
  background: #6f291a;
  color: #fff8e9;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

@media (max-width: 767.98px) {
  .timeline-item.is-candidate .candidate-card-actions { display: grid !important; }
  .candidate-panel.is-expanded { transform: translateY(0) !important; visibility: visible !important; }
  .candidate-list:not(.is-locked) .candidate-source { pointer-events: auto !important; touch-action: pan-y !important; }
}


/* v10 — vaste tijdlijngeometrie, arcade-invoer en compacte footerlink */
.site-footer .container { align-items: flex-start; }
.site-footer a { display: inline-flex; width: auto; align-self: flex-start; }

.result-timeline-wrap,
.result-timeline,
.wrong-placement-card { overflow: visible !important; }
.timeline-list {
  --timeline-pad: 2.7rem;
  --timeline-line-x: 1rem;
  --timeline-dot-size: .9rem;
  padding-left: var(--timeline-pad) !important;
  overflow: visible !important;
}
.timeline-list::before {
  left: var(--timeline-line-x) !important;
  width: 3px !important;
}
.timeline-item::before {
  left: calc(var(--timeline-line-x) - var(--timeline-pad) - (var(--timeline-dot-size) / 2) + 1.5px) !important;
  width: var(--timeline-dot-size) !important;
  height: var(--timeline-dot-size) !important;
}
.result-timeline { padding-left: var(--timeline-pad) !important; padding-right: 0 !important; }

.arcade-entry-row { display: flex; align-items: stretch; gap: .75rem; }
.arcade-letter-boxes { display: grid; grid-template-columns: repeat(5, minmax(2.8rem, 4.2rem)); gap: .45rem; }
.arcade-letter-input {
  width: 100%;
  aspect-ratio: 1 / 1.05;
  border: 2px solid #c6995a;
  border-radius: .65rem;
  background: #fffaf0;
  color: #3d2816;
  text-align: center;
  font: 800 clamp(1.2rem, 3vw, 1.65rem)/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), 0 .2rem .45rem rgba(73,44,20,.08);
}
.arcade-letter-input:focus {
  outline: none;
  border-color: #8f581d;
  box-shadow: 0 0 0 .22rem rgba(166,106,36,.2), inset 0 0 0 1px #fff4d9;
}
.arcade-save-button { min-width: 7rem; }
.selection-warning {
  padding: .65rem .8rem;
  border: 1px solid rgba(143,53,31,.32);
  border-radius: .65rem;
  background: rgba(143,53,31,.07);
  color: #7b2f1f !important;
}
#startGameButton:disabled { opacity: .48; cursor: not-allowed; filter: grayscale(.25); }

@media (max-width: 767.98px) {
  .site-footer .container { align-items: flex-start !important; }
  .site-footer a { flex: 0 0 auto; align-self: flex-start; }
  .timeline-list {
    --timeline-pad: 2.15rem;
    --timeline-line-x: .75rem;
    --timeline-dot-size: .72rem;
  }
  .timeline-list::before { width: 2px !important; }
  .timeline-item::before {
    left: calc(var(--timeline-line-x) - var(--timeline-pad) - (var(--timeline-dot-size) / 2) + 1px) !important;
  }
  .arcade-entry-row { flex-direction: column; }
  .arcade-letter-boxes { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; }
  .arcade-save-button { width: 100%; }
}

/* v11 — compacte viewport en taalkeuze */
#startScreen > .container { padding-top: 1.1rem !important; padding-bottom: .25rem !important; }
#startScreen .min-vh-game { min-height: calc(100dvh - 126px); }
.site-footer { padding-top: .45rem !important; padding-bottom: .65rem !important; }
.language-switcher { display: inline-flex; gap: .25rem; padding: .2rem; border: 1px solid rgba(221,189,125,.35); border-radius: 999px; background: rgba(255,248,232,.09); }
.language-button { width: 2.25rem; height: 1.9rem; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 999px; background: transparent; font-size: 1.15rem; line-height: 1; opacity: .62; transition: opacity .15s ease, background .15s ease, border-color .15s ease, transform .15s ease; }
.language-button:hover, .language-button:focus-visible { opacity: 1; transform: translateY(-1px); outline: none; background: rgba(255,248,232,.14); }
.language-button.is-active { opacity: 1; border-color: #d6a44d; background: rgba(214,164,77,.22); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.privacy-language-bar { position: fixed; top: .75rem; right: .75rem; z-index: 10; }
.privacy-language-bar .language-switcher { background: #3d2816; }
@media (max-width: 575.98px) {
  #startScreen > .container { padding-top: .75rem !important; padding-bottom: 0 !important; }
  #startScreen .min-vh-game { min-height: auto; }
  .site-footer { padding-top: .35rem !important; padding-bottom: .5rem !important; }
  .language-button { width: 2rem; height: 1.75rem; font-size: 1.05rem; }
}

/* v12 — compacte NL/EN-keuze en datumweergave */
.language-switcher { flex: 0 0 auto; }
.language-button {
  width: 2.15rem;
  height: 1.8rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.revealed-date {
  font: inherit;
  font-weight: inherit;
  color: inherit;
}
@media (max-width: 575.98px) {
  .language-button { width: 2rem; height: 1.7rem; font-size: .68rem; }
}


/* v13 — testtools, scorebordlink en edwingames woordmerk */
.edwingames-wordmark { font-family: "Raleway", sans-serif; font-weight: 600; letter-spacing: .035em; }
.test-tools { border-top: 1px solid rgba(119,76,31,.22); padding-top: .9rem; }

/* v14 — vaste kop en acties met een eigen scrollvlak op fout- en uitslagschermen */
.result-screen { overflow: hidden; }
.result-screen-container {
  height: calc(100dvh - 7.4rem);
  min-height: 0;
}
.result-layout {
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden !important;
}
.result-fixed-header {
  position: relative;
  z-index: 2;
  padding-bottom: 1rem;
  background: inherit;
}
.result-scroll-area {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: .25rem .55rem 1rem .15rem;
  mask-image: linear-gradient(to bottom, transparent 0, #000 1rem, #000 calc(100% - 1rem), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 1rem, #000 calc(100% - 1rem), transparent 100%);
}
.result-scroll-area::-webkit-scrollbar { width: .72rem; }
.result-scroll-area::-webkit-scrollbar-track { background: rgba(139, 90, 35, .08); border-radius: 999px; }
.result-scroll-area::-webkit-scrollbar-thumb { background: linear-gradient(#d0a354, #8f5a22); border: 2px solid #f8f0df; border-radius: 999px; }
.result-fixed-actions {
  position: relative;
  z-index: 2;
  padding-top: 1rem;
  border-top: 1px solid rgba(112, 69, 27, .16);
  background: inherit;
}
.result-scroll-area .result-timeline-wrap { margin: 0 !important; }
.result-scroll-area .result-timeline {
  max-height: none !important;
  overflow: visible !important;
}

@media (max-width: 767.98px) {
  .result-screen-container {
    height: calc(100dvh - 6.35rem);
    padding-inline: .65rem;
  }
  .result-layout { border-radius: 1rem; }
  .wrong-placement-card,
  .result-card { padding: .9rem; }
  .result-fixed-header { padding-bottom: .7rem; }
  .result-fixed-header .result-icon { font-size: 2rem; }
  .result-fixed-header h1 { font-size: clamp(1.45rem, 7vw, 2rem); }
  .result-fixed-header .lead { font-size: .95rem; }
  .result-score { padding: .65rem 1rem; min-width: 8rem; }
  .result-score strong { font-size: 2.25rem; }
  .result-scroll-area { padding-right: .2rem; }
  .result-fixed-actions { padding-top: .7rem; }
}
