/* Gesamte Gestaltung.

   Zuerst fürs Handy gebaut, danach für größere Bildschirme erweitert –
   nicht umgekehrt. Die Zielgruppe hat ein Telefon in der Hand.

   Drei Dinge, die leicht wieder kaputtgehen:
   * 100dvh statt 100vh: Blendet der Browser seine Adressleiste ein, läge
     die letzte Antwort sonst unter dem Bildschirmrand.
   * safe-area-inset: Auf iPhones mit runden Ecken sitzt die Kopfzeile
     sonst unter der Uhr.
   * Antwortknöpfe mindestens 52 px hoch. Kinderdaumen treffen ungenauer
     als Erwachsenendaumen, und ein Fehltipp fühlt sich wie ein Fehler an. */

:root {
  --bg: #080b18;
  --card: rgba(255, 255, 255, .07);
  --card-2: rgba(255, 255, 255, .12);
  --line: rgba(255, 255, 255, .14);
  --fg: #eef2ff;
  --muted: #a6b0d0;
  --accent: #7fd4ff;
  --gold: #ffd76b;
  --ok: #6ee7a8;
  --soft: #ffb35c;
  --bad: #ff8fb0;
  --r: 18px;
  --fs: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font: var(--fs)/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

body.big { --fs: 19px; }
body.contrast { --card: rgba(255,255,255,.16); --card-2: rgba(255,255,255,.24); --muted: #d5dcf5; --line: rgba(255,255,255,.35); }

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}
body.contrast #sky { opacity: .35; }

#app {
  position: relative;
  z-index: 1;
  /* vh zuerst als Rückfallebene für ältere Safari-Fassungen, dvh danach. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}

#view {
  width: 100%;
  max-width: 620px;
  padding: calc(env(safe-area-inset-top) + 8px) 16px calc(env(safe-area-inset-bottom) + 28px);
}

h1, h2 { line-height: 1.2; margin: 0 0 .4em; }
h2 { font-size: 1.15em; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: .85em; }
.dim { opacity: .35; }

a.link { color: var(--accent); }

/* --------------------------------------------------------------- Kopfzeile */

.top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 14px;
  position: sticky;
  top: 0;
  background: linear-gradient(var(--bg) 55%, rgba(8, 11, 24, 0));
  z-index: 5;
}
.top-title { flex: 1; font-size: 1.15em; margin: 0; }
.top-sp { width: 44px; }
.icon-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--fg);
  font-size: 26px; line-height: 1;
  cursor: pointer;
}
.dust {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ Figuren */

.fig { position: relative; flex: none; }
.fig-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.28), rgba(255,255,255,.05) 60%, rgba(255,255,255,0));
  border: 2px solid rgba(255,255,255,.35);
}
.fig-img {
  position: absolute;
  left: 12%; top: 8%;
  width: 76%; height: 84%;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.5));
}
.fig-glass {
  position: absolute; inset: 0;
  border-radius: 50%;
  pointer-events: none;
}
/* Ersatz, wenn eine Bilddatei fehlt – siehe CS.standIn. */
.fig-standin { display: flex; align-items: center; justify-content: center; }
.fig-standin svg { max-width: 100%; max-height: 100%; }
.fig-rainbow { background: linear-gradient(150deg, rgba(255,120,180,.4), rgba(120,200,255,.25) 40%, rgba(180,255,180,.2) 70%, transparent); }

.enemy-svg { display: block; }
.ship-svg, .buddy-svg { display: block; }

/* -------------------------------------------------------------------- Start */

/* Titelkarte: Bild, darüber ein Verlauf, darauf der Text. Die
   Hintergrundfarbe steht hier und nicht im Bild – fällt das Bild aus,
   bleibt eine dunkle Karte mit lesbarem Text statt einer weißen Lücke. */
