/* Slow Burn Spanish – Leseprobe. Der Buchseiten-Look der App als Web-CSS.
   Eine bewusste Ein-Themen-Welt (warmes Papier), alle Farben explizit. */

:root {
  --papier: #FAF3E7;
  --papier-tief: #F4EBD9;
  --tinte: #2A2118;
  --tinte-sanft: #73634C;
  --linie: #E3D4B8;
  --akzent: #B4531F;
  --oliv: #5C6B3C;
  --oliv-hell: #EBEDDD;
  --tafel: #2E3A2F;
  --kreide: #F2EFE4;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; }
body {
  background: var(--papier);
  color: var(--tinte);
  font-family: 'Literata', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

/* Papierkorn + Vignette, wie BookPage in der App */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(42,33,24,.06) 100%),
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(42,33,24,.012) 2px 3px);
}

.hand { font-family: 'Caveat', 'Bradley Hand', cursive; }

/* ---------- Kopfzeile ---------- */
.kopf {
  position: sticky; top: 0; z-index: 30;
  background: rgba(250,243,231,.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--linie);
}
.kopf-inhalt {
  max-width: 44rem; margin: 0 auto; padding: .55rem 1.1rem;
  display: flex; align-items: baseline; gap: .8rem;
}
.kopf a { color: var(--tinte-sanft); text-decoration: none; font-size: .85rem; }
.kopf a:hover { color: var(--akzent); }
.kopf-titel { font-size: .95rem; }
.kopf-titel em { color: var(--tinte); }
.kopf-sprache { margin-left: auto; font-weight: 600; letter-spacing: .08em; }
.kopf-szene { color: var(--tinte-sanft); font-size: .82rem;
  font-variant-numeric: tabular-nums; }
.fortschritt { height: 3px; background: var(--linie); }
.fortschritt > div { height: 100%; width: 0%; background: var(--akzent);
  transition: width .35s ease; }

/* ---------- Lesefläche ---------- */
main { position: relative; z-index: 1; }
.seite {
  max-width: 42rem; margin: 0 auto;
  padding: 2.2rem 1.3rem 42vh;
  cursor: pointer;
}
.seite:focus { outline: none; }
.seite:focus-visible { outline: 2px solid var(--akzent); outline-offset: 4px; }

.kapitel-opener { text-align: center; margin-bottom: 2.4rem; cursor: default; }
.kapitel-opener .nummer { letter-spacing: .35em; font-size: .8rem;
  color: var(--tinte-sanft); text-transform: uppercase; }
.kapitel-opener h1 { font-style: italic; font-weight: 600;
  font-size: 2rem; margin: .3rem 0 .9rem; }
.zierlinie { width: 46px; border: 0; border-top: 1px solid var(--akzent);
  margin: 0 auto; }

.szenenbild { margin: 0 0 2rem; }
.szenenbild img {
  display: block; width: 100%; height: auto; border-radius: 4px;
  border: 1px solid var(--linie);
  box-shadow: 0 1px 0 rgba(42,33,24,.08), 0 10px 28px -16px rgba(42,33,24,.45);
}
.szenenbild figcaption { text-align: center; color: var(--tinte-sanft);
  font-size: .82rem; font-style: italic; margin-top: .5rem; }

/* Blöcke erscheinen weich, Gelesenes dimmt (wie Tap-to-Advance der App) */
.block { margin: 0 0 1.35rem; opacity: 1; transition: opacity .4s ease; }
.block.gelesen { opacity: .7; }
.block.neu { animation: auftauchen .3s ease both; }
@keyframes auftauchen {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .block.neu { animation: none; }
  .ton.spielt, .karte.schuettel { animation: none; }
}

/* Sprechervermerk wie SpeakerMark: Versalien in Sprecherfarbe */
.rede { margin-bottom: 1.35rem; }
.rede .wer { display: block; font-size: .72rem; letter-spacing: .24em;
  text-transform: uppercase; color: var(--akzent); margin-bottom: .15rem; }
.rede.mia { text-align: right; }
.rede.mia .wer { color: var(--tinte-sanft); }
.rede .zeile { font-size: 1.06em; }

