/* Reels – eine einzige Stildatei. Handy zuerst. Look: dunkles Milchglas wie bei Apple („Liquid Glass“):
   farbiger Hintergrund, durchscheinende Karten mit heller Oberkante, runde Knöpfe mit Glanz, schwebende Leiste.
   Faustregel: Glas für Leisten und Karten, Text immer hell auf dunkel, damit alles gut lesbar bleibt. */

:root {
  --grund: #070812;
  --text: #f5f6fb;
  --leise: rgba(235, 238, 255, 0.64);
  --glas: rgba(255, 255, 255, 0.075);
  --glas-hell: rgba(255, 255, 255, 0.14);
  --glas-tief: rgba(8, 10, 26, 0.38);
  --kante: rgba(255, 255, 255, 0.17);
  --kante-hell: rgba(255, 255, 255, 0.38);
  --blau: #4da3ff;
  --gold: #ffd35c;
  --gruen: #5fe08f;
  --rot: #ff7b86;
  --lila: #c9a4ff;
  --rund: 26px;
  --rund-klein: 16px;
  --unschaerfe: blur(26px) saturate(180%);
  --schatten: 0 22px 44px -22px rgba(0, 0, 0, 0.75);
  --glanz: inset 0 1px 0 var(--kante-hell), inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  --schrift: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rund-schrift: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--grund); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  /* kein eigener Hintergrund: sonst läge er über den Lichtflecken (die Grundfarbe sitzt auf html) */
  color: var(--text);
  font-family: var(--schrift);
  font-size: 17px;
  line-height: 1.5;
  accent-color: var(--blau);
  -webkit-font-smoothing: antialiased;
}

/* Farbiger Hintergrund hinter dem Glas: vier weiche Lichtflecken, die ganz langsam wandern. */
body::before {
  content: "";
  position: fixed;
  inset: -12%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 34% at 16% 12%, rgba(124, 92, 255, 0.62), transparent 72%),
    radial-gradient(34% 30% at 86% 16%, rgba(0, 168, 255, 0.5), transparent 72%),
    radial-gradient(44% 38% at 78% 86%, rgba(255, 72, 164, 0.4), transparent 72%),
    radial-gradient(40% 34% at 10% 88%, rgba(255, 158, 64, 0.3), transparent 72%),
    radial-gradient(55% 45% at 50% 50%, rgba(64, 86, 220, 0.2), transparent 75%);
  animation: wandern 36s ease-in-out infinite alternate;
}
@keyframes wandern {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

a { color: var(--blau); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--blau);
  outline-offset: 2px;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; letter-spacing: -0.02em; }
h1 { font-size: 2.1rem; font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 0.75rem; }
hr { border: 0; border-top: 1px solid var(--kante); margin: 1rem 0; }

.leise { color: var(--leise); font-size: 0.92rem; }
.umbruch { overflow-wrap: anywhere; }
.versteckt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fehler-text { color: var(--rot); overflow-wrap: anywhere; }
.abschnitt { margin: 2rem 0 0.75rem 0.35rem; color: var(--leise); text-transform: uppercase; letter-spacing: 0.09em; font-size: 0.8rem; font-weight: 700; }

/* ---- Glas: gemeinsame Grundlage ---- */
.karte, .kachel, .held, .kopf, .reiter, .hinweis, .anmelden, .tabelle-rahmen, .liste-karten > li {
  background: linear-gradient(140deg, var(--glas-hell), var(--glas) 55%);
  -webkit-backdrop-filter: var(--unschaerfe);
  backdrop-filter: var(--unschaerfe);
  border: 1px solid var(--kante);
  box-shadow: var(--glanz), var(--schatten);
}

