/* MindCraft – das Spiel. Alles in Pixelschrift. Baut auf den Farben aus site.css auf.
   Gestaltungsregeln: drei Schriftgrößen (12, 10, 8), eine Art Fläche (dunkel mit heller Linie),
   Gold nur für das, was man jetzt tun soll. Im Kampf steht so wenig wie möglich. */
.seite-spiel { background: var(--ink); }
.spielbereich { background: var(--ink); border-bottom: var(--line) solid var(--ink); }
.spiel { position: relative; width: min(100%, 1040px); margin-inline: auto; color: var(--cream); min-height: 70vh; --gruen: #7CE38B; --hell: #FF8A98; --flaeche: #2A1560;
  font-family: var(--font-pixel); font-size: 10px; line-height: 1.7; font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; -webkit-font-smoothing: none; }
.spiel[data-szene="kampf"] { width: min(100%, 940px, (100vh - 176px) * 1.78); min-width: min(100%, 560px); }
.spiel button, .spiel a.sp-knopf { font-family: inherit; font-variant-ligatures: none; }
.spiel__laedt { display: grid; place-items: center; align-content: center; gap: 16px; min-height: 60vh; text-transform: uppercase; }
.spiel__laedt img { width: 52px; height: auto; animation: sp-atmen 1s steps(2) infinite; }
.spiel img { max-width: none; }
.spiel .px { flex: none; }
.spiel p { max-width: none; }
.spiel h3 { font-family: inherit; font-size: 12px; line-height: 1.6; font-weight: 400; text-transform: uppercase; margin: 0 0 10px; }
.spiel h4 { font-family: inherit; font-size: 8px; line-height: 1.6; font-weight: 400; text-transform: uppercase; color: var(--gold); margin: 18px 0 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spiel .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- Icons aus icons.png (16 x 16, pixelgenau vergrößert) ---------- */
.sp-ic { display: inline-block; flex: none; width: var(--g, 32px); height: var(--g, 32px); background: url("../spiel/icons.png") calc(var(--i) * var(--g, 32px) * -1) 0 / auto var(--g, 32px) no-repeat; image-rendering: pixelated; vertical-align: middle; }
.sp-slot { display: grid; place-items: center; flex: none; width: 40px; height: 40px; background: var(--cream); border: 3px solid var(--ink); box-shadow: inset -3px -3px 0 rgba(22, 11, 46, .16); }
.sp-slot img { width: 26px; height: auto; }
.sp-slot--klein { width: 30px; height: 30px; border-width: 2px; }
.sp-slot--gross { width: 64px; height: 64px; }

/* ---------- Kleine Teile ---------- */
.sp-pixel { font-size: 8px; text-transform: uppercase; margin: 0 0 6px; }
.sp-gold { color: var(--gold); }
.sp-klein { font-size: 8px; line-height: 1.8; margin: 10px 0 0; }
.sp-klein a { color: var(--gold); text-underline-offset: 3px; }
.sp-zeile { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; justify-content: inherit; font-size: 8px; text-transform: uppercase; margin: 6px 0 0; }
.sp-dialog--mitte .sp-zeile { justify-content: center; }
.sp-etikett { display: inline-block; font-size: 8px; line-height: 1.5; text-transform: uppercase; background: var(--gold); color: var(--ink); padding: 3px 6px; vertical-align: middle; margin: 0; }
.sp-tag { display: inline-block; font-size: 8px; line-height: 1.4; text-transform: uppercase; color: var(--ink); background: var(--farbe, var(--cream)); padding: 2px 6px; white-space: nowrap; box-shadow: 2px 2px 0 var(--ink); }
.sp-muenzen { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-size: 12px; margin: 0; }
.sp-muenzen b { font-weight: 400; }

.sp-knopf { display: block; width: 100%; text-align: center; text-decoration: none; font-size: 10px; line-height: 1.6; text-transform: uppercase; color: var(--cream); background: var(--flaeche); border: 3px solid var(--cream); box-shadow: 0 4px 0 var(--ink); padding: 13px 12px; cursor: pointer; position: relative; }
.sp-knopf small { display: block; font-size: 8px; line-height: 1.7; text-transform: none; margin-top: 4px; opacity: .9; }
.sp-knopf:hover:not(:disabled), .sp-knopf:focus-visible { background: var(--violet); transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); outline: none; }
.sp-knopf:focus-visible { box-shadow: 0 0 0 3px var(--gold); }
.sp-knopf--gold { background: var(--gold); color: var(--ink); border-color: var(--ink); box-shadow: 0 4px 0 var(--violet); }
.sp-knopf--gold:hover:not(:disabled), .sp-knopf--gold:focus-visible { background: var(--cream); color: var(--ink); }
.sp-knopf--gold:focus-visible { box-shadow: 0 0 0 3px var(--cream), 0 0 0 6px var(--violet); }
.sp-knopf--still { background: transparent; border-color: rgba(255, 246, 221, .65); box-shadow: none; }
.sp-knopf--rot { background: var(--red); border-color: var(--ink); }
.sp-knopf--links { text-align: left; text-transform: none; }
.sp-knopf:disabled { opacity: .4; cursor: default; }
.sp-knopf[aria-pressed="false"], .sp-mini[aria-pressed="false"] { opacity: .7; border-style: dashed; }
.sp-mini { font-size: 8px; line-height: 1.5; text-transform: uppercase; color: var(--cream); background: transparent; border: 2px solid rgba(255, 246, 221, .7); padding: 7px 9px; cursor: pointer; white-space: nowrap; }
.sp-mini:hover, .sp-mini:focus-visible { background: var(--violet); border-color: var(--cream); outline: none; }
.sp-mini:focus-visible { box-shadow: 0 0 0 3px var(--gold); }
.sp-mini--neu { background: var(--gold); color: var(--ink); border-color: var(--gold); white-space: normal; }
.sp-reihe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.sp-reihe .sp-knopf { width: auto; flex: 1 1 120px; }
.sp-reihe--klein { margin-top: 10px; }
.sp-liste, .sp-wahl { display: grid; gap: 10px; }
.sp-hinweis { margin: 0; text-align: center; }