.home-hero {
  position: relative;
  margin: 0 0 16px;
  border-radius: var(--r);
  overflow: hidden;
  background: linear-gradient(160deg, #101a3a, #0a0e20);
  border: 1px solid var(--line);
}
.hero-img {
  display: block; width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  opacity: .9;
}
.hero-ship {
  position: absolute; top: 8px; right: 8px;
  opacity: .95;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.6));
}
.hero-text {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 40px 16px 14px;
  background: linear-gradient(to top, rgba(8,11,24,.96) 45%, rgba(8,11,24,.6) 70%, rgba(8,11,24,0));
  text-align: center;
}
.title { font-size: 2.1em; letter-spacing: .5px; margin: 0 0 6px; text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.title span { color: var(--accent); }
.claim { color: var(--muted); margin: 0; font-size: .9em; }

/* Auf kleinen Bildschirmen darf die Karte nicht die halbe Seite fressen. */
@media (max-height: 720px) {
  .hero-img { aspect-ratio: 16 / 9; }
  .title { font-size: 1.7em; }
}

.big-btn {
  display: block; width: 100%;
  border: none; border-radius: var(--r);
  background: linear-gradient(135deg, #3f6fe0, #7b4fd0);
  color: #fff;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  margin-bottom: 14px;
  box-shadow: 0 8px 22px rgba(60, 90, 220, .3);
}
.big-btn-k { display: block; font-size: 1.2em; font-weight: 700; }
.big-btn-s { display: block; font-size: .88em; opacity: .85; }

.mini-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--fg);
  border-radius: 999px;
  padding: 11px 18px;
  font-size: .95em;
  cursor: pointer;
  min-height: 44px;
}
.mini-btn.wide { display: block; width: 100%; margin: 0 0 10px; border-radius: 14px; }
.mini-btn.danger { color: var(--bad); border-color: rgba(255,143,176,.4); }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: .95em; padding: 8px 4px; }
.center-b { display: block; margin: 6px auto; }

.home-crew {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px; margin-bottom: 16px;
}
/* :not(.fig) ist nötig: Die Figur ist ebenfalls ein direktes div-Kind und
   würde sonst mitwachsen – aus dem runden Helm wird ein Ei. */
.home-crew > div:not(.fig) { flex: 1; min-width: 0; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 12px;
  text-align: left; color: var(--fg); cursor: pointer;
  min-height: 96px;
}
.tile-i { font-size: 1.6em; display: block; }
.tile-n { display: block; font-weight: 700; margin-top: 2px; }
.tile-s { display: block; font-size: .82em; color: var(--muted); }
.song {
  margin-top: 20px; padding: 14px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r);
}
.song h2 { font-size: 1.05em; margin: 0 0 10px; }
.song-player {
  display: block; width: 100%;
  aspect-ratio: 16 / 9;
  background: #05070f;
  border-radius: 12px; margin-bottom: 10px;
}
.song-dl {
  display: block; text-align: center; text-decoration: none;
  line-height: 22px;
}
.song .small { margin: 8px 0 0; }

.home-foot { text-align: center; margin-top: 18px; color: var(--muted); }

/* ------------------------------------------------------------ Sternenkarte */

.sector {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px; margin: 14px 0;
  border-left: 4px solid var(--c);
}
.sector.locked { opacity: .55; }
.sector-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.sector-head h2 { font-size: 1.05em; margin: 0; }
.sector-mini { width: 54px; flex: none; text-align: center; }
.lock { font-size: 1.6em; }
.lock.big { font-size: 2.2em; }
.diff { color: var(--c); letter-spacing: 2px; font-size: .8em; margin: 2px 0 0; }

.levels { display: grid; gap: 8px; }
.lvl {
  display: grid; grid-template-columns: 34px 1fr auto;
  align-items: center; gap: 10px;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 10px;
  color: var(--fg); text-align: left; cursor: pointer;
  min-height: 52px;
}
.lvl.lock { opacity: .45; }
.lvl.done { border-color: rgba(110,231,168,.4); }
.lvl-n { font-weight: 700; color: var(--muted); text-align: center; }
.lvl-t { font-size: .95em; }
.lvl-s { color: var(--gold); font-size: .9em; white-space: nowrap; }

/* ---------------------------------------------------------------- Mission */

.sector-chip {
  display: inline-block; background: var(--c); color: #0b1024;
  border-radius: 999px; padding: 3px 12px; font-size: .8em; font-weight: 700;
  margin: 0 0 8px;
}
.brief-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.bubble {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; border-top-left-radius: 4px;
  padding: 12px 14px; margin: 0; flex: 1;
}
.bubble-bad { border-color: rgba(255,143,176,.45); background: rgba(255,143,176,.10); border-top-left-radius: 16px; }
.enemy-stage { text-align: center; margin: 10px 0 16px; }
.enemy-stage svg { margin: 0 auto; animation: float 5s ease-in-out infinite; }
.enemy-name { font-weight: 700; margin: 4px 0 10px; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
body.still .enemy-stage svg { animation: none; }

.speak-btn {
  background: none; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 8px 14px; font-size: .85em; cursor: pointer;
  margin-bottom: 12px; min-height: 40px;
}
.speak-btn.small { padding: 4px 10px; min-height: 32px; margin: 6px 0 0; }

/* ------------------------------------------------------------------- Quiz */

.qbar { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .85em; }
.qdots { display: flex; gap: 5px; }
.qdots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: block; }
.qdots i.on { background: var(--ok); }
.qdots i.now { background: var(--accent); }

