/* Bundesfrei RolePlay – Homepage (v4)
   Bewusst ohne externe Schriften/Skripte (kein Cookie-Banner nötig).

   Regeln (VectorLab UX-Audit):
   - Schrift: Gewichte 400/600, Größen 12/14/16 + Überschriften-Stufen, keine Zeilenhöhe < 1.1
   - Abstände im 4/8-px-Raster, Fließtext max. 75ch
   - Klickflächen mind. 44×44 px
   - Nur zwei Umbrüche: schmal (< 768 px) und ab 768 px; Raster sonst über auto-fit
   - Bewegung nur transform/opacity, 150/200/300 ms ease-out, alles aus bei reduced-motion */

:root {
  --bg: #0b0d10;          /* L0 Fläche */
  --surface: #12161b;     /* L1 Karten */
  --surface-2: #171c22;
  --border: #222931;
  --border-strong: #303945;
  --text: #e9edf1;
  --text-2: #c3cbd3;
  --muted: #8d98a5;
  --accent: #3b82f6;      /* bayerisches Blau */
  --accent-hover: #5b97f8;
  --ok: #22c55e;
  --off: #ef4444;

  --radius: 12px;
  --max: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 150ms;
  --t-base: 200ms;
  --t-slow: 300ms;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, strong, b, th, dt { font-weight: 600; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

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

/* Einheitlicher Fokusring */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ── Header ───────────────────────────── */
.header { position: sticky; top: 0; z-index: 10; isolation: isolate; }
/* Hintergrund als eigene Ebene (deckend, kein Weichzeichner), blendet per opacity */
.header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(11, 13, 16, 0.96);
  border-bottom: 1px solid var(--border);
  transition: opacity var(--t-base) var(--ease-out);
}
/* Startseite: Header liegt transparent über dem Foto, bis gescrollt oder das Menü geöffnet wird */
.home .header { position: fixed; left: 0; right: 0; }
.home .header:not(.is-scrolled):not(.menu-open)::before { opacity: 0; }

.header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.brand img { width: auto; height: 40px; }
.header-actions { display: flex; align-items: center; gap: 8px; }

.nav { display: flex; gap: 24px; font-size: 14px; }
.nav a {
  position: relative; display: inline-flex; align-items: center; min-height: 44px;
  color: var(--muted); text-decoration: none;
  transition: color var(--t-fast) var(--ease-out);
}
.nav a:hover, .nav a.is-active, .nav a[aria-current="page"] { color: var(--text); }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 2px;
  background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-base) var(--ease-out);
}
.nav a.is-active::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }

/* Menü-Knopf nur schmal; Navigation klappt darunter auf */
.header .menu-btn { display: none; }
@media (max-width: 767.98px) {
  .header .menu-btn { display: grid; }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: rgba(11, 13, 16, 0.98); border-bottom: 1px solid var(--border);
    font-size: 16px;
    opacity: 0; transform: translateY(-4px); pointer-events: none; visibility: hidden;
    transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out), visibility 0s linear var(--t-base);
  }
  .header.menu-open .nav {
    opacity: 1; transform: none; pointer-events: auto; visibility: visible;
    transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out), visibility 0s;
  }
  .nav a { min-height: 48px; border-bottom: 1px solid var(--border); }
  .nav a:last-child { border-bottom: 0; }
  .nav a::after { display: none; }
  .header .btn-primary { padding: 0 16px; }
}

