/* ============================================================
   WILDE HORDE – STYLESHEET (Hero Wars: Dominion Era Fan-Seite)
   ------------------------------------------------------------
   AUFBAU:
   1. Design-Tokens (Schwarz/Dunkelgrau mit Logo-Grün)
   2. Basis-Styles
   3. Kopf, Navigation, Suche
   4. Karten & Listen
   5. Detailseiten (Helden / Pets / Titanen / Totems / Abenteuer)
   6. BILDER & AVATARE – HIER EINFÜGEN  <<< ! >>>
   7. Spezialbereiche (Asgard-Teams, Gildenkrieg, Fusionen, Chat)
   8. Responsive Anpassungen
   ============================================================ */


/* ============================================================
   1. DESIGN-TOKENS
   Palette: „Wilde Horde“ – Schwarz & Dunkelgrau,
   Akzentgrün aus dem Gildenbanner (#b5de4e).
   Die Seite läuft dauerhaft im Dunkelmodus.
   ============================================================ */
:root {
  /* Typo-Skala */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);

  /* Abstände (4px-System) */
  --space-1: 0.25rem;  --space-2: 0.5rem;   --space-3: 0.75rem;
  --space-4: 1rem;     --space-5: 1.25rem;  --space-6: 1.5rem;
  --space-8: 2rem;     --space-10: 2.5rem;  --space-12: 3rem;
  --space-16: 4rem;    --space-20: 5rem;

  /* Radien & Übergänge */
  --radius-sm: 0.375rem; --radius-md: 0.5rem;
  --radius-lg: 0.75rem; --radius-xl: 1rem; --radius-full: 9999px;
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Schriften */
  --font-display: 'Cinzel', Georgia, serif;
  --font-body: 'Satoshi', 'Segoe UI', Tahoma, sans-serif;

  /* Inhaltsbreiten */
  --content-default: 1080px;
  --content-wide: 1280px;

  /* Fraktions-/Element-Farben (in beiden Modis gleich kräftig) */
  --f-chaos: #d94141;
  --f-nature: #4caf50;
  --f-honor: #e6b31e;
  --f-progress: #3f8fd4;
  --f-eternity: #9b5fd0;
  --f-mystery: #20b2a6;
  --el-water: #3f8fd4;
  --el-fire: #e05a3a;
  --el-earth: #8a9b3a;
  --el-light: #e8cf6d;
  --el-dark: #8a7fb8;
  --el-distortion: #d06cd4;
}

/* ---------- STANDARD: Schwarz & Dunkelgrau mit Logo-Grün ---------- */
:root, [data-theme='dark'] {
  color-scheme: dark;
  --color-bg: #0a0a0b;                 /* Schwarz */
  --color-surface: #141416;            /* Dunkelgrau */
  --color-surface-2: #1b1b1e;
  --color-surface-offset: #101012;
  --color-divider: #232326;
  --color-border: #2f2f33;
  --color-text: #e9e9ec;
  --color-text-muted: #a6a6ac;
  --color-text-faint: #8a8a91;
  --color-primary: #b5de4e;            /* Logo-Grün */
  --color-primary-hover: #c9ec70;      /* helleres Grün für Hover */
  --color-primary-highlight: #2c3a15; /* dunkler Grünton für Flächen */
  --color-accent: #b5de4e;             /* Akzent = Logo-Grün */
  --color-gold: #b5de4e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.65);
  --hero-card-overlay: rgba(0, 0, 0, 0.6);
}

/* ---------- ZWEITER MODUS: Düsteres Dunkelgrün-Grau ---------- */
[data-theme='light'] {
  color-scheme: dark;
  --color-bg: #1a1c18;                 /* düsteres Grün-Grau */
  --color-surface: #212420;
  --color-surface-2: #272a25;
  --color-surface-offset: #1d1f1b;
  --color-divider: #31342c;
  --color-border: #3e4237;
  --color-text: #d6d8d0;
  --color-text-muted: #9da094;
  --color-text-faint: #82857a;
  --color-primary: #b5de4e;            /* Logo-Grün */
  --color-primary-hover: #c9ec70;
  --color-primary-highlight: #2c351c;
  --color-accent: #b5de4e;
  --color-gold: #b5de4e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
  --hero-card-overlay: rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { /* identische Palette – siehe oben */ }
}


