/* Lumara – Grundlayout. Querformat: Bild füllt den Bildschirm, Texte liegen darüber.
   Hochformat: Bild oben, Text- und Steuerbereich darunter. */

:root {
  --cream: #f3ecd2;
  --frame: #a8743a;
  --frame-dark: #7a5236;
  --ink: #1d2b3a;
  --button: #2f4a5e;
  --button-hover: #3b5d75;
  --ok: #3d8f4f;
  --bad: #c0392b;
  --night: #12111f;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* werden von screen.js gesetzt */
  --img-left: 0px;
  --img-top: 0px;
  --img-width: 100vw;
  --img-height: 66vw;
  --img-bottom: 0px;
  --gpx: 4px;

  --text: clamp(18px, calc(var(--gpx) * 4.6), 26px);
  --text-small: clamp(15px, calc(var(--gpx) * 3.6), 20px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--night);
  color: var(--cream);
  font-family: var(--font);
  font-size: var(--text);
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
}

input, textarea { -webkit-user-select: text; user-select: text; font-family: var(--font); }

#stage {
  position: fixed;
  top: env(safe-area-inset-top);
  right: env(safe-area-inset-right);
  bottom: env(safe-area-inset-bottom);
  left: env(safe-area-inset-left);
}

#screen { display: block; width: 100%; height: 100%; }

#ui {
  position: fixed;
  left: var(--img-left);
  top: var(--img-top);
  width: var(--img-width);
  height: var(--img-height);
  pointer-events: none;
  z-index: 10;
}
#ui > * { pointer-events: auto; }
#ui > .passive { pointer-events: none; }

#panel {
  position: fixed;
  left: var(--img-left);
  width: var(--img-width);
  bottom: var(--img-bottom);
  max-height: calc(var(--img-height) * 0.75);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 20;
  padding: 10px 12px 12px;
}
#panel:empty { display: none; }

@media (orientation: portrait) {
  #stage {
    bottom: auto;
    height: calc((100vw - env(safe-area-inset-left) - env(safe-area-inset-right)) * 2 / 3);
  }
  #panel {
    top: calc(var(--img-top) + var(--img-height));
    bottom: 0;
    left: 0;
    width: auto;
    right: 0;
    max-height: none;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: var(--ink);
  }
}

/* Kästen im Pixel-Stil wie im Entwurf: creme, brauner Rahmen */
.box {
  background: var(--cream);
  color: var(--ink);
  border: 4px solid var(--frame);
  border-radius: 6px;
  box-shadow: 0 0 0 2px var(--frame-dark), 0 4px 0 2px rgba(0, 0, 0, 0.35);
  padding: 12px 14px;
  font-size: var(--text);
  line-height: 1.35;
}

