:root{
  --green: rgba(0,200,0,0.5);
  --red: rgba(200,0,0,0.5);
  --black: black;
  --white: white;

  /* palette: Brettspielabend — Holztisch, Filz-Spielmatte, Messing & Würfel (Tagmodus) */
  --paper: #efe2c4;
  --ink: #2e2013;
  --ink-soft: #6b5738;
  --leather: #25396f;
  --leather-light: #142f6d;
  --gold: #e0a94a;
  --gold-bright: #f2c877;
  --gold-dark: #a97b2f;
  --shadow: rgba(35,22,8,0.4);
  --toc-bg: rgba(239,226,196,0.95);
  --surface: rgba(0,0,0,0.05);
  --game-logo:#efe2c4;


  --font-display: "Bitter", "Rockwell", Georgia, serif;
  --font-body: "Karla", "Segoe UI", "Trebuchet MS", sans-serif;
}

/* Nachtmodus per Systemeinstellung, sofern der Benutzer nichts explizit gewählt hat */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --paper: #26262a;
    --ink: #f0e2c1;
    --ink-soft: #c9b48c;
    --leather: #375c99;
    --leather-light: #142f6d;
    --gold: #d9a441;
    --gold-bright: #f0c268;
    --gold-dark: #a97d2f;
    --shadow: rgba(0,0,0,0.65);
    --toc-bg: rgba(38,38,42,0.95);
    --surface: rgba(255,255,255,0.06);
    --game-logo:#c9b48c;
  }
}

/* Explizite Nachtmodus-Wahl über den Umschalter */
:root[data-theme="dark"]{
  --paper: #26262a;
  --ink: #f0e2c1;
  --ink-soft: #c9b48c;
  --leather: #375c99;
  --leather-light: #142f6d;
  --gold: #d9a441;
  --gold-bright: #f0c268;
  --gold-dark: #a97d2f;
  --shadow: rgba(0,0,0,0.65);
  --toc-bg: rgba(38,38,42,0.95);
  --surface: rgba(255,255,255,0.06);
  --game-logo:#c9b48c;
}

*{ box-sizing: border-box; }

body{
  background-color: var(--paper);
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  position: relative;
  margin: 0px;
  padding: 0px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

main{
  display: block;
  padding: 8px 16px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ---------- hero ---------- */

.hero{
  text-align: center;
  padding: 36px 16px 18px;
}

.hero-seal{
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px var(--shadow));
}

.hero-title{
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--leather);
  text-shadow: 0 2px 0 var(--gold-dark), 0 4px 12px var(--shadow);
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 10px 0 6px;
}

.hero-tagline{
  font-family: var(--font-body);
  font-style: italic;
  color: var(--ink-soft);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  margin: 0;
}

/* ---------- category selector (table of contents) ---------- */

.toc{
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 14px;
  background-color: var(--toc-bg);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background-color 0.25s ease;
}

.toc-track{
  position: relative;
  display: flex;
  gap: 6px;
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 4px 8px 0;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 2px solid var(--gold-dark);
}

.toc-track::-webkit-scrollbar{ display: none; }

.toc-indicator{
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 3px;
  background: var(--leather);
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.65,0,0.35,1), width 0.35s cubic-bezier(0.65,0,0.35,1);
  pointer-events: none;
}

.theme-toggle{
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--gold-dark);
  background: transparent;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover{
  background-color: var(--leather);
  color: var(--gold-bright);
  border-color: var(--gold);
}

.toc-pill{
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  padding: 8px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.toc-pill:hover{
  color: var(--leather);
}

.toc-pill.active{
  color: var(--leather);
  font-weight: 700;
}

/* ---------- categories ---------- */

.category{
  display: block;
  margin: 40px auto 18px;
  scroll-margin-top: 84px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.category.in-view{
  opacity: 1;
  transform: translateY(0);
}

.category:first-of-type{
  margin-top: 18px;
}

h1{
  font-family: var(--font-display);
  font-weight: 600;
  text-align: center;
  color: var(--leather);
  letter-spacing: 0.02em;
}

.category > h1{
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 4px 0;
}

.sammlung{
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 900px;
  width: 100%;
  margin: 14px auto;
  min-width: 0;
}

.game-group > .sammlung{
  margin-top: 0;
  margin-bottom: 0;
}

.line{
  display: block;
  width: 100%;
  max-width: 640px;
  height: 16px;
  margin: 6px auto;
}

/* ---------- game groups (Marvel, LOTR, MTG, ...) ---------- */

.game-group{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 14px auto 14px;
  max-width: 1000px;
  min-width: 0;
  scroll-margin-top: 84px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.game-group.in-view{
  opacity: 1;
  transform: translateY(0);
}

.game-logo{
  text-align: center;
  min-width: 0;
}

.game-logo img{
  display: inline-block;
  width: 100%;
  max-width: 320px;
  height: auto;
  background-color: var(--game-logo);
  border: 1px solid var(--gold-dark);
  border-radius: 10px;
  padding: 12px 20px;
  box-shadow: 0 3px 10px var(--shadow);
}

.game-jump{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 900px;
  margin: 8px auto 4px;
}

.game-jump a{
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--leather);
  border: 1px solid var(--gold-dark);
  border-radius: 999px;
  padding: 5px 12px;
  text-decoration: none;
  background: var(--surface);
  transition: background 0.2s ease, color 0.2s ease;
}

.game-jump a:hover{
  background: var(--leather);
  color: var(--gold-bright);
}

/* ---------- link cards ---------- */

.info-link{
  display: block;
  flex: 1 1 150px;
  max-width: 240px;
  min-width: 0;
  background-color: var(--leather);
  border: 1px solid var(--gold-dark);
  border-radius: 10px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.info-link:hover{
  background-color: var(--leather-light);
  border-color: var(--gold);
}

.info-link a{
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  display: block;
  padding: 10px 12px;
}

@media (prefers-reduced-motion: reduce){
  .category, .game-group{
    transition: none;
    opacity: 1;
    transform: none;
  }
  .info-link{ transition: none; }
  .toc-indicator{ transition: none; }
}

@media (max-width: 640px){
  .toc{ padding: 8px 10px; }
  .toc-pill{ font-size: 12px; padding: 7px 8px; }
  main{ padding: 8px 10px 32px; }
  .sammlung{gap: 14px;}
}