/* ============================================================
   2. BASIS-STYLES
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-24);
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color 300ms ease, color 300ms ease;
}

img, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4 { text-wrap: balance; line-height: 1.2; font-family: var(--font-display); }
p, li { text-wrap: pretty; max-width: 78ch; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); text-decoration: underline; }

::selection { background: color-mix(in oklab, var(--color-primary) 30%, transparent); }

:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }

button { cursor: pointer; background: none; border: none; }
table { border-collapse: collapse; width: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ============================================================
   3. KOPF, NAVIGATION, SUCHE
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in oklab, var(--color-surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  position: relative;
  max-width: var(--content-wide); margin-inline: auto;
  display: flex; align-items: center; justify-content: flex-end; gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  min-height: 104px;
}
/* Marke: großes Logo überlappt Kopf- UND Navigationsleiste, endet knapp über dem Menütext */
.header-inner { padding-left: 540px; } /* Platz für den absoluten Schriftzug reservieren */
.brand {
  position: absolute; left: var(--space-6); top: 8px; z-index: 5;
  display: flex; align-items: flex-start; gap: var(--space-4);
  color: var(--color-text); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 100px; height: 100px; flex-shrink: 0; border-radius: 18px; display: block;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
/* Schriftzug: doppelt so groß, oben bündig neben dem Logo */
.brand-name {
  font-family: var(--font-display); font-weight: 700; font-size: 50px;
  line-height: 78px; height: 78px; letter-spacing: 0.03em; white-space: nowrap;
}
.brand-name em { font-style: normal; color: var(--color-primary); }

/* Suche rechtsbündig */
.search-wrap { position: relative; flex: 1 1 auto; max-width: 520px; min-width: 200px; margin-left: auto; }
#globalSearch {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text);
}
#globalSearch::placeholder { color: var(--color-text-faint); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 65vh; overflow-y: auto;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none; z-index: 200;
}
.search-results.open { display: block; }
.search-result {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  cursor: pointer; border-bottom: 1px solid var(--color-divider);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover, .search-result.active { background: var(--color-primary-highlight); }
.search-result .kind { font-size: var(--text-xs); color: var(--color-text-faint); margin-left: auto; white-space: nowrap; }

.theme-toggle {
  flex-shrink: 0;
  width: 42px; height: 42px; border-radius: var(--radius-full);
  display: grid; place-items: center;
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  background: var(--color-surface-2);
}
.theme-toggle:hover { background: var(--color-primary-highlight); }

/* Sprach-Fahnen */
.lang-flags { display: flex; gap: var(--space-1); align-items: center; flex-shrink: 0; }
.lang-flag {
  width: 34px; height: 30px; padding: 0;
  display: grid; place-items: center;
  font-size: 17px; line-height: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity var(--transition), border-color var(--transition);
}
.lang-flag:hover { opacity: 1; }
.lang-flag.active { opacity: 1; border-color: var(--color-primary); box-shadow: 0 0 0 1px rgba(181, 222, 78, 0.35); }

.site-nav { position: sticky; top: 105px; z-index: 90; background: var(--color-surface-offset); border-bottom: 1px solid var(--color-border); }
.site-nav ul {
  max-width: var(--content-wide); margin-inline: auto;
  display: flex; justify-content: flex-end; gap: var(--space-1);
  list-style: none; padding: var(--space-2) var(--space-4);
}
.site-nav a {
  display: block; white-space: nowrap;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  color: var(--color-text-muted); font-size: var(--text-sm); font-weight: 500;
}
.site-nav a:hover { color: var(--color-text); background: var(--color-primary-highlight); text-decoration: none; }
.site-nav a.active { color: var(--color-primary); background: var(--color-primary-highlight); font-weight: 700; }

/* Dropdown-Menüs (Schlägertrupp, Schlachten) */
.nav-dropdown { position: relative; }
.nav-dropdown > a::after { content: "▾"; margin-left: 6px; font-size: 10px; }
.nav-dropdown > a.has-active { color: var(--color-primary); font-weight: 700; }
.site-nav ul.submenu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 190px;
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  padding: var(--space-2); list-style: none; display: none; z-index: 200;
  flex-direction: column; gap: 0;
}
.nav-dropdown.open ul.submenu { display: block; }
@media (hover: hover) { .nav-dropdown:hover ul.submenu { display: block; } }
.submenu li { list-style: none; }
.submenu a {
  display: block; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  color: var(--color-text-muted); font-size: var(--text-sm); white-space: nowrap;
}
.submenu a:hover { color: var(--color-text); background: var(--color-primary-highlight); text-decoration: none; }
.submenu a.active { color: var(--color-primary); background: var(--color-primary-highlight); font-weight: 700; }