/* Karaoke-Highlight */
.zeile .w.an { color: var(--akzent); }

/* Replay-Knopf */
.ton {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.7rem; height: 1.7rem; margin-left: .45rem;
  vertical-align: -0.35rem;
  border: 1px solid var(--linie); border-radius: 50%;
  background: var(--papier-tief); color: var(--tinte-sanft);
  font-size: .8rem; cursor: pointer; transition: color .2s, border-color .2s;
}
.ton:hover { color: var(--akzent); border-color: var(--akzent); }
.ton.spielt { color: var(--akzent); border-color: var(--akzent); animation: puls 1s ease infinite; }
@keyframes puls { 50% { transform: scale(1.12); } }

/* Rätselkasten: gestrichelt, wie mit Bleistift gezogen; nie übersetzt */
.raetsel {
  border: 1.5px dashed var(--tinte-sanft); border-radius: 10px;
  padding: .8rem 1rem; background: rgba(244,235,217,.5);
}
.raetsel .wer { display: block; font-size: .72rem; letter-spacing: .24em;
  text-transform: uppercase; color: var(--akzent); margin-bottom: .2rem; }
.raetsel .original { font-style: italic; color: var(--tinte-sanft); }
.raetsel .deut { font-size: .8rem; color: var(--tinte-sanft); margin-top: .35rem; }

/* Antippbare Wörter */
b.tap {
  font-weight: 600; color: var(--akzent); cursor: pointer;
  border-bottom: 1px dotted var(--akzent);
}
b.tap:hover { background: rgba(180,83,31,.08); }

/* Vokabel-Popover */
.popover {
  position: absolute; z-index: 40; max-width: 15rem;
  background: #FFFDF7; border: 1px solid var(--linie); border-radius: 10px;
  padding: .65rem .9rem .7rem;
  box-shadow: 0 8px 24px -10px rgba(42,33,24,.4);
  cursor: default;
}
.popover .es { font-size: 1.5rem; line-height: 1.1; }
.popover .de { color: var(--tinte-sanft); font-size: .92rem; margin-top: .1rem; }
.popover .pop-kopf { display: flex; align-items: center; gap: .7rem; }
.popover .vok-bild { width: 3.4rem; height: 3.4rem; border-radius: 12px; }
.nb-add {
  margin-top: .65rem; font: inherit; font-size: .85rem; color: var(--akzent);
  background: rgba(180,83,31,.08); border: 0; border-radius: 999px;
  padding: .35rem .9rem; cursor: pointer;
}
.nb-add:hover { background: rgba(180,83,31,.14); }
.nb-add:disabled { color: var(--oliv); background: var(--oliv-hell); cursor: default; }

/* Notizbuch-Moment wie in der App: Buch-Icon, kleine Zeile darüber,
   die Wörter kursiv und antippbar; sie fliegen als Chips zum Kopf-Icon. */
.notizbuch {
  display: flex; gap: .7rem; align-items: flex-start;
  background: #FFFDF7; border: 1px solid var(--linie);
  border-radius: 8px; padding: .6rem .9rem;
  color: var(--tinte-sanft);
}
.notizbuch .nb-icon { display: inline-flex; flex: none; color: var(--akzent); padding-top: .2rem; }
.notizbuch .nb-caption { font-size: .78rem; margin-bottom: .1rem; }
.notizbuch .woerter b.tap { font-style: italic; border-bottom: 0; }

/* Karten (Wahl & Übung): aufgelegte Zettel */
.karte {
  background: #FFFDF7; border: 1px solid var(--linie); border-radius: 10px;
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: 0 1px 0 rgba(42,33,24,.06), 0 12px 30px -20px rgba(42,33,24,.5);
  cursor: default;
}
.karte .frage { margin: 0 0 .8rem; }
.karte.schuettel { animation: schuetteln .4s ease; }
@keyframes schuetteln {
  20% { transform: translateX(-6px); } 40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(2px); }
}