/* ---- Kopf ---- */
.kopf {
  position: sticky; top: calc(0.6rem + env(safe-area-inset-top)); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin: calc(0.6rem + env(safe-area-inset-top)) 0.75rem 0;
  padding: 0.5rem 0.6rem 0.5rem 0.55rem;
  border-radius: 999px;
}
.kopf-name { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.kopf-rechts { display: flex; align-items: center; gap: 0.5rem; }
.kopf-zeichen, .anmelden-zeichen {
  display: inline-flex; align-items: center; justify-content: center;
  color: #3a2800; font-family: var(--rund-schrift); font-weight: 800;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 48%), linear-gradient(160deg, #ffe27a, #ff9d2e);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 6px 16px -6px rgba(255, 166, 40, 0.8);
}
.kopf-zeichen { width: 2.1rem; height: 2.1rem; border-radius: 0.72rem; font-size: 1.2rem; }

/* ---- Inhalt ---- */
main {
  max-width: 42rem; margin: 0 auto;
  padding: 1.25rem 1rem calc(7.5rem + env(safe-area-inset-bottom));
}
main.schmal { max-width: 25rem; padding-top: 14vh; padding-bottom: 2rem; }

.karten { display: grid; gap: 1rem; }
.karte {
  display: block;
  border-radius: var(--rund);
  padding: 1.15rem;
  margin: 0 0 1rem;
}
.karten > .karte { margin: 0; }
.karte-link { color: inherit; text-decoration: none; transition: transform 0.18s ease, border-color 0.18s ease; }
.karte-link:hover, .karte-link:focus-visible { border-color: var(--kante-hell); transform: translateY(-2px); }
.karte-aktiv { border-color: rgba(77, 163, 255, 0.75); box-shadow: var(--glanz), 0 0 0 3px rgba(77, 163, 255, 0.22), var(--schatten); }
.karte > :last-child { margin-bottom: 0; }

.leer {
  border: 1px dashed var(--kante-hell);
  border-radius: var(--rund);
  background: var(--glas-tief);
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--leise);
  margin: 0 0 1rem;
}
.leer > :last-child { margin-bottom: 0; }

/* ---- Schilder (kleine Status-Marken) ---- */
.schilder { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.6rem; }
.schild {
  display: inline-block;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  color: var(--leise);
  background: color-mix(in srgb, currentColor 15%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 38%, transparent);
  text-decoration: none;
  white-space: nowrap;
}
.schild-ok { color: var(--gruen); }
.schild-warnung { color: var(--gold); }
.schild-fehler { color: var(--rot); }
.schild-info { color: var(--blau); }
.schild-beispiel { color: var(--lila); }

/* ---- Hinweise ---- */
.hinweis {
  position: relative;
  border-radius: var(--rund-klein);
  padding: 0.8rem 1rem 0.8rem 1.25rem;
  margin: 0 0 1rem;
  overflow-wrap: anywhere;
  --farbe: var(--blau);
}
.hinweis::before { content: ""; position: absolute; left: 0.5rem; top: 0.7rem; bottom: 0.7rem; width: 4px; border-radius: 4px; background: var(--farbe); box-shadow: 0 0 12px var(--farbe); }
.hinweis-ok { --farbe: var(--gruen); }
.hinweis-fehler { --farbe: var(--rot); }
.hinweis-beispiel { --farbe: var(--lila); }