.quiz-stage { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px 4px; }
.quiz-enemy svg { animation: float 5s ease-in-out infinite; }
body.still .quiz-enemy svg { animation: none; }
.quiz-hero { position: relative; }
.buddy { position: absolute; right: -14px; bottom: -6px; }

.question { font-size: 1.12em; font-weight: 600; margin: 10px 0 14px; }
.answers { display: grid; gap: 10px; }
.answer {
  width: 100%; min-height: 52px;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 13px 15px;
  color: var(--fg); font-size: 1em; text-align: left; cursor: pointer;
}
.answer:active { transform: scale(.99); }
.answer.ok { background: rgba(110,231,168,.22); border-color: var(--ok); }
.answer.no { background: rgba(255,179,92,.16); border-color: rgba(255,179,92,.5); opacity: .8; }
.answer.gone { opacity: .3; text-decoration: line-through; }
.answer[disabled] { cursor: default; }

.qtools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.power-btn {
  background: rgba(127,212,255,.14); border: 1px solid rgba(127,212,255,.45);
  color: var(--accent); border-radius: 999px; padding: 8px 14px;
  font-size: .85em; cursor: pointer; min-height: 40px;
}
.power-btn[disabled] { opacity: .4; color: var(--muted); border-color: var(--line); background: none; }

.lex-note, .hint-note {
  background: rgba(127,212,255,.12); border: 1px solid rgba(127,212,255,.3);
  border-radius: 12px; padding: 10px 12px; font-size: .92em; margin: 8px 0;
}
.fb { border-radius: 14px; padding: 13px 15px; margin: 14px 0 10px; }
.fb-ok { background: rgba(110,231,168,.16); border: 1px solid rgba(110,231,168,.4); }
.fb-soft { background: rgba(255,179,92,.13); border: 1px solid rgba(255,179,92,.35); }
.fb-shield { background: rgba(127,212,255,.14); border: 1px solid rgba(127,212,255,.4); }

/* -------------------------------------------------------------- Belohnung */

.result { text-align: center; }
.stars { font-size: 2.6em; letter-spacing: 6px; color: rgba(255,255,255,.16); }
.stars .lit { color: var(--gold); text-shadow: 0 0 18px rgba(255,215,107,.6); }
.gain { color: var(--gold); font-weight: 700; font-size: 1.1em; }
.learn-card {
  background: linear-gradient(135deg, rgba(63,111,224,.28), rgba(123,79,208,.24));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; margin: 14px 0;
}
.learn-k { font-size: .78em; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.learn-t { font-size: 1.12em; font-weight: 600; margin: 0 0 10px; }
.gone-card, .unlock-card, .badge-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px; margin: 12px 0;
}
.gone-card { display: grid; gap: 8px; justify-items: center; }
.gone-card p { margin: 0; }
.unlock-card { display: flex; gap: 12px; align-items: center; text-align: left; }
.badge-card { color: var(--gold); font-weight: 600; }
.result-btns { margin-top: 18px; }

/* ------------------------------------------------------------------- Crew */

