/*
 * Startseite von Seewind. Gestaltung wie im Spiel (Kapitel 159): Papier-Plaketten des HUD (hud/text.ts),
 * Titel in IM Fell English wie die Logo-Tafel der Werbefilme (hud/PromoCards.tsx), Gold auf dunkler See.
 * Eine Datei, kein Bauschritt, kein fremder Server.
 */
@font-face {
  font-family: "IM Fell English";
  src: url("/fonts/IMFeENrm28P.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IM Fell English";
  src: url("/fonts/IMFeENit28P.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* HUD: PAPER, INK, plate-Rand (hud/text.ts). */
  --papier: #f4ead2;
  --papier-glas: rgba(244, 234, 210, 0.97);
  --papier-hell: #fdf6e3;
  --rand: rgba(90, 68, 40, 0.55);
  --linie: rgba(90, 68, 40, 0.2);
  --tinte: #2f2418;
  --tinte-leise: rgba(47, 36, 24, 0.68);
  --siegel: #8c2f23;
  --messing: #7a5a12;
  /* Logo-Tafel und Ruf-Pille der Werbefilme. */
  --gold: #f4e3b5;
  --creme: #fff8e6;
  --glas: rgba(10, 20, 30, 0.6);
  --see: #0f2b3a;
  --himmel: #7fb6d6;
  /* Seltenheiten wie im Spiel (hud/Item.tsx). */
  --gut: #2f7a32;
  --selten: #2f5d8a;
  --episch: #8a4fa0;
  --legendaer: #c46a1a;
  --serif: "IM Fell English", Georgia, serif;
  --platte-schatten: 0 2px 10px rgba(0, 0, 0, 0.18), 0 14px 34px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--see);
  color: var(--tinte);
  font:
    16px / 1.6 system-ui,
    sans-serif;
}

/* ---------- Bühne und Kopf ---------- */
/* Standbild und Film liegen fest hinter der ganzen Seite (Spec 21); der Inhalt scrollt darüber. */
.buehne {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--see);
}

.hero-bild,
.hero-film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-bild {
  object-fit: cover;
  filter: saturate(1.05);
}

/* Der Film wird erst sichtbar, wenn er läuft. */
.hero-film {
  border: 0;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
  background: transparent;
}

.hero-film.bereit {
  opacity: 1;
}

/* Beim Scrollen dunkelt der Film ab, damit der Text lesbar bleibt. */
.schleier {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #081016;
  opacity: var(--schleier, 0);
  pointer-events: none;
}

/* Der erste Bildschirm gehört dem Film; nur unten ein leiser Hinweis zum Scrollen. */
.hero {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100svh;
}

.scroll-hinweis {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(8, 16, 22, 0.35);
  color: #f4ecd8;
  font-size: 28px;
  line-height: 1;
  text-decoration: none;
  animation: wippen 2.4s ease-in-out infinite;
  transition: opacity 0.4s ease;
}

.scroll-hinweis span {
  margin-top: -8px;
}

.scroll-hinweis.weg {
  opacity: 0;
  pointer-events: none;
}

@keyframes wippen {
  0%,
  100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, 6px);
  }
}

/* Texte zum Film: Untertitel im unteren Drittel, ohne Kasten. */
.filmtexte {
  position: absolute;
  left: 50%;
  bottom: 11vh;
  transform: translateX(-50%);
  width: min(820px, 92vw);
  display: grid;
  pointer-events: none;
}

.filmtext {
  grid-area: 1 / 1;
  align-self: end;
  margin: 0;
  text-align: center;
  color: var(--creme);
  font: italic 400 clamp(20px, 2.7vw, 32px) / 1.35 var(--serif);
  letter-spacing: 0.02em;
  text-shadow:
    0 2px 14px rgba(0, 0, 0, 0.75),
    0 1px 3px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 1.1s ease,
    transform 1.1s ease;
}

.filmtext.da {
  opacity: 1;
  transform: none;
}

/* Niedrige Schirme (Handy quer): Texte über dem Scroll-Hinweis, der Name kleiner. */
@media (max-height: 520px) {
  .filmtexte {
    bottom: 76px;
  }

  .filmtext.gross {
    font-size: clamp(36px, 14vh, 64px);
  }
}

