/* =========================================================
   style.css – das Aussehen der ganzen Website
   Alle Seiten verwenden diese eine Datei.
   Tipp: Farben und Schrift änderst du nur ganz oben bei :root.
   ========================================================= */


/* ---------- 1. Farben und Schrift (hier ändern!) ---------- */
/* Es gibt zwei Farbsets: NACHT (dunkel) und TAG (hell).
   Welches gezeigt wird:
   - automatisch so, wie Handy/Laptop eingestellt ist (Hell- oder Dunkelmodus)
   - mit dem Schalter oben rechts kann man auf das andere wechseln.
   Wenn du eine Farbe änderst, ändere sie bei NACHT und/oder TAG –
   und zwar jeweils an BEIDEN Stellen, wo das Set steht (siehe Kommentare). */

/* Schrift und Mond-Text gelten immer */
:root {
  --schrift: "Times New Roman", Times, serif;   /* Haupttext     */
  --klein:   Arial, Helvetica, sans-serif;      /* Menü, Labels  */
}

/* NACHT – Stelle 1: Standard */
:root {
  --hintergrund: #16131a;   /* Nachthimmel, Seitenhintergrund       */
  --flaeche:     #1f1b24;   /* Hintergrund von Kästchen/Karten      */
  --text:        #ece6ef;   /* normale Schriftfarbe                 */
  --grau:        #a69daf;   /* leise Schrift (Untertitel, Hinweise) */
  --linie:       #352f3c;   /* Trennlinien und Rahmen               */
  --mond:        #c9ccd6;   /* Akzentfarbe (Silber): Buttons usw.   */
  --lila:        #c6a3d1;   /* Links                                */
  /* der große Kreis auf der Startseite = Mond */
  --kreis:   radial-gradient(circle at 35% 35%, #ffffff, #e8e9ee 45%, #b9bcc7);
  --leuchten: 0 0 60px rgba(232, 233, 238, 0.35);
  --schalter-text: "☀ Hell";   /* Beschriftung des Schalters */
  color-scheme: dark;
}

/* TAG – Stelle 1: wenn das Gerät auf "hell" eingestellt ist */
@media (prefers-color-scheme: light) {
  :root {
    --hintergrund: #f7f6f3;   /* helles Papier          */
    --flaeche:     #ffffff;
    --text:        #222026;
    --grau:        #5f5a66;
    --linie:       #dedbe2;
    --mond:        #4f5466;   /* Akzent: dunkles Schiefergrau */
    --lila:        #6b3f78;
    /* der große Kreis = Sonne */
    --kreis:   #f08a6c;
    --leuchten: 0 0 70px rgba(233, 120, 100, 0.45);
    --schalter-text: "☾ Dunkel";
    color-scheme: light;
  }
}

/* Schalter angeklickt + Gerät dunkel  ->  TAG (Stelle 2) */
:root:has(#farbwechsel:checked) {
  --hintergrund: #f7f6f3;
  --flaeche:     #ffffff;
  --text:        #222026;
  --grau:        #5f5a66;
  --linie:       #dedbe2;
  --mond:        #4f5466;
  --lila:        #6b3f78;
  --kreis:   #f08a6c;
  --leuchten: 0 0 70px rgba(233, 120, 100, 0.45);
  --schalter-text: "☾ Dunkel";
  color-scheme: light;
}

/* Schalter angeklickt + Gerät hell  ->  NACHT (Stelle 2) */
@media (prefers-color-scheme: light) {
  :root:has(#farbwechsel:checked) {
    --hintergrund: #16131a;
    --flaeche:     #1f1b24;
    --text:        #ece6ef;
    --grau:        #a69daf;
    --linie:       #352f3c;
    --mond:        #c9ccd6;
    --lila:        #c6a3d1;
    --kreis:   radial-gradient(circle at 35% 35%, #ffffff, #e8e9ee 45%, #b9bcc7);
    --leuchten: 0 0 60px rgba(232, 233, 238, 0.35);
    --schalter-text: "☀ Hell";
    color-scheme: dark;
  }
}

/* Der Schalter selbst (steht in der Kopfzeile jeder Seite).
   Das Kästchen (checkbox) ist unsichtbar, man klickt auf die Beschriftung. */
.schalter {
  font-family: var(--klein);
  font-size: 0.8rem;
  color: var(--grau);
  cursor: pointer;
  border: 1px solid var(--linie);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.schalter:hover { color: var(--text); }
.schalter::after { content: var(--schalter-text); }
.schalter input {                 /* Kästchen verstecken, bleibt aber per Tastatur bedienbar */
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.schalter:has(input:focus-visible) { outline: 2px solid var(--mond); outline-offset: 2px; }


/* ---------- 2. Grundeinstellungen ---------- */
body {
  margin: 0;
  background: var(--hintergrund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 19px;
  line-height: 1.6;

  /* Kopierschutz: Text kann nicht markiert und damit nicht kopiert werden.
     Achtung: Das hält normale Besucher ab, aber keine Profis
     (die können trotzdem in den Quelltext schauen). */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;  /* kein Kopier-Menü beim langen Tippen am iPhone */
}

/* Bilder sollen nie breiter als der Bildschirm werden */
img { max-width: 100%; height: auto; }

a { color: var(--lila); }

h1, h2, h3 { font-weight: normal; line-height: 1.15; margin: 0; }
h1 { font-size: 2.8rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }
p  { margin: 0 0 1rem 0; }

/* Der "Container": hält den Inhalt in der Mitte und lässt am Rand Platz */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}


/* ---------- 3. Kopfzeile mit Menü ---------- */
.kopf {
  border-bottom: 1px solid var(--linie);
}
.kopf .container {
  display: flex;
  flex-wrap: wrap;               /* am Handy darf das Menü in die nächste Zeile */
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
  padding-top: 18px;
  padding-bottom: 18px;
}
.name {
  font-size: 1.35rem;
  color: var(--text);
  text-decoration: none;
}
.menue {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-family: var(--klein);
  font-size: 0.8rem;
}
.menue a {
  color: var(--grau);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.menue a:hover { color: var(--text); }
/* "aktiv" = die Seite, auf der man gerade ist. In jeder Seite steht
   class="aktiv" beim passenden Menüpunkt. */
.menue a.aktiv {
  color: var(--text);
  border-bottom-color: var(--mond);
}


/* ---------- 4. Hauptbereich ---------- */
main {
  padding-top: 40px;
  padding-bottom: 64px;
}
.abschnitt { margin-bottom: 56px; }

/* kleine Überschrift über einer großen (z. B. "Neueste Geschichte") */
.ueberzeile {
  display: block;
  font-family: var(--klein);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mond);
  margin-bottom: 8px;
}
.leise { color: var(--grau); }

/* Button, z. B. "Bei Amazon ansehen" */
.knopf {
  display: inline-block;
  font-family: var(--klein);
  font-size: 0.85rem;
  font-weight: bold;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 4px;
  background: var(--mond);
  color: var(--hintergrund);
}
.knopf:hover { opacity: 0.85; }
.knopf.rahmen {               /* zweite Button-Art: nur mit Rahmen */
  background: transparent;
  color: var(--text);
  border: 1px solid var(--linie);
}


/* ---------- 5. Startseite: großer Mond ---------- */
.mondbild {
  text-align: center;
  padding: 24px 0 8px;
}
.mond {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  /* Mond bei Nacht, Sonne bei Tag – die Farben stehen oben bei --kreis */
  background: var(--kreis);
  box-shadow: var(--leuchten);
}
.mondbild p {
  font-style: italic;
  color: var(--grau);
  font-size: 1.15rem;
  max-width: 34ch;
  margin: 16px auto 24px;
}

/* Zwei Spalten: links Geschichten, rechts das Buch.
   Am Handy (schmaler als 760px) untereinander. */
.zwei-spalten {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 760px) {
  .zwei-spalten { grid-template-columns: 1fr; }
}


/* ---------- 6. Liste der Kurzgeschichten ---------- */
.geschichten {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--linie);
}
.geschichten li {
  border-bottom: 1px solid var(--linie);
  padding: 18px 0;
}
.geschichten a {
  color: var(--text);
  text-decoration: none;
}
.geschichten a:hover h3 { color: var(--lila); }
.geschichten .zeile {          /* Titel links, Lesedauer rechts */
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.geschichten p {
  color: var(--grau);
  font-size: 1rem;
  margin: 6px 0 0;
}
.lesedauer {
  font-family: var(--klein);
  font-size: 0.78rem;
  color: var(--mond);
  white-space: nowrap;
}
.geschichten li.bald { opacity: 0.5; }  /* "kommt bald"-Einträge */


/* ---------- 7. Bücher ---------- */
/* Das echte Coverbild (liegt im Ordner bilder/) */
.cover-bild {
  display: block;
  width: 180px;
  max-width: 100%;
  aspect-ratio: 1057 / 1687;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}
.buch .cover-bild { width: 220px; }

/* Das Cover. Sobald du ein echtes Coverbild hast, ersetze das
   <div class="cover"> einfach durch <img src="bilder/cover-band-1.jpg" alt="..."> */
.cover {
  width: 180px;
  max-width: 100%;
  aspect-ratio: 2 / 3;
  background: #fff;
  color: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
  box-sizing: border-box;
  border: 1px solid var(--linie);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}
.cover b { font-weight: normal; font-size: 1.3rem; line-height: 1.1; }
.cover hr { width: 45%; border: 0; border-top: 1px solid #222; margin: 10px 0; }
.cover small { margin-top: 24px; font-size: 0.75rem; }

/* Ein Buch-Kasten: Cover links, Text rechts */
.buch {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: start;
  padding: 28px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 6px;
  margin-bottom: 32px;
}
@media (max-width: 600px) {
  .buch { grid-template-columns: 1fr; justify-items: center; }
}
.buch .knoepfe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.hinweis {                       /* klein gedruckt, z. B. Werbehinweis */
  font-family: var(--klein);
  font-size: 0.75rem;
  color: var(--grau);
  margin-top: 12px;
}


/* ---------- 8. Charaktere ---------- */
/* Karten nebeneinander; der Browser macht so viele Spalten, wie Platz ist */
.karten {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}
.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 6px;
  padding: 20px;
}
.karte .zeichen {               /* runder Anfangsbuchstabe als "Bild" */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--mond);
  color: var(--mond);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.karte .rolle {
  font-family: var(--klein);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grau);
  margin: 6px 0 10px;
}
.karte p { font-size: 1rem; }


/* ---------- 9. Leseseite einer Geschichte ---------- */
.lesen {
  max-width: 640px;               /* schmale Spalte = angenehm zu lesen */
  margin: 0 auto;
}
.lesen header {
  text-align: center;
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--linie);
}
.lesen header h1 { margin: 6px 0 10px; }
.text {
  font-size: 1.2rem;
  line-height: 1.75;
  hyphens: auto;                  /* lange Wörter werden getrennt */
}
.text p { margin: 0; }
.text p + p { text-indent: 1.4em; }  /* Absatz-Einzug wie im Buch */

.danach {
  text-align: center;
  border-top: 1px solid var(--linie);
  margin-top: 40px;
  padding-top: 32px;
}
.danach p { font-style: italic; max-width: 40ch; margin: 0 auto 20px; }


/* ---------- 10. Impressum und Datenschutz ---------- */
.recht { max-width: 720px; font-size: 1.05rem; }
.recht h2 { font-size: 1.35rem; margin: 28px 0 10px; }
.recht h1 { margin-bottom: 24px; }
.angaben {                      /* zweispaltige Liste: Bezeichnung | Angabe */
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 6px 16px;
  margin: 0;
}
.angaben dt { color: var(--grau); }
.angaben dd { margin: 0; }
@media (max-width: 560px) {
  .angaben { grid-template-columns: 1fr; }
  .angaben dd { margin-bottom: 10px; }
}

/* GELB = Platzhalter, die du noch ausfüllen musst. Vor dem Online-Gehen
   sollte keiner mehr übrig sein! */
.platzhalter {
  background: #5a4a1f;
  color: #f3e2b0;
  padding: 0 4px;
  border-radius: 3px;
  font-family: var(--klein);
  font-size: 0.85em;
}


/* ---------- 11. Fußzeile ---------- */
.fuss {
  border-top: 1px solid var(--linie);
  font-family: var(--klein);
  font-size: 0.78rem;
  color: var(--grau);
}
.fuss .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 24px;
  padding-bottom: 24px;
}
.fuss a { color: var(--grau); margin-left: 16px; }
.fuss a:first-child { margin-left: 0; }


/* ---------- 12. Kleine Bildschirme (Handy) ---------- */
@media (max-width: 560px) {
  body { font-size: 18px; }
  h1 { font-size: 2.2rem; }
}


/* ---------- 13. Steckbrief-Seiten (charakter-....html) ---------- */
/* Die Karten auf charaktere.html sind Links: ganze Karte ist klickbar */
a.karte { display: block; color: var(--text); text-decoration: none; }
a.karte:hover { border-color: var(--mond); }
.karte .mehr {
  font-family: var(--klein);
  font-size: 0.78rem;
  color: var(--mond);
}
/* Kopfbereich: großer Buchstabe links, Name rechts */
.steckbrief {
  display: flex;
  align-items: center;
  gap: 24px;
}
.zeichen.gross {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--mond);
  color: var(--mond);
  font-size: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.zitat {                          /* Lieblingszitat der Figur */
  font-style: italic;
  color: var(--grau);
  margin: 12px 0 0;
}
.steckbrief-daten {               /* im Kasten statt frei */
  grid-template-columns: 1fr;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 6px;
  padding: 20px;
}
.steckbrief-daten dd { margin-bottom: 10px; }


/* ---------- 14. Charakter-Übersicht: einheitliche Karten + Filter ---------- */
/* Alle Karten gleich: Name, Rasse, Alter */
.figuren {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.figur { padding: 16px 18px; }
.figur h3 { font-size: 1.2rem; margin-bottom: 6px; }
.figur .rasse {
  font-family: var(--klein);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mond);
}
.figur .alter {
  font-family: var(--klein);
  font-size: 0.8rem;
  color: var(--grau);
  margin-top: 4px;
}

/* Suchfeld + Filter-Knöpfe über den Karten */
.filter-leiste { margin-bottom: 24px; }
.suche {
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
  font-family: var(--klein);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 999px;
  padding: 8px 16px;
  margin-bottom: 12px;
  -webkit-user-select: text;
  user-select: text;
}
.suche:focus { outline: 2px solid var(--mond); outline-offset: 2px; }
.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter label {
  font-family: var(--klein);
  font-size: 0.8rem;
  color: var(--grau);
  border: 1px solid var(--linie);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
}
.filter label:hover { color: var(--text); }
.filter input {                   /* Kreis verstecken, per Tastatur bleibt es bedienbar */
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.filter label:has(input:checked) {
  background: var(--mond);
  border-color: var(--mond);
  color: var(--hintergrund);
}
.filter label:has(input:focus-visible) { outline: 2px solid var(--mond); outline-offset: 2px; }

/* So funktioniert der Filter: ist z. B. "Engel" gewählt,
   werden alle Karten ohne class="art-engel" ausgeblendet. */
main:has(#f-werwolf:checked)     .figur:not(.art-werwolf)     { display: none; }
main:has(#f-tierdaemon:checked)  .figur:not(.art-tierdaemon)  { display: none; }
main:has(#f-engel:checked)       .figur:not(.art-engel)       { display: none; }
main:has(#f-mensch:checked)      .figur:not(.art-mensch)      { display: none; }
main:has(#f-andere:checked)      .figur:not(.art-andere)      { display: none; }

/* Von der Namenssuche ausgeblendete Karten */
.figur.versteckt { display: none; }
/* "Keine Figur gefunden" nur zeigen, wenn keine Karte sichtbar ist */
.keine-treffer { display: none; margin-top: -32px; }
.figuren:not(:has(.figur:not(.versteckt))) + .keine-treffer { display: block; }

/* ---------- 15. Spoiler-Kästchen (aufklappbar, ohne Skript) ----------
   Verwendung in einem Steckbrief:
   <details class="spoiler"><summary>Achtung Spoiler!</summary>Geheimer Text</details> */
.spoiler {
  margin-top: 6px;
  border: 1px dashed var(--linie);
  border-radius: 6px;
  padding: 6px 10px;
}
.spoiler summary { cursor: pointer; color: var(--grau); font-size: 0.9em; }
.spoiler[open] summary { margin-bottom: 6px; }

/* Großer Scherz-Spoiler (z. B. bei Dusty) */
.spoiler-gross { margin-top: 8px; }
.spoiler-gross p { font-size: 1.3em; font-weight: bold; margin: 0 0 8px; }
.spoiler-gross button {
  font: inherit; font-weight: bold; cursor: pointer;
  background: var(--flaeche); color: inherit;
  border: 2px solid var(--linie); border-radius: 6px; padding: 6px 14px;
}
.spoiler-gross > button:only-child { font-size: 1.4em; letter-spacing: 1px; padding: 10px 18px; }

/* ---------- 16. Rassen ---------- */
/* Rassen-Karten auf rassen.html; "bald" = noch ohne Beschreibung */
.karte.bald { opacity: 0.5; }
/* Rasse auf den Charakterkarten als Link zur Rassenseite */
a.rasse-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--mond);
  text-underline-offset: 3px;
}
a.rasse-link:hover { color: var(--mond); }
/* Lesedauer unter der Überschrift der Leseprobe */
.lesen header .lesedauer { display: block; margin-top: 6px; }
