/* Paper Sting – Oberfläche des Spiels. Farbthema „Salzwüste“ (Farben exakt wie js/daten.js).
   Haltung wie die Webseite und konzept/13-menue-edel-a.webp: fast leerer dunkler Grund, dünne weit gesperrte Kleinbuchstaben,
   kleine Ziffern in Dunst, haarfeine Linien statt Flächen. Signal nur für die Marke, das gewählte Menüwort (Dreieck, Haarlinie)
   und den wichtigsten Knopf – nie als Schrift, nie als dünne Linie auf Hellem. Kein Glanz, kein Leuchten, keine Schlagschatten. */

:root {
  --kalk: #F3F2EA; --stein: #DAD7C8; --dunst: #AED0C9; --signal: #FFFB08; --see: #1B6F81; --tiefe: #09324A;
  --koralle: #D9583B; --pflaume: #8A4A6B; --moos: #6F8F5A; --kupfer: #B07A3C;
  --schrift: "Bahnschrift", "DIN Alternate", "Segoe UI", system-ui, sans-serif;
  --rand: clamp(20px, 5.2vw, 96px);
  --oben: clamp(22px, 5.5vh, 56px);
  --haar: color-mix(in srgb, var(--kalk) 16%, transparent);
  --kurve: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { background: var(--tiefe); -webkit-text-size-adjust: 100%; height: 100%; }
body {
  height: 100%; min-width: 320px; overflow: hidden;
  background: var(--tiefe); color: var(--kalk);
  font-family: var(--schrift); font-weight: 300; font-size: 16px; line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 2px solid var(--kalk); outline-offset: 4px; }
a { color: inherit; text-underline-offset: .24em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
.nur-lesen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-delay: 0s !important; }
}

/* ---------------------------------------------------------------- Bühne und Ebene */
#buehne { position: fixed; inset: 0; width: 100%; height: 100%; display: block; background: var(--tiefe); }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
#ui > * { pointer-events: auto; }
#zeichen, #zweit, #hinweis, #ui .faehigkeiten, #pause, #ui > #touch { pointer-events: none; }
body.vorschau #ui { display: none; }

.rueckfall { position: fixed; right: var(--rand); top: 34%; z-index: 4; max-width: min(26rem, calc(100% - 2 * var(--rand))); padding: 22px 24px; background: color-mix(in srgb, var(--tiefe) 92%, transparent); border: 1px solid var(--haar); color: var(--kalk); }
.rueckfall h2 { font-size: 16px; font-weight: 500; letter-spacing: .04em; margin-bottom: 10px; }
.rueckfall-text { font-size: 13.5px; line-height: 1.55; color: var(--stein); margin-bottom: 16px; }
.rueckfall-knopf { min-height: 44px; padding: 0 2px; font-size: 12px; letter-spacing: .24em; text-transform: lowercase; color: var(--kalk); border-bottom: 1px solid var(--dunst); }
.rueckfall-knopf:focus-visible { outline: 2px solid var(--dunst); outline-offset: 3px; }
/* Schmal: die Meldung steht unter dem Markenzeichen, über den Menüworten; die Worte rücken um ihre Höhe nach unten (main.js setzt
   --rueckfall-hoehe), damit nichts überdeckt wird */
@media (max-width: 700px) {
  .rueckfall { top: calc(var(--oben) + 44px); bottom: auto; left: var(--rand); right: var(--rand); max-width: none; padding: 14px 16px; }
  .rueckfall h2 { margin-bottom: 6px; }
  .rueckfall-text { font-size: 12.5px; line-height: 1.45; margin-bottom: 6px; }
  .rueckfall-knopf { min-height: 40px; }
  body.rueckfall .woerter { top: calc(var(--oben) + 44px + var(--rueckfall-hoehe, 0px) + 18px); transform: none; }
}
.ohne-js { position: fixed; inset: 0 0 auto 0; z-index: 5; padding: 40px var(--rand); background: var(--tiefe); }
.ohne-js p { margin-bottom: 10px; }
.fehler { position: fixed; left: var(--rand); top: 40%; max-width: 30rem; z-index: 5; color: var(--kalk); }

/* ---------------------------------------------------------------- Hauptmenü */
#menue { position: absolute; inset: 0; transition: opacity .3s var(--kurve), visibility 0s; }
body[data-blatt] #menue { opacity: 0; visibility: hidden; transition: opacity .3s var(--kurve), visibility 0s .3s; }
.marke { position: absolute; left: var(--rand); top: var(--oben); display: flex; align-items: center; gap: 14px; }
.marke h1 { font-size: 13px; font-weight: 300; letter-spacing: .46em; text-transform: lowercase; margin-right: -.46em; }
.dreieck { display: inline-block; width: 10px; height: 11px; background: var(--signal); clip-path: polygon(0 0, 100% 50%, 0 100%); flex: none; }