.hero-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px; margin: 12px 0;
}
.hero-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(127,212,255,.3); }
.hero-card.locked { opacity: .6; }
.hero-top { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.hero-top h2 { margin: 0; }
.power { margin: 4px 0 0; color: var(--accent); }
.power-text { font-size: .92em; }
.story { color: var(--muted); font-size: .92em; }
.saying { font-style: italic; }
.chosen { color: var(--ok); font-weight: 600; margin: 0; }

/* ------------------------------------------------------------------ Basar */

.dust-big { text-align: center; font-size: 2em; color: var(--gold); font-weight: 700; margin: 6px 0 4px; }
.dust-big span { font-size: .45em; color: var(--muted); font-weight: 400; display: block; }
.shop-h { margin: 22px 0 10px; font-size: 1em; }
.shop-h .muted { font-weight: 400; font-size: .85em; }
.items { display: grid; gap: 10px; }
.item {
  display: flex; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px;
}
.item.owned { border-color: rgba(110,231,168,.35); }
.item-i { font-size: 1.7em; }
.item-b { flex: 1; }
.item-b p { margin: 0; font-size: .85em; }
.buy {
  background: var(--gold); color: #241a00; border: none;
  border-radius: 999px; padding: 10px 14px; font-weight: 700; cursor: pointer;
  white-space: nowrap; min-height: 44px;
}
.buy.poor { background: none; color: var(--muted); border: 1px solid var(--line); }
.have { color: var(--ok); font-size: .85em; white-space: nowrap; }

/* ---------------------------------------------------------------- Lexikon */

.lex-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px; margin: 12px 0;
}
.lex-card.locked { display: flex; gap: 12px; align-items: center; opacity: .55; }
.lex-card.locked h2 { font-size: 1em; margin: 0; }
.lex-top { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.lex-top h2 { margin: 0; }
.lex-card p { font-size: .93em; }
.gone-text { color: var(--ok); }

/* ------------------------------------------------------------------ Hilfe */

.alarm {
  background: rgba(255,143,176,.14); border: 1px solid rgba(255,143,176,.45);
  border-radius: var(--r); padding: 14px; margin-bottom: 14px; font-weight: 600;
}
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab {
  background: var(--card); border: 1px solid var(--line); color: var(--fg);
  border-radius: 999px; padding: 9px 14px; cursor: pointer; font-size: .9em; min-height: 42px;
}
.tab.on { background: var(--accent); color: #06243a; border-color: var(--accent); font-weight: 700; }

.call {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px; margin-bottom: 10px;
}
.call-n {
  background: rgba(110,231,168,.16); border: 1px solid rgba(110,231,168,.4);
  border-radius: 12px; padding: 10px 12px; color: var(--ok);
  font-weight: 700; text-decoration: none; white-space: nowrap; min-width: 96px; text-align: center;
}
.call-n.web { color: var(--muted); background: none; border-color: var(--line); }
.call-b { flex: 1; }
.call-b p { margin: 2px 0; font-size: .88em; }

/* ------------------------------------------------------------------- ORBI */

.orbi-mode { display: flex; gap: 8px; margin-bottom: 10px; }
.chat {
  display: grid; gap: 10px;
  max-height: 46vh; overflow-y: auto;
  padding: 4px 2px; margin-bottom: 10px;
}
.msg { border-radius: 16px; padding: 12px 14px; max-width: 92%; }
.msg p { margin: 0; }
.msg-bot { background: var(--card); border: 1px solid var(--line); border-top-left-radius: 4px; justify-self: start; }
.msg-me { background: rgba(63,111,224,.35); border: 1px solid rgba(127,212,255,.3); border-top-right-radius: 4px; justify-self: end; }
.msg.urgent { border-color: rgba(255,143,176,.6); background: rgba(255,143,176,.14); }
.msg-calls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.call-chip {
  display: block; text-decoration: none;
  background: rgba(110,231,168,.16); border: 1px solid rgba(110,231,168,.4);
  border-radius: 12px; padding: 8px 12px; color: var(--ok);
}
.call-chip span { display: block; font-size: .75em; color: var(--muted); }

/* Die Schnellfragen liegen in einer Wischleiste. Auf dem Handy blendet
   das System die Leiste ohnehin aus, auf dem Rechner soll sie nicht wie
   ein Bedienelement aussehen – gewischt wird trotzdem. */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  background: var(--card); border: 1px solid var(--line); color: var(--fg);
  border-radius: 999px; padding: 9px 14px; white-space: nowrap; cursor: pointer; font-size: .88em;
  min-height: 42px;
}
.ask { display: flex; gap: 8px; margin-bottom: 10px; }
.ask input, .gate input {
  flex: 1; min-height: 48px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; color: var(--fg); font-size: 1em;
}
.ask input::placeholder { color: var(--muted); }
.send {
  width: 48px; min-height: 48px; border: none; border-radius: 14px;
  background: var(--accent); color: #06243a; font-size: 1.2em; cursor: pointer;
}

/* --------------------------------------------------------- Einstellungen */

/* Ein Schalter ist ein Knopf mit zwei Teilen: dem Schieber links und dem
   Text rechts. Ohne diese Regeln bleibt es ein gewöhnlicher Knopf mit
   zentriertem Text – die Einstellungen sahen genau so aus, bis es jemand
   bemerkt hat. */
.setting {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%; margin-bottom: 10px; padding: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; color: var(--fg);
  text-align: left; font-size: 1em; cursor: pointer;
}
.setting[aria-pressed="true"] { border-color: rgba(127,212,255,.45); }
.setting-b { flex: 1; }
.setting-b .muted { font-size: .85em; }

.sw {
  flex: none; position: relative;
  width: 48px; height: 28px; margin-top: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid var(--line);
  transition: background .15s ease, border-color .15s ease;
}
.sw i {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #cbd5ff; display: block;
  transition: transform .15s ease, background .15s ease;
}
.sw.on { background: var(--accent); border-color: var(--accent); }
.sw.on i { transform: translateX(20px); background: #06243a; }
body.still .sw, body.still .sw i { transition: none; }

#selftest { margin-top: 10px; }
#selftest .fb { text-align: left; }

/* ------------------------------------------------------------ Meldehilfe */

.report .lead { font-size: 1.02em; }
.courage {
  margin: 0 0 16px; padding: 12px 14px 12px 30px;
  background: rgba(110,231,168,.08);
  border: 1px solid rgba(110,231,168,.3);
  border-radius: 14px;
}
.courage li { margin: 5px 0; }

.rep-kinds { display: grid; gap: 8px; margin-bottom: 12px; }
.rep-kind {
  text-align: left; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; color: var(--fg); font-size: .96em;
  line-height: 1.35;
}
.rep-kind.on {
  border-color: var(--accent);
  background: rgba(127,212,255,.14);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.rep-in {
  width: 100%; margin-bottom: 10px; padding: 12px;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 12px; color: var(--fg); font: inherit;
}
.rep-area { resize: vertical; min-height: 90px; line-height: 1.45; }
.rep-lab { display: block; margin-bottom: 6px; color: var(--muted); font-size: .9em; }
.rep-lab .rep-in { margin-top: 4px; }
.rep-row { display: flex; gap: 10px; }
.rep-row .rep-lab { flex: 1; }

.rep-checks { display: grid; gap: 6px; margin-bottom: 12px; }
.rep-check {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px;
  font-size: .94em; cursor: pointer;
}
.rep-check input { margin-top: 3px; width: 20px; height: 20px; flex: none; accent-color: var(--accent); }

.rep-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.rep-actions .mini-btn { flex: 1 1 auto; }

.tip.warn { border-left-color: var(--gold); }

/* Die Druckansicht. Am Bildschirm ist sie unsichtbar; beim Drucken bleibt
   sie als Einziges übrig – ohne Kopfzeile, ohne Knöpfe, schwarz auf weiß.
   Ein Bericht, den man auf der Wache vorlegt, soll nicht aussehen wie ein
   Spiel. */
.rep-print { display: none; }

@media print {
  /* Alles weg außer dem Bericht. Die Kopfzeile heißt `.top`, das
     Sternenfeld `#sky` – wer hier einen Namen vergisst, druckt das Spiel
     mit aufs Amt. */
  #sky, .top, .no-print, .home-foot, header, nav, button, canvas, img, svg,
  video, audio { display: none !important; }
  body, #app, #view {
    background: #fff !important; color: #000 !important;
    max-width: none; padding: 0; margin: 0;
  }
  .rep-print {
    display: block;
    white-space: pre-wrap;
    font: 12pt/1.5 "Courier New", monospace;
    color: #000;
  }
  @page { margin: 18mm 16mm; }
}

/* ---------------------------------------------------- Passwort-Werkstatt */

.pass-out {
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 14px; margin-bottom: 10px;
  font-size: 1.15em; font-weight: 600; text-align: center;
  word-break: break-word;
}
.pass .ask { margin-top: 0; }
.pass-bar { display: flex; gap: 5px; margin-bottom: 8px; }
.pass-bar i {
  display: block; flex: 1; height: 7px; border-radius: 4px;
  background: rgba(255,255,255,.14);
}
.pass-bar i.on { background: var(--soft); }
.pass-bar i.on.lvl2 { background: var(--gold); }
.pass-bar i.on.lvl3 { background: var(--ok); }

/* --------------------------------------------------------------- Eltern */

.gate { text-align: center; padding-top: 20px; }
.gate-i { font-size: 3em; margin: 0; }
.gate-task { font-size: 1.8em; font-weight: 700; letter-spacing: 2px; margin: 16px 0; }
.gate form { display: flex; gap: 8px; justify-content: center; }
.gate input { max-width: 140px; text-align: center; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 6px; text-align: center;
}
.stat strong { display: block; font-size: 1.15em; }
.stat span { font-size: .78em; color: var(--muted); }

.psector { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 8px; }
.psector.dimmed { opacity: .55; }
.psector-h { display: flex; justify-content: space-between; gap: 8px; }
.psector p { margin: 6px 0 0; font-size: .85em; }
.bar { height: 6px; background: rgba(255,255,255,.1); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; }

.talk, .tip {
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 12px; margin-bottom: 8px;
}
.talk p, .tip p { margin: 4px 0 0; font-size: .9em; color: var(--muted); }

.loglist { display: grid; gap: 6px; }
.logrow {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px;
}
.logn { text-align: center; color: var(--muted); font-weight: 700; }
.logt { font-size: .9em; }
.logs { color: var(--gold); }

/* ------------------------------------------------------------------ Über */

.about h2 { margin-top: 20px; }
.about p { font-size: .95em; }

/* ------------------------------------------------------------ Flugstrecke */

/* Die Strecke legt sich über alles. `touch-action: none` auf der
   Zeichenfläche ist wichtig: Ohne das zieht unter iOS jede Wischbewegung
   die Seite mit, obwohl der Daumen einen Knopf halten wollte. */
body[data-screen="run"] { overflow: hidden; }
.run { position: fixed; inset: 0; z-index: 20; }
#stage { display: block; width: 100%; height: 100%; touch-action: none; }

.run-top {
  position: absolute; left: 12px; right: 12px;
  top: calc(env(safe-area-inset-top) + 10px);
  display: flex; align-items: center; gap: 10px;
}
.run-bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(255,255,255,.16); overflow: hidden; }
.run-bar i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 4px; }