/* ---- Formulare ---- */
.stapel { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.stapel > label { font-weight: 600; margin-top: 0.35rem; }
input[type="text"], input[type="url"], input[type="password"], input[type="datetime-local"], select, textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.9rem;
  font: inherit; font-size: 1rem;
  color: var(--text);
  background: var(--glas-tief);
  border: 1px solid var(--kante);
  border-radius: var(--rund-klein);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
}
input:focus, select:focus, textarea:focus { border-color: rgba(77, 163, 255, 0.8); }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: rgba(235, 238, 255, 0.4); }
fieldset { border: 1px solid var(--kante); border-radius: var(--rund-klein); padding: 0.75rem 0.9rem; margin: 0.35rem 0; min-width: 0; display: grid; gap: 0.5rem; background: var(--glas-tief); }
legend { font-weight: 700; padding: 0 0.4rem; }
.wahl { display: flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; font-weight: 400; }
.wahl input { width: 1.4rem; height: 1.4rem; margin: 0; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem;
  padding: 0.6rem 1.3rem;
  font: inherit; font-weight: 650; font-size: 1rem;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.07));
  -webkit-backdrop-filter: var(--unschaerfe);
  backdrop-filter: var(--unschaerfe);
  border: 1px solid var(--kante);
  border-radius: 999px;
  box-shadow: var(--glanz), 0 10px 22px -14px rgba(0, 0, 0, 0.8);
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.knopf:hover { filter: brightness(1.12); }
.knopf:active { transform: scale(0.97); }
.knopf-haupt {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.32);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 52%), linear-gradient(180deg, #49a6ff, #0a63f2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 14px 28px -12px rgba(10, 99, 242, 0.9);
  text-shadow: 0 1px 1px rgba(0, 40, 120, 0.45);
}
.knopf-gefahr { color: var(--rot); border-color: rgba(255, 123, 134, 0.5); background: linear-gradient(180deg, rgba(255, 123, 134, 0.22), rgba(255, 123, 134, 0.08)); }
.knopf-leise { background: transparent; border-color: var(--kante); color: var(--leise); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.knopf-breit { width: 100%; min-height: 3.4rem; font-size: 1.08rem; }
.knopf-rund { min-height: 2.4rem; width: 2.4rem; padding: 0; }
.knopf-rund svg { width: 1.25rem; height: 1.25rem; }
.knopf[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.knopf-formular { display: inline-block; margin: 0; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.85rem; }
.knoepfe:empty { display: none; }
.knoepfe-zwei { display: grid; grid-template-columns: 1fr 1fr; }

details { margin: 0.75rem 0; }
summary { cursor: pointer; min-height: 2.75rem; display: flex; align-items: center; color: var(--blau); font-weight: 600; }
summary::before { content: "›"; margin-right: 0.55rem; font-size: 1.3rem; line-height: 1; transition: transform 0.15s ease; }
details[open] > summary::before { transform: rotate(90deg); }
summary::-webkit-details-marker { display: none; }

progress { width: 100%; height: 0.6rem; }
meter { flex: 1; height: 0.6rem; min-width: 4rem; }
.hitze { display: flex; align-items: center; gap: 0.6rem; }

/* ---- Bildchen (Linien wie bei Apple) ---- */
.bild { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Listen ---- */
.liste { list-style: none; margin: 0.5rem 0; padding: 0; }
.liste > li { padding: 0.8rem 0; border-top: 1px solid var(--kante); }
.liste > li:first-child { border-top: 0; }
.liste > li > :last-child { margin-bottom: 0; }
.liste-karten > li { border-radius: var(--rund-klein); padding: 0.95rem 1rem; margin-bottom: 0.75rem; }
.liste-karten > li:first-child { border-top: 1px solid var(--kante); }
.zeile { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }

.steckbrief { margin: 0 0 1rem; }
.steckbrief dt { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--leise); margin-top: 0.85rem; }
.steckbrief dd { margin: 0.15rem 0 0; }

.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 0.6rem; margin: 0.6rem 0; }
.kennzahlen > div { background: var(--glas-tief); border: 1px solid var(--kante); border-radius: var(--rund-klein); padding: 0.6rem 0.75rem; }
.kennzahlen dt { font-size: 0.8rem; color: var(--leise); }
.kennzahlen dd { margin: 0; font-family: var(--rund-schrift); font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; }

/* ---- Übersicht ---- */
.held { position: relative; overflow: hidden; border-radius: calc(var(--rund) + 6px); padding: 1.4rem 1.25rem; margin: 1rem 0; }
.held::after {
  content: ""; position: absolute; right: -4rem; top: -5rem; width: 15rem; height: 15rem; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 211, 92, 0.42), transparent 68%);
}
.held > * { position: relative; z-index: 1; }
.held-zahl { font-family: var(--rund-schrift); font-size: 4.2rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; margin: 0.25rem 0;
  background: linear-gradient(180deg, #fff, #ffd98a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.held-text { font-size: 1.15rem; font-weight: 650; margin: 0; }

.kacheln { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; margin: 0 0 1rem; }
.kachel {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 0.15rem;
  min-height: 8.6rem;
  border-radius: var(--rund);
  padding: 0.95rem 1rem;
  color: inherit; text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease;
  --farbe: var(--blau);
}
.kachel::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), transparent 42%); }
.kachel:hover, .kachel:focus-visible { transform: translateY(-3px); border-color: var(--kante-hell); }
.kachel-bild {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 0.85rem; margin-bottom: auto;
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 50%), var(--farbe);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 10px 20px -10px var(--farbe);
}
.kachel-zahl { font-family: var(--rund-schrift); font-size: 2.1rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 0.7rem; }
.kachel-text { color: var(--leise); font-size: 0.9rem; font-weight: 600; }
.kachel-blau { --farbe: #1f86ff; }
.kachel-gold { --farbe: #ff9f1a; }
.kachel-gruen { --farbe: #22c55e; }
.kachel-rot { --farbe: #ff4d6d; }
.kachel-lila { --farbe: #8b5cf6; }
.kachel-tuerkis { --farbe: #14b8c8; }

/* ---- Skript ---- */
.szenen { margin: 0.5rem 0 0; padding: 0; list-style: none; counter-reset: szene; }
.szene { counter-increment: szene; border-left: 3px solid var(--kante-hell); padding: 0.4rem 0 0.4rem 0.85rem; margin-bottom: 0.75rem; }
.szene > :last-child { margin-bottom: 0; }
.szene-kopf { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.85rem; font-weight: 600; }
.szene-kopf > span:first-child::before { content: "Szene " counter(szene) " · "; color: var(--blau); }
.szene-satz { font-size: 1.05rem; margin: 0.35rem 0; }
.szene-text { margin: 0.35rem 0; }

/* ---- Video-Vorschau ---- */
.vorschau {
  display: block;
  width: 100%;
  max-width: 14rem;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: #000;
  border: 1px solid var(--kante-hell);
  border-radius: 22px;
  box-shadow: 0 24px 44px -20px rgba(0, 0, 0, 0.9);
  margin: 0 auto 0.85rem;
}
.vorschau-gross { max-width: min(100%, 22rem); max-height: 72vh; width: auto; }
.vorschau-leer { display: flex; align-items: center; justify-content: center; color: var(--leise); }
.karte-freigabe .zaehler { text-align: center; font-weight: 700; color: var(--leise); }
.blaettern { display: flex; justify-content: space-between; margin-top: 1rem; }
.post-zahlen { border-top: 1px solid var(--kante); padding-top: 0.75rem; margin-top: 0.75rem; }

/* ---- Tabellen ---- */
.tabelle-rahmen { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--rund-klein); box-shadow: var(--glanz); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { padding: 0.5rem 0.7rem; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--kante); }
th:first-child { text-align: left; }
thead th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--leise); background: rgba(0, 0, 0, 0.18); }
tbody tr:last-child > * { border-bottom: 0; }
td { font-variant-numeric: tabular-nums; }

/* ---- Leiste: schwebt unten als Glas-Pille ---- */
.reiter {
  position: fixed; z-index: 10;
  left: 0.6rem; right: 0.6rem; bottom: calc(0.6rem + env(safe-area-inset-bottom));
  max-width: 34rem; margin: 0 auto;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.1rem;
  padding: 0.3rem;
  border-radius: 2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  backdrop-filter: blur(30px) saturate(200%);
}
.reiter-eintrag {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
  min-height: 3.4rem; min-width: 0;
  padding: 0.35rem 0.1rem;
  border-radius: 1.7rem;
  color: var(--leise);
  text-decoration: none;
  font-size: 0.66rem; font-weight: 650;
  transition: background 0.18s ease, color 0.18s ease;
}
.reiter-eintrag.aktiv { color: #fff; background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.12)); box-shadow: var(--glanz); }
.reiter-bild { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.reiter-zahl {
  position: absolute; top: 0.2rem; left: calc(50% + 0.35rem);
  min-width: 1.25rem; height: 1.25rem; line-height: 1.25rem; padding: 0 0.3rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff6b7d, #ff2d55); color: #fff; text-align: center; font-size: 0.72rem; font-weight: 800;
  box-shadow: 0 4px 10px -3px rgba(255, 45, 85, 0.9);
}

/* ---- Anmelden ---- */
.anmelden { text-align: center; border-radius: calc(var(--rund) + 6px); padding: 2rem 1.4rem 1.5rem; }
.anmelden form { text-align: left; }
.anmelden-zeichen { width: 4.4rem; height: 4.4rem; border-radius: 1.3rem; font-size: 2.6rem; margin: 0 auto 1rem; }

/* ---- Breite Bildschirme: Leiste wandert als Seitenleiste nach links ---- */
@media (min-width: 60rem) {
  body { font-size: 17.5px; padding-left: 15.5rem; }
  body:has(main.schmal) { padding-left: 0; }
  main { max-width: 68rem; padding: 1.5rem 2rem 3rem; }
  .kopf { display: none; }   /* der Name steht dann schon in der Seitenleiste */
  .reiter {
    left: 1rem; top: 1rem; bottom: 1rem; right: auto; width: 13.5rem; max-width: none; margin: 0;
    grid-auto-flow: row; grid-auto-rows: min-content; grid-auto-columns: auto; align-content: start; gap: 0.3rem;
    padding: 5.2rem 0.7rem 0.7rem;
    border-radius: 2rem;
  }
  .reiter::before {
    content: "Side Quest Dept."; position: absolute; left: 1.35rem; top: 1.6rem;
    font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--text);
  }
  .reiter::after { content: "Reels-Zentrale"; position: absolute; left: 1.35rem; top: 3.15rem; font-size: 0.8rem; color: var(--leise); }
  .reiter-eintrag { flex-direction: row; justify-content: flex-start; gap: 0.8rem; min-height: 3rem; padding: 0.5rem 0.9rem; font-size: 1rem; border-radius: 1.1rem; }
  .reiter-zahl { position: static; margin-left: auto; }
  .karten { grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); align-items: start; }
  .kacheln { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
  .kachel { min-height: 10rem; }
  .held { padding: 2rem; }
  .held-zahl { font-size: 5.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .knopf, .karte-link, .kachel { transition: none; }
  .knopf:active, .karte-link:hover, .kachel:hover { transform: none; }
}

/* Ohne Milchglas-Unterstützung: Flächen etwas dichter, damit Text lesbar bleibt. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .karte, .kachel, .held, .kopf, .reiter, .hinweis, .anmelden, .tabelle-rahmen, .liste-karten > li { background: rgba(30, 32, 58, 0.94); }
}