.woerter { position: absolute; left: var(--rand); top: 50%; transform: translateY(-52%); max-width: calc(100% - 2 * var(--rand)); }
.woerter li + li { margin-top: clamp(4px, 1.6vh, 18px); }
.wort {
  position: relative; display: flex; align-items: baseline; gap: clamp(12px, 1.6vw, 26px);
  padding: 4px 0 10px clamp(26px, 3vw, 48px); min-height: 44px; color: var(--stein);
}
.wort .ziffer { font-size: 12.5px; letter-spacing: .14em; font-weight: 400; color: var(--dunst); min-width: 2em; }
.wort .name { font-size: clamp(30px, 4.6vw, 64px); font-weight: 200; line-height: 1.05; letter-spacing: .3em; text-transform: lowercase; margin-right: -.3em; transition: color .3s var(--kurve); }
/* gewähltes Wort: Signal-Dreieck und haarfeine Signallinie (auf Tiefe erlaubt) */
.wort::before { content: ""; position: absolute; left: 0; top: .72em; width: 11px; height: 12px; background: var(--signal); clip-path: polygon(0 0, 100% 50%, 0 100%); opacity: 0; transform: translateX(-6px); transition: opacity .3s var(--kurve), transform .3s var(--kurve); }
.wort::after { content: ""; position: absolute; left: clamp(26px, 3vw, 48px); right: 0; bottom: 3px; height: 1px; background: var(--signal); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--kurve); }
.wort[aria-current] { color: var(--kalk); }
.wort[aria-current]::before { opacity: 1; transform: none; }
.wort[aria-current]::after { transform: scaleX(1); }
.wort[aria-current] .name { color: var(--kalk); }
.wort:focus-visible { outline: 0; }
.wort:focus-visible .name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }

/* Einblenden: Wörter nacheinander, sonst nichts Verspieltes */
.ein .marke, .ein .fuss { animation: blende 1.2s var(--kurve) .2s both; }
.ein .woerter li { animation: blende .9s var(--kurve) calc(.35s + var(--i, 0) * .14s) both; }
@keyframes blende { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Fuß: Bestwerte links, Sprache / Ton / Einstellungen rechts */
.fuss { position: absolute; left: var(--rand); right: var(--rand); bottom: clamp(16px, 4vh, 40px); display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 36px; color: var(--dunst); }
.bestwerte { display: flex; gap: 6px 30px; flex-wrap: wrap; }
.bestwerte div { display: flex; flex-direction: column-reverse; gap: 2px; }
.bestwerte dt { font-size: 10.5px; letter-spacing: .3em; text-transform: lowercase; font-weight: 300; }
.bestwerte dd { font-size: 17px; letter-spacing: .06em; font-variant-numeric: tabular-nums; font-weight: 300; }
.attrappe { flex-basis: 100%; order: 3; font-size: 11px; letter-spacing: .1em; color: var(--dunst); opacity: .8; max-width: 40em; }
.fuss-rechts { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); flex-wrap: wrap; }
.fuss-rechts button { min-height: 44px; padding: 0 2px; font-size: 12px; letter-spacing: .24em; text-transform: lowercase; color: var(--stein); border-bottom: 1px solid transparent; }
.fuss-rechts button:hover, .fuss-rechts button[aria-pressed="true"], .fuss-rechts button[aria-checked="true"] { color: var(--kalk); }
.fuss-rechts button[aria-pressed="true"] { border-bottom-color: currentColor; }
.sprache { display: flex; align-items: center; gap: 2px; }
.sprache i { font-style: normal; color: var(--dunst); font-size: 12px; }   /* Trenner in Dunst auf Tiefe: weit über 4,5:1, ohne Deckkraft */
.sprache button { min-width: 32px; text-align: center; }
.tonknopf span { color: var(--dunst); }

/* Schmale und niedrige Fenster */
@media (max-width: 700px) {
  #menue::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, color-mix(in srgb, var(--tiefe) 78%, transparent) 0, color-mix(in srgb, var(--tiefe) 40%, transparent) 70%, transparent 100%); }
  .marke, .woerter, .fuss { z-index: 1; }
  .woerter { top: 46%; }
  .wort { gap: 12px; padding-left: 24px; }
  .wort .name { letter-spacing: .22em; margin-right: -.22em; font-size: clamp(26px, 9vw, 38px); }
  .wort::after { left: 24px; }
  .fuss { flex-direction: column; align-items: flex-start; gap: 0; }
  .fuss-rechts { gap: 6px 18px; }
  .fuss-rechts button { letter-spacing: .18em; }
}
@media (max-height: 560px) {
  .wort .name { font-size: clamp(24px, 4vw, 36px); }
  .wort { min-height: 38px; padding-bottom: 6px; }
  .woerter li + li { margin-top: 0; }
}