.run-sign {
  position: absolute; left: 14px; right: 14px;
  top: calc(env(safe-area-inset-top) + 62px);
  margin: 0; padding: 12px 14px;
  background: rgba(10,14,30,.88); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 14px; font-size: .95em;
}
.run-sign[hidden] { display: none; }

/* Links, nicht rechts: Die Figur läuft bei 36 % der Breite, alles Neue
   kommt von rechts ins Bild. Ein Knopf dort verdeckt genau das, worauf man
   zuspringen will. Links liegt bereits Durchlaufenes. */
.run-skip {
  position: absolute; left: 14px;
  bottom: calc(env(safe-area-inset-bottom) + 108px);
  background: rgba(10,14,30,.8); border: 1px solid var(--line);
  color: var(--fg); border-radius: 999px; padding: 10px 16px;
  font-size: .88em; min-height: 44px;
}
/* Der Hinweis steht oben, nicht unten: Unten stünde er dort, wo die Figur
   läuft, und läge nach ein paar Metern quer über ihr. */
.run-hint {
  position: absolute; left: 14px; right: 14px;
  top: calc(env(safe-area-inset-top) + 62px);
  margin: 0; padding: 10px 14px;
  background: rgba(10,14,30,.75); border-radius: 12px;
  color: var(--muted); font-size: .85em;
}
.run-hint[hidden] { display: none; }