.app-main { max-width: var(--content-wide); margin-inline: auto; padding: var(--space-8) var(--space-6) var(--space-20); min-height: 60vh; }

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-offset);
  padding: var(--space-8) var(--space-6);
  font-size: var(--text-sm); color: var(--color-text-muted);
}
.site-footer p { max-width: none; margin-bottom: var(--space-2); }

.back-to-top {
  position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: 150;
  width: 44px; height: 44px; border-radius: var(--radius-full);
  background: var(--color-primary); color: var(--color-bg);
  font-size: var(--text-lg); font-weight: 700;
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }


/* ============================================================
   4. KARTEN & LISTEN
   ============================================================ */
.page-title { font-size: var(--text-xl); margin-bottom: var(--space-2); color: var(--color-text); }
.page-intro { color: var(--color-text-muted); margin-bottom: var(--space-8); }

.section-heading {
  font-size: var(--text-lg); margin: var(--space-10) 0 var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-primary);
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
}
.section-heading .count { font-family: var(--font-body); font-size: var(--text-xs); color: var(--color-text-faint); font-weight: 500; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--space-4);
}

/* --- Einheiten-Karte (Held/Pet/Titan/Totem/Abenteuer) --- */
.unit-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex; flex-direction: column;
  text-decoration: none; color: var(--color-text);
}
.unit-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
  text-decoration: none;
}

.unit-card .card-top { position: relative; }

.unit-card .card-body { padding: var(--space-3) var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.unit-card .card-name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm); line-height: 1.25; }
.unit-card .card-meta { display: flex; flex-wrap: wrap; gap: var(--space-1); }

/* Badges */
.badge {
  display: inline-block;
  font-size: var(--text-xs); font-weight: 500;
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  white-space: nowrap;
}
.badge.role { }
.badge.s-blessed  { color: var(--f-honor);    border-color: color-mix(in oklab, var(--f-honor) 45%, transparent); }
.badge.s-grove    { color: var(--f-nature);   border-color: color-mix(in oklab, var(--f-nature) 45%, transparent); }
.badge.s-undead   { color: var(--f-eternity); border-color: color-mix(in oklab, var(--f-eternity) 45%, transparent); }
.badge.s-engineer { color: var(--f-progress); border-color: color-mix(in oklab, var(--f-progress) 45%, transparent); }
.badge.s-fire     { color: var(--el-fire);    border-color: color-mix(in oklab, var(--el-fire) 45%, transparent); }
[data-theme='dark'] .badge.s-grove { color: #7fd982; }
[data-theme='dark'] .badge.s-blessed { color: #f0c445; }
[data-theme='light'] .badge.s-grove { color: #7fd982; }
[data-theme='light'] .badge.s-blessed { color: #f0c445; }

/* Filterleiste */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  margin-bottom: var(--space-6);
}
.filter-bar select, .filter-bar input {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text);
}
.chip-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.chip:hover { border-color: var(--color-primary); color: var(--color-text); }
.chip.active { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-bg); font-weight: 700; }

/* Startseiten-Kacheln */
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-4); }
.home-tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex; flex-direction: column; gap: var(--space-2);
  text-decoration: none; color: var(--color-text);
  transition: transform var(--transition), border-color var(--transition);
}
.home-tile:hover { transform: translateY(-3px); border-color: var(--color-primary); text-decoration: none; }
.home-tile h3 { font-size: var(--text-base); }
.home-tile p { font-size: var(--text-sm); color: var(--color-text-muted); }
.home-tile .tile-icon { font-size: 1.6rem; margin-bottom: var(--space-1); }

/* Info-/Hinweiskästen */
.note-box {
  background: var(--color-surface-offset);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-4) 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Tabellen */
.data-table { font-size: var(--text-sm); margin: var(--space-4) 0; }
.data-table th, .data-table td { padding: var(--space-2) var(--space-3); text-align: left; border-bottom: 1px solid var(--color-divider); }
.data-table th { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xs); letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-muted); }
.data-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-scroll { overflow-x: auto; }