.btn {
  appearance: none;
  -webkit-appearance: none;
  min-height: 48px;
  min-width: 48px;
  padding: 10px 16px;
  border: 3px solid var(--frame-dark);
  border-radius: 6px;
  background: var(--button);
  color: var(--cream);
  font: inherit;
  font-size: var(--text);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
  touch-action: manipulation;
}
.btn:hover { background: var(--button-hover); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn:focus-visible { outline: 3px solid var(--cream); outline-offset: 2px; }
.btn.primary { background: var(--frame); color: #fff; border-color: var(--frame-dark); }
.btn.link {
  background: none;
  border: none;
  box-shadow: none;
  color: var(--cream);
  text-decoration: underline;
  font-weight: 400;
  font-size: var(--text-small);
}

.noscript { padding: 24px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Steuerkreuz und Knöpfe: nur bei Touch und nur beim Laufen */
#pad { display: none; }
body.touch[data-mode="walk"] #pad { display: block; }

#pad {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}
#pad .dpad, #pad .ab { pointer-events: auto; position: absolute; touch-action: none; }

#pad .dpad {
  width: 150px;
  height: 150px;
  right: calc(18px + env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  border-radius: 50%;
  background: rgba(18, 17, 31, 0.28);
  opacity: 0.8;
}
#pad .dpad-arm, #pad .dpad-hub {
  position: absolute;
  background: rgba(243, 236, 210, 0.75);
  border: 3px solid rgba(122, 82, 54, 0.9);
}
#pad .dpad-arm.up, #pad .dpad-arm.down { left: 52px; width: 46px; height: 52px; }
#pad .dpad-arm.left, #pad .dpad-arm.right { top: 52px; width: 52px; height: 46px; }
#pad .dpad-arm.up { top: 4px; border-radius: 8px 8px 0 0; border-bottom: none; }
#pad .dpad-arm.down { bottom: 4px; border-radius: 0 0 8px 8px; border-top: none; }
#pad .dpad-arm.left { left: 4px; border-radius: 8px 0 0 8px; border-right: none; }
#pad .dpad-arm.right { right: 4px; border-radius: 0 8px 8px 0; border-left: none; }
#pad .dpad-hub { left: 52px; top: 52px; width: 46px; height: 46px; border: none; }
#pad .dpad[data-dir="up"] .dpad-arm.up,
#pad .dpad[data-dir="down"] .dpad-arm.down,
#pad .dpad[data-dir="left"] .dpad-arm.left,
#pad .dpad[data-dir="right"] .dpad-arm.right { background: var(--frame); }

#pad .ab {
  left: calc(18px + env(safe-area-inset-left));
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: 170px;
  height: 150px;
}
#pad .pad-btn {
  position: absolute;
  border-radius: 50%;
  border: 3px solid rgba(122, 82, 54, 0.95);
  background: rgba(243, 236, 210, 0.78);
  color: var(--ink);
  font: 700 26px var(--font);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  opacity: 0.85;
}
#pad .pad-btn.down { background: var(--frame); color: #fff; }
#pad .pad-btn.a { width: 84px; height: 84px; right: 0; top: 0; }
#pad .pad-btn.b { width: 64px; height: 64px; left: 0; bottom: 0; font-size: 22px; }

@media (orientation: portrait) {
  #pad { top: calc(var(--img-top) + var(--img-height)); background: var(--ink); }
  #pad .dpad, #pad .ab { opacity: 1; }
}

/* Textfenster */
#panel { padding-top: 20px; }
.dialog { position: relative; min-height: 4.4em; margin: 0 auto; max-width: 900px; }
.dialog + .dialog { margin-top: 10px; }
.dialog-speaker {
  position: absolute;
  top: -16px;
  left: 14px;
  background: var(--frame);
  color: #fff;
  border: 3px solid var(--frame-dark);
  border-radius: 5px;
  padding: 1px 10px;
  font-size: var(--text-small);
  font-weight: 700;
}
.dialog-text { display: block; white-space: pre-wrap; }
.dialog-more {
  position: absolute;
  right: 14px;
  bottom: 6px;
  color: var(--frame);
  font-size: 14px;
  animation: lumara-bob 1.2s ease-in-out infinite;
}
@keyframes lumara-bob { 50% { transform: translateY(3px); } }
.choice { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.choice .btn { text-align: left; }
.choice.many { display: grid; grid-template-columns: 1fr 1fr; }
.choice.many .btn:last-child { grid-column: 1 / -1; }
/* Lange Namen wie „Leuchtturmbucht“ trennen auf schmalen Bildschirmen statt überzulaufen */
.choice.many .btn { min-width: 0; padding-inline: 10px; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
.choice .btn.selected { background: var(--frame); color: #fff; outline: 3px solid var(--cream); outline-offset: -6px; }

/* Titel und Bildschirme */
.title-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-left: 8%;
  padding-bottom: 12%;
  color: var(--cream);
  text-shadow: 0 3px 0 #12111f, 0 0 18px rgba(18, 17, 31, 0.9);
}
.title-logo {
  margin: 0;
  font-size: clamp(44px, calc(var(--gpx) * 22), 120px);
  letter-spacing: 0.08em;
  font-weight: 800;
  color: #ffe08a;
}
.title-sub { margin: 0.1em 0 0; font-size: clamp(18px, calc(var(--gpx) * 6), 34px); font-weight: 600; }
.title-tap {
  margin-top: 1.6em;
  font-size: var(--text);
  animation: lumara-pulse 2s ease-in-out infinite;
}
@keyframes lumara-pulse { 50% { opacity: 0.35; } }

.screen-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}
.screen-card p { margin: 0; }
.btn.big { font-size: calc(var(--text) * 1.15); padding: 14px 28px; min-width: 260px; }
.btn.link { color: var(--ink); }
#panel .btn.link { color: var(--ink); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
label.btn { display: inline-flex; align-items: center; justify-content: center; position: relative; }
.pack-message { width: 100%; text-align: left; }
.pack-message:empty { display: none; }
.msg { margin: 6px 0; font-weight: 600; }
.msg.bad { color: var(--bad); }
.msg.ok { color: var(--ok); }
.details { font-size: var(--text-small); color: var(--ink); }
.details summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; list-style: none; }
.details summary::-webkit-details-marker { display: none; }
.details summary::before { content: '▸'; margin-right: 6px; }
.details[open] summary::before { content: '▾'; }
.details ul { margin: 6px 0 0; padding-left: 20px; max-height: 30vh; overflow: auto; }