/* ---------------------------------------------------------------- Blatt (Unterseiten) und Ende */
.blatt {
  position: absolute; left: 0; top: 0; bottom: 0; width: min(660px, 100%);
  overflow-y: auto; overscroll-behavior: contain;
  background: color-mix(in srgb, var(--tiefe) 94%, transparent);
  border-right: 1px solid var(--haar);
  animation: blatt-ein .45s var(--kurve) both;
  scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--kalk) 25%, transparent) transparent;
}
@keyframes blatt-ein { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.blatt-innen { padding: calc(var(--oben) + 6px) var(--rand) 56px; max-width: 640px; }
.blatt-mitte { inset: 0; margin: auto; width: min(560px, 100%); height: fit-content; max-height: 100%; border: 1px solid var(--haar); background: var(--tiefe); animation-name: blatt-mitte; }
@keyframes blatt-mitte { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* Mittlere Breiten (zum Beispiel 1024 px): das Blatt bleibt schmaler, damit das Tier der Menüszene rechts daneben zu sehen ist */
@media (min-width: 701px) and (max-width: 1279px) { .blatt:not(.blatt-mitte) { width: min(660px, max(420px, 44vw)); } }
@media (max-width: 700px) { .blatt { border-right: 0; background: color-mix(in srgb, var(--tiefe) 97%, transparent); } .blatt-mitte { border: 0; } }

.blatt-kopf { display: flex; flex-direction: column; gap: 22px; margin-bottom: 26px; }
.zurueck { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; width: fit-content; font-size: 12px; letter-spacing: .3em; text-transform: lowercase; color: var(--stein); }
.zurueck:hover { color: var(--kalk); }
.dreieck-zu { width: 9px; height: 10px; background: var(--stein); clip-path: polygon(100% 0, 0 50%, 100% 100%); }
/* Lange Titel („einstellungen“) laufen nicht über: die Schrift folgt der Breite des Blatts (Container), abzüglich der Ränder;
   ein Umbruch mitten im Wort bleibt nur der letzte Ausweg */
.blatt { container-type: inline-size; }
.blatt h2 { font-size: clamp(22px, 4.2vw, 52px); font-weight: 200; line-height: 1.1; letter-spacing: .26em; text-transform: lowercase; display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; overflow-wrap: anywhere; }
/* Das Blatt in der Mitte (Ende): Titel brechen nur zwischen Wörtern; passt ein Wort nicht, wird die Schrift kleiner, nie bricht ein Wort (HD-PS-059) */
.blatt-mitte h2 { overflow-wrap: break-word; word-break: normal; hyphens: manual; }
@supports (width: 1cqw) { .blatt h2 { font-size: clamp(22px, min(4.2vw, calc((100cqw - 2 * var(--rand)) / 10.8)), 52px); } }
.blatt h2 .zif { font-size: 12.5px; letter-spacing: .14em; font-weight: 400; color: var(--dunst); }
.lead { font-size: 17px; max-width: 34em; color: var(--kalk); margin-bottom: 8px; }
.leise { font-size: 14px; color: var(--stein); max-width: 38em; margin-top: 14px; }
.zwischen { margin: 38px 0 6px; display: flex; align-items: center; gap: 14px; font-size: 11.5px; font-weight: 300; letter-spacing: .38em; text-transform: lowercase; color: var(--dunst); }
.zwischen::before { content: ""; width: 7px; height: 8px; background: var(--dunst); clip-path: polygon(0 0, 100% 50%, 0 100%); flex: none; }
.notiz { display: flex; gap: 14px; align-items: baseline; margin: 24px 0 0; font-size: 14.5px; color: var(--stein); max-width: 38em; }
.d-klein { width: 7px; height: 8px; background: var(--dunst); clip-path: polygon(0 0, 100% 50%, 0 100%); flex: none; transform: translateY(-1px); }

/* Knöpfe: der wichtigste in Signal (Tiefe auf Signal), Zweitknöpfe als Haarlinie */
.knoepfe { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-top: 36px; align-items: center; }
/* Lange Blätter (Duell): die Knopfleiste klebt am unteren Rand des Blatts; der Rand hebt sie vom Inhalt ab */
.blatt { scroll-padding-bottom: 96px; }
.knoepfe-fest { position: sticky; bottom: 0; z-index: 1; margin: 36px calc(-1 * var(--rand)) -56px; padding: 14px var(--rand) 18px; background: var(--tiefe); border-top: 1px solid var(--haar); }
.knopf {
  display: inline-flex; align-items: center; gap: 18px; min-height: 54px; padding: 0 34px 0 30px;
  font-size: 14px; font-weight: 400; letter-spacing: .26em; text-transform: lowercase; color: var(--tiefe);
  background: linear-gradient(225deg, transparent 14px, var(--signal) 14px);
}
.knopf:focus-visible { outline-color: var(--kalk); outline-offset: 5px; }
.knopf:disabled { background: linear-gradient(225deg, transparent 14px, var(--stein) 14px); }
.pfeil { display: block; width: 14px; height: 10px; background: var(--tiefe); clip-path: polygon(0 40%, 70% 40%, 70% 0, 100% 50%, 70% 100%, 70% 60%, 0 60%); transition: transform .25s; }
.knopf:hover .pfeil { transform: translateX(4px); }
.knopf-leise { min-height: 48px; padding: 0 24px; font-size: 12.5px; letter-spacing: .24em; text-transform: lowercase; border: 1px solid color-mix(in srgb, var(--kalk) 30%, transparent); color: var(--kalk); }
.knopf-leise:hover { border-color: var(--kalk); }

/* Artwahl */
.artwahl { margin-top: 10px; border-bottom: 1px solid var(--haar); }
.artknopf { display: block; width: 100%; position: relative; padding: 14px 0 14px 28px; border-top: 1px solid var(--haar); min-height: 48px; }
.artknopf::before { content: ""; position: absolute; left: 0; top: 22px; width: 8px; height: 9px; background: var(--stein); clip-path: polygon(0 0, 100% 50%, 0 100%); opacity: 0; transition: opacity .25s; }
.artknopf[aria-pressed="true"]::before { opacity: 1; background: var(--kalk); }
.artknopf:hover::before { opacity: .5; }
.artname { display: block; font-size: 19px; letter-spacing: .04em; color: var(--stein); }
.artknopf[aria-pressed="true"] .artname { color: var(--kalk); }
.artzeile { display: block; margin-top: 2px; font-size: 14px; color: var(--stein); opacity: .85; max-width: 34em; }

/* Arten: Name, Zeile, fünf Werte als Dreiecksreihen */
.arten-liste { margin-top: 24px; border-bottom: 1px solid var(--haar); }
.artzeile-knopf { display: grid; grid-template-columns: 2.6em 1fr; gap: 6px 14px; width: 100%; padding: 20px 0; border-top: 1px solid var(--haar); align-items: start; }
.artzeile-knopf .nr { font-size: 12.5px; letter-spacing: .14em; color: var(--dunst); padding-top: 6px; }
.artzeile-knopf .text { display: block; }
.artzeile-knopf .artname { font-size: 21px; font-weight: 300; color: var(--kalk); }
.artzeile-knopf[aria-pressed="true"] .artname { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.artzeile-knopf small { margin-left: 12px; font-size: 10.5px; letter-spacing: .3em; text-transform: lowercase; color: var(--dunst); }
.artregel { display: block; margin-top: 6px; font-size: 13px; color: var(--dunst); max-width: 34em; }
.werte { grid-column: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(7.2em, 1fr)); gap: 8px 18px; margin-top: 12px; }
.werte .wert { display: flex; flex-direction: column; gap: 4px; }
.werte .wert-name { font-size: 10px; letter-spacing: .26em; text-transform: lowercase; color: var(--stein); }
.werte .wert-reihe { color: var(--kalk); }
li.gesperrt .artname { color: var(--stein); }
li.gesperrt .werte .wert-reihe { color: var(--stein); }
.reihe { display: inline-flex; gap: 5px; align-items: center; }
.reihe .d { display: block; width: 9px; height: 8px; background: currentColor; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.reihe .d.aus { opacity: .2; }
/* gesperrt: nur Umriss */
.reihe .d.umriss { background: none; position: relative; opacity: .7; }
.reihe .d.umriss::before { content: ""; position: absolute; inset: 0; background: currentColor; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.reihe .d.umriss::after { content: ""; position: absolute; inset: 0; background: var(--tiefe); clip-path: polygon(50% 24%, 80% 88%, 20% 88%); }
.reihe .d.umriss.aus { opacity: .25; }

/* Einstellungen */
.zeilen { border-bottom: 1px solid var(--haar); }
.zeile { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 10px 0; min-height: 56px; border-top: 1px solid var(--haar); }
.zeilentext { font-size: 12px; letter-spacing: .3em; text-transform: lowercase; color: var(--stein); }
.schalter { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 2px; font-size: 13px; letter-spacing: .2em; text-transform: lowercase; color: var(--kalk); }
.schalter i { width: 34px; height: 14px; border: 1px solid color-mix(in srgb, var(--kalk) 45%, transparent); position: relative; display: block; }
.schalter i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; background: var(--stein); clip-path: polygon(0 0, 100% 50%, 0 100%); transition: transform .3s var(--kurve); }
.schalter[aria-checked="true"] i::after { transform: translateX(20px); background: var(--kalk); }
.reihe-wahl { display: flex; gap: 4px 18px; flex-wrap: wrap; }
.wahl { min-height: 44px; padding: 0 2px; font-size: 13px; letter-spacing: .22em; text-transform: lowercase; color: var(--stein); border-bottom: 1px solid transparent; }
.wahl:hover { color: var(--kalk); }
.wahl[aria-pressed="true"] { color: var(--kalk); border-bottom-color: var(--kalk); }
.steuerung { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14.5px; }
.steuerung th, .steuerung td { text-align: left; padding: 12px 16px 12px 0; border-top: 1px solid var(--haar); vertical-align: baseline; font-weight: 300; }
.steuerung thead th { font-size: 10px; letter-spacing: .3em; text-transform: lowercase; color: var(--dunst); border-top: 0; padding-bottom: 6px; }
.steuerung tbody th { width: 38%; }
.steuerung tr:last-child > * { border-bottom: 1px solid var(--haar); }
kbd { display: inline-block; min-width: 1.9em; padding: 0 7px; text-align: center; font: 300 13px var(--schrift); letter-spacing: .08em; border: 1px solid color-mix(in srgb, currentColor 32%, transparent); }
@media (max-width: 560px) {
  .steuerung thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .steuerung, .steuerung tbody, .steuerung tr, .steuerung th, .steuerung td { display: block; }
  .steuerung tr { border-top: 1px solid var(--haar); padding: 12px 0; }
  .steuerung th, .steuerung td { border: 0 !important; padding: 2px 0; width: auto !important; }
  .steuerung td::before { content: attr(data-label) ": "; font-size: 10px; letter-spacing: .18em; color: var(--dunst); }
}
.rueckfrage { margin-top: 20px; padding: 16px 0 0; border-top: 1px solid var(--haar); }
.rueckfrage p { font-size: 15px; max-width: 34em; }
.rueckfrage .knoepfe { margin-top: 18px; }
.seitenlink { margin-top: 34px; font-size: 12px; letter-spacing: .26em; text-transform: lowercase; }
.seitenlink a { display: inline-block; padding: 12px 0; color: var(--stein); }
.seitenlink a:hover { color: var(--kalk); }

/* ---------------------------------------------------------------- Tastenzeichen (nur beim ersten Start) */
#zeichen { position: fixed; left: 0; top: 0; display: flex; flex-direction: column; gap: 6px; will-change: transform; }
/* Der Grund im Lauf ist oft hell: ein leiser Tiefe-Grund hält die Zeichen lesbar */
.zeichen { display: flex; align-items: center; gap: 10px; width: fit-content; padding: 3px 10px 3px 6px; background: color-mix(in srgb, var(--tiefe) 78%, transparent); font-size: 11px; letter-spacing: .16em; text-transform: lowercase; color: var(--kalk); opacity: 0; animation: zeichen-ein 1.4s var(--kurve) .6s forwards; transition: opacity 1.4s var(--kurve); }
.zeichen kbd { font-size: 11px; border-color: color-mix(in srgb, var(--kalk) 55%, transparent); }
.zeichen.weg { animation: none; opacity: 0; }
body[data-phase="pause"] #zeichen { visibility: hidden; }
/* Häutungsfolge (Riss bis Entfalten): nichts am Tier */
#zeichen { transition: opacity .6s var(--kurve); }
#zeichen.still { opacity: 0; }
@keyframes zeichen-ein { from { opacity: 0; } to { opacity: .8; } }
/* HD-PS-097: unter 360 px bricht die Erklärung um, statt über den Rand zu laufen (Zeichen 3 war bei 320 px 315 px breit ab x 20) */
@media (max-width: 359px) { #zeichen { max-width: calc(100vw - 40px); } .zeichen { white-space: normal; max-width: 100%; } .zeichen kbd { flex: none; } }

/* ---------------------------------------------------------------- Duell zu zweit und Hinweis */
/* Der Grund im Lauf ist oft hell: ein leiser Tiefe-Grund hält die Zeilen lesbar, sonst bleibt das Bild leer */
#zweit { position: absolute; left: 0; right: 0; top: var(--oben); display: flex; flex-direction: column; align-items: center; gap: 12px; }
body[data-phase="pause"] #zweit { visibility: hidden; }
.zweit-hinweis, .rundenstand { padding: 6px 16px; background: color-mix(in srgb, var(--tiefe) 78%, transparent); color: var(--kalk); }
.zweit-hinweis { font-size: 11.5px; letter-spacing: .26em; text-transform: lowercase; text-align: center; max-width: min(34em, calc(100% - 2 * var(--rand))); }
.rundenstand { display: flex; flex-direction: column; gap: 6px; animation: blende .5s var(--kurve) both; }
.rundenstand .reihe { gap: 7px; }
#hinweis { position: absolute; left: var(--rand); top: calc(var(--oben) + 44px); max-width: min(30em, calc(100% - 2 * var(--rand))); font-size: 13.5px; color: var(--stein); display: flex; gap: 14px; align-items: baseline; z-index: 1; }
#hinweis::before { content: ""; width: 7px; height: 8px; background: var(--dunst); clip-path: polygon(0 0, 100% 50%, 0 100%); flex: none; }

/* ---------------------------------------------------------------- Pause */
#pause { position: absolute; inset: 0; background: color-mix(in srgb, var(--tiefe) 28%, transparent); pointer-events: none; }
/* Der Grund im Lauf ist oft hell: die Pause liegt auf einem Blatt in Tiefe wie die Unterseiten */
#pause .pausenblatt { position: absolute; left: 0; top: 0; bottom: 0; width: min(420px, 100%); padding: 0 var(--rand); display: flex; flex-direction: column; justify-content: center; pointer-events: auto; background: color-mix(in srgb, var(--tiefe) 94%, transparent); border-right: 1px solid var(--haar); animation: blatt-ein .4s var(--kurve) both; }
@media (max-width: 700px) { #pause .pausenblatt { width: 100%; background: color-mix(in srgb, var(--tiefe) 88%, transparent); border: 0; } }
#pause h2 { font-size: 12px; font-weight: 300; letter-spacing: .4em; text-transform: lowercase; color: var(--dunst); margin-bottom: 14px; }
.wort-klein { display: block; min-height: 52px; padding: 6px 0 6px 26px; position: relative; font-size: clamp(20px, 2.2vw, 30px); font-weight: 200; letter-spacing: .2em; text-transform: lowercase; color: var(--stein); }
.wort-klein::before { content: ""; position: absolute; left: 0; top: 50%; width: 9px; height: 10px; margin-top: -5px; background: var(--kalk); clip-path: polygon(0 0, 100% 50%, 0 100%); opacity: 0; transition: opacity .25s; }
.wort-klein:hover, .wort-klein:focus-visible { color: var(--kalk); }
.wort-klein:hover::before, .wort-klein:focus-visible::before { opacity: 1; }
.wort-klein:focus-visible { outline: 0; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
#pause .leise { margin-top: 18px; max-width: 18em; }
#pause .leise:empty { display: none; }
.linkfeld { width: 100%; margin-top: 10px; padding: 8px 0; font: inherit; font-size: 12.5px; letter-spacing: .04em; color: var(--kalk); background: none; border: 0; border-bottom: 1px solid var(--haar); border-radius: 0; }
/* „ergebnis teilen“ ist länger als die übrigen Wörter: kleiner und enger gesetzt, damit es auf dem Blatt nicht umbricht */
.wort-klein.lang { font-size: clamp(17px, 1.8vw, 25px); letter-spacing: .12em; white-space: nowrap; }
/* Niedriges Fenster (Telefon quer): das Pausenblatt wird enger und läuft, wenn nötig, zum Scrollen über (mit „ergebnis teilen“ steht dort ein Textfeld) */
@media (max-height: 560px) {
  #pause .pausenblatt { justify-content: safe center; overflow-y: auto; padding-top: 10px; padding-bottom: 10px; }
  #pause .wort-klein { min-height: 38px; padding-top: 1px; padding-bottom: 1px; font-size: clamp(16px, 4.4vh, 22px); }
  #pause h2 { margin-bottom: 4px; }
  #pause .leise { margin-top: 8px; }
  #pause .linkfeld { margin-top: 4px; }
}
.faehigkeiten { position: absolute; inset: 0; }
.faehigkeit { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: grid; place-items: center; pointer-events: auto; }
.faehigkeit i { position: relative; display: block; width: 18px; height: 16px; background: var(--kalk); clip-path: polygon(50% 0, 100% 100%, 0 100%); transition: transform .25s var(--kurve); }
/* Tiefe-Rand um das Dreieck, damit es auf hellem wie dunklem Grund lesbar bleibt */
.faehigkeit::before { content: ""; position: absolute; width: 30px; height: 27px; background: var(--tiefe); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.faehigkeit:hover::before, .faehigkeit:focus-visible::before { background: var(--see); }
.faehigkeit:focus-visible { outline: 0; }
.faehigkeit:hover i, .faehigkeit:focus-visible i { transform: scale(1.3); }
.tipp { position: fixed; width: 240px; padding: 14px 16px; background: var(--tiefe); border: 1px solid color-mix(in srgb, var(--kalk) 28%, transparent); pointer-events: none; display: flex; flex-direction: column; gap: 2px; z-index: 4; }
.tipp b { font-weight: 400; font-size: 15px; letter-spacing: .06em; }
.tipp small { font-size: 10px; letter-spacing: .3em; text-transform: lowercase; color: var(--dunst); margin-bottom: 4px; }
.tipp span { font-size: 13.5px; color: var(--stein); line-height: 1.45; }

/* ---------------------------------------------------------------- Ende */
#ende .blatt-innen { padding-top: 44px; }
#ende h2 { letter-spacing: .24em; }
#ende .leise { margin-top: 18px; max-width: 24em; }
#ende .leise:empty { display: none; }
#ende .linkfeld { resize: none; line-height: 1.5; border: 1px solid var(--haar); padding: 8px 10px; }
.ergebnis { margin-top: 28px; border-bottom: 1px solid var(--haar); }
.ergebnis div { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 14px 0; border-top: 1px solid var(--haar); }
.ergebnis dt { font-size: 11px; letter-spacing: .32em; text-transform: lowercase; color: var(--dunst); }
.ergebnis dd { font-size: 28px; font-weight: 200; letter-spacing: .02em; font-variant-numeric: tabular-nums; text-align: right; }
.ergebnis dd.liste { font-size: 16px; letter-spacing: .04em; line-height: 1.45; }
.ergebnis dd small { display: block; font-size: 10.5px; font-weight: 300; letter-spacing: .28em; text-transform: lowercase; color: var(--dunst); }
@media (max-width: 700px) { .blatt-mitte { inset: 0; margin: 0; width: 100%; height: 100%; max-height: none; background: var(--tiefe); } }

/* Niedrige Fenster: Blatt eng halten */
@media (max-height: 560px) { .blatt-innen { padding-top: 20px; } .blatt-kopf { gap: 8px; margin-bottom: 14px; } .knoepfe { margin-top: 22px; } }

/* ---------------------------------------------------------------- Häutungsstreifen */
/* Eine feine Messlinie unten in der Bildmitte (Fassung 2, Wunsch des Inhabers: edler und dezenter): eine Haarlinie mit
   zwei Endstrichen und fünf kurzen Kerben, darauf eine 2 px hohe Füllung in Signal mit dunkler Unterkante (so liest sie sich
   auch über dem gelben Revier) und eine kleine Papierraute am Füllende. Im Lauf leise (0,5), beim Fressen 2,5 s deutlich.
   Keine Zahl, kein Text. Bewegung nur über transform und opacity. Das Tastenzeichen erscheint nur, wenn die Häutung bereit ist. */
#streifen {
  --breite: 148px; --f: 0; --linie: color-mix(in srgb, var(--tiefe) 46%, transparent);
  position: absolute; left: 50%; margin-left: calc(var(--breite) / -2); width: var(--breite); height: 9px;
  bottom: calc(clamp(18px, 4vh, 40px) + env(safe-area-inset-bottom, 0px)); pointer-events: none;
  opacity: .5; transition: opacity .9s var(--kurve);
}
#streifen.wach, #streifen.bereit { opacity: 1; transition-duration: .25s; }
body[data-phase="pause"] #streifen { visibility: hidden; }
/* Haarlinie über die ganze Breite, auf der Höhe der dunklen Unterkante der Füllung */
.streifen-papier { position: absolute; inset: 0; }
.streifen-papier::before { content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 1px; background: var(--linie); }
/* Messfeld: Endstriche links und rechts, die Füllung wird darin beschnitten */
.streifen-grund { position: absolute; left: 0; right: 0; top: 1px; height: 7px; overflow: hidden; border-left: 1px solid var(--linie); border-right: 1px solid var(--linie); }
.streifen-fuell { position: absolute; left: 0; right: 0; top: 2px; height: 3px; background: linear-gradient(var(--signal) 0 2px, var(--tiefe) 2px 3px); transform-origin: left center; transform: scaleX(var(--f)); transition: transform .45s var(--kurve); }
.kerbe { position: absolute; top: 4px; height: 3px; left: calc(var(--k) * 100% / 6); width: 1px; background: var(--linie); }
/* Die Papierraute am Füllende: dunkel unterlegt, gelb gefüllt; sie wandert mit und schwillt beim Fressen kurz an */
.streifen-spitze { position: absolute; left: 0; top: 0; width: 0; height: 0; transform: translateX(calc(var(--f) * var(--breite))); transition: transform .45s var(--kurve); }
.streifen-spitze i { position: absolute; left: -4px; top: 0; width: 8px; height: 8px; background: var(--tiefe); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.streifen-spitze i::after { content: ""; position: absolute; inset: 1.5px; background: var(--signal); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
#streifen.hupft:not(.bereit) .streifen-spitze i { animation: streifen-hupf .9s var(--kurve) both; }
@keyframes streifen-hupf { 0% { transform: scale(1); } 22% { transform: scale(1.7); } 100% { transform: scale(1); } }
/* Beute: die Linie hebt sich einmal kurz, ohne zu springen */
#streifen.ruck { animation: streifen-ruck .5s var(--kurve); }
@keyframes streifen-ruck { 0% { transform: none; } 30% { transform: scaleY(1.7); } 100% { transform: none; } }
/* Häutungsfolge: Riss, Schlüpfen und Entfalten treten den Streifen zurück (0,15, kein Tastenzeichen). In der Weichphase leert sich die
   Linie in Papierweiß (kalk, dunkle Unterkante) von rechts nach links: so lange bleibt das Tier verletzlich. Danach strafft sie sich kurz
   und der gelbe Fortschritt beginnt bei 0. Die Weichfüllung nutzt dieselbe Größe --f wie der gelbe Fortschritt. */
.streifen-weich { position: absolute; left: 0; right: 0; top: 2px; height: 3px; background: linear-gradient(var(--kalk) 0 2px, var(--tiefe) 2px 3px); transform-origin: left center; transform: scaleX(var(--f)); transition: transform .45s var(--kurve), opacity .5s var(--kurve); opacity: 0; }
#streifen.weichmodus .streifen-weich { opacity: 1; }
#streifen.weichmodus .streifen-fuell { opacity: 0; }
.streifen-fuell { transition: transform .45s var(--kurve), opacity .5s var(--kurve); }
#streifen.weichmodus .streifen-spitze i::after { background: var(--kalk); }
#streifen.weichmodus { opacity: .95; transition-duration: .4s; }
#streifen.leise, #streifen.leise.wach { opacity: .15; transition-duration: .6s; }
#streifen.strafft { animation: streifen-strafft .6s var(--kurve); }
@keyframes streifen-strafft { 0% { transform: scaleX(.9); opacity: .95; } 35% { transform: scaleX(1.04); } 100% { transform: none; } }
/* Voll: die Füllung atmet langsam (Deckkraft 0,7 bis 1) */
#streifen.bereit .streifen-fuell { animation: streifen-atmen 1.8s ease-in-out infinite alternate; }
@keyframes streifen-atmen { from { opacity: .7; } to { opacity: 1; } }
/* Nach der Häutung zieht sich die Linie kurz zur Mitte zusammen, die Füllung beginnt leer */
#streifen.faltet { animation: streifen-faltet .8s var(--kurve); }
@keyframes streifen-faltet { 0% { transform: none; opacity: 1; } 40% { transform: scaleX(.08); opacity: 1; } 100% { transform: none; opacity: .5; } }
/* Tastenzeichen ohne Kasten: nur die Taste im feinen Rahmen und das Wort, in der Farbe der Linie */
.streifen-hinweis { position: absolute; left: calc(100% + 14px); top: 50%; display: flex; align-items: center; gap: 7px; transform: translateY(-50%); white-space: nowrap; opacity: 0; transition: opacity .5s var(--kurve); font-size: 10px; letter-spacing: .2em; text-transform: lowercase; color: var(--tiefe); }
.streifen-hinweis kbd { font-size: 10px; line-height: 1.5; padding: 0 5px; min-width: 0; color: var(--tiefe); background: color-mix(in srgb, var(--kalk) 62%, transparent); border-color: color-mix(in srgb, var(--tiefe) 55%, transparent); }
#streifen.bereit .streifen-hinweis { opacity: 1; }
@media (max-width: 375px) { #streifen { --breite: 112px; } .streifen-hinweis { letter-spacing: .1em; gap: 4px; left: calc(100% + 8px); } }
@media (prefers-reduced-motion: reduce) {
  #streifen, #streifen .streifen-fuell, #streifen .streifen-spitze i { animation: none !important; }
  #streifen.bereit .streifen-fuell { opacity: 1; }
  #streifen .streifen-weich { transition: opacity .01s; }
}

/* ---------------------------------------------------------------- Touch-Steuerung */
/* Nur im laufenden Spiel auf Touch-Geräten (js/ui/touch.js). Die Schicht selbst fängt nichts ab; nur die Zone des Sticks und die
   Knöpfe tun es (touch-action: none), damit Stick und Knopf zusammen nicht als Zoomgeste auf dem Bild zählen. Haarfeine Ringe in Kalk
   auf einem leisen Tiefe-Grund (der Grund im Lauf ist oft hell), in Ruhe 0,45, gedrückt voll. Signal nur als kleines Dreieck am
   gedrückten Knopf. Der Rahmen hält die Ränder der Aussparungen (safe-area) ein. */
#touch { position: absolute; inset: 0; z-index: 1; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; }
.touch-rahmen { position: absolute; pointer-events: none; inset: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.touch-zone { position: absolute; left: 0; top: 20%; width: 50%; bottom: 0; pointer-events: auto; touch-action: none; }
.touch-geist { position: absolute; left: 24px; bottom: 28px; width: 112px; height: 112px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--kalk) 55%, transparent); opacity: .3; pointer-events: none; transition: opacity .6s var(--kurve); }
#touch.geuebt .touch-geist { opacity: 0; }
.touch-ring { position: absolute; left: -56px; top: -56px; width: 112px; height: 112px; border-radius: 50%; pointer-events: none; opacity: 0; will-change: transform;
  border: 1px solid color-mix(in srgb, var(--kalk) 75%, transparent); background: color-mix(in srgb, var(--tiefe) 30%, transparent); transition: opacity .15s var(--kurve); }
.touch-ring.an { opacity: .75; }
.touch-knauf { position: absolute; left: 38px; top: 38px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--kalk); background: color-mix(in srgb, var(--kalk) 40%, transparent); will-change: transform; }
.touch-knopf { position: absolute; display: grid; place-items: center; padding: 0; border-radius: 50%; pointer-events: auto; touch-action: none; cursor: default;
  color: var(--kalk); border: 1px solid color-mix(in srgb, var(--kalk) 85%, transparent); background: color-mix(in srgb, var(--tiefe) 55%, transparent);
  opacity: .45; transition: opacity .12s var(--kurve), transform .12s var(--kurve); -webkit-tap-highlight-color: transparent; }
.touch-knopf.gross::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--kalk) 35%, transparent); pointer-events: none; }
.touch-knopf:focus, .touch-knopf:focus-visible { outline: 0; }
.touch-ikon { display: block; width: 44%; height: 44%; pointer-events: none; }
.touch-ikon svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; pointer-events: none; }
.touch-oben .touch-ikon { width: 50%; height: 50%; }
.touch-knopf.an { opacity: 1; transform: scale(.94); background: color-mix(in srgb, var(--tiefe) 82%, transparent); }
.touch-knopf.an::after { content: ""; position: absolute; left: 50%; top: -5px; width: 9px; height: 8px; margin-left: -4.5px; background: var(--signal); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
/* Häutung bereit: der Eingraben-Knopf wird deutlicher (kein Gelb) */
.touch-knopf.bereit { opacity: .9; border-width: 2px; }
/* Revierstein in Stachelreichweite (zustand.zielhilfe.steinNah): der Ring des Stachelknopfs pulsiert ruhig, das Signaldreieck wie am
   gedrückten Knopf, daneben links „stein markieren“. Ohne Bewegungswunsch (prefers-reduced-motion): kein Pulsieren, nur der Akzent. */
.touch-stein { position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); padding: 2px 7px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .3s var(--kurve);
  font-size: 10px; line-height: 1.5; letter-spacing: .2em; text-transform: lowercase; color: var(--kalk); background: color-mix(in srgb, var(--tiefe) 72%, transparent); }
.touch-knopf.stein { opacity: .95; border-color: color-mix(in srgb, var(--signal) 55%, var(--kalk)); }
.touch-knopf.stein::before { border-color: color-mix(in srgb, var(--signal) 70%, var(--kalk)); animation: touch-stein 1.8s ease-in-out infinite; }
.touch-knopf.stein::after { content: ""; position: absolute; left: 50%; top: -5px; width: 9px; height: 8px; margin-left: -4.5px; background: var(--signal); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.touch-knopf.stein .touch-stein { opacity: 1; }
@keyframes touch-stein { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .touch-knopf.stein::before { animation: none; } }
/* Foto (Stille): Stick und Bogen weichen, damit ein Finger die Kamera ziehen kann; Pause, Karte und Foto bleiben */
.touch-rahmen.foto .touch-zone, .touch-rahmen.foto .touch-knopf:not(.touch-oben) { display: none; }
body[data-phase="pause"] #touch, body[data-phase="ende"] #touch { visibility: hidden; }

/* ---------------------------------------------------------------- Lage im Revier */
/* Auftakt-Ziel, laufende Nacht, Morgenblatt (js/ui/lagezeile.js): oben links, ruhig wie der Häutungsstreifen. Oben rechts liegen auf Touch Pause,
   Karte und Foto, unten Stick und Knöpfe, in der Mitte das Tier: links oben ist frei. Nichts davon fängt Berührungen ab. Kein Signalgelb. */
#lage { position: absolute; left: max(var(--rand), env(safe-area-inset-left, 0px)); top: calc(clamp(14px, 3.2vh, 30px) + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: min(24em, calc(100% - 150px)); pointer-events: none; }
body[data-phase="pause"] #lage, body[data-phase="ende"] #lage { visibility: hidden; }
.lage-zeile { padding: 3px 10px 3px 8px; font-size: 11px; line-height: 1.5; letter-spacing: .16em; text-transform: lowercase; color: var(--kalk); background: color-mix(in srgb, var(--tiefe) 78%, transparent); border-left: 1px solid color-mix(in srgb, var(--kalk) 55%, transparent); animation: blende .6s var(--kurve) both; }
.lage-auftakt { display: flex; flex-direction: column; gap: 4px; }
/* Haarlinie als Zeitbalken: der Rest bis zur ersten Nacht, von rechts nach links aufgezehrt */
.lage-zeit { display: block; width: 100%; min-width: 9em; height: 3px; border-top: 1px solid color-mix(in srgb, var(--kalk) 40%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--kalk) 40%, transparent); }
.lage-zeit i { display: block; height: 1px; margin-top: 0; background: var(--kalk); transform-origin: left center; transform: scaleX(var(--f, 1)); transition: transform .9s linear; }
.lage-kommen { color: var(--kalk); border-left-color: var(--kalk); }
.lage-morgen { padding: 8px 14px 8px 10px; background: color-mix(in srgb, var(--tiefe) 84%, transparent); border-left: 1px solid var(--kalk); animation: blende .8s var(--kurve) both; }
.lage-morgen b { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 400; letter-spacing: .34em; text-transform: lowercase; color: var(--dunst); }
.lage-morgen p { font-size: 12.5px; line-height: 1.55; letter-spacing: .06em; color: var(--kalk); }
@media (prefers-reduced-motion: reduce) { .lage-zeile, .lage-morgen { animation: none; } .lage-zeit i { transition-duration: 0s; } }
@media (max-width: 420px) { .lage-zeile { font-size: 10.5px; letter-spacing: .1em; } }
/* Erzfeind und Falter (HD-PS-A054): Zeilen wie die übrigen Lagezeilen; der Erzfeind trägt einen dunklen, der Falter einen hellen Strich */
.lage-erz { border-left-color: var(--dunst); }
.lage-falter { border-left-color: var(--kalk); }
/* HD-PS-099: Ansage für Screenreader (js/ui/lagezeile.js): im Baum, aber nicht zu sehen */
.lage-ansage { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; pointer-events: none; }
#pause .erz-pause { margin-top: 0; margin-bottom: 12px; color: var(--dunst); }

/* ---------------------------------------------------------------- Foto: bild speichern */
#fotoknopf { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(clamp(18px, 4vh, 40px) + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
#fotoknopf .foto-knopf { pointer-events: auto; min-height: 44px; padding: 0 22px; white-space: nowrap; background: color-mix(in srgb, var(--tiefe) 72%, transparent); }
.foto-status { font-size: 11px; letter-spacing: .14em; text-transform: lowercase; color: var(--kalk); padding: 2px 8px; background: color-mix(in srgb, var(--tiefe) 78%, transparent); }
.foto-status:empty { display: none; }
body[data-phase="pause"] #fotoknopf { visibility: hidden; }