/* Wahl: gleichwertige, neutrale Optionen – nie grün/rot */
.option {
  display: block; width: 100%; text-align: left;
  font: inherit; color: inherit;
  background: var(--papier-tief); border: 1px solid var(--linie);
  border-radius: 8px; padding: .55rem .85rem; margin-top: .5rem;
  cursor: pointer; transition: border-color .2s, opacity .3s;
}
.option:hover { border-color: var(--tinte-sanft); }
.option.gewaehlt { border-color: var(--tinte); background: #FFFDF7; }
.option.dimm { opacity: .45; }
.reaktion { margin-top: 1rem; }

/* Zuordnen: Kreidetafel-Kacheln gegen Papier-Kacheln */
.paare { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .4rem; }
.kachel {
  font: inherit; width: 100%;
  border-radius: 8px; padding: .5rem .6rem; cursor: pointer;
  display: flex; align-items: center; gap: .55rem; justify-content: center;
  transition: transform .15s, opacity .3s, box-shadow .2s;
}
.kachel.es {
  background: var(--tafel); color: var(--kreide);
  border: 1px solid #243027;
  font-family: 'Caveat', cursive; font-size: 1.45rem; line-height: 1;
}
.kachel.de {
  background: var(--papier-tief); color: var(--tinte);
  border: 1px solid var(--linie); font-size: .95rem;
}
.kachel.de img { width: 2rem; height: 2rem; border-radius: 6px; object-fit: cover; }
.kachel.aktiv { box-shadow: 0 0 0 2px var(--akzent); }
.kachel.geloest {
  background: var(--oliv-hell); color: var(--oliv);
  border-color: var(--oliv); cursor: default;
}
.kachel.es.geloest { font-family: 'Caveat', cursive; background: var(--oliv-hell); }
.hilfe-zeile { margin-top: .8rem; font-size: .88rem; color: var(--tinte-sanft); }
.erfolg { margin-top: .9rem; color: var(--oliv); }

/* Weiter-Hinweis (Coach-Pill, einmalig) */
.coach {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%);
  z-index: 25; background: var(--tinte); color: var(--papier);
  font-size: .85rem; border-radius: 999px; padding: .45rem 1.1rem;
  opacity: .92; pointer-events: none; transition: opacity .5s;
}
.coach.weg { opacity: 0; }

/* Abschluss / CTA */
.ende-karte {
  text-align: center; border-top: 1px solid var(--linie);
  margin-top: 2.6rem; padding-top: 2.2rem; cursor: default;
}
.asterismus { text-align: center; letter-spacing: .6em; color: var(--tinte-sanft);
  margin: 2rem 0 1.4rem; }
.ende-karte h2 { font-style: italic; font-weight: 600; font-size: 1.45rem;
  max-width: 30rem; margin-left: auto; margin-right: auto; line-height: 1.35; }
.ende-karte h2 em { color: var(--akzent); }
.ende-karte p { max-width: 32rem; margin-left: auto; margin-right: auto; }
.knopf {
  display: inline-block; text-decoration: none; font: inherit;
  background: var(--akzent); color: #FFFDF7; border: 0; border-radius: 10px;
  padding: .7rem 1.5rem; margin: .4rem .3rem 0; cursor: pointer;
}
.knopf:hover { background: #9c4517; }
.knopf.zweit { background: transparent; color: var(--akzent);
  border: 1px solid var(--akzent); }
.knopf.zweit:hover { background: rgba(180,83,31,.07); }
.ende-karte .meta { color: var(--tinte-sanft); font-size: .88rem; margin-top: 1rem; }

footer { position: relative; z-index: 1; text-align: center;
  color: var(--tinte-sanft); font-size: .85rem; padding: 2rem 1rem 2.6rem; }
footer a { color: var(--tinte-sanft); }

@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .paare { grid-template-columns: 1fr; }
  .kachel.es { font-size: 1.3rem; }
}

/* ---------- Notizbuch (Kopf-Icon, Chips, Arbeitsblatt) ----------
   Wie das Notizbuch der App: sauberes Papier, Wort in Drucktinte,
   Handschrift (Kugelschreiber-Blau) nur für Mias Notizen und Regeln. */