/* ---------- Balken ---------- */
.sp-balken { position: relative; display: block; flex: 1; height: 12px; background: var(--ink); border: 2px solid var(--cream); overflow: hidden; }
/* Schadensspur: Das verlorene Stück bleibt kurz hell stehen und läuft dann nach. So sieht man den Schaden auch am Balken. */
.sp-balken u { position: absolute; left: 0; top: 0; height: 100%; background: #FFF6DD; transition: width .5s linear .45s; }
.sp-balken i { position: relative; }
.sp-balken i { display: block; height: 100%; background: var(--gold); transition: width .35s steps(10); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22); }
.sp-balken--hp i { background: #E43B44; }
.sp-balken--mp i { background: var(--pink); }
.sp-balken--gegner i { background: var(--orange); }
.sp-balken--xp i { transition: width .8s linear; }
.sp-balken.ist-knapp { animation: sp-knapp .5s steps(2) infinite; }

/* ---------- Held (Figur mit Aura und Weltensteinen) ---------- */
.sp-held { position: relative; display: inline-block; height: 100%; line-height: 0; }
.sp-held img { height: 100%; width: auto; display: block; }
.sp-held--grau img { filter: grayscale(1) brightness(.82); }
.sp-held[data-aura="1"] img { filter: drop-shadow(0 0 3px rgba(31, 95, 224, .95)); }
.sp-held[data-aura="2"] img { filter: drop-shadow(0 0 5px rgba(31, 95, 224, .95)) drop-shadow(0 0 2px #fff); }
.sp-held[data-aura="3"] img { filter: drop-shadow(0 0 6px rgba(255, 203, 46, .9)); }
.sp-held[data-aura="4"] img { filter: drop-shadow(0 0 8px rgba(255, 203, 46, .95)) drop-shadow(0 0 2px #fff); }
.sp-held[data-aura="5"] img { filter: drop-shadow(0 0 9px rgba(215, 38, 61, .95)) drop-shadow(0 0 3px #FFCB2E); }
.sp-held[data-aura="6"] img { filter: drop-shadow(0 0 10px rgba(240, 107, 168, .95)) drop-shadow(0 0 3px #fff); }
.sp-held[data-aura="7"] img { filter: drop-shadow(0 0 12px rgba(240, 107, 168, 1)) drop-shadow(0 0 4px #FFCB2E); }
.sp-held[data-aura="8"] img { filter: drop-shadow(0 0 13px rgba(247, 147, 30, 1)) drop-shadow(0 0 5px #fff); }
.sp-held[data-aura="9"] img { filter: drop-shadow(0 0 16px #FFCB2E) drop-shadow(0 0 7px #fff) drop-shadow(0 0 2px #FFCB2E); }
.sp-steine { position: absolute; left: 50%; top: -9%; transform: translateX(-50%); display: flex; gap: 7px; z-index: 1; }
.sp-steine i { width: 10px; height: 10px; background: var(--farbe); border: 2px solid var(--cream); transform: rotate(45deg); box-shadow: 0 0 6px var(--farbe); animation: sp-stein 1.6s steps(4) infinite; animation-delay: calc(var(--i) * -.3s); }
.sp-strip { display: block; height: 100%; background-repeat: no-repeat; image-rendering: pixelated; animation: sp-streifen .9s infinite; }

/* ---------- Titel und Ende ---------- */
.sp-titel { background-size: cover; background-position: center; image-rendering: pixelated; position: relative; min-height: min(86vh, 720px); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 28px 14px 36px; }
.sp-titel::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(22, 11, 46, .78), rgba(31, 13, 71, .55) 45%, rgba(22, 11, 46, .92)); }
.sp-titel__inhalt { position: relative; width: min(100%, 420px); display: grid; gap: 18px; justify-items: center; text-align: center; }
.sp-titel__inhalt > * { min-width: 0; max-width: 100%; }
.sp-titel__marke { font-size: 10px; text-transform: uppercase; margin: 0; }
/* Titel richtet sich nach der Breite des Spielfensters, nicht des Browsers: bleibt immer einzeilig. */
.sp-titel { container-type: inline-size; }
.sp-titel__name { font-family: inherit; font-size: clamp(20px, 8vw, 52px); font-size: clamp(20px, 9cqi, 52px); line-height: 1.5; font-weight: 400; text-transform: uppercase; color: var(--gold); margin: 0; white-space: nowrap; text-shadow: 3px 3px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink), 5px 5px 0 var(--ink); }
.sp-titel__satz { font-size: 10px; line-height: 1.9; margin: 0; }
.sp-titel__unter { font-size: clamp(9px, 2.6vw, 12px); line-height: 1.7; text-transform: uppercase; margin: -8px 0 0; text-shadow: 2px 2px 0 var(--ink); }
.sp-titel__buehne { display: flex; align-items: flex-end; justify-content: center; gap: clamp(14px, 8vw, 70px); height: clamp(130px, 26vh, 200px); width: 100%; min-width: 0; }
.sp-titel__buehne img { max-width: 44%; object-fit: contain; object-position: bottom; }
.sp-titel__held { height: 100%; width: auto; animation: sp-atmen 1.2s steps(2) infinite; filter: drop-shadow(5px 5px 0 rgba(22, 11, 46, .6)); }
.sp-titel__gegner { height: 82%; width: auto; animation: sp-atmen 1s steps(2) infinite reverse; filter: drop-shadow(5px 5px 0 rgba(22, 11, 46, .6)); }
.sp-titel .sp-wahl { width: 100%; }
.sp-titel .sp-knopf { font-size: 12px; padding: 16px 12px; }
.sp-wahl__klein { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
.sp-ende__figur { height: clamp(160px, 30vh, 230px); margin-top: 10px; }

/* ---------- Karte: oben Level und Münzen, links der Weg, rechts (am Handy unten) die Ziele ---------- */
.sp-kartenszene { display: grid; grid-template-columns: minmax(0, 500px) minmax(0, 1fr); grid-template-areas: "kopf kopf" "karte dock"; gap: 14px 22px; padding: 14px; align-items: start; }
.sp-kopf { grid-area: kopf; display: flex; align-items: center; gap: 12px; background: var(--night); border: 3px solid var(--cream); padding: 8px 12px; }
.sp-kopf > img { width: 40px; height: 40px; border: 2px solid var(--ink); background: var(--gold); }
.sp-kopf__lv { flex: 1; max-width: 300px; display: grid; gap: 6px; }
.sp-kopf__lv b { font-weight: 400; font-size: 10px; text-transform: uppercase; line-height: 1; }
.sp-kopf .sp-muenzen { margin-left: auto; }
.sp-karte { grid-area: karte; max-height: calc(100vh - 110px); overflow: auto; border: 4px solid var(--cream); box-shadow: 0 0 0 4px var(--ink), 8px 8px 0 var(--violet); scrollbar-width: thin; }
.sp-karte__bild { position: relative; line-height: 0; }
.sp-karte__bild > img { width: 100%; height: auto; display: block; }
.sp-dock { grid-area: dock; display: grid; gap: 16px; align-content: start; position: sticky; top: 12px; }
.sp-dock__held { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; background: var(--night); border: 3px solid var(--cream); padding: 22px 18px 14px; }
.sp-dock__held .sp-held { height: 150px; }
.sp-dock__held p { margin: 0; display: grid; gap: 8px; text-transform: uppercase; }
.sp-dock__held b { font-weight: 400; font-size: 12px; }
/* Tagesquest: eine schmale Zeile über dem Weiter-Knopf */
.sp-tq { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; background: var(--night); color: var(--cream); border: 3px solid var(--gold); cursor: pointer; text-transform: uppercase; text-align: left; }
.sp-tq .px { width: 22px; height: 22px; color: var(--gold); flex: none; }
.sp-tq b { font-weight: 400; font-size: 11px; flex: 1; }
.sp-tq small { font-size: 9px; color: var(--gold); white-space: nowrap; }
.sp-tq:hover, .sp-tq:focus-visible { background: #3B1F86; outline: none; }
.sp-tq.ist-fertig { border-color: rgba(255, 246, 221, .45); }
.sp-tq.ist-fertig .px, .sp-tq.ist-fertig small { color: var(--gruen); }
.sp-serie { display: inline-block; margin: 10px 0 0 !important; font-size: 10px; text-transform: uppercase; color: var(--gold); }
.sp-teilbild { display: block; width: auto; max-width: 100%; height: auto; max-height: min(58vh, 520px); margin: 12px auto 4px; border: 3px solid var(--cream); image-rendering: auto; }
.sp-dialog--karte a.sp-knopf { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.sp-char__kopf .sp-mini { margin-top: 10px; }
.sp-code { display: flex; gap: 8px; margin: 14px 0 4px; }
.sp-code__feld { flex: 1; min-width: 0; font: inherit; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; text-align: center; padding: 12px 8px; background: var(--ink); color: var(--gold); border: 3px solid var(--cream); }
.sp-code__feld:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.sp-code .sp-knopf { width: auto; flex: none; }
.sp-weiter { font-size: 14px; padding: 18px 12px; }
.sp-weiter small { font-size: 9px; text-transform: uppercase; }
.sp-ziele { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sp-ziel { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 12px; background: var(--flaeche); border: 3px solid var(--cream); box-shadow: 0 4px 0 var(--ink); color: var(--cream); font-size: 10px; line-height: 1.4; text-transform: uppercase; cursor: pointer; }
.sp-ziel b { font-weight: 400; }
.sp-ziel:hover, .sp-ziel:focus-visible { background: var(--violet); outline: none; transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.sp-ziel:focus-visible { box-shadow: 0 0 0 3px var(--gold); }
.sp-ziel.ist-neu { border-color: var(--gold); }
.sp-marke-neu { position: absolute; top: -9px; right: -7px; font-style: normal; font-size: 9px; line-height: 1.4; background: var(--gold); color: var(--ink); border: 2px solid var(--ink); padding: 2px 6px; animation: sp-huepf .8s steps(2) infinite; }
.sp-striche { display: block; width: 20px; height: 4px; background: var(--ink); box-shadow: 0 -7px 0 var(--ink), 0 7px 0 var(--ink); }
.sp-knoten { position: absolute; transform: translate(-50%, -50%); width: max(34px, 7.4%); aspect-ratio: 1; padding: 0; display: grid; place-items: center; font-family: inherit; font-size: clamp(9px, 2.2vw, 12px); color: var(--ink); background: var(--cream); border: 4px solid var(--ink); box-shadow: 3px 3px 0 rgba(22, 11, 46, .55); cursor: pointer; z-index: 2; line-height: 1; }
.sp-knoten span { display: grid; place-items: center; }
.sp-knoten .px { width: 62%; height: auto; }
.sp-knoten.ist-offen { background: var(--gold); animation: sp-puls 1s steps(2) infinite; z-index: 3; }
.sp-knoten.ist-fertig { background: var(--farbe); color: var(--ink); }
.sp-knoten.ist-zu { background: rgba(31, 13, 71, .82); color: rgba(255, 246, 221, .7); cursor: default; box-shadow: none; border-width: 3px; width: max(24px, 5.2%); font-size: clamp(7px, 1.6vw, 9px); }
.sp-knoten.ist-zu.ist-boss { width: max(28px, 6.2%); }
.sp-knoten.ist-boss { width: max(42px, 9.4%); }
.sp-knoten--neben { transform: translate(-50%, -50%) rotate(45deg); width: max(30px, 6.4%); }
.sp-knoten--neben span { transform: rotate(-45deg); }
.sp-knoten:hover:not(:disabled), .sp-knoten:focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }
.sp-zeiger { position: absolute; transform: translate(-50%, -260%); z-index: 5; pointer-events: none; line-height: 0; animation: sp-zeiger .7s steps(2) infinite; }
.sp-marke { position: absolute; width: 8.5%; transform: translate(-50%, -112%); z-index: 4; pointer-events: none; line-height: 0; filter: drop-shadow(3px 3px 0 rgba(22, 11, 46, .5)); }
.sp-marke img { width: 100%; height: auto; animation: sp-atmen .9s steps(2) infinite; }
.sp-deko { position: absolute; transform: translate(-50%, -50%); background-repeat: no-repeat; image-rendering: pixelated; pointer-events: none; z-index: 1; animation: sp-streifen 1s infinite; }
.sp-vogel { width: 3.6%; aspect-ratio: 1; top: 9%; left: 0; background-size: 400% 100%; animation: sp-streifen .5s steps(4, jump-none) infinite, sp-flug 30s linear infinite; }
.sp-vogel--2 { top: 14%; animation-delay: 0s, -13s; animation-duration: .45s, 38s; }
@media (max-width: 859px) {
  .sp-kartenszene { grid-template-columns: minmax(0, 1fr); grid-template-areas: "kopf" "karte" "dock"; gap: 10px; padding: 10px 10px 0; }
  .sp-karte { max-height: none; overflow: visible; max-width: 520px; width: 100%; margin-inline: auto; box-shadow: 0 0 0 4px var(--ink); }
  .sp-dock { position: sticky; top: auto; bottom: 0; z-index: 6; gap: 10px; background: var(--ink); padding: 10px 0 10px; margin-inline: -10px; padding-inline: 10px; border-top: 3px solid var(--cream); }
  .sp-dock__held { display: none; }
  .sp-weiter { font-size: 12px; padding: 12px; }
  .sp-tq { min-height: 44px; padding: 6px 12px; border-width: 2px; }
  .sp-tq b { font-size: 10px; }
  .sp-ziele { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .sp-ziel { font-size: 7px; padding: 8px 2px 7px; gap: 5px; }
  .sp-ziel .sp-slot { width: 34px; height: 34px; }
  .sp-ziel .sp-ic { --g: 24px; }
}

/* ---------- Kampf: Bühne ---------- */
.sp-kampf { display: grid; }
.sp-buehne { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink); border: 3px solid var(--ink); }
.sp-welt { position: absolute; inset: -14px; background: center 70% / cover no-repeat; image-rendering: pixelated; will-change: transform; }
.sp-welt::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(22, 11, 46, .5), rgba(22, 11, 46, 0) 38%, rgba(22, 11, 46, .28)); pointer-events: none; }
.sp-seite { position: absolute; bottom: calc(7% + 14px); height: 47%; display: flex; align-items: flex-end; }
.sp-seite--held { left: calc(6% + 14px); animation: sp-rein-links .4s steps(6); }
.sp-seite--gegner { right: calc(9% + 14px); height: 43%; animation: sp-rein-rechts .4s steps(6); }
.sp-seite--gegner.ist-boss { height: 54%; right: calc(6% + 14px); }
.sp-kaempfer { height: 100%; animation: sp-atmen 1.1s steps(2) infinite; transform-origin: 50% 100%; }
.sp-seite--gegner > img.sp-kaempfer { width: auto; filter: drop-shadow(4px 4px 0 rgba(22, 11, 46, .45)); }
.sp-seite--gegner .sp-strip { animation: sp-streifen .9s infinite; height: 100%; width: auto; }
.sp-seite--held .sp-held { filter: drop-shadow(4px 4px 0 rgba(22, 11, 46, .45)); }
.sp-gefaehrte { height: 50%; width: auto; margin-right: -7%; animation: sp-atmen 1.3s steps(2) infinite; filter: drop-shadow(3px 3px 0 rgba(22, 11, 46, .45)); }
.sp-gefaehrte--1 { animation-delay: -.4s; height: 54%; }
.sp-gefaehrte--2 { animation-delay: -.8s; }
.sp-gefaehrte.ist-dran { animation: sp-sprung .5s steps(4); }
.sp-fx { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; z-index: 4; }
/* Schadenszahlen liegen über allem im Kampfbild, auch über den Statuskästen (die haben z-index 6). */
.sp-zahlen { position: absolute; inset: 0; pointer-events: none; z-index: 9; }
.sp-blitz { position: absolute; inset: 0; opacity: 0; pointer-events: none; z-index: 7; }
.sp-banner { position: absolute; left: 0; right: 0; top: 40%; margin: 0; text-align: center; font-size: clamp(18px, 6vw, 34px); text-transform: uppercase; color: var(--gold); text-shadow: 4px 4px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink); opacity: 0; pointer-events: none; z-index: 8; }
.sp-banner.ist-an { animation: sp-banner 1.1s steps(12) forwards; }
.sp-buehne.ist-stopp * { animation-play-state: paused !important; }

/* Die zwei Felder: links du, rechts der Gegner. Mehr steht nicht auf der Bühne. */
.sp-box { position: absolute; top: 10px; width: min(43%, 250px); background: rgba(22, 11, 46, .93); border: 3px solid var(--cream); box-shadow: 4px 4px 0 var(--ink); padding: 8px 10px 6px; z-index: 6; }
.sp-box--held { left: 10px; }
.sp-box--gegner { right: 10px; }
.sp-box__name { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 9px; line-height: 1.3; text-transform: uppercase; }
.sp-box__name b { font-weight: 400; overflow-wrap: anywhere; }
.sp-box__name span { color: var(--gold); white-space: nowrap; }
.sp-leiste { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; }
.sp-leiste .px { width: 14px; height: 14px; }
.sp-leiste[title="HP"] .px { color: #E43B44; }
.sp-leiste[title="Mana"] .px, .sp-kosten .px { color: var(--pink); }
.sp-leiste em { font-style: normal; font-size: 8px; min-width: 3ch; text-align: right; line-height: 1; }
.sp-box__fuss { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin: 4px 0 0; }
.sp-info { display: inline-flex; gap: 6px; align-items: center; background: transparent; border: 0; padding: 2px 0; color: var(--cream); font-size: 7px; line-height: 1.4; text-transform: uppercase; cursor: pointer; }
.sp-zustaende { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 0; min-height: 0; }
.sp-chip { display: inline-flex; align-items: center; gap: 2px; font-size: 8px; line-height: 1; padding: 1px 4px 1px 1px; background: var(--ink); border: 2px solid var(--cream); color: var(--cream); cursor: pointer; }
.sp-chip.ist-gut { border-color: var(--gruen); color: var(--gruen); }
.sp-chip.ist-schlecht { border-color: var(--hell); color: var(--hell); }
.sp-chip:focus-visible, .sp-info:focus-visible, .sp-absicht:focus-visible, .sp-pause:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* Was der Gegner gleich tut: Sprechblase über seinem Kopf */
.sp-absicht { position: absolute; bottom: 104%; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; background: var(--cream); color: var(--ink); border: 3px solid var(--ink); box-shadow: 3px 3px 0 rgba(22, 11, 46, .5); padding: 2px 8px 2px 4px; font-size: 10px; line-height: 1; white-space: nowrap; cursor: pointer; z-index: 3; }
.sp-absicht b { font-weight: 400; }
.sp-absicht b:empty { display: none; }
.sp-absicht::after { content: ""; position: absolute; left: 50%; top: 100%; width: 8px; height: 8px; margin-left: -4px; background: inherit; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: translateY(-3px) rotate(45deg); }
.sp-absicht.ist-gefahr { background: var(--red); color: #fff; animation: sp-gefahr .5s steps(2) infinite; }
.sp-absicht.ist-ruhig { background: var(--gruen); }
.sp-pause { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); width: 30px; height: 30px; display: flex; gap: 5px; align-items: center; justify-content: center; background: rgba(22, 11, 46, .85); border: 2px solid rgba(255, 246, 221, .7); cursor: pointer; z-index: 6; }
.sp-pause i { width: 4px; height: 12px; background: var(--cream); }

/* Bewegung der Figuren */
.sp-seite--held .sp-kaempfer.ist-vor { animation: sp-vor .2s steps(5); }
.sp-seite--gegner .sp-kaempfer.ist-vor { animation: sp-vor-links .22s steps(5); }
.sp-buehne:not([data-stufe="0"]) .sp-seite--held .sp-kaempfer.ist-vor { animation-name: sp-vor-spur; }
.sp-kaempfer.ist-getroffen:not(.sp-strip) { animation: sp-blink .26s steps(1); }
.sp-kaempfer.ist-gestaucht:not(.sp-strip) { animation: sp-stauch .26s cubic-bezier(.34, 1.56, .64, 1); }
.sp-kaempfer.ist-getroffen.ist-gestaucht:not(.sp-strip) { animation: sp-blink .26s steps(1), sp-stauch .26s cubic-bezier(.34, 1.56, .64, 1); }
/* Rückstoß: schnell nach hinten, weich zurück. Als Übergang, damit die Einlauf-Animation nicht neu startet. */
.sp-seite { transition: transform .24s cubic-bezier(.2, .8, .3, 1); }
.sp-seite.ist-zurueck, .sp-seite.ist-zurueck-stark { transition-duration: .05s; }
.sp-seite--gegner.ist-zurueck { transform: translateX(5%); }
.sp-seite--gegner.ist-zurueck-stark { transform: translateX(13%); }
.sp-seite--held.ist-zurueck { transform: translateX(-5%); }
.sp-seite--held.ist-zurueck-stark { transform: translateX(-13%); }
.sp-kaempfer.ist-besiegt { animation: sp-weg .7s steps(8) forwards; }
/* Schadenszahlen: je wichtiger, desto größer */
.sp-zahl { position: absolute; top: 34%; font-size: clamp(13px, 3vw, 20px); line-height: 1; color: #fff; white-space: nowrap; text-shadow: 2px 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink); animation: sp-zahl 1.1s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.sp-zahl.ist-mittig { translate: -50% 0; }      /* Ort kommt aus dem Skript: Mitte der getroffenen Figur */
.sp-zahl--gegner { right: calc(33% + var(--dx, 0px)); }
.sp-zahl--held { left: calc(30% + var(--dx, 0px)); }
.sp-zahl.ist-mittel { font-size: clamp(16px, 3.8vw, 26px); }
.sp-zahl.ist-effektiv { font-size: clamp(22px, 5.4vw, 38px); color: var(--gold); }
.sp-zahl.ist-krit { font-size: clamp(24px, 6vw, 42px); color: #fff; text-shadow: 3px 3px 0 var(--red), -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink); }
.sp-zahl.ist-stempel { top: 20%; font-size: clamp(14px, 3.4vw, 22px); color: var(--ink); background: var(--gold); border: 3px solid var(--ink); padding: 4px 6px; text-shadow: none; animation: sp-stempel .9s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.sp-zahl.ist-schlecht { color: #fff; font-size: clamp(17px, 3.8vw, 26px); text-shadow: 3px 3px 0 var(--red), -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink); }
.sp-zahl.ist-gut { color: var(--gruen); }
.sp-zahl.ist-mana { color: var(--pink); font-size: clamp(10px, 2.4vw, 14px); top: 44%; }

/* ---------- Kampf: Textzeile und Menü ---------- */
.sp-pult { display: grid; gap: 10px; background: var(--night); border: 3px solid var(--ink); border-top: 0; padding: 10px; }
.sp-log { display: flex; align-items: center; gap: 10px; min-height: 52px; margin: 0; padding: 8px 12px; background: var(--ink); border: 3px solid var(--cream); font-size: 10px; line-height: 1.7; }
.sp-log.ist-masko { border-color: var(--gold); color: var(--gold); }
.sp-log img { width: 32px; height: 32px; flex: none; border: 2px solid var(--ink); background: var(--gold); }
.sp-menue { display: grid; gap: 8px; }
.sp-menue__haupt { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sp-akt { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; padding: 6px; font-size: 10px; line-height: 1.3; text-transform: uppercase; color: var(--cream); background: var(--flaeche); border: 3px solid var(--cream); box-shadow: 0 4px 0 var(--ink); cursor: pointer; }
.sp-akt b { font-weight: 400; }
.sp-akt--gold { background: var(--gold); color: var(--ink); border-color: var(--ink); box-shadow: 0 4px 0 var(--violet); }
.sp-akt:hover:not(:disabled), .sp-akt:focus-visible { background: var(--violet); color: var(--cream); outline: none; transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.sp-akt:focus-visible { box-shadow: 0 0 0 3px var(--gold); }
.sp-akt:disabled { opacity: .3; cursor: default; }
.sp-akt.ist-tipp { animation: sp-puls .8s steps(2) infinite; }
.sp-menue__wahl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 8px; padding-top: 6px; }
.sp-zurueck { justify-self: start; font-family: inherit; font-size: 8px; text-transform: uppercase; color: var(--cream); background: transparent; border: 2px solid rgba(255, 246, 221, .7); padding: 8px 12px; cursor: pointer; }
.sp-zurueck:hover, .sp-zurueck:focus-visible { background: var(--violet); outline: none; }
/* Eine Methode: Symbol, Name, drei Wörter, Kosten. Links die Farbe ihres Typs. */
.sp-meth { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; text-align: left; min-height: 58px; padding: 6px 8px; font-family: inherit; color: var(--cream); background: var(--flaeche); border: 3px solid var(--cream); border-left: 9px solid var(--farbe, var(--cream)); box-shadow: 0 4px 0 var(--ink); }
button.sp-meth { cursor: pointer; }
.sp-meth__text { display: grid; gap: 4px; min-width: 0; }
.sp-meth b { font-weight: 400; font-size: 9px; line-height: 1.4; text-transform: uppercase; overflow-wrap: break-word; }
.sp-meth small { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px; font-size: 7px; line-height: 1.5; }
.sp-meth small > span:last-child { opacity: .9; }
.sp-meth small .sp-tag { font-size: 7px; padding: 1px 4px; box-shadow: none; }
.sp-kosten { display: inline-flex; align-items: center; gap: 2px; font-style: normal; font-size: 9px; color: var(--pink); white-space: nowrap; }
.sp-kosten--zahl { color: var(--gold); }
.sp-kosten .px { width: 12px; height: 12px; }
button.sp-meth:hover:not(:disabled), button.sp-meth:focus-visible { background: var(--violet); outline: none; }
button.sp-meth:focus-visible { box-shadow: 0 0 0 3px var(--gold); }
button.sp-meth:disabled { opacity: .35; cursor: default; }
.sp-meth.ist-effektiv { border-color: var(--gold); border-left-color: var(--farbe); background: #3B1F86; animation: sp-puls .9s steps(2) infinite; }
.sp-mal { position: absolute; top: -11px; right: -6px; font-style: normal; font-size: 9px; line-height: 1.3; background: var(--gold); color: var(--ink); border: 2px solid var(--ink); padding: 2px 5px; transform: rotate(6deg); }
.sp-gefbild { width: 40px; height: 40px; object-fit: contain; object-position: bottom; }
@media (max-width: 720px) {
  .spiel[data-szene="kampf"] { min-width: 0; }
  .sp-buehne { aspect-ratio: 4 / 3; }
  .sp-box { top: 6px; padding: 6px 7px 4px; width: 46%; border-width: 2px; }
  .sp-box--held { left: 6px; } .sp-box--gegner { right: 6px; }
  .sp-box__name { font-size: 8px; margin-bottom: 5px; }
  .sp-balken { height: 10px; }
  /* Handy: Das Kampfbild ist niedrig. Zahlen starten tiefer und steigen kürzer, damit sie frei zwischen Kasten und Figur stehen. */
  .sp-zahl { --hub: -30px; font-size: 17px; }
  .sp-zahl.ist-mittel, .sp-zahl.ist-schlecht { font-size: 21px; }
  .sp-zahl.ist-effektiv { font-size: 27px; }
  .sp-zahl.ist-krit { font-size: 29px; }
  .sp-zahl.ist-stempel { font-size: 13px; }
  .sp-zahl.ist-mana { font-size: 12px; }
  .sp-pause { top: auto; bottom: 6px; left: auto; right: 6px; transform: none; }
  .sp-seite--held { left: calc(3% + 14px); } .sp-seite--gegner { right: calc(5% + 14px); }
  .sp-seite { height: 44%; } .sp-seite--gegner { height: 40%; } .sp-seite--gegner.ist-boss { height: 48%; }
  .sp-pult { padding: 8px; gap: 8px; }
  .sp-log { font-size: 9px; min-height: 50px; padding: 6px 10px; }
  .sp-menue__haupt, .sp-menue__wahl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-akt { min-height: 54px; }
  .sp-meth { gap: 8px; padding: 6px; }
  .sp-meth b { font-size: 8px; }
  .sp-meth .sp-slot { width: 36px; height: 36px; }
}

/* ---------- Fenster ---------- */
.sp-dialog { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 12px; background: rgba(12, 6, 28, .84); overflow: auto; }
.sp-dialog--unten { align-items: end; padding-bottom: 28px; }
.sp-dialog__fenster { width: min(100%, 420px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto; background: var(--night); border: 4px solid var(--cream); box-shadow: 0 0 0 4px var(--ink), 10px 10px 0 var(--ink); padding: 18px; animation: sp-auf .14s steps(3); scrollbar-width: thin; }
.sp-dialog--gross .sp-dialog__fenster { width: min(100%, 520px); }
.sp-dialog--mitte .sp-dialog__fenster { text-align: center; }
.sp-dialog__fenster > p { margin: 0 0 8px; }
.sp-masko { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; text-align: left; margin: 10px 0; }
.sp-masko img { width: 56px; height: 56px; border: 3px solid var(--ink); background: var(--gold); }
.sp-masko p { margin: 0; font-size: 10px; line-height: 1.8; }
.sp-masko b { display: block; font-weight: 400; font-size: 8px; text-transform: uppercase; color: var(--gold); }
.sp-quest { text-align: left; background: var(--ink); border: 3px solid var(--gold); padding: 10px 12px; margin: 12px 0 0; }
.sp-quest b { display: block; font-weight: 400; font-size: 8px; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.sp-quest p { margin: 0; font-size: 10px; line-height: 1.8; }
.sp-neues { text-align: left; margin: 14px 0 0; display: grid; gap: 8px; justify-items: start; }
.sp-neues .sp-meth { box-shadow: none; }
.sp-gegnerkarte { height: clamp(110px, 22vh, 160px); display: flex; align-items: center; justify-content: center; margin: 4px 0 12px; background: radial-gradient(circle, rgba(215, 38, 61, .34), transparent 66%); }
.sp-gegnerkarte.ist-boss { height: clamp(130px, 26vh, 190px); }
.sp-gegnerkarte > img { height: 100%; width: auto; animation: sp-atmen 1s steps(2) infinite; }
.sp-gegnerkarte > .sp-strip { height: 100%; width: auto; }
/* Sieg */
.sp-sieg { font-size: clamp(22px, 8vw, 34px); line-height: 1.2; text-transform: uppercase; color: var(--gold); margin: 0 0 4px !important; text-shadow: 4px 4px 0 var(--ink), 6px 6px 0 var(--violet); animation: sp-stempel .5s cubic-bezier(.34, 1.56, .64, 1); }
.sp-sieg--aus { color: var(--hell); text-shadow: 4px 4px 0 var(--ink); }
.sp-wandel { position: relative; height: clamp(140px, 26vh, 190px); margin: 6px 0; background: radial-gradient(circle, rgba(255, 203, 46, .36), transparent 64%); overflow: hidden; }
.sp-wandel > div { position: absolute; left: 0; right: 0; top: 16%; height: 72%; display: flex; justify-content: center; }
.sp-wandel__alt { animation: sp-alt 1.5s steps(12) forwards; }
.sp-wandel__neu { opacity: 0; animation: sp-neu 1.5s steps(12) forwards; }
.sp-wandel--fertig .sp-wandel__neu { animation: none; opacity: 1; }
.sp-neutitel { font-size: 12px; text-transform: uppercase; color: var(--gold); margin: 0 0 10px !important; }
.sp-xp { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; margin: 10px 0 8px; }
.sp-xp b { font-weight: 400; font-size: 10px; text-transform: uppercase; }
.sp-xp .sp-balken { height: 16px; }
.sp-beute { display: flex; justify-content: center; align-items: center; gap: 22px; font-size: 12px; margin: 0 !important; }
.sp-levelup { display: inline-block; font-size: 10px; text-transform: uppercase; background: var(--gold); color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--violet); padding: 6px 10px; margin: 12px 0 0 !important; animation: sp-stempel .5s cubic-bezier(.34, 1.56, .64, 1); }
.sp-levelup[hidden] { display: none; }
/* Held */
.sp-char__kopf { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.sp-char__kopf .sp-held { height: 120px; margin-top: 12px; }
.sp-char__kopf p { margin: 0 0 4px; font-size: 8px; text-transform: uppercase; }
.sp-char__kopf h3 { margin: 0; }
.sp-char__kopf .sp-zeile { font-size: 10px; }
.sp-char__kopf .sp-zeile .px { width: 16px; height: 16px; }
.sp-char__kopf .sp-zeile .px:first-of-type { color: #E43B44; }
.sp-char__kopf .sp-zeile .px:nth-of-type(2) { color: var(--pink); }
.sp-werte { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; }
.sp-werte li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 6px 8px; background: var(--ink); border-left: 8px solid var(--farbe); }
.sp-werte li .px { width: 20px; height: 20px; color: var(--farbe); }
.sp-werte b { display: block; font-weight: 400; font-size: 9px; text-transform: uppercase; }
.sp-werte small { font-size: 7px; opacity: .85; }
.sp-werte em { font-style: normal; font-size: 12px; color: var(--gold); }
.sp-plus { width: 34px; height: 34px; font-family: inherit; font-size: 14px; line-height: 1; background: var(--gold); color: var(--ink); border: 3px solid var(--ink); cursor: pointer; }
.sp-plus:disabled { opacity: .25; cursor: default; }
.sp-plus:focus-visible { outline: 3px solid var(--cream); }
.sp-platz { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 10px; }
.sp-char .sp-meth { box-shadow: none; margin-bottom: 8px; }
.sp-char .sp-platz .sp-meth { margin-bottom: 0; }
/* Laden */
.sp-ladenkopf { display: flex; justify-content: space-between; align-items: center; }
.sp-ladenkopf h3 { margin: 0; }
.sp-regal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.sp-ware { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 12px 8px 10px; background: var(--ink); border: 3px solid var(--cream); }
.sp-ware b { font-weight: 400; font-size: 9px; text-transform: uppercase; }
.sp-ware small { font-size: 8px; color: var(--gruen); }
.sp-ware__hab { font-size: 8px; opacity: .8; }
.sp-preis { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 6px; }
/* Hilfe */
.sp-hilfe { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; text-align: left; }
.sp-hilfe li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; font-size: 9px; line-height: 1.7; }
.sp-hilfe--typen li { grid-template-columns: 62px 1fr; }
.sp-hilfe--typen .sp-tag { justify-self: start; }

/* ---------- Bewegungen ---------- */
@keyframes sp-atmen { 50% { transform: translateY(-3%); } }
@keyframes sp-stein { 50% { transform: rotate(45deg) translate(-3px, -3px); } }
@keyframes sp-puls { 50% { box-shadow: 0 0 0 4px var(--gold); } }
@keyframes sp-gefahr { 50% { box-shadow: 0 0 0 4px #fff; transform: translateX(-50%) scale(1.08); } }
@keyframes sp-huepf { 50% { transform: translateY(-3px); } }
@keyframes sp-knapp { 50% { border-color: var(--red); } }
@keyframes sp-zeiger { 50% { transform: translate(-50%, -290%); } }
@keyframes sp-streifen { from { background-position: 0 0; } to { background-position: 100% 0; } }
@keyframes sp-flug { from { left: -6%; } to { left: 106%; } }
@keyframes sp-vor { 30% { transform: translateX(-8%) scale(.96, 1.04); } 60% { transform: translateX(46%) scale(1.08, .94); } }
@keyframes sp-vor-spur { 30% { transform: translateX(-8%) scale(.96, 1.04); } 60% { transform: translateX(52%) scale(1.1, .92); filter: drop-shadow(-14px 0 0 rgba(255, 203, 46, .6)) drop-shadow(-26px 0 0 rgba(255, 203, 46, .3)); } }
@keyframes sp-vor-links { 30% { transform: translateX(6%); } 60% { transform: translateX(-36%); } }
@keyframes sp-blink { 0% { filter: brightness(6) saturate(0); } 50% { filter: none; } 75% { filter: brightness(4) saturate(0); } 100% { filter: none; } }
@keyframes sp-stauch { 0% { transform: scale(1.3, .7); } 100% { transform: none; } }
@keyframes sp-weg { 0% { filter: brightness(6) saturate(0); } 100% { opacity: 0; transform: scale(1.5, .2); filter: brightness(6) saturate(0); } }
@keyframes sp-sprung { 50% { transform: translateY(-16%); filter: brightness(1.6); } }
@keyframes sp-rein-links { from { transform: translateX(-70%); opacity: 0; } }
@keyframes sp-rein-rechts { from { transform: translateX(70%); opacity: 0; } }
@keyframes sp-zahl { 0% { transform: translateY(10px) scale(.4); opacity: 0; } 18% { transform: translateY(-18px) scale(1.25); opacity: 1; } 34% { transform: translateY(-14px) scale(1); } 78% { opacity: 1; } 100% { transform: translateY(var(--hub, -58px)); opacity: 0; } }
@keyframes sp-stempel { 0% { transform: scale(2.4) rotate(-14deg); opacity: 0; } 30% { transform: scale(1) rotate(6deg); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(1) rotate(6deg); opacity: 1; } }
@keyframes sp-banner { 0% { opacity: 0; transform: scale(1.6); } 15%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-20px); } }
@keyframes sp-auf { from { transform: scale(.94); opacity: 0; } }
@keyframes sp-alt { 0%, 30% { opacity: 1; filter: none; } 60% { opacity: 1; filter: brightness(6) saturate(0); } 100% { opacity: 0; filter: brightness(6) saturate(0); transform: scale(1.2); } }
@keyframes sp-neu { 0%, 30% { opacity: 0; } 60% { opacity: 1; filter: brightness(6) saturate(0); transform: scale(1.2); } 100% { opacity: 1; transform: none; } }
.sp-zahl.ist-stempel { --dreh: 6deg; }
@media (prefers-reduced-motion: reduce) {
  .sp-wandel__alt { opacity: 0; animation: none; } .sp-wandel__neu { opacity: 1; animation: none; } .sp-banner.ist-an { opacity: 1; }
  .sp-kaempfer, .sp-gefaehrte, .sp-absicht.ist-gefahr, .sp-meth.ist-effektiv, .sp-akt.ist-tipp { animation: none; }
}
@media print { .spielbereich { display: none; } }