/* ── Buttons ──────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border-radius: 8px; border: 1px solid transparent;
  font-weight: 600; font-size: 16px; text-decoration: none; white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: rgba(11, 13, 16, 0.4); }
.btn-ghost:hover { border-color: var(--muted); }
.btn .arrow { transition: transform var(--t-base) var(--ease-out); }
@media (hover: hover) { .btn:hover .arrow { transform: translateX(4px); } }

/* Quadratische Icon-Knöpfe mit Tooltip (Hover und Tastatur-Fokus) */
.icon-btn {
  position: relative; display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-out);
}
.icon-btn:hover { border-color: var(--muted); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 8px);
  padding: 4px 8px; border-radius: 6px; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text);
  font-size: 12px; line-height: 1.4; font-weight: 400;
  opacity: 0; transform: translate(-50%, 4px); pointer-events: none;
  transition: opacity var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.icon-btn[data-tip].tip-below::after { bottom: auto; top: calc(100% + 8px); transform: translate(-50%, -4px); }
.icon-btn[data-tip]:hover::after, .icon-btn[data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.icon-btn[data-tip].tip-end::after { left: auto; right: 0; transform: translate(0, 4px); }
.icon-btn[data-tip].tip-end:hover::after, .icon-btn[data-tip].tip-end:focus-visible::after { transform: none; }

/* ── Hero ─────────────────────────────── */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: 112px 0 96px; }
@media (min-width: 768px) { .hero { padding: 160px 0 128px; } }
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%;
  transform: scale(1.06); transform-origin: 50% 30%;
}
/* Foto bewegt sich beim Scrollen leicht mit (nur wo der Browser es nativ kann) */
@supports (animation-timeline: scroll()) {
  .hero-bg {
    animation: hero-parallax linear both;
    animation-timeline: scroll(root);
    animation-range: 0 100vh;
  }
  @keyframes hero-parallax {
    from { transform: scale(1.06) translateY(0); }
    to   { transform: scale(1.06) translateY(10%); }
  }
}
/* Abdunkeln: oben für das Menü, links für den Text, unten weicher Übergang */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(11, 13, 16, 0.75) 0, rgba(11, 13, 16, 0) 160px),
    linear-gradient(180deg, rgba(11, 13, 16, 0) 55%, var(--bg) 100%),
    linear-gradient(90deg, rgba(11, 13, 16, 0.94) 0%, rgba(11, 13, 16, 0.8) 40%, rgba(11, 13, 16, 0.35) 100%);
}
@media (max-width: 767.98px) {
  .hero::after { background: linear-gradient(180deg, rgba(11, 13, 16, 0.75) 0%, rgba(11, 13, 16, 0.85) 60%, var(--bg) 100%); }
}
.hero h1 {
  margin: 24px 0 16px; max-width: 14ch;
  font-size: clamp(40px, 7vw, 64px); line-height: 1.1; letter-spacing: -0.02em;
}
.hero h1 .accent { color: var(--accent); }
.hero p.lead { margin: 0 0 32px; max-width: 56ch; color: var(--text-2); font-size: 18px; line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Live-Status */
.status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: rgba(11, 13, 16, 0.6); color: var(--text-2); font-size: 14px;
}
.status .dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.online .dot { background: var(--ok); }
.status.offline .dot { background: var(--off); }
/* Puls nur bei Live-Daten (funktionale Animation, Bedeutung steht zusätzlich im Text) */
.status.online .dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--ok);
  animation: live-ping 1.6s var(--ease-out) infinite;
}
@keyframes live-ping {
  from { transform: scale(1); opacity: 0.7; }
  to   { transform: scale(2.8); opacity: 0; }
}

/* Kennzahlen unter dem Startbild */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 1px;
  margin-top: -40px; position: relative; z-index: 1;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.stat { padding: 20px 24px; background: var(--surface); }
.stat strong { display: block; font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 14px; }
.stat .live { color: var(--ok); }