.kopf-nb {
  position: relative; align-self: center; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem; margin: -.25rem -.35rem -.25rem 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--tinte);
  cursor: pointer;
}
.kopf-nb:hover { color: var(--akzent); background: rgba(180,83,31,.07); }
.kopf-nb.puls { animation: nb-puls .44s ease; }
@keyframes nb-puls { 50% { transform: scale(1.35); } }
.nb-zahl {
  position: absolute; right: -2px; top: 0;
  min-width: 1.05rem; padding: 0 .22rem; border-radius: 999px;
  background: var(--akzent); color: #FFFDF7;
  font: 600 .62rem/1.05rem 'Literata', Georgia, serif; text-align: center;
  font-variant-numeric: tabular-nums;
}
.nb-zahl[hidden] { display: none; }

.chip {
  position: fixed; left: 0; top: 0; z-index: 45; pointer-events: none;
  background: #F6E1D2; color: #6B2E0F; border-radius: 999px;
  padding: .18rem .65rem; font-size: .85rem; font-style: italic;
  white-space: nowrap; will-change: transform, opacity;
}

.vok-bild {
  width: 2.75rem; height: 2.75rem; flex: none; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--linie);
}

.nb-panel {
  position: fixed; inset: 0; z-index: 50;
  overflow-y: auto; overscroll-behavior: contain;
  background: #FDFBF4; color: var(--tinte); cursor: default;
  opacity: 0; transform: translateY(14px);
  transition: opacity .22s ease, transform .22s ease;
}
.nb-panel.offen { opacity: 1; transform: none; }
.nb-panel[hidden] { display: none; }
.nb-leiste {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: .45rem max(1.1rem, calc((100% - 42rem) / 2 + 1.1rem));
  background: rgba(253,251,244,.96); border-bottom: 1px solid var(--linie);
}
.nb-titel { font-weight: 600; }
.nb-zu {
  font: inherit; font-size: 1.6rem; line-height: 1;
  width: 2.3rem; height: 2.3rem; margin-right: -.5rem;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--tinte-sanft); cursor: pointer;
}
.nb-zu:hover { color: var(--akzent); background: rgba(180,83,31,.07); }

.nb-blatt { max-width: 42rem; margin: 0 auto; padding: .4rem 1.3rem 4rem; font-size: 1rem; line-height: 1.5; }
.nb-kopf { text-align: center; padding: 1.1rem 0 .5rem; }
.nb-nummer { font-size: .7rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--tinte-sanft); font-weight: 500; }
.nb-name { font-style: italic; font-weight: 500; font-size: 1.35rem; margin-top: .25rem; }
.nb-zier { display: flex; align-items: center; justify-content: center; gap: .55rem; margin-top: .6rem; }
.nb-zier i { width: 30px; height: 1px; background: rgba(115,99,76,.55); }
.nb-zier b { width: 4px; height: 4px; background: rgba(115,99,76,.55); transform: rotate(45deg); }
.nb-hinweis { text-align: center; font-size: .78rem; font-style: italic;
  color: var(--tinte-sanft); margin: .5rem 0 0; }