/* Entwickler-Galerie */
.gallery-label { position: absolute; font-size: 12px; color: var(--ink); font-weight: 700; }

/* Intro, Name, Eier */
.skip-btn { position: absolute; top: 10px; right: 10px; font-size: var(--text-small); }
.name-form { display: flex; flex-direction: column; gap: 10px; max-width: 560px; margin: 0 auto; }
.name-prompt { font-weight: 700; }
.name-input {
  font-size: calc(var(--text) * 1.2);
  padding: 10px 12px;
  min-height: 52px;
  border: 3px solid var(--button);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.name-input:focus { outline: 3px solid var(--frame); }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.msg:empty { display: none; }
.egg-info { max-width: 900px; margin: 0 auto; }
.egg-info p { margin: 6px 0; }
.egg-name { margin: 0 0 4px; font-size: calc(var(--text) * 1.15); }
.egg-special { font-size: var(--text-small); }
.egg-hit { position: absolute; background: transparent; border: none; padding: 0; cursor: pointer; }
.egg-hit:focus-visible { outline: 3px solid var(--cream); }

/* Duell */
body[data-mode="duel"] #panel { background: var(--ink); border-radius: 8px 8px 0 0; }
.duel-panel { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.duel-top { display: flex; gap: 10px; align-items: stretch; }
.duel-question { flex: 1; font-size: max(18px, var(--text)); font-weight: 600; }
.duel-side { display: flex; flex-direction: column; gap: 6px; }
.btn.side { font-size: var(--text-small); padding: 6px 12px; white-space: nowrap; }
.duel-notice { margin: 0; color: #ffb4a8; font-weight: 700; }
/* Zeitbalken (Design 7.4): blinkt nie; knapp = Farbe und Streifen, angehalten = blau mit Text. */
/* sticky: Scrollt das Panel bei offener iPad-Tastatur, bleibt der Balken oben sichtbar. Der Grund ist
   deckend (dieselbe Farbe wie vorher über --ink), damit nichts darunter durchscheint. */
.timebar {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(rgba(243, 236, 210, 0.16), rgba(243, 236, 210, 0.16)), var(--ink);
  overflow: hidden;
}
.timebar-fill { position: absolute; inset: 0 auto 0 0; background: #e0b34a; }
.timebar.low .timebar-fill {
  background: repeating-linear-gradient(-45deg, #e2553f 0 6px, #b8321f 6px 12px);
}
.timebar.frozen .timebar-fill { background: #5a9fd6; }
/* Eigener dunkler Hintergrund: auf jeder Füllung gut lesbar (tests/contrast.test.js) */
.timebar-label {
  position: absolute;
  top: 2px;
  right: 6px;
  bottom: 2px;
  display: flex;
  align-items: center;
  padding: 0 5px;
  border-radius: 3px;
  background: rgba(29, 43, 58, 0.88);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: var(--cream);
}
.timebar.frozen .timebar-label { right: 50%; transform: translateX(50%); }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.answer { display: flex; align-items: center; gap: 10px; text-align: left; min-height: 56px; font-weight: 600; }
.answer-key {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: rgba(243, 236, 210, 0.18);
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
body.touch .answer-key { display: none; }
.btn.answer.struck { text-decoration: line-through; opacity: 0.35; }
.typing-row { display: flex; gap: 8px; }
.answer-input {
  flex: 1;
  min-width: 0;
  font-size: max(18px, calc(var(--text) * 1.1));
  padding: 10px 12px;
  min-height: 56px;
  border: 3px solid var(--frame);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.answer-hint { margin: 6px 0 0; color: var(--cream); font-size: var(--text-small); }
.answer-hint:empty { display: none; }
.tiles { display: flex; flex-direction: column; gap: 8px; }
.tiles-line, .tiles-pool { display: flex; flex-wrap: wrap; gap: 6px; min-height: 56px; align-items: center; }
.tiles-line { border-bottom: 3px dashed var(--frame); padding-bottom: 6px; }
.tiles-empty { color: var(--mist, #a3a7c4); font-size: var(--text-small); }
.btn.tile { background: var(--frame); color: #fff; border-color: var(--frame-dark); min-height: 48px; font-weight: 700; }
.btn.tile.placed { background: var(--cream); color: var(--ink); }
.btn.tile.locked { opacity: 1; outline: 3px solid #ffe08a; }
.duel-feedback { border-width: 5px; }
.duel-feedback.ok { border-color: var(--ok); }
.duel-feedback.bad { border-color: var(--bad); }
.feedback-title { margin: 0 0 4px; font-weight: 800; font-size: calc(var(--text) * 1.1); }
.duel-feedback.ok .feedback-title { color: var(--ok); }
.duel-feedback.bad .feedback-title { color: var(--bad); }
.feedback-icon { font-size: 1.3em; }
.feedback-line { margin: 4px 0; }
.feedback-more { margin: 4px 0 0; text-align: right; color: var(--frame); font-size: var(--text-small); }

.plate {
  position: absolute;
  background: var(--cream);
  color: var(--ink);
  border: 3px solid var(--frame);
  border-radius: 6px;
  padding: 4px 8px 6px;
  width: calc(var(--gpx) * 92);
  max-width: 46%;
  font-size: clamp(14px, calc(var(--gpx) * 3.6), 20px);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}
.plate.foe { left: calc(var(--gpx) * 6); top: calc(var(--gpx) * 6); }
.plate.own { right: calc(var(--gpx) * 6); top: calc(var(--gpx) * 60); }
.plate-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; }
.plate-lv { font-weight: 600; }
.plate-bar { display: flex; gap: 2px; margin-top: 3px; height: 9px; }
.plate-bar .seg { flex: 1; background: #c9c2a8; border-radius: 2px; }
.plate-bar .seg.on { background: #5cb85c; }
.plate-bar.low .seg.on { background: #d9a43a; }
.plate-extra { display: flex; align-items: center; gap: 8px; margin-top: 3px; min-height: 12px; }
/* Ohne Inhalt (etwa beim Gegner ohne Glanzform) keine leere Zeile: Das Schild bleibt flach. */
.plate-extra:empty { display: none; }
.shiny-mark { font-weight: 800; color: var(--frame-dark); }
.pips { display: flex; gap: 3px; }
.pip { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--frame); }
.pip.on { background: #ffe08a; }
.ready { font-size: 0.8em; font-weight: 800; color: var(--frame-dark); }

@media (orientation: portrait) {
  .plate.own { top: auto; bottom: calc(var(--gpx) * 6); }
}

/* Bildschirmtastatur offen (iPad): Panel oben im sichtbaren Bereich */
body.kbd #panel {
  top: var(--vv-top, 0px);
  bottom: auto;
  left: 0;
  right: 0;
  width: auto;
  max-height: var(--vv-height, 50vh);
}

/* Kleine Anzeige in der Welt */
.hud {
  position: absolute;
  left: calc(var(--gpx) * 4);
  top: calc(var(--gpx) * 4);
  background: var(--cream);
  color: var(--ink);
  border: 3px solid var(--frame);
  border-radius: 6px;
  padding: 3px 8px 5px;
  min-width: 150px;
  font-size: clamp(14px, calc(var(--gpx) * 3.4), 18px);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}
body:not([data-mode="walk"]) .hud { display: none; }

/* Flüsternde Bäume: blasser Text oben im Bild, blockiert nichts */
.whisper {
  position: absolute;
  left: 50%;
  top: calc(var(--gpx) * 22);
  transform: translateX(-50%);
  max-width: 80%;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(27, 26, 46, 0.45);
  color: #f3ecd2;
  font-size: var(--text-small);
  font-style: italic;
  text-align: center;
  opacity: 0.9;
}
body:not([data-mode="walk"]) .whisper { display: none; }

/* Hinweis oben in der Mitte (Speicherfehler, neue Version) */
.toast {
  position: fixed;
  left: 50%;
  top: max(12px, env(safe-area-inset-top));
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(92vw, 640px);
  background: var(--cream);
  color: var(--ink);
  border: 3px solid var(--frame);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: var(--text-small);
  font-weight: 600;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

/* Spielstand wiederherstellen */
.recover-title { font-weight: 700; font-size: calc(var(--text) * 1.1); }

/* Menüknopf oben rechts */
.menu-btn {
  position: absolute;
  right: calc(var(--gpx) * 4);
  top: calc(var(--gpx) * 4);
  width: 52px;
  height: 52px;
  border: 3px solid var(--frame);
  border-radius: 8px;
  background: rgba(243, 236, 210, 0.92);
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
  touch-action: manipulation;
}
.menu-btn:focus-visible { outline: 3px solid var(--cream); outline-offset: 2px; }
body:not([data-mode="walk"]) .menu-btn { display: none; }

/* Menü-Blatt über dem ganzen Bildschirm */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(18, 17, 31, 0.78);
}
.sheet-card {
  width: min(760px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 3px solid var(--frame);
}
.sheet-title { margin: 0; font-size: calc(var(--text) * 1.15); }
.sheet-back { font-size: var(--text-small); }
.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sheet .btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.sheet-list { display: flex; flex-direction: column; gap: 10px; }
.sheet-list .btn { width: 100%; text-align: left; }
.bag-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }

/* Karte der Insel (Menü): 3 Spalten × 5 Zeilen, der Ring um den Berg. Nebel grau und gestrichelt,
   „Du bist hier“ mit dunklem Rahmen; der Zustand steht immer auch als Text da. */
.island-map { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(5, auto); gap: 8px; }
.map-cell { margin: 0; padding: 8px 10px; border: 3px solid var(--frame); border-radius: 8px; background: #fffaf0; min-width: 0; }
.map-cell p { margin: 0; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
.map-cell .map-name, .choice.many .btn { hyphens: manual; -webkit-hyphens: manual; } /* Namen trennen nur an ihren festen Stellen */
.map-name { font-weight: 700; }
.map-state { font-size: var(--text-small); }
.map-area.fog { background: #d4d6e6; color: #46496e; border-style: dashed; border-color: #6b6f94; }
.map-area.here { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.map-cave { background: #2b2d4a; color: #f3ecd2; border-color: #46496e; }
@media (max-width: 480px) {
  .island-map { gap: 6px; }
  .map-cell { padding: 6px; }
  .map-name { font-size: var(--text-small); }
  .map-state { font-size: 14px; }
}
.bag-row { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.bag-name { flex: 1; }
.bag-count { min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.bag-message { min-height: 1.4em; font-weight: 700; }
.bag-note { display: block; font-size: var(--text-small); color: var(--frame-dark); }
.bag-shine { font-weight: 700; color: var(--frame-dark); }
.diary .diary-area h4 { margin: 8px 0 4px; }
.diary .diary-piece { margin: 0 0 8px; line-height: 1.45; }
.diary-piece.missing { color: var(--frame-dark); font-style: italic; opacity: 0.75; }
.sheet-section { display: flex; flex-direction: column; gap: 8px; }
.sheet-section h3 { margin: 0; font-size: var(--text-small); text-transform: uppercase; letter-spacing: 0.05em; color: var(--frame-dark); }
.sheet-section p { margin: 0; }
.sheet-text { margin: 0; white-space: pre-line; }
.sheet-confirm { justify-content: flex-end; }
.sheet-foot { margin: 4px 0 0; font-size: var(--text-small); opacity: 0.75; text-align: center; }
.sheet-msg:empty { display: none; }
.sheet-card.taken { padding: 16px 18px; gap: 12px; width: min(560px, 100%); text-align: center; align-items: center; }
.sheet-card.taken p { margin: 0; }
.sheet .btn.link { color: var(--ink); align-self: flex-start; }
.sheet label.btn { align-self: flex-start; }
.sheet-msg .msg { margin: 0; }
.seg { justify-content: flex-start; }
.seg .btn[aria-pressed="true"] { background: var(--frame); color: #fff; outline: 3px solid var(--ink); outline-offset: -6px; }
.btn.danger { background: var(--bad); color: #fff; }
.small { font-size: var(--text-small); }

/* Für die Lehrkraft: alles auf einen Blick, für einen Screenshot */
.sheet-card.wide { width: min(1000px, 100%); }
.teacher { display: grid; grid-template-columns: 3fr 2fr; gap: 14px 20px; }
.teacher-values { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: var(--text); }
.teacher-values dt { font-weight: 700; color: var(--frame-dark); }
.teacher-values dd { margin: 0; font-weight: 600; }
.teacher-side { display: flex; flex-direction: column; gap: 6px; font-size: var(--text); }
.teacher-code { display: flex; flex-direction: column; align-items: center; padding: 8px; border: 3px solid var(--ink); border-radius: 6px; background: #fff; }
.teacher-code span { font-weight: 700; }
.teacher-code b { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: clamp(30px, 5vw, 44px); letter-spacing: 0.08em; }
.teacher-topics-title { margin: 4px 0 0; font-weight: 700; color: var(--frame-dark); }
.teacher-topics { margin: 0; padding-left: 1.6em; display: flex; flex-direction: column; gap: 2px; }
.teacher-foot { margin: 0; font-size: 14px; opacity: 0.8; word-break: break-all; }
@media (max-width: 700px) { .teacher { grid-template-columns: 1fr; } }

/* Erst installieren: Schritte mit Teilen-Symbol */
.install-steps { margin: 0; padding-left: 1.4em; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.share-icon { width: 1.2em; height: 1.2em; vertical-align: -0.2em; color: var(--button); }

/* Wesen-Seite */
.creature-card { display: flex; flex-direction: column; gap: 6px; }
.creature-card p { margin: 0; }
.creature-name { font-size: calc(var(--text) * 1.3); font-weight: 700; }
.creature-species { font-size: var(--text-small); opacity: 0.8; margin-top: -4px !important; }
.creature-special { font-size: var(--text-small); }
.xp-bar { height: 14px; border: 2px solid var(--frame-dark); border-radius: 4px; background: #fff; overflow: hidden; }
.xp-bar > span { display: block; height: 100%; background: var(--ok); }

/* Seite „Wesen“: Bild und Fähigkeiten (Plan 4b) */
.creature-portrait { display: flex; justify-content: center; margin-bottom: 6px; }
.creature-img { image-rendering: pixelated; image-rendering: crisp-edges; }
.creature-abilities-title { margin: 12px 0 4px; font-size: var(--text); }
.creature-abilities { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
.creature-abilities .off { color: var(--frame-dark); }

/* Wesen-Buch (Plan 4b): Raster mit 33 Kästen, auf 390 px vier Spalten */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 8px; }
.book-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 2px; min-height: 88px; padding: 4px 2px; border: 2px solid var(--frame); border-radius: 6px; background: var(--cream); color: var(--ink); font: inherit; font-size: var(--text-small); }
.book-cell.unknown { opacity: 0.7; border-style: dashed; }
.book-cell canvas { width: 48px; height: 48px; image-rendering: pixelated; image-rendering: crisp-edges; }
.book-q { font-size: 32px; font-weight: 800; line-height: 48px; color: var(--frame); }
.book-no { font-size: 0.75em; color: var(--frame-dark); }
.book-name { font-weight: 700; font-size: 0.8em; text-align: center; overflow-wrap: anywhere; hyphens: manual; }
.book-star { position: absolute; top: 2px; right: 4px; color: #b07a1a; font-weight: 800; }
.book-pictures { display: flex; gap: 16px; justify-content: center; align-items: flex-end; }
.book-pictures figure { margin: 0; text-align: center; }
.book-pictures canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
.book-labels { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 2px; }

/* Tagebuch: Aufträge (Plan 4c) */
.quest-log { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.quest-log li { display: grid; gap: 2px; }
.quest-log .done b { color: var(--frame-dark); }
.quest-hint { font-size: var(--text-small); }