/* Zählleisten / Stat-Liste */
.stat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); margin: var(--space-4) 0; }
.stat-item { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }
.stat-item dt { font-size: var(--text-xs); color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-item dd { font-weight: 700; }


/* ============================================================
   5. DETAILSEITEN
   ============================================================ */
.detail-head {
  display: flex; gap: var(--space-6); align-items: flex-start;
  margin-bottom: var(--space-8);
}
.detail-head .detail-titles { flex: 1; }
.detail-head h1 { font-size: var(--text-xl); }
.detail-head .subtitle { color: var(--color-text-muted); font-size: var(--text-sm); }
.breadcrumb { font-size: var(--text-xs); color: var(--color-text-faint); margin-bottom: var(--space-2); }
.breadcrumb a { color: var(--color-text-faint); }

.detail-section { margin-bottom: var(--space-10); }
.detail-section > h2 { font-size: var(--text-lg); margin-bottom: var(--space-3); padding-bottom: var(--space-1); border-bottom: 1px solid var(--color-divider); }
.detail-section ul { padding-left: var(--space-6); display: grid; gap: var(--space-1); }

.tag-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.hero-mini {
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-full); padding: 0.15rem 0.7rem 0.15rem 0.15rem;
  font-size: var(--text-sm); cursor: pointer; text-decoration: none; color: var(--color-text);
}
.hero-mini:hover { border-color: var(--color-primary); text-decoration: none; }
.hero-mini .mini-avatar { width: 26px; height: 26px; border-radius: 50%; }

/* Routen (Abenteuer) */
.route-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-3);
}
.route-card h4 { font-family: var(--font-body); font-weight: 700; font-size: var(--text-base); margin-bottom: var(--space-1); }
.route-card .route-nodes {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  background: var(--color-surface-offset);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  word-break: break-word;
}
.route-color { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: var(--space-2); vertical-align: -1px; }

/* Asgard-Teamkarten */
.team-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}
.team-card .team-head { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
.team-card .team-rank { font-family: var(--font-display); font-weight: 700; color: var(--color-primary); font-size: var(--text-lg); }
.team-card .team-note { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-3); }

/* Held mit zugehörigem Patronage-Pet (Asgard-/Team-Karten) */
.team-card .tag-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-2) var(--space-3);
  align-items: start;
}
.team-card, .detail-section, .route-card, .unit-card { scroll-margin-top: 140px; }
.hero-with-pet {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: flex-start;
}
.hero-with-pet .hero-mini { padding-right: var(--space-3); }

/* Großes Bild auf Detailseiten (Platzhalter) – Hochformat auf der rechten Seite */
.detail-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: var(--space-5);
  align-items: stretch;
}
.detail-media .big-image {
  margin-bottom: 0;
  min-height: 360px;
  align-self: stretch;
}
.big-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-faint);
  font-size: var(--text-sm);
  text-align: center;
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

/* Skin-Avatar-Platzhalter (Raster auf Detailseiten) */
.skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: var(--space-3);
}
.skin-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.skin-label { font-size: var(--text-xs); color: var(--color-text-muted); }

.muted { font-size: var(--text-sm); color: var(--color-text-muted); }

/* Echte Bilder (über IMAGES-Map in script.js automatisch gesetzt) */
.avatar.has-img::after { content: none; }
.big-image.has-img { border-style: solid; }

/* Routen-Bild-Platzhalter in Abenteuer-Details */
.route-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  margin-top: var(--space-3);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  text-align: center;
  padding: var(--space-3);
}

@media (max-width: 700px) {
  .detail-media { grid-template-columns: 1fr; }
  .detail-media .big-image { order: -1; min-height: 0; aspect-ratio: 3 / 4; width: 100%; }
}