.nb-abschnitt { display: flex; align-items: center; gap: .5rem; padding: 1.15rem 0 .2rem; }
.nb-ab-titel { font-size: .7rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: #5A4C39; }
.nb-ab-zahl { font-size: .7rem; color: var(--tinte-sanft); }
.nb-ab-linie { flex: 1; height: 1px; background: var(--linie); margin-left: .3rem; }

.nb-eintrag { display: flex; gap: .75rem; align-items: flex-start;
  padding: .6rem 0; border-bottom: 1px solid rgba(227,212,184,.6); }
.nb-eintrag.ohne-linie { border-bottom: 0; }
.nb-panel .blass { opacity: .55; }
.nb-inhalt { flex: 1; min-width: 0; }
.nb-wortzeile { display: flex; align-items: center; }
.nb-es { font-weight: 600; font-size: 1.05rem; }
.nb-wortzeile .ton { width: 1.5rem; height: 1.5rem; font-size: .72rem; vertical-align: 0; }
.nb-bed { font-size: .92rem; color: #5A4C39; }
.nb-notiz { font-size: 1.2rem; line-height: 1.15; color: #243B63; margin-top: .2rem; }
.nb-fund { font-size: .8rem; font-style: italic; color: var(--tinte-sanft); margin-top: .2rem; }

.nb-verb { margin: 0 0 .6rem; padding: .45rem .65rem;
  border-left: 2px solid var(--linie); border-bottom: 1px solid rgba(227,212,184,.6); }
.nb-zeit { font-size: .62rem; font-weight: 700; letter-spacing: .1em; color: #5A4C39; }
.nb-inf { font-weight: 400; letter-spacing: 0; font-style: italic; font-size: .72rem;
  color: var(--tinte-sanft); margin-left: .5rem; }
.nb-formen { border-collapse: collapse; margin-top: .25rem; width: 100%; }
.nb-formen th { text-align: left; font-weight: 400; font-size: .7rem; line-height: 1.25;
  color: var(--tinte-sanft); padding: 0 .45rem .3rem 0; vertical-align: top; white-space: nowrap; }
.nb-formen th span { display: block; }
.nb-formen td { width: 50%; font-size: .85rem; font-weight: 500; padding: 0 .8rem .3rem 0; vertical-align: top; }

.nb-regel { border-bottom: 1px solid rgba(227,212,184,.6); }
.nb-regel summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: .8rem;
  padding: .55rem 0; font-size: 1.45rem; line-height: 1.15; color: #243B63;
}
.nb-regel summary::-webkit-details-marker { display: none; }
.nb-regel summary::after {
  content: ''; flex: none; width: .45rem; height: .45rem; margin-right: .35rem;
  border-right: 1.5px solid var(--tinte-sanft); border-bottom: 1.5px solid var(--tinte-sanft);
  transform: rotate(45deg) translateY(-2px); transition: transform .2s;
}
.nb-regel[open] summary::after { transform: rotate(-135deg); }
.nb-regel-seite { padding: 0 0 1rem; }
.nb-regel-text { font-size: .95rem; margin: 0 0 .75rem; }
.nb-regel-formen { width: 100%; margin-bottom: .75rem; border-spacing: 0;
  border: 1px solid rgba(110,134,173,.2); border-radius: 4px; }
.nb-regel-formen tr + tr > * { border-top: 1px solid rgba(110,134,173,.2); }
.nb-regel-formen th { width: 7.5rem; text-align: left; font-weight: 400; font-size: .8rem;
  color: var(--tinte-sanft); padding: .35rem .5rem; border-right: 1px solid rgba(110,134,173,.2); }
.nb-regel-formen td { font-family: 'Caveat', 'Bradley Hand', cursive; font-size: 1.35rem;
  line-height: 1.1; color: #243B63; padding: .2rem .6rem; }
.nb-beispiel { display: flex; justify-content: space-between; align-items: flex-start; gap: .4rem; margin-bottom: .45rem; }
.nb-bsp-es { font-style: italic; font-size: .95rem; }
.nb-klein { font-size: .8rem; color: var(--tinte-sanft); }
.nb-mia { border-left: 2px solid var(--akzent); padding-left: .65rem; margin: .6rem 0 .5rem;
  font-size: 1.35rem; line-height: 1.15; color: #243B63; }
.nb-falle { margin: .3rem 0 0; }

@media (max-width: 560px) {
  .nb-blatt { padding: .4rem 1rem 4rem; }
  /* Platz fürs Notizbuch-Icon: die Szenen-Angabe (in der Leseprobe
     immer Szene 1) weicht auf dem Handy, die Fortschrittslinie bleibt. */
  .kopf-inhalt { gap: .7rem; }
  .kopf-szene { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .nb-panel { transition: none; transform: none; }
  .kopf-nb.puls { animation: none; }
}

/* Fokus: Tastatur sichtbar in Markenfarbe, Maus ohne blauen Systemring */
button:focus { outline: none; }
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--akzent); outline-offset: 2px;
}