.filmtext.gross {
  color: var(--gold);
  font-style: normal;
  font-size: clamp(40px, 8vw, 96px);
  letter-spacing: 0.05em;
}

.filmtext.gross span {
  display: block;
  margin-top: 8px;
  color: var(--creme);
  font-style: italic;
  font-size: clamp(18px, 2.4vw, 26px);
  letter-spacing: 0.06em;
}

/* Die Tafel ist die Logo-Tafel der Werbefilme: Name in Gold über einer weichen Vignette, darunter die Ruf-Pille. */
.hero-text {
  width: min(720px, 100%);
  margin: 0 auto 40px;
  padding: 34px 24px 30px;
  text-align: center;
  color: var(--creme);
  background: radial-gradient(ellipse at center, rgba(8, 14, 22, 0.62) 0%, rgba(8, 14, 22, 0.38) 55%, transparent 75%);
}

.hero-text h1 {
  margin: 0;
  color: var(--gold);
  font: 400 clamp(64px, 13vw, 132px) / 0.95 var(--serif);
  letter-spacing: 0.05em;
  text-shadow:
    0 3px 18px rgba(0, 0, 0, 0.75),
    0 1px 3px rgba(0, 0, 0, 0.9);
}

.hero-text .unterzeile {
  margin: 4px 0 16px;
  color: var(--creme);
  font: italic 400 clamp(20px, 3vw, 30px) / 1.2 var(--serif);
  letter-spacing: 0.08em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.hero-text .satz {
  max-width: 30em;
  margin: 0 auto 20px;
  font-size: clamp(17px, 1.8vw, 21px);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
}

.hero-text .klein {
  color: rgba(255, 248, 230, 0.82);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.hero-text .knopf-ruf + .klein {
  display: block;
}

.hero-text .klein.oben {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}

/* Einblenden beim Scrollen – nur mit Skript, sonst ist alles sofort da. */
.mit-einblenden .einblenden {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.mit-einblenden .einblenden.da {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hinweis {
    animation: none;
  }

  .filmtext {
    transform: none;
  }

  .mit-einblenden .einblenden {
    transform: none;
    transition: opacity 0.3s ease;
  }
}

/* Nach dem Ausblenden der Tafel bleibt der Weg ins Spiel oben rechts. */
.knopf-fest {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 3;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.knopf-fest.sichtbar {
  opacity: 1;
  pointer-events: auto;
}

/* Sprachwahl oben links (Kapitel 38, Regel 7): DE · EN · ES, die aktive hervorgehoben. */
.sprachen {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 3;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(244, 227, 181, 0.45);
  background: var(--glas);
  backdrop-filter: blur(4px);
}

.sprachen button {
  border: none;
  border-radius: 999px;
  padding: 5px 10px;
  background: transparent;
  color: var(--gold);
  font:
    600 13px / 1 system-ui,
    sans-serif;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.sprachen button[aria-pressed="true"] {
  background: var(--papier);
  color: var(--tinte);
}

h1 {
  font: 400 clamp(38px, 8vw, 68px) / 1.05 var(--serif);
  margin: 4px 0 10px;
  letter-spacing: 0.03em;
}

h2 {
  font: 400 clamp(26px, 4.4vw, 36px) / 1.15 var(--serif);
  margin: 0 0 10px;
  letter-spacing: 0.02em;
}

h3 {
  font: 400 21px / 1.2 var(--serif);
  margin: 0 0 6px;
  letter-spacing: 0.01em;
}

.satz {
  font: italic 400 clamp(18px, 2.4vw, 22px) / 1.45 var(--serif);
  margin: 0 0 16px;
}

.klein {
  color: var(--tinte-leise);
  font-size: 13px;
}

/* Knöpfe wie im Spiel: auf Papier eine helle Plakette mit Tinte (Auswahlbildschirm, „Segel setzen“),
   auf dem Film die Ruf-Pille der Werbefilme – Goldrand, dunkles Glas. */
.knopf {
  display: inline-block;
  margin-right: 12px;
  padding: 10px 22px;
  border-radius: 10px;
  background: rgba(255, 244, 214, 0.97);
  border: 1px solid var(--rand);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  color: var(--tinte);
  font: 800 16px / 1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
  text-decoration: none;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.knopf:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.26);
}

.knopf-ruf,
.knopf-fest {
  border: 2px solid var(--gold);
  border-radius: 999px;
  background: var(--glas);
  backdrop-filter: blur(4px);
  color: var(--creme);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.knopf-ruf {
  margin: 0 0 12px;
  padding: 13px 34px;
  font-size: clamp(17px, 2vw, 20px);
  letter-spacing: 0.02em;
}

.knopf-ruf:hover,
.knopf-fest:hover {
  background: rgba(10, 20, 30, 0.78);
}

/* ---------- Inhalt ---------- */
main,
footer {
  position: relative;
  z-index: 1;
}

main {
  width: min(1040px, 94vw);
  margin: 0 auto;
  padding: 34px 0 10px;
}

/* Plakette wie im HUD: Papier, feiner brauner Rand, Radius 10. */
.rolle {
  background: var(--papier-glas);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 24px 30px;
  margin: 0 0 26px;
  box-shadow: var(--platte-schatten);
}

.rolle h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--linie);
}

.rolle p {
  margin: 0 0 10px;
}

.ehrlich {
  background: rgba(253, 246, 227, 0.94);
}

.neu-liste {
  margin: 4px 0 12px;
  padding-left: 1.2em;
}

.neu-liste li {
  margin-bottom: 4px;
}

footer {
  color: rgba(244, 241, 234, 0.7);
  text-align: center;
  padding: 26px 16px 40px;
  font-size: 14px;
}

footer a {
  color: var(--gold);
}

@media (max-width: 640px) {
  .hero-text {
    padding: 22px 8px 20px;
  }

  .hero-text .satz {
    font-size: 16px;
    margin-bottom: 14px;
  }

  .hero-text .knopf + .klein {
    display: block;
    margin-top: 6px;
  }

  .knopf-fest {
    top: 10px;
    right: 10px;
    padding: 7px 14px;
    font-size: 14px;
  }

  .rolle {
    padding: 18px 16px;
  }
}

/* ---------- Trailer und Reels (Kapitel 158) ---------- */
.trailer-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.trailer.hochkant .trailer-player {
  aspect-ratio: 9 / 16;
  width: min(100%, calc(82svh * 9 / 16));
  margin: 0 auto;
}

/* Tablet hochkant: der Trailer in 3:4 (Kapitel 159). */
.trailer.mittel .trailer-player {
  aspect-ratio: 3 / 4;
  width: min(100%, calc(80svh * 3 / 4));
  margin: 0 auto;
}

/* Hochkant ohne schwarze Balken: der Rahmen ist so breit wie der Film. */
.trailer.hochkant .serie-bild,
.trailer.mittel .serie-bild {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

.reels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 0;
}

.reel {
  margin: 0;
  background: #000;
  border: 1px solid rgba(244, 227, 181, 0.35);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}

.reel video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #000;
}

.reel figcaption {
  padding: 8px 12px 10px;
  color: var(--gold);
  font: 400 18px / 1.25 var(--serif);
  letter-spacing: 0.02em;
}

/* Am Handy: Reels zum Wischen wie in den Apps, eins nach dem anderen einrastend (Kapitel 159). */
@media (max-width: 640px) {
  .reels {
    display: flex;
    gap: 12px;
    margin: 14px -3vw 0;
    padding: 0 3vw 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 3vw;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .reels::-webkit-scrollbar {
    display: none;
  }

  .reel {
    flex: 0 0 68%;
    scroll-snap-align: start;
  }

  .reel video {
    max-height: 70svh;
  }
}

/* ---------- Die Serie (Spec 25) ---------- */
.serie {
  margin-bottom: 26px;
}

.serie-kopf {
  margin-bottom: 14px;
}

.serie-kopf .klein {
  margin: 0 0 4px;
}

.serie-bild {
  background: #000;
  border: 1px solid rgba(244, 227, 181, 0.35);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.serie-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.folgen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.folge {
  display: flex;
  flex-direction: column;
  padding: 0;
  text-align: left;
  font: inherit;
  color: var(--tinte);
  background: var(--papier-glas);
  border: 1px solid var(--rand);
  border-left: 4px solid var(--rand);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--platte-schatten);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.folge:hover,
.folge:focus-visible {
  transform: translateY(-2px);
}

.folge.gewaehlt {
  border-left-color: var(--siegel);
}

.folge img {
  width: 100%;
  /* Die Vorschaubilder tragen Kinobalken – in der Karte nur das Bild dazwischen. */
  aspect-ratio: 2.39 / 1;
  object-fit: cover;
  display: block;
}

.folge-text {
  display: grid;
  gap: 2px;
  padding: 10px 14px 14px;
}

.folge-text b {
  font: 400 20px / 1.2 var(--serif);
}

.serie-kurz {
  margin: 12px 2px 0;
  color: rgba(244, 241, 234, 0.8);
  font-size: 14px;
}

.serie-kurz a {
  color: var(--gold);
}

@media (max-width: 640px) {
  .folge {
    flex-direction: row;
    align-items: center;
  }

  .folge img {
    width: 42%;
    flex: none;
    aspect-ratio: 2.39 / 1;
  }

  .folge-text {
    padding: 8px 12px;
  }

  .folge-text b {
    font-size: 16px;
  }

  .folge-text span:last-child {
    display: none;
  }
}

/* ---------- Was du in Seewind tust (Kapitel 69) ---------- */
.tun {
  margin-bottom: 26px;
}

.tun-kopf {
  text-align: center;
}

.tun-kopf .satz {
  max-width: 34em;
  margin: 0 auto 14px;
}

.zahlen {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 26px;
  margin: 6px 0 2px;
}

.zahlen div {
  display: grid;
  justify-items: center;
  min-width: 84px;
}

.zahlen b {
  font: 400 clamp(34px, 5.4vw, 50px) / 1 var(--serif);
  color: var(--siegel);
  font-variant-numeric: tabular-nums;
}

.zahlen span {
  font-size: 13px;
  color: var(--tinte-leise);
}

/* Reiter: nur mit Skript; ohne stehen alle Themen untereinander. */
.themen {
  display: none;
}

.mit-themen .themen {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
}

.themen-knopf {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px 9px;
  overflow: hidden;
  border: 1px solid rgba(244, 227, 181, 0.45);
  border-radius: 999px;
  background: var(--glas);
  backdrop-filter: blur(4px);
  color: var(--gold);
  font:
    600 15px / 1 system-ui,
    sans-serif;
  cursor: pointer;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.2s ease;
}

.themen-knopf:hover {
  transform: translateY(-1px);
  background: rgba(10, 20, 30, 0.85);
}

.themen-knopf[aria-selected="true"] {
  background: var(--papier);
  color: var(--tinte);
  border-color: var(--papier);
}

.themen-knopf:focus-visible {
  outline: 2px solid var(--messing);
  outline-offset: 2px;
}

.ikon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Fortschrittslinie: läuft am aktiven Reiter, dann kommt das nächste Thema. */
.themen-knopf .lauf {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--siegel);
  transform: scaleX(0);
  transform-origin: left;
}

.themen.laeuft .themen-knopf[aria-selected="true"] .lauf {
  animation: laufen 9s linear forwards;
}

.themen.pause .themen-knopf .lauf {
  animation-play-state: paused;
}

@keyframes laufen {
  to {
    transform: scaleX(1);
  }
}

.thema {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-bottom: 18px;
  padding: 18px;
  background: var(--papier-glas);
  border: 1px solid var(--rand);
  border-radius: 10px;
  box-shadow: var(--platte-schatten);
}

.mit-themen .thema {
  margin-bottom: 0;
}

.thema[hidden] {
  display: none;
}

.thema.aktiv {
  animation: auftauchen 0.55s ease both;
}

@keyframes auftauchen {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.thema-bild {
  position: relative;
  margin: 0;
}

/* Auf breiten Schirmen bleibt das Bild beim Lesen der Liste stehen. */
@media (min-width: 761px) {
  .thema-bild {
    position: sticky;
    top: 76px;
  }
}

.thema-bild > img:first-child {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--rand);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* Zweites Bild als aufgelegte Karte, leicht schräg. */
.thema-zweit {
  position: absolute;
  right: -8px;
  top: 58%;
  width: 46%;
  border: 5px solid var(--papier-hell);
  border-radius: 3px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  transform: rotate(3deg);
}

.thema.aktiv .thema-zweit {
  animation: auflegen 0.8s 0.25s ease both;
}

@keyframes auflegen {
  from {
    opacity: 0;
    transform: rotate(10deg) translate(20px, 16px);
  }
}

.thema-bild figcaption {
  font-size: 13px;
  color: var(--tinte-leise);
  padding: 8px 2px 0;
  max-width: 52%;
}

.thema-bild:not(:has(.thema-zweit)) figcaption {
  max-width: none;
}

.thema-nr {
  margin: 0 0 2px;
  letter-spacing: 0.08em;
}

.thema-text h3 {
  font-size: clamp(22px, 3vw, 28px);
}

.thema-lead {
  margin: 0 0 10px;
}

.tun-liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.tun-liste li {
  position: relative;
  padding: 7px 10px 7px 30px;
  border-radius: 8px;
  border: 1px solid var(--linie);
  background: rgba(253, 246, 227, 0.7);
  font-size: 15px;
  line-height: 1.45;
}

/* Ein kleiner Anker als Aufzählungszeichen. */
.legendaer {
  color: var(--legendaer);
  font-weight: 700;
}

.tun-liste li::before {
  content: "⚓";
  position: absolute;
  left: 9px;
  top: 7px;
  color: var(--messing);
  font-size: 14px;
}

.thema.aktiv .tun-liste li {
  animation: auftauchen 0.5s ease both;
  animation-delay: calc(0.12s + var(--i, 0) * 0.07s);
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  margin: 0 1px;
  padding: 1px 5px;
  border: 1px solid var(--rand);
  border-bottom-width: 3px;
  border-radius: 5px;
  background: var(--papier-hell);
  font:
    600 12px / 1.4 system-ui,
    sans-serif;
  text-align: center;
  color: var(--tinte);
}

/* Schiffsklassen: segeln nacheinander ins Bild und wiegen sich dann. */
.klassen {
  list-style: none;
  margin: 14px 0 4px;
  padding: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 3px solid rgba(15, 43, 58, 0.35);
}

.klassen li {
  display: grid;
  grid-template-rows: 1fr auto auto;
  justify-items: center;
  text-align: center;
  gap: 2px;
  padding-bottom: 8px;
  flex: 1 1 0;
  min-width: 0;
  align-self: stretch;
}

.klasse-bild {
  align-self: end;
}

.klassen b {
  font: 400 18px / 1.2 var(--serif);
}

.klassen .klein {
  font-size: 12px;
  line-height: 1.3;
  /* Drei Zeilen Platz: so stehen alle Namen auf einer Linie. */
  min-height: 3.9em;
}

.klasse-bild svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.klasse-bild .rumpf {
  fill: #6b4a2b;
}

.klasse-bild .leiste {
  fill: var(--siegel);
}

.klasse-bild .mast {
  fill: var(--tinte);
}

.klasse-bild .segel {
  fill: var(--papier-hell);
  stroke: #a88b58;
  stroke-width: 0.8;
}

.klasse-bild .wimpel {
  fill: var(--siegel);
}

.mit-einblenden .flotte .klassen li {
  opacity: 0;
  transform: translateX(-36px);
}

.mit-einblenden .flotte.da .klassen li {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.6s ease,
    transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(0.15s + var(--i, 0) * 0.14s);
}

.flotte.da .klasse-bild {
  animation: wiegen 4.2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.6s);
}

@keyframes wiegen {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-3px) rotate(1deg);
  }
}

@media (max-width: 760px) {
  .thema {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 12px;
  }

  .thema-zweit {
    width: 40%;
    top: auto;
    bottom: 26px;
    /* Gedreht ragt die Ecke sonst über den Bildschirmrand (Kapitel 134, Verlauf). */
    right: 4px;
  }

  .themen-knopf {
    padding: 7px 11px 8px;
    font-size: 14px;
  }

  .klassen {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    align-items: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thema.aktiv,
  .thema.aktiv .tun-liste li,
  .thema.aktiv .thema-zweit,
  .flotte.da .klasse-bild {
    animation: none;
  }

  .mit-einblenden .flotte .klassen li {
    transform: none;
  }
}

/* ---------- Update-Liste (Kapitel 134) ---------- */
.unsichtbar {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.updates-form {
  margin-top: 6px;
}

.updates-zeile {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.updates-zeile input[type="email"] {
  flex: 1 1 240px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--rand);
  border-radius: 8px;
  background: #fffaf0;
  color: var(--tinte);
  font: inherit;
}

.updates-zeile input[type="email"]:focus-visible {
  outline: 2px solid var(--messing);
  outline-offset: 1px;
}

.updates-zeile .knopf {
  margin-right: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.updates-ja {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  font-size: 14px;
  color: var(--tinte-leise);
}

.updates-ja input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--messing);
}

.updates-ja a {
  color: var(--siegel);
}

.updates-meldung {
  padding: 10px 14px;
  border-left: 4px solid var(--messing);
  border-radius: 8px;
  background: rgba(253, 246, 227, 0.8);
}

.updates-meldung.ok {
  border-color: #4f7a3a;
}

.updates-meldung.fehler {
  border-color: var(--siegel);
}

footer .recht {
  margin-top: 6px;
}

footer .klein {
  color: inherit;
}

/* ---------- Handy und hochkant (Kapitel 159) ---------- */
/* Ränder der Geräte (Notch, Home-Leiste) frei lassen. */
.sprachen {
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
}

.knopf-fest {
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
}

/* Finger statt Maus: größere Ziele. */
@media (pointer: coarse) {
  .sprachen button {
    min-width: 44px;
    min-height: 36px;
  }

  .themen-knopf {
    min-height: 42px;
  }
}

@media (max-width: 640px) {
  main {
    width: 94vw;
    padding-top: 20px;
  }

  h2 {
    font-size: 27px;
  }

  .sprachen {
    transition: opacity 0.3s ease;
  }

  .gescrollt .sprachen {
    opacity: 0;
    pointer-events: none;
  }

  /* Der Weg ins Spiel liegt unten in der Mitte, wo der Daumen ist. */
  .knopf-fest {
    background: rgba(10, 20, 30, 0.94);
    top: auto;
    right: auto;
    left: 50%;
    bottom: max(14px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    padding: 12px 30px;
    font-size: 16px;
    white-space: nowrap;
  }

  .knopf-fest:hover {
    transform: translateX(-50%);
  }

  footer {
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }

  /* Themen: eine Reihe zum Wischen statt vier Zeilen Knöpfe. */
  .mit-themen .themen {
    flex-wrap: nowrap;
    justify-content: flex-start;
    margin: 0 -3vw 12px;
    padding: 2px 3vw 6px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 3vw, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, transparent 0, #000 3vw, #000 calc(100% - 28px), transparent);
  }

  .mit-themen .themen::-webkit-scrollbar {
    display: none;
  }

  .themen-knopf {
    flex: none;
    scroll-snap-align: center;
  }

  .themen-knopf:hover {
    transform: none;
  }

  /* Das zweite Bild als kleine Karte oben rechts, die Bildunterschrift darunter in voller Breite. */
  .thema-zweit {
    top: -10px;
    bottom: auto;
    right: -4px;
    width: 36%;
    border-width: 3px;
  }

  .thema-bild figcaption {
    max-width: none;
  }

  .thema-text h3 {
    font-size: 25px;
  }

  .tun-liste li {
    font-size: 15px;
  }

  .zahlen {
    gap: 6px 14px;
  }

  .zahlen div {
    min-width: 30%;
  }

  .updates-zeile .knopf {
    width: 100%;
  }
}