/* ============================================================
   6. BILDER & AVATARE – HIER EINFÜGEN
   ============================================================

   WICHTIG: Seit dem Bilder-Update werden echte Spielfiguren-Bilder
   automatisch über die IMAGES- und SKINS-Maps in script.js
   eingebunden (Dateien liegen im Ordner „bilder/“). Die unten
   beschriebene CSS-Methode funktioniert weiterhin als Alternative
   bzw. für zusätzliche eigene Bilder.

   A) Avatare (Helden, Pets, Titanen, Totems):
      Bilddateien in den Ordner „bilder/“ legen und unten im
      Stylesheet (NICHT im Kommentar!) je Eintrag eine Regel
      ergänzen, z. B.:

      .avatar[data-id="held-astaroth"] {
        background-image: url("bilder/astaroth.png");
        background-size: cover;
        background-position: center;
      }
      .avatar[data-id="held-astaroth"]::after { content: none; }
      (letzte Zeile blendet die Initialen-Platzhalter aus)

      Die data-id setzt sich zusammen aus KIND-ID:
        Helden:   held-<id>   z. B. held-keira, held-mushy-and-shroom
        Pets:     pet-<id>    z. B. pet-albus, pet-fenris
        Titanen:  titan-<id>  z. B. titan-sigurd, titan-verdoc-phyto
        Totems:   totem-<id>  z. B. totem-wasser (IDs: wasser, feuer,
                  erde, licht, dunkel, verzerrung)
        Abenteuer (Kartenbanner): abenteuer-<n>  z. B. abenteuer-9
      Die IDs stehen jeweils in script.js (HELDEN, PETS, TITANS,
      TOTEMS, ADVENTURES).

   B) Karten-Banner (großes Bild oben auf den Karten):
      .card-top[data-id="held-astaroth"] {
        background-image: url("bilder/astaroth-banner.png");
      }
      .card-top[data-id="held-astaroth"] .avatar { display: none; }

   C) Abenteuer-Karten (Routenbilder, Liste und Detailseite):
      .card-top[data-id="abenteuer-9"] {
        background-image: url("bilder/abenteuer-9-karte.png");
      }
      .card-top[data-id="abenteuer-9"] .avatar { display: none; }
      Detailseite (großes Kartenbild): .card-top[data-id="abenteuer-9-karte"] { … }

   D) Große Bilder auf Detailseiten (Held, Pet, Titan):
      .big-image[data-id="held-astaroth-bild"] {
        background-image: url("bilder/astaroth-gross.png");
        background-size: cover;
        background-position: center top;
      }
      Das große Bild füllt den Rahmen oben auf der Detailseite.
      IDs: held-<id>-bild, pet-<id>-bild, titan-<id>-bild

   E) Skin-Avatare (Raster auf den Detailseiten):
      .avatar[data-id="held-astaroth-skin1"] {
        background-image: url("bilder/astaroth-skin1.png");
        background-size: cover;
      }
      .avatar[data-id="held-astaroth-skin1"]::after { content: none; }
      IDs: held-<id>-skin1 bis -skin4, pet-<id>-skin1 bis -skin3,
      titan-<id>-skin1 bis -skin4

   F) Routen-Bilder in Abenteuer-Details (pro Route ein Bild):
      .route-image[data-id="abenteuer-9-route1-bild"] {
        background-image: url("bilder/abenteuer-9-route1.png");
        background-size: cover;
        background-position: center;
      }
      IDs: <abenteuer-id>-route1-bild, -route2-bild, -route3-bild

   Tipp: Die Avatare werden auf allen Seiten (Karten,
   Detailseiten, Suchergebnisse, Asgard-Teams, Chat-Teilnehmer)
   automatisch verwendet – einmal einfügen genügt.
   ============================================================ */

/* Avatar-Platzhalter */
.avatar {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  background:
    linear-gradient(160deg, color-mix(in oklab, var(--av, #5b548a) 82%, black), color-mix(in oklab, var(--av, #5b548a) 55%, black)),
    var(--color-surface-offset);
  background-blend-mode: normal;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  position: relative;
  user-select: none;
}
.avatar::after {
  /* Initialen-Platzhalter; wird per Regel oben ausgeblendet, sobald ein Bild gesetzt ist */
  content: attr(data-initials);
}
.avatar.sm { width: 30px; height: 30px; font-size: 0.7rem; border-radius: var(--radius-sm); }
.avatar.md { width: 56px; height: 56px; font-size: 1.1rem; border-radius: var(--radius-md); }
.avatar.lg { width: 96px; height: 96px; font-size: 1.8rem; border-radius: var(--radius-lg); flex-shrink: 0; }
.avatar.xl { width: 132px; height: 132px; font-size: 2.4rem; border-radius: var(--radius-xl); flex-shrink: 0; }

.card-top { padding: var(--space-5) var(--space-5) 0; display: flex; align-items: flex-end; min-height: 96px; }

/* ============================================================
   7. SPEZIALBEREICHE
   ============================================================ */

/* Geschenke (tägliche Links) */
.gift-list { display: grid; gap: var(--space-3); max-width: 720px; }
.gift-day {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: var(--space-4);
}
.gift-day.today { border-color: var(--color-primary); box-shadow: 0 0 0 1px rgba(181, 222, 78, 0.3), var(--shadow-md); }
.gift-day-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.gift-date { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); }
.gift-today-badge {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em;
  background: var(--color-primary); color: var(--color-bg);
  padding: 2px 10px; border-radius: var(--radius-full);
}
.gift-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-2) 0; border-top: 1px solid var(--color-divider);
}
.gift-label { color: var(--color-text-muted); }
.gift-claim {
  color: var(--color-bg); background: var(--color-primary);
  padding: 6px 16px; border-radius: var(--radius-full);
  text-decoration: none; font-weight: 700; font-size: var(--text-sm); white-space: nowrap;
}
.gift-claim:hover { background: var(--color-primary-hover); text-decoration: none; }
.gift-claim.web {
  color: var(--color-primary); background: transparent;
  border: 1px solid var(--color-primary);
  padding: 5px 15px; /* 1px weniger wegen Rahmen */
}
.gift-claim.web:hover { background: rgba(181, 222, 78, 0.12); }