/* ── Sections ─────────────────────────── */
section { padding: 64px 0; border-top: 1px solid var(--border); }
@media (min-width: 768px) { section { padding: 96px 0; } }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 14px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
h2 { margin: 0 0 16px; font-size: clamp(28px, 4vw, 36px); line-height: 1.2; letter-spacing: -0.01em; }
.section-lead { margin: 0 0 40px; max-width: 65ch; color: var(--muted); }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  padding: 24px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
  transition: transform var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out);
}
.card h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.25; }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.card .tag { display: inline-block; margin-top: 16px; font-size: 14px; color: var(--accent); }
.card-media { padding: 0; overflow: hidden; display: flex; flex-direction: column; isolation: isolate; }
.card-media > img {
  width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover;
  border-bottom: 1px solid var(--border);
  transition: transform var(--t-slow) var(--ease-out);
}
.card-body { padding: 24px; }
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
  .card-media:hover > img { transform: scale(1.04); }
}
.card:focus-within { border-color: var(--border-strong); }

.icon-box {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 16px;
  border-radius: 8px; background: rgba(59, 130, 246, 0.12); color: var(--accent);
}
.icon-box svg { width: 24px; height: 24px; }

/* Fakten-Leiste */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.fact { padding: 24px; background: var(--surface); }
.fact strong { display: block; margin-bottom: 4px; font-weight: 600; }
.fact span { color: var(--muted); font-size: 14px; }

/* Schritte */
.steps { counter-reset: step; }
.step { position: relative; padding-top: 64px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 24px; left: 24px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 600;
}

/* Galerie */
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.shot {
  position: relative; display: block; width: 100%; padding: 0; overflow: hidden; cursor: zoom-in;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
  aspect-ratio: 16 / 10; font: inherit;
}
.gallery .shot:first-child { grid-column: span 2; aspect-ratio: 16 / 9; }
@media (min-width: 768px) {
  .gallery { grid-template-columns: repeat(4, 1fr); }
  .gallery .shot:first-child { grid-row: span 2; aspect-ratio: auto; min-height: 100%; }
}
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease-out); }
.shot .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 32px 16px 12px; text-align: left;
  font-size: 14px; font-weight: 600;
  background: linear-gradient(180deg, transparent, rgba(11, 13, 16, 0.85));
}
/* Beschriftung ist immer da; mit Maus blendet sie zusätzlich weich ein */
@media (hover: hover) {
  .shot .cap { opacity: 0; transform: translateY(4px); transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out); }
  .shot:hover .cap, .shot:focus-visible .cap { opacity: 1; transform: none; }
  .shot:hover img { transform: scale(1.04); }
}
.shot:focus-visible img { transform: scale(1.04); }

/* Vollbild-Ansicht */
.lightbox {
  width: min(1200px, 100vw - 32px); max-width: none; max-height: calc(100vh - 32px);
  padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg); color: var(--text); overflow: visible;
}
.lightbox[open] { animation: lb-in var(--t-base) var(--ease-out); }
.lightbox::backdrop { background: rgba(5, 6, 8, 0.88); }
.lightbox[open]::backdrop { animation: fade-in var(--t-base) var(--ease-out); }
@keyframes lb-in { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox img {
  width: 100%; height: auto; max-height: calc(100vh - 112px); object-fit: contain;
  background: #000; border-radius: var(--radius) var(--radius) 0 0;
}
.lightbox .lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 16px; }
.lightbox .lb-cap { font-size: 14px; color: var(--muted); }
.lightbox .lb-actions { display: flex; gap: 8px; }

/* FAQ */
.faq { display: grid; gap: 8px; max-width: 760px; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.faq summary {
  cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 16px 24px; font-weight: 600; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 24px 16px; color: var(--muted); max-width: 70ch; }
.faq details[open] p { animation: fade-in var(--t-base) var(--ease-out); }
.faq a { color: var(--accent); }

/* Abschluss */
.cta { text-align: center; position: relative; overflow: hidden; isolation: isolate; }
.cta::before {
  content: ""; position: absolute; left: 50%; top: 50%; z-index: -1;
  width: 900px; height: 400px; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(59, 130, 246, 0.12), transparent);
}
.cta .actions { justify-content: center; }
.cta p { margin: 0 auto 32px; max-width: 52ch; color: var(--muted); }

