/* === Design tokens === */
:root {
  --bg: #0d0d0d;
  --bg-card: #1a1209;
  --bg-card-hover: #231810;
  --text: #d4c5a9;
  --text-muted: #8a7a65;
  --gold: #CFB53B;
  --gold-dim: #9a8628;
  --border: #3a2e1e;
  --header-bg: #0a0600;
  --shadow: 0 4px 24px rgba(0,0,0,0.7);
  --radius: 8px;
  --font-display: 'Cinzel Decorative', Georgia, serif;
  --font-heading: 'Cinzel', Georgia, serif;
  --font-body: 'EB Garamond', Georgia, serif;
}

/* === Lichte modus (beter leesbaar in de zon) === */
html.light-mode {
  --bg: #f0e6d3;
  --bg-card: #ede0c8;
  --bg-card-hover: #e4d4b5;
  --text: #1a0e00;
  --text-muted: #5a4020;
  --gold: #8a6a00;
  --gold-dim: #6a5000;
  --border: #c8a870;
  --header-bg: #2a1800;
  --shadow: 0 4px 24px rgba(0,0,0,0.2);
}
html.light-mode body { background: var(--bg); color: var(--text); }
html.light-mode header { background: var(--header-bg); }
html.light-mode .logo { color: #f0c040; text-shadow: 0 0 12px rgba(240,192,64,0.4); }
html.light-mode #search-input { background: #f8f0e0; color: var(--text); border-color: var(--border); }
html.light-mode #search-input::placeholder { color: var(--text-muted); }
html.light-mode .main-nav { background: #3a2200; border-color: #5a3800; }
html.light-mode .nav-tab { color: #d4b870; }
html.light-mode .nav-tab.active { color: #f0c040; border-color: #f0c040; }
html.light-mode .info-card-img { filter: brightness(1.05); }
html.light-mode .map-sea { fill: #7aa8c8; }
html.light-mode .map-region { fill: #c8b890; stroke: #8a7050; }
html.light-mode .map-region.north       { fill: #b0c8d8; }
html.light-mode .map-region.crownlands  { fill: #d4b870; }
html.light-mode .map-region.essos       { fill: #d0b880; }
html.light-mode .map-region.riverlands  { fill: #c4d4a4; }
html.light-mode .map-region.reach       { fill: #b8d098; }
html.light-mode .map-region.dorne       { fill: #d4b880; }
html.light-mode .map-region.vale        { fill: #b8c8a0; }
html.light-mode .map-region.westerlands { fill: #d8c898; }
html.light-mode .map-region.stormlands  { fill: #b8c0a8; }
html.light-mode .map-region.iron-islands { fill: #a8b8b8; }
html.light-mode .map-region.dothraki   { fill: #d0c880; }
html.light-mode .map-ice { fill: #d8e8f0; }
html.light-mode .map-pin { fill: #8a6a00; stroke: #fff; }
html.light-mode .map-pin:hover { fill: #c09a00; }
html.light-mode .map-river { stroke: #4878a8; opacity: 0.65; }
html.light-mode .map-mountain-mark { fill: #6a5030; opacity: 0.5; }
html.light-mode .map-legend-box { fill: rgba(248,240,224,0.88); }
html.light-mode .map-compass-bg { fill: rgba(248,240,224,0.72); }
html.light-mode .season-card { background: var(--bg-card); border-color: var(--border); }
html.light-mode .season-card summary { color: var(--text); }
html.light-mode details.season-card[open] summary { border-color: var(--gold); }
html.light-mode .actor-link { color: #0050a0; }
html.light-mode .actor-link:hover { color: #003070; }
html.light-mode .lang-toggle,
html.light-mode .theme-toggle { color: #d4c5a9; border-color: #a89060; }
html.light-mode .lang-toggle:hover,
html.light-mode .theme-toggle:hover { border-color: #f0c040; background: rgba(240,192,64,0.15); }
html.light-mode .rel-chip { background: #e8d8b8; color: #1a0e00; border-color: #c8a870; }
html.light-mode .rel-chip:hover { background: #dcc8a0; border-color: #8a6a00; }
html.light-mode .rel-chip .rel-label { color: #5a4020; }
html.light-mode .rel-chip img { background: #e0d0b8; }
html.light-mode .spoiler-notice { background: #f5e8cc; border-color: #c8a870; color: #7a4800; }
html.light-mode .info-card-img { background: #e0d0b8; }
html.light-mode .info-card-img.is-svg { background: #e8d8b8; }

/* === Reset & base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  min-height: 100vh;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; }

/* === Header === */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.8);
}

.header-top {
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  position: relative;
}

/* === Show-selector === */
.show-selector {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  justify-content: center;
}
.show-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-display);
  font-size: clamp(0.7rem, 2.8vw, 1.15rem);
  color: #a89870;
  cursor: pointer;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.4rem 0.15rem;
  transition: color 0.2s, text-shadow 0.2s, border-color 0.2s;
  text-align: center;
  line-height: 1.2;
}
.show-btn:hover { color: #d4c5a9; border-bottom-color: #a89870; }
.show-btn.active[data-show="got"] {
  color: var(--gold);
  text-shadow: 0 0 18px rgba(207,181,59,0.4);
  border-bottom-color: var(--gold);
}
.show-btn.active[data-show="hotd"] {
  color: #e04040;
  text-shadow: 0 0 18px rgba(224,64,64,0.45);
  border-bottom-color: #e04040;
}
.show-divider {
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  opacity: 0.5;
  flex-shrink: 0;
}

/* === HotD thema-accent === */
:root[data-show="hotd"] {
  --gold: #e04040;
  --gold-dim: #a02020;
}
html.light-mode:root[data-show="hotd"] {
  --gold: #b00000;
  --gold-dim: #800000;
}

.logo {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4vw, 1.9rem);
  color: var(--gold);
  text-align: center;
  letter-spacing: 0.06em;
  text-shadow: 0 0 24px rgba(207,181,59,0.35);
  line-height: 1.2;
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { border-color: var(--gold); background: rgba(207,181,59,0.1); }

.lang-toggle {
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 20px;
  padding: 0.22rem 0.6rem;
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-heading);
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.lang-toggle:hover { border-color: var(--gold); background: rgba(207,181,59,0.1); }

/* === Acteur IMDB link === */
.actor-link {
  color: var(--gold-dim);
  text-decoration: none;
  transition: color 0.15s;
}
.actor-link:hover { color: var(--gold); text-decoration: underline; }

/* === Zoekbalk === */
.search-container { width: 100%; max-width: 500px; }

#search-input {
  width: 100%;
  background: #130d04;
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.55rem 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#search-input::placeholder { color: var(--text-muted); }
#search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(207,181,59,0.25);
}

/* === Views === */
.view { display: none; padding: 1.5rem 1rem; }
.view.active { display: block; }

/* === Grid === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* === Huiskaart === */
.house-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s, background 0.18s;
  position: relative;
  overflow: hidden;
  user-select: none;
}
.house-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--house-color, var(--gold));
}
.house-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--house-color, var(--gold));
  background: var(--bg-card-hover);
}
.house-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--house-color, var(--gold));
  margin-bottom: 0.2rem;
}
.house-card .sigil {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}
.house-card .house-motto {
  font-style: italic;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.45rem;
  margin-top: 0.45rem;
  line-height: 1.4;
}
.house-card .count {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* === House header === */
.house-header {
  max-width: 1400px;
  margin: 0 auto 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
#back-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
#back-btn:hover { background: var(--bg-card); border-color: var(--gold); }
#house-title {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 3vw, 1.7rem);
}
.motto { font-style: italic; color: var(--text-muted); font-size: 0.9rem; }

/* === Personagekaart === */
.character-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s;
  display: flex;
  flex-direction: column;
  position: relative;
}
.character-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--house-color, var(--gold));
  z-index: 1;
}
.character-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.character-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: top center;
  background: #1a1209;
}

.character-card .card-body { padding: 0.9rem; flex: 1; }
.character-card h3 {
  font-family: var(--font-heading);
  font-size: 0.97rem;
  color: var(--house-color, var(--gold));
  margin-bottom: 0.35rem;
  line-height: 1.3;
}
.character-card .description {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

/* === Relaties === */
.relationships {
  padding: 0.65rem 0.9rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.rel-chip {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: #1e1208;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.2rem 0.55rem 0.2rem 0.2rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.3;
}
.rel-chip:hover { border-color: var(--gold-dim); background: #2a1a0a; }
.rel-chip img {
  width: 26px; height: 26px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  background: #1a1209;
  flex-shrink: 0;
}
.rel-chip .rel-info { display: flex; flex-direction: column; }
.rel-chip .rel-name { font-size: 0.76rem; }
.rel-chip .rel-label { color: var(--text-muted); font-size: 0.68rem; }

/* === Huisbadge in zoekresultaten === */
.house-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  padding: 0.12rem 0.45rem;
  border-radius: 3px;
  border: 1px solid currentColor;
  margin-bottom: 0.35rem;
  letter-spacing: 0.04em;
}

/* === Search heading === */
.search-heading {
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 1rem;
  max-width: 1400px;
  margin: 0 auto 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* === Geen resultaten === */
.no-results {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 3rem 1rem;
  grid-column: 1 / -1;
}

/* === Laden === */
.loading {
  color: var(--text-muted);
  text-align: center;
  padding: 3rem;
  font-style: italic;
  grid-column: 1 / -1;
}

/* === Acteur-badge === */
.actor-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.3rem;
}
.actor-badge span { color: var(--gold-dim); }

/* === Navigatietabbladen === */
.main-nav {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  background: #0f0802;
  border-bottom: 1px solid var(--border);
  padding: 0 0.5rem;
  position: sticky;
  top: var(--header-height, 96px);
  z-index: 90;
}
.main-nav::-webkit-scrollbar { display: none; }

.nav-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0.04em;
}
.nav-tab:hover { color: var(--text); }
.nav-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* === Info-kaartlijst (locaties, wezens, organisaties) === */
.info-list {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.info-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--gold);
  z-index: 1;
}
.info-card-img {
  width: 100%;
  aspect-ratio: 16/7;
  object-fit: cover;
  object-position: center 30%;
  background: #1a1209;
  display: block;
}
.info-card-img.is-svg {
  aspect-ratio: unset;
  height: 140px;
  object-fit: contain;
  padding: 1rem;
  background: #0f0802;
}
.info-card-body {
  padding: 1.1rem 1.3rem;
}
.info-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--gold);
  margin-bottom: 0.2rem;
}
.info-card .info-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
  font-style: italic;
}
.info-card p { font-size: 0.92rem; line-height: 1.6; }
.info-card .info-tag {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  font-family: var(--font-heading);
  color: var(--gold-dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
}

/* === Westeros kaart === */
.map-container {
  max-width: 900px;
  margin: 0 auto 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.map-header h2 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
.map-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  color: var(--gold-dim);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.25rem 0.65rem;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.map-ext-link:hover { color: var(--gold); border-color: var(--gold-dim); }
.westeros-map {
  width: 100%;
  display: block;
}
.map-region { fill: #1e2a1a; stroke: #3a4a30; stroke-width: 1; }
.map-region.crownlands  { fill: #2a1e0a; }
.map-region.north       { fill: #1a2230; }
.map-region.essos       { fill: #2a1e0f; }
.map-region.riverlands  { fill: #1e2a14; }
.map-region.reach       { fill: #182610; }
.map-region.dorne       { fill: #2a2010; }
.map-region.vale        { fill: #1c2218; }
.map-region.westerlands { fill: #2a1e08; }
.map-region.stormlands  { fill: #1e2218; }
.map-region.iron-islands { fill: #1e2020; }
.map-region.dothraki    { fill: #2a2208; }
.map-sea { fill: #0a1520; }
.map-ice { fill: #1a2838; }
.map-river { fill: none; stroke: #2a5a8a; stroke-width: 1.3; stroke-linecap: round; opacity: 0.55; }
.map-mountain-mark { fill: #4a3820; opacity: 0.45; }
.map-legend-box { fill: rgba(5,2,0,0.62); }
.map-compass-bg { fill: rgba(5,2,0,0.55); }
.map-pin { fill: var(--gold); stroke: #0d0d0d; stroke-width: 1.5; cursor: pointer; transition: fill 0.15s; }
.map-pin:hover { fill: #fff3a0; }
.map-label {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 7px;
  fill: #8a9a7a;
  text-anchor: middle;
  pointer-events: none;
}
.map-pin-label {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 6px;
  fill: var(--gold);
  text-anchor: middle;
  pointer-events: none;
}
.map-region-label {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 7.5px;
  fill: #4a5a40;
  text-anchor: middle;
  pointer-events: none;
  font-style: italic;
}

/* === Woordenlijst === */
.glossary-list {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.8rem;
}

.glossary-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}
.glossary-item dt {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--gold);
  margin-bottom: 0.3rem;
}
.glossary-item dd {
  font-size: 0.87rem;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
}

/* === Zoekresultaten (gecombineerd) === */
.results-list {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.result-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.result-item img {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  flex-shrink: 0;
  background: #1a1209;
}
.result-item .result-body { flex: 1; min-width: 0; }
.result-item h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--gold);
  margin-bottom: 0.15rem;
}
.result-item p { font-size: 0.85rem; color: var(--text); }
.result-item .result-type {
  font-size: 0.7rem;
  font-family: var(--font-heading);
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  letter-spacing: 0.04em;
}
.result-item.clickable { cursor: pointer; }
.result-item.clickable:hover {
  border-color: var(--gold-dim);
  background: var(--bg-card-hover);
}

/* === Seizoenen === */
.spoiler-notice {
  max-width: 900px;
  margin: 0 auto 1rem;
  background: #1e1000;
  border: 1px solid #5a3a00;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: #c49a3c;
}

.seasons-list {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.season-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.season-card summary {
  list-style: none;
  padding: 1rem 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  user-select: none;
}
.season-card summary::-webkit-details-marker { display: none; }
.season-card summary:hover { background: var(--bg-card-hover); }

.season-card .season-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--gold);
}
.season-card .season-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.season-card .season-chevron {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.season-card[open] .season-chevron { transform: rotate(180deg); }

.season-card .season-body {
  padding: 0 1.2rem 1rem;
  border-top: 1px solid var(--border);
}
.season-card .spoiler-label {
  font-size: 0.72rem;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  padding: 0.6rem 0 0.4rem;
  color: var(--text-muted);
}
.season-card p { font-size: 0.9rem; line-height: 1.6; }

/* === Sectie-heading === */
.section-heading {
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 1rem;
  max-width: 900px;
  margin: 0 auto 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* === Tijdlijn === */
.timeline-controls {
  max-width: 900px;
  margin: 0 auto 1.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tl-filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 0.45rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.tl-filter-btn:hover { color: var(--text); border-color: var(--text-muted); }
.tl-filter-btn.active {
  background: var(--gold);
  color: #0d0d0d;
  border-color: var(--gold);
}
.tl-filter-btn.got.active {
  background: #CFB53B;
  border-color: #CFB53B;
  color: #0d0d0d;
}
.tl-filter-btn.hotd.active {
  background: #e04040;
  border-color: #e04040;
  color: #fff;
}

.timeline-list {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  padding-left: 2.5rem;
}
.timeline-list::before {
  content: '';
  position: absolute;
  left: 1.1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.tl-event {
  position: relative;
  margin-bottom: 1.2rem;
}
.tl-event::before {
  content: '';
  position: absolute;
  left: -1.4rem;
  top: 1.05rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg);
  z-index: 1;
}
.tl-event[data-show="hotd"]::before { background: #e04040; }
.tl-event[data-show="got"]::before  { background: #CFB53B; }

.tl-event-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.tl-event-card summary {
  list-style: none;
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  user-select: none;
}
.tl-event-card summary::-webkit-details-marker { display: none; }
.tl-event-card summary:hover { background: var(--bg-card-hover); }

.tl-year-badge {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  color: #0d0d0d;
  background: var(--gold);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.tl-event[data-show="hotd"] .tl-year-badge { background: #e04040; color: #fff; }
.tl-event[data-show="got"]  .tl-year-badge { background: #CFB53B; color: #0d0d0d; }

.tl-event-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  color: var(--text);
  flex: 1;
}
.tl-chevron {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.tl-event-card[open] .tl-chevron { transform: rotate(180deg); }

.tl-event-body {
  padding: 0.6rem 1rem 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
}

.tl-show-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-bottom: 0.4rem;
}
.tl-show-badge.hotd { background: rgba(224,64,64,0.15); color: #e04040; border: 1px solid rgba(224,64,64,0.3); }
.tl-show-badge.got  { background: rgba(207,181,59,0.12); color: #CFB53B; border: 1px solid rgba(207,181,59,0.3); }

/* Gap-kaart */
.tl-gap-card {
  position: relative;
  margin-bottom: 1.2rem;
}
.tl-gap-card::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg);
  z-index: 1;
}
.tl-gap-inner {
  background: #0f0802;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  text-align: center;
}
.tl-gap-inner .tl-gap-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
.tl-gap-inner .tl-gap-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-style: italic;
}

/* === Stamboom === */
.family-selector-bar {
  max-width: 900px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.family-selector-label {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.family-selector {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  padding: 0.45rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.family-selector:focus { border-color: var(--gold); }

#family-tree-container {
  max-width: 1100px;
  margin: 0 auto;
}

.family-unit {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1rem 1rem;
  margin-bottom: 1.5rem;
  position: relative;
}
.family-unit-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

.parents-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  position: relative;
}
.parents-row::after {
  content: '';
  position: absolute;
  bottom: -1.2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 1.2rem;
  background: var(--border);
}

.parent-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 90px;
  cursor: pointer;
  transition: transform 0.15s;
}
.parent-card:hover { transform: translateY(-3px); }
.parent-card img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 2px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.15s;
}
.parent-card:hover img { border-color: var(--gold); }
.parent-card .parent-name {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
}

.partner-connector {
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  padding-top: 1.5rem;
  color: #e04040;
  font-size: 1rem;
  flex-shrink: 0;
}

.children-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  position: relative;
}
.children-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: var(--border);
}

.child-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 80px;
  position: relative;
  cursor: pointer;
  transition: transform 0.15s;
}
.child-card::before {
  content: '';
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 0.5rem;
  background: var(--border);
}
.child-card:hover { transform: translateY(-3px); }
.child-card img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 2px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.15s;
}
.child-card:hover img { border-color: var(--gold); }
.child-card .child-name {
  font-family: var(--font-heading);
  font-size: 0.62rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
}

/* Lichte modus overrides tijdlijn & stamboom */
html.light-mode .tl-event-card { background: var(--bg-card); border-color: var(--border); }
html.light-mode .tl-gap-inner  { background: #e8d8b8; border-color: var(--border); }
html.light-mode .family-unit   { background: var(--bg-card); border-color: var(--border); }

/* === Mobiel via JS class (werkt ook in Chrome desktopmodus) === */
html.small-screen .grid { grid-template-columns: 1fr 1fr !important; gap: 0.75rem; }
html.small-screen .house-card { padding: 1.1rem 1rem; }
html.small-screen .house-card h3 { font-size: 1.05rem; }
html.small-screen .nav-tab { font-size: 0.8rem; padding: 0.75rem 0.7rem; }
html.small-screen .glossary-list { grid-template-columns: 1fr; }

/* === Responsive === */
@media (max-width: 768px) {
  header { padding: 0.7rem 1rem; gap: 0.5rem; }
  .view { padding: 1rem 0.75rem; }

  /* Explicit 2 kolommen — auto-fill kan op sommige apparaten 4 kolommen geven */
  .grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }

  /* Huiskaarten: beter leesbaar */
  .house-card { padding: 1.1rem 1rem; }
  .house-card h3 { font-size: 1.05rem; }
  .house-card .sigil { font-size: 0.82rem; }
  .house-card .house-motto { font-size: 0.86rem; }
  .house-card .count { font-size: 0.78rem; }

  /* Personagekaarten */
  .character-card img { aspect-ratio: 3/4; }
  .character-card .card-body { padding: 0.75rem; }
  .character-card h3 { font-size: 0.97rem; }
  .character-card .description { font-size: 0.85rem; }

  /* Navigatietabs: grotere touch-targets */
  .nav-tab { font-size: 0.8rem; padding: 0.75rem 0.7rem; }

  /* Woordenlijst: 1 kolom */
  .glossary-list { grid-template-columns: 1fr; }

  /* Serie-knoppen iets groter */
  .show-btn { font-size: clamp(0.85rem, 3.8vw, 1.15rem); }
}

@media (min-width: 769px) {
  header { flex-direction: row; justify-content: space-between; }
  .logo { font-size: 1.6rem; }
  .search-container { max-width: 380px; }
}

/* === Doneer-footer === */
.donate-footer {
  text-align: center;
  padding: 1.25rem 1rem 2rem;
  border-top: 1px solid var(--border);
}
.donate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.donate-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(207,181,59,0.07);
}