/* Bonusfrage aus einem Fragezeichen-Block: Sie legt sich über die
   Strecke, die dabei stillsteht. Kein Abbrechen-Knopf – es gibt nichts
   zu verlieren, also auch nichts, wovor man fliehen müsste. */
.bonus {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(6, 9, 20, .82);
  z-index: 5;
}
.bonus[hidden] { display: none; }
.bonus-card {
  width: 100%; max-width: 480px;
  max-height: 88%; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.bonus-k {
  font-size: .78em; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--gold); margin: 0 0 6px;
}
.bonus .question { margin-top: 0; }

.item.locked-item { opacity: .6; border-style: dashed; }

.pad {
  position: absolute; left: 0; right: 0;
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  display: flex; gap: 14px; padding: 0 16px;
}
.pad-b {
  width: 78px; height: 78px; border-radius: 50%;
  background: rgba(255,255,255,.10); border: 1px solid var(--line);
  color: var(--fg); font-size: 26px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  touch-action: none; user-select: none;
}
.pad-b.pressed { background: rgba(127,212,255,.30); border-color: var(--accent); transform: scale(.95); }
.pad-jump { margin-left: auto; background: rgba(127,212,255,.16); border-color: rgba(127,212,255,.45); }

@media (min-width: 700px) {
  .pad-b { width: 88px; height: 88px; }
}

/* --------------------------------------------------------- Größere Geräte */

@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .levels { grid-template-columns: 1fr 1fr; }
  .items { grid-template-columns: 1fr 1fr; }
  .title { font-size: 2.6em; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