/* ── Footer ───────────────────────────── */
.footer { padding: 32px 0 48px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: flex-start; }
.footer nav { display: flex; flex-wrap: wrap; gap: 0 24px; }
.footer nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.footer nav a:hover { color: var(--text); }
.footer small { display: block; margin-top: 8px; font-size: 12px; }

/* ── Rechtstexte ──────────────────────── */
.legal { padding: 64px 0 96px; }
.legal h1 { margin: 0 0 32px; font-size: 36px; line-height: 1.2; }
.legal h2 { margin: 40px 0 8px; font-size: 20px; }
.legal p, .legal li { max-width: 70ch; color: var(--muted); }
.legal strong { color: var(--text); }
.placeholder {
  padding: 16px 24px; border: 1px dashed #f59e0b; border-radius: var(--radius);
  color: #fbbf24; background: rgba(245, 158, 11, 0.06);
}

/* ── Regelwerk ────────────────────────── */
.rules { padding: 64px 0 96px; }
.rules-head h1 { margin: 0 0 16px; font-size: clamp(32px, 5vw, 44px); line-height: 1.1; letter-spacing: -0.02em; }
.rules-head .section-lead { margin-bottom: 8px; }
.rules-meta { margin: 0 0 40px; color: var(--muted); font-size: 14px; }
.rules-meta a { color: var(--muted); }
.rules-layout { display: grid; gap: 32px; }
@media (min-width: 768px) { .rules-layout { grid-template-columns: 220px minmax(0, 1fr); } }

.toc { align-self: start; }
@media (min-width: 768px) { .toc { position: sticky; top: 88px; max-height: calc(100vh - 112px); overflow: auto; } }
.toc nav { display: none; }
@media (min-width: 768px) { .toc nav { display: flex; flex-direction: column; margin-top: 16px; } }
.toc nav a {
  display: flex; align-items: center; min-height: 44px; padding: 4px 12px;
  border-left: 2px solid var(--border); color: var(--muted); font-size: 14px; line-height: 1.4; text-decoration: none;
  transition: color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.toc nav a:hover { color: var(--text); }
.toc nav a.active { border-left-color: var(--accent); color: var(--text); }
.toc nav a[hidden] { display: none; }

.search { display: block; }
.search-label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.search input {
  width: 100%; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

.rules-body { min-width: 0; }
.rule { padding: 32px 0; border-top: 1px solid var(--border); scroll-margin-top: 80px; }
.rule:first-child { border-top: 0; padding-top: 0; }
.rule h2 { margin: 0 0 16px; font-size: 24px; line-height: 1.25; }
.rule h3 { margin: 24px 0 8px; font-size: 18px; line-height: 1.25; scroll-margin-top: 80px; }
.rule p, .rule li, .rule dd { color: var(--text-2); }
.rule p { margin: 0 0 12px; max-width: 72ch; }
.rule ul, .rule ol { margin: 0 0 12px; padding-left: 24px; max-width: 72ch; }
.rule li { margin-bottom: 8px; }
.rule li > ul, .rule li > ol { margin-top: 8px; }
.rule strong { color: var(--text); }
.rule a { color: var(--accent); }

/* Leere Suche: erklären und zurücksetzen */
.no-results {
  padding: 32px 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.no-results h2 { margin: 0 0 8px; font-size: 20px; }
.no-results p { margin: 0 0 16px; color: var(--muted); }

/* ── Bewegung: Einblenden (nur mit JS, html.js) ── */
.js .reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ── Weniger Bewegung gewünscht: sofort, ohne Verschieben/Zoomen ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .js .reveal { opacity: 1; transform: none; }
  .hero-bg { animation: none !important; transform: none; }
  .status.online .dot::after { display: none; }
  .card:hover, .card-media:hover > img, .shot:hover img, .shot:focus-visible img, .btn:hover .arrow { transform: none; }
  .nav { transform: none !important; }
}