/* Chat */
.chat-layout {
  display: grid; grid-template-columns: 240px 1fr;
  gap: var(--space-4);
  height: min(72vh, 640px);
  min-height: 420px;
}
.chat-sidebar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-sidebar h3 { font-size: var(--text-base); padding: var(--space-4); border-bottom: 1px solid var(--color-divider); }
.chat-userlist { list-style: none; overflow-y: auto; flex: 1; padding: var(--space-2); }
.chat-userlist li { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); font-size: var(--text-sm); }
.chat-userlist li.me { color: var(--color-primary); font-weight: 700; }
.chat-sidebar .chat-count { padding: var(--space-3); font-size: var(--text-xs); color: var(--color-text-faint); border-top: 1px solid var(--color-divider); }

.chat-main {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-messages { flex: 1; overflow-y: auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.chat-msg { display: flex; gap: var(--space-3); }
.chat-msg .msg-body { background: var(--color-surface-offset); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); max-width: 72%; }
.chat-msg .msg-head { font-size: var(--text-xs); color: var(--color-text-faint); margin-bottom: 2px; }
.chat-msg .msg-head strong { color: var(--color-primary); }
.chat-msg.own .msg-body { background: var(--color-primary-highlight); }
.chat-msg.system { justify-content: center; }
.chat-msg.system .msg-body { font-size: var(--text-xs); color: var(--color-text-faint); background: none; padding: 0; text-align: center; }
.chat-input-row { display: flex; gap: var(--space-2); padding: var(--space-3); border-top: 1px solid var(--color-divider); }
.chat-input-row input { flex: 1; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); border: 1px solid var(--color-border); background: var(--color-surface-2); color: var(--color-text); }
.chat-status { font-size: var(--text-xs); color: var(--color-text-faint); padding: var(--space-2) var(--space-4); }
.chat-status.online { color: var(--f-nature); }
.chat-status.offline { color: var(--f-chaos); }

/* Fusionen */
.fusion-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }
.fusion-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5); }
.fusion-card h4 { font-family: var(--font-body); font-weight: 700; margin-bottom: var(--space-2); }
.fusion-card .fusion-type { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-primary); margin-bottom: var(--space-1); }
.fusion-card p { font-size: var(--text-sm); color: var(--color-text-muted); }

/* Element-Zyklus-Diagramm */
.element-cycle { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; margin: var(--space-6) 0; }
.element-node {
  display: flex; align-items: center; gap: var(--space-2);
  border: 1px solid var(--color-border); border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4); font-weight: 500;
}
.element-node .dot { width: 14px; height: 14px; border-radius: 50%; }
.cycle-arrow { color: var(--color-text-faint); font-size: var(--text-lg); }

/* ============================================================
   8. RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { max-height: 180px; }
}
@media (max-width: 1100px) {
  .header-inner { flex-wrap: wrap; justify-content: flex-start; min-height: 0; row-gap: var(--space-2); padding-left: var(--space-6); }
  .brand { position: static; }
  .brand-logo { width: 56px; height: 56px; border-radius: 11px; }
  .brand-name { font-size: var(--text-lg); line-height: 28px; height: 28px; }
  .search-wrap { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
}
@media (max-width: 700px) {
  .header-inner { flex-wrap: wrap; justify-content: flex-start; min-height: 0; row-gap: var(--space-2); }
  .brand { position: static; }
  .brand-logo { width: 56px; height: 56px; border-radius: 11px; }
  .brand-name { font-size: var(--text-lg); line-height: 28px; height: 28px; }
  .search-wrap { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .site-nav ul { flex-wrap: wrap; justify-content: flex-start; }
  .detail-head { flex-direction: column; }
  .site-nav { top: 0; position: static; }
}
@media (max-width: 480px) {
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .badge { white-space: normal; }
  .hero-mini { max-width: 100%; }
}
