/* =====================================================================
   Burgsturm – Oberfläche
   Design-Tokens: Mittelalter-Hof (Stein, Holz, Banner-Blau, Pergament),
   MedievalSharp (Display) + Nunito (Text).
   Signatur-Element: die Wimpelkette als Fortschrittsleiste.
   ===================================================================== */

@font-face {
  font-family: 'MedievalSharp';
  src: url('fonts/MedievalSharp.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('fonts/Nunito.woff2') format('woff2');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Mittelalter-Palette; --fladen/--tomate bleiben als Rollen-Namen für Knopf/Warnfarbe */
  --fladen: #E9B44C;          /* Banner-Gold: Knöpfe, Akzent */
  --fladen-dunkel: #C48F2A;
  --fleisch: #8B5A2B;         /* Holz */
  --rotkohl: #7B2D9E;
  --tomate: #B8302A;          /* Feindrot / Warnung */
  --salat: #6FAE4E;
  --banner: #2F5FB3;          /* Team-Blau */
  --creme: #F1E4C6;           /* Pergament */
  --creme-dunkel: #DCCBA3;
  --stein: #7C7F86;
  --kohle: #2B2521;
  --kohle-2: #3D342E;
  --weiss: #FFFDF7;

  /* Himmel je Tageszeit – wird per data-tageszeit am body umgeschaltet */
  --himmel-oben: #7FB4E8;
  --himmel-unten: #E6EEF5;

  --schrift-display: 'MedievalSharp', 'Georgia', serif;
  --schrift-text: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --rand: clamp(14px, 4vw, 28px);
  --luft: clamp(8px, 2.2vh, 24px);
  --radius: 22px;
  --schatten: 0 6px 0 rgba(43, 37, 33, .28);
}
body[data-tageszeit="abend"] { --himmel-oben: #E98A5C; --himmel-unten: #E0A070; }
body[data-tageszeit="nacht"] { --himmel-oben: #141433; --himmel-unten: #3E2E6E; }
/* Welten 31-60 (data-welt schlaegt die Tageszeit): Finsterwald, Nebelsumpf, Eisgipfel */
body[data-welt="wald"] { --himmel-oben: #2E3D2A; --himmel-unten: #5C6B4E; }
body[data-welt="sumpf"] { --himmel-oben: #7F8F78; --himmel-unten: #A9B7A0; }
body[data-welt="schnee"] { --himmel-oben: #8FB6DA; --himmel-unten: #DDE8F2; }

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; height: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  overflow: hidden;
  font-family: var(--schrift-text);
  color: var(--kohle);
  background: linear-gradient(180deg, var(--himmel-oben) 0%, var(--himmel-unten) 62%, var(--himmel-unten) 100%);
  transition: background 1.2s ease;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
[hidden] { display: none !important; }

#buehne {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#ui {
  position: fixed;
  pointer-events: none;
  top: env(safe-area-inset-top, 0px); right: env(safe-area-inset-right, 0px); bottom: env(safe-area-inset-bottom, 0px); left: env(safe-area-inset-left, 0px);
}
.schirm { pointer-events: auto; }
.schirm--voll {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: var(--rand);
}
.schirm--dialog {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--rand);
  background: rgba(43, 37, 33, .45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.mono {
  font-family: var(--schrift-display);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ---------- Knöpfe ---------- */
.knopf {
  font-family: var(--schrift-display);
  font-size: clamp(1.05rem, 2.4vh + .4rem, 1.4rem);
  letter-spacing: .03em;
  color: var(--kohle);
  background: var(--fladen);
  border: 3px solid var(--kohle);
  border-radius: 999px;
  padding: .55em 1.6em;
  min-height: 48px;
  min-width: 48px;
  box-shadow: var(--schatten);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  line-height: 1.1;
  transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
  max-width: 100%;
}
.knopf:hover { background: #F2C462; }
.knopf:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(43, 37, 33, .28); }
.knopf:focus-visible { outline: 4px solid var(--weiss); outline-offset: 2px; }
.knopf--gross {
  font-size: clamp(1.4rem, 3.4vh + .5rem, 2rem);
  padding: .5em 1.6em;
  flex-direction: column;
  gap: 0;
}
.knopf--gross small {
  font-family: var(--schrift-text);
  font-weight: 800;
  font-size: .55em;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .75;
}
.knopf--leise { background: var(--creme); }
.knopf--leise:hover { background: var(--weiss); }
.knopf--rund {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  background: var(--creme);
}
.knopf--rund svg { width: 26px; height: 26px; fill: currentColor; }
.knopf[disabled] { opacity: .5; cursor: default; transform: none; }

/* ---------- Münzanzeige ---------- */
.muenzen {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-family: var(--schrift-display);
  font-size: 1.15rem;
  color: var(--kohle);
  background: var(--creme);
  border: 3px solid var(--kohle);
  border-radius: 999px;
  padding: .25em .9em .25em .55em;
  box-shadow: var(--schatten);
}
.ico-muenze { width: 1.35em; height: 1.35em; fill: var(--fladen); stroke: var(--kohle); stroke-width: 1.6; }
.ico-muenze__innen { fill: var(--fladen-dunkel); stroke: none; }

/* ---------- Startbildschirm ---------- */
.start { justify-content: space-between; align-items: center; text-align: center; overflow-y: auto; overscroll-behavior: contain; }
.start__kopf { padding-top: calc(var(--luft) * 1.5); }
.titel {
  margin: 0;
  font-family: var(--schrift-display);
  font-weight: 400;
  font-size: clamp(2.8rem, min(15vw, 11vh), 6rem);
  line-height: .9;
  color: var(--creme);
  text-shadow: 0 4px 0 var(--kohle), 0 8px 0 rgba(43, 37, 33, .35);
  display: flex;
  flex-direction: column;
  transform: rotate(-3deg);
}
.titel span:last-child { color: var(--fladen); }
.titel { letter-spacing: .02em; }
.untertitel {
  margin: var(--luft) 0 0;
  font-weight: 800;
  font-size: clamp(1rem, 2.2vh + .3rem, 1.3rem);
  color: var(--kohle);
  background: var(--creme);
  border: 3px solid var(--kohle);
  border-radius: 999px;
  padding: .3em 1em;
  display: inline-block;
  box-shadow: var(--schatten);
}
.start__mitte { display: flex; flex-direction: column; gap: var(--luft); align-items: center; margin-top: auto; padding-top: max(1dvh, calc(14dvh - var(--sicher-hoehe))); }
.start__reihe { display: flex; gap: var(--luft); flex-wrap: wrap; justify-content: center; }
.start__fuss {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--luft);
  margin-top: auto;
  padding-top: var(--luft);
}
.hinweis {
  margin: 0;
  font-weight: 800;
  font-size: .95rem;
  color: var(--creme);
  text-shadow: 0 2px 0 var(--kohle);
  flex: 1;
}
.textlink {
  font-family: var(--schrift-text);
  font-weight: 800;
  font-size: .95rem;
  color: var(--creme);
  text-shadow: 0 2px 0 var(--kohle);
  background: none;
  border: 0;
  padding: 10px 8px;
  min-height: 40px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.textlink:focus-visible { outline: 4px solid var(--weiss); outline-offset: 2px; border-radius: 8px; }
.rechtliches { display: inline-flex; align-items: center; gap: 2px; color: var(--creme); text-shadow: 0 2px 0 var(--kohle); font-weight: 800; }
.rechtliches a { padding-inline: 6px; }
.credit {
  margin: 4px 0 0;
  font-family: var(--schrift-display);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--kohle);
  opacity: .5;
}

/* ---------- Anleitung ---------- */
.dialog.anleitung { width: min(100%, 520px); max-height: calc(100dvh - 2 * var(--rand) - var(--sicher-hoehe)); }
.anleitung__liste {
  list-style: none;
  margin: 0;
  padding: 0 4px 0 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  min-height: 0;
  padding-bottom: 26px;
  /* weicher Auslauf unten als Hinweis: hier geht es weiter */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
}
.anleitung__liste li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  background: var(--weiss);
  border: 2px solid var(--kohle);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.4;
}
.anleitung__liste svg { width: 34px; height: 34px; fill: var(--kohle); color: var(--kohle); margin-top: 2px; }
.anleitung__liste b { font-family: var(--schrift-display); font-weight: 400; letter-spacing: .02em; }
.anleitung__liste li > div > b:first-child { display: block; font-size: 1.05rem; margin-bottom: 2px; }
.anleitung__liste kbd { font-size: .8em; }
.tor { font-family: var(--schrift-display); padding: 0 .4em; border-radius: 6px; color: var(--weiss); }
.tor--gut { background: var(--banner); }
.tor--schlecht { background: var(--tomate); }
@media (min-width: 46rem) {
  .dialog.anleitung { width: min(100%, 820px); }
  .anleitung__liste { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-height: 700px) { .dialog.anleitung { padding-block: 14px; gap: 10px; } .dialog.anleitung h2 { font-size: 1.6rem; } }
kbd {
  font-family: var(--schrift-display);
  background: var(--creme);
  color: var(--kohle);
  border-radius: 6px;
  padding: 0 .35em;
  text-shadow: none;
  border: 2px solid var(--kohle);
}
.ico-ton-aus { display: none; }
.knopf[aria-pressed="false"] .ico-ton-an { display: none; }
.knopf[aria-pressed="false"] .ico-ton-aus { display: block; }

/* ---------- Tafeln (Level, Shop) ---------- */
.tafel { padding: 0; background: rgba(43, 37, 33, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.tafel--shop { background: linear-gradient(180deg, rgba(43, 37, 33, 0) 0%, rgba(43, 37, 33, 0) 35%, rgba(43, 37, 33, .35) 60%); backdrop-filter: none; -webkit-backdrop-filter: none; }
.tafel__kopf {
  display: flex;
  align-items: center;
  gap: var(--luft);
  padding: var(--rand) var(--rand) calc(var(--luft) * .6);
}
.tafel__kopf h2 {
  flex: 1;
  margin: 0;
  font-family: var(--schrift-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 5vh, 2.6rem);
  color: var(--creme);
  text-shadow: 0 3px 0 var(--kohle);
  text-align: center;
}
.tafel__inhalt {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--rand) var(--rand);
  touch-action: pan-y;
}
.tafel__inhalt--unten { display: flex; flex-direction: column; justify-content: flex-end; }

.levelraster {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(8px, 1.6vw, 14px);
  max-width: 640px;
  margin: 0 auto;
}
.levelraster__welt {
  grid-column: 1 / -1;
  margin: clamp(10px, 2vw, 18px) 0 0;
  font-family: var(--schrift-display);
  font-size: clamp(1.1rem, 3.6vw, 1.5rem);
  color: var(--creme);
  text-shadow: 0 2px 0 rgba(43, 37, 33, .5);
  letter-spacing: .02em;
}
.levelraster__welt:first-child { margin-top: 0; }
.level-kachel {
  aspect-ratio: 1;
  border: 3px solid var(--kohle);
  border-radius: 18px;
  background: var(--creme);
  box-shadow: var(--schatten);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--schrift-display);
  font-size: clamp(1.3rem, 4.5vw, 2rem);
  color: var(--kohle);
  cursor: pointer;
  padding: 0;
  transition: transform .08s ease;
}
.level-kachel:hover { transform: translateY(-2px); }
.level-kachel:focus-visible { outline: 4px solid var(--weiss); outline-offset: 2px; }
.level-kachel--aktuell { background: var(--fladen); }
.level-kachel--gesperrt { background: rgba(246, 240, 220, .8); border-color: rgba(43, 37, 33, .45); color: rgba(43, 37, 33, .38); cursor: default; box-shadow: none; }
.level-kachel--gesperrt:hover { transform: none; }
.level-kachel svg.schloss { width: 40%; height: 40%; fill: currentColor; }
/* Boss-Level (40/50/60): Krone über der Zahl */
.level-kachel--boss { position: relative; }
.level-kachel--boss::before { content: '\265B'; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-size: .8em; line-height: 1; color: var(--fladen); text-shadow: 0 2px 0 var(--kohle), -1px 0 0 var(--kohle), 1px 0 0 var(--kohle); }
.level-kachel .sterne { gap: 1px; }
.level-kachel .sterne svg { width: clamp(11px, 3.2vw, 16px); height: clamp(11px, 3.2vw, 16px); }

.sterne { display: inline-flex; gap: 6px; }
.sterne svg { width: 44px; height: 44px; fill: var(--creme-dunkel); stroke: var(--kohle); stroke-width: 1.4; stroke-linejoin: round; }
.sterne svg.an { fill: var(--fladen); }
.ergebnis .sterne svg { width: clamp(44px, 9vh, 64px); height: clamp(44px, 9vh, 64px); }

.shopraster {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.6vw, 14px);
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}
.skin-karte {
  border: 3px solid var(--kohle);
  border-radius: 18px;
  background: var(--creme);
  box-shadow: var(--schatten);
  padding: 10px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition: transform .08s ease;
}
.skin-karte:hover { transform: translateY(-2px); }
.skin-karte:focus-visible { outline: 4px solid var(--weiss); outline-offset: 2px; }
.skin-karte--aktiv { background: var(--fladen); }
.skin-karte__brot {
  width: 56px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--kohle);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .12);
  position: relative;
}
.skin-karte__brot--glanz::after {
  content: '';
  position: absolute;
  inset: 6px 12px;
  background: linear-gradient(135deg, rgba(255,255,255,.55), transparent 55%);
  border-radius: 50%;
}
.skin-karte__name { font-family: var(--schrift-display); font-size: 1rem; line-height: 1.1; }
.skin-karte__preis {
  font-family: var(--schrift-display);
  font-size: .85rem;
  display: inline-flex;
  align-items: center;
  gap: .25em;
  background: var(--weiss);
  border: 2px solid var(--kohle);
  border-radius: 999px;
  padding: .1em .6em;
}
.skin-karte__preis .ico-muenze { width: 1em; height: 1em; }
.skin-karte--gesperrt .skin-karte__preis { color: var(--tomate); }

/* Truppenzug: Meter-Anzeige an Stelle der Wimpelkette */
.hud__meter {
  position: absolute;
  left: 50%;
  top: calc(var(--rand) + 2px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--schrift-display);
  color: var(--creme);
  text-shadow: 0 3px 0 var(--kohle);
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}
.hud__meter b { font-size: clamp(2.2rem, 7vh, 3.6rem); font-weight: 400; }
.hud__meter span { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.hud__meter em { font-style: normal; color: var(--fladen); }
.knopf--zug { background: var(--kohle2); color: var(--creme); }
.knopf--zug:hover { background: #4A4038; }
.knopf--zug small { opacity: .85; }
.knopf--zug.knopf--gesperrt { opacity: .7; }

/* Karten nach einer Horde */
.karten { max-width: 640px; }
.karten__reihe { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 1.6vw, 14px); width: 100%; }
.karte {
  border: 3px solid var(--kohle);
  border-radius: 18px;
  background: var(--creme);
  box-shadow: var(--schatten);
  padding: 14px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition: transform .08s ease;
  min-width: 0;
}
.karte:hover { transform: translateY(-3px); }
.karte:focus-visible { outline: 4px solid var(--weiss); outline-offset: 2px; }
.karte__symbol { font-size: 2.2rem; line-height: 1; color: var(--kohle); }
.karte__name { font-family: var(--schrift-display); font-size: 1rem; line-height: 1.1; }
.karte__text { font-size: .78rem; line-height: 1.25; color: var(--kohle2); }
.karte--power { background: #FFF3D6; }
.karten__wartet { margin: 0; font-weight: 800; color: var(--kohle2); }

/* Bestenliste */
.bestenliste { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.bestenliste__info { margin: 0; font-weight: 800; color: var(--creme); text-shadow: 0 2px 0 var(--kohle); text-align: center; }
.bestenliste__liste {
  list-style: none;
  margin: 0;
  padding: 8px;
  background: var(--creme);
  border: 3px solid var(--kohle);
  border-radius: 18px;
  box-shadow: var(--schatten);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--schrift-display);
}
.bestenliste__liste li { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 10px; }
.bestenliste__liste li:nth-child(1) { background: var(--fladen); }
.bestenliste__liste li:nth-child(2) { background: #E8E2D2; }
.bestenliste__liste li:nth-child(3) { background: #F0D9B8; }
.bestenliste__liste li.bl--du { outline: 3px solid var(--tomate); outline-offset: -3px; }
.bestenliste__liste .bl__platz { opacity: .6; }
.bestenliste__liste .bl__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--schrift-text); font-weight: 800; }
.bestenliste__liste .bl__meter::after { content: ' m'; font-size: .8em; opacity: .7; }
.bestenliste__laden { justify-content: center; opacity: .6; }
.bestenliste__hinweis { margin: 0; font-weight: 800; color: var(--creme); text-shadow: 0 2px 0 var(--kohle); text-align: center; }
.ergebnis .bestenliste__hinweis { color: var(--kohle2); text-shadow: none; }
.bestenliste__hinweis--gut { color: #4E9A34 !important; }
.bestenliste__name, .bestenliste__eintrag { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; width: 100%; }
.bestenliste__name label { font-weight: 800; color: var(--creme); text-shadow: 0 2px 0 var(--kohle); width: 100%; text-align: center; }
.bestenliste input, .bestenliste__eintrag input {
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  padding: .55em .9em;
  border: 3px solid var(--kohle);
  border-radius: 999px;
  background: var(--weiss);
  color: var(--kohle);
  width: min(100%, 220px);
  min-height: 44px;
}
.bestenliste input:focus-visible, .bestenliste__eintrag input:focus-visible { outline: 4px solid var(--fladen); outline-offset: 2px; }
/* iOS: user-select:none am body verhindert sonst den Fokus im Eingabefeld */
input, textarea { -webkit-user-select: text !important; user-select: text !important; -webkit-touch-callout: default; touch-action: manipulation; }
.ergebnis__werte { flex-wrap: wrap; }

/* Lobby (Zusammen spielen) */
.lobby-schirm .tafel__inhalt { overscroll-behavior: contain; }
.tafel__platz { width: 52px; }
.lobby { max-width: 520px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: var(--luft); align-items: center; color: var(--creme); text-align: center; padding-bottom: var(--luft); }
.lobby__wahl { display: flex; flex-direction: column; gap: var(--luft); align-items: center; width: 100%; }
.lobby__name { display: flex; flex-direction: column; gap: 6px; font-weight: 800; text-shadow: 0 2px 0 var(--kohle); width: min(100%, 300px); }
.lobby__name input, .lobby__beitreten input { font-family: var(--schrift-display); font-weight: 700; font-size: 1.15rem; color: var(--kohle); background: var(--creme); border: 3px solid var(--kohle); border-radius: 999px; padding: .35em .9em; min-height: 46px; text-align: center; box-shadow: var(--schatten); }
.lobby__beitreten input { width: 130px; letter-spacing: .25em; text-transform: uppercase; }
.lobby__name input:focus-visible, .lobby__beitreten input:focus-visible { outline: 4px solid var(--fladen); outline-offset: 2px; }
.lobby__oder { font-family: var(--schrift-display); letter-spacing: .1em; text-shadow: 0 2px 0 var(--kohle); }
.lobby__beitreten { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; width: 100%; }
.lobby__beitreten label { width: 100%; font-weight: 800; text-shadow: 0 2px 0 var(--kohle); }
.lobby__tipp { margin: 0; font-size: .9rem; font-weight: 700; text-shadow: 0 2px 0 var(--kohle); max-width: 440px; }
.lobby__raum { display: flex; flex-direction: column; gap: 8px; align-items: center; width: 100%; }
.lobby__label { margin: 0; font-weight: 800; text-shadow: 0 2px 0 var(--kohle); }
.lobby__code { margin: 0; font-family: var(--schrift-display); font-size: clamp(2.6rem, 11vw, 4.4rem); letter-spacing: .25em; color: var(--fladen); text-shadow: 0 4px 0 var(--kohle); background: rgba(43, 37, 33, .55); border: 3px solid var(--kohle); border-radius: 18px; padding: .1em .4em .1em .65em; }
.lobby__status { margin: 0; font-weight: 800; text-shadow: 0 2px 0 var(--kohle); min-height: 1.4em; }
.lobby__status--fehler { color: #FFB3B3; }
.lobby__spieler { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 6px; }
.lobby__spieler li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--creme); color: var(--kohle); border: 3px solid var(--kohle); border-radius: 14px; padding: 6px 14px 6px 10px; font-weight: 800; text-align: left; }
.lobby__spieler li b { font-family: var(--schrift-display); font-weight: 600; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby__spieler li i { font-style: normal; color: #2FA84A; font-size: .85rem; }
.lobby__spieler li .wappen { width: 22px; height: 26px; border: 2px solid var(--kohle); border-radius: 3px 3px 11px 11px; }
.lobby__spieler li.lobby__ich { outline: 3px solid var(--banner); outline-offset: -3px; }
.lobby__spieler li.lobby__frei { opacity: .55; background: transparent; color: var(--creme); border-style: dashed; }
.lobby__einstellungen { width: 100%; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.lobby__chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; width: 100%; }
.lobby__chips--scroll { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 4px 2px; scrollbar-width: thin; }
.chip { font-family: var(--schrift-display); font-weight: 600; font-size: .95rem; background: var(--creme); color: var(--kohle); border: 2.5px solid var(--kohle); border-radius: 999px; padding: .35em .9em; min-height: 40px; min-width: 44px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .4em; flex: 0 0 auto; }
.chip.aktiv { background: var(--fladen); }
.chip:focus-visible { outline: 4px solid var(--weiss); outline-offset: 2px; }
.lobby__info { margin: 0; font-weight: 800; text-shadow: 0 2px 0 var(--kohle); }
/* Rangliste */
.rangliste__liste li { grid-template-columns: 2.2em minmax(0, 1fr) auto; }
.rangliste__liste .rang__wert { font-size: .85rem; white-space: nowrap; }
.rangliste__liste .bl__meter::after { content: none; }
.rangliste__liste li.rang--weg { opacity: .55; }

/* Reiter im Laden (Wappen | Schmiede) */
.reiter { display: flex; justify-content: center; gap: 8px; padding: 0 var(--rand) 10px; }
.reiter__knopf {
  font-family: var(--schrift-display);
  font-size: 1.05rem;
  padding: .4em 1.1em;
  border: 3px solid var(--kohle);
  border-radius: 999px;
  background: var(--creme);
  color: var(--kohle);
  box-shadow: var(--schatten);
  cursor: pointer;
}
.reiter__knopf.aktiv { background: var(--fladen); }
.reiter__knopf:focus-visible { outline: 4px solid var(--weiss); outline-offset: 2px; }
.schmiede { max-width: 560px; margin: 0 auto; width: 100%; }
.schmiede__text { font-size: .95rem; color: var(--creme); text-shadow: 0 2px 0 rgba(43, 37, 33, .5); text-align: center; margin: 0 0 10px; }
.schmiederaster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 1.6vw, 14px); }
.schmiede-karte {
  border: 3px solid var(--kohle);
  border-radius: 18px;
  background: var(--creme);
  box-shadow: var(--schatten);
  padding: 10px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition: transform .08s ease;
  min-width: 0;
}
.schmiede-karte:hover { transform: translateY(-2px); }
.schmiede-karte:focus-visible { outline: 4px solid var(--weiss); outline-offset: 2px; }
.schmiede-karte--fertig { background: var(--fladen); cursor: default; }
.schmiede-karte svg.werk { width: 44px; height: 44px; fill: var(--kohle); }
.schmiede-karte__name { font-family: var(--schrift-display); font-size: 1rem; line-height: 1.1; }
.schmiede-karte__stufen { display: inline-flex; gap: 4px; }
.schmiede-karte__stufen i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--kohle); background: var(--weiss); }
.schmiede-karte__stufen i.an { background: var(--fladen); }
.schmiede-karte--fertig .schmiede-karte__stufen i.an { background: var(--kohle); }
.schmiede-karte__text { font-size: .78rem; line-height: 1.25; color: var(--kohle2); }
.schmiede-karte__preis {
  font-family: var(--schrift-display);
  font-size: .85rem;
  display: inline-flex;
  align-items: center;
  gap: .25em;
  background: var(--weiss);
  border: 2px solid var(--kohle);
  border-radius: 999px;
  padding: .1em .6em;
}
.schmiede-karte__preis .ico-muenze { width: 1em; height: 1em; }
.schmiede-karte--teuer .schmiede-karte__preis { color: var(--tomate); }

/* ---------- Dialoge ---------- */
.dialog {
  width: min(100%, 420px);
  background: var(--creme);
  border: 3px solid var(--kohle);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: clamp(18px, 4vh, 30px) clamp(16px, 4vw, 28px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--luft);
  text-align: center;
}
.dialog h2 {
  margin: 0;
  font-family: var(--schrift-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 5vh, 2.6rem);
  line-height: 1;
}
.dialog__reihe { display: flex; gap: var(--luft); flex-wrap: wrap; justify-content: center; }
.dialog .knopf--gross { font-size: clamp(1.3rem, 2.8vh + .4rem, 1.7rem); padding-inline: 1.2em; white-space: nowrap; }
.ergebnis__level { margin: 0; font-size: .95rem; color: var(--kohle-2); }
.ergebnis__text { margin: 0; font-weight: 700; }
.ergebnis__werte {
  margin: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ergebnis__werte div {
  background: var(--weiss);
  border: 2px solid var(--kohle);
  border-radius: 14px;
  padding: 8px 4px;
}
.ergebnis__werte dt { font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--kohle-2); }
.ergebnis__werte dd { margin: 2px 0 0; font-family: var(--schrift-display); font-size: 1.5rem; }
.ergebnis--fehl h2 { color: var(--tomate); }

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; padding: var(--rand); }
.hud .knopf { pointer-events: auto; }
.hud__zeile { display: flex; align-items: center; gap: var(--luft); }
.hud__level, .hud__muenzen {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  font-family: var(--schrift-display);
  font-size: 1.05rem;
  color: var(--kohle);
  background: var(--creme);
  border: 3px solid var(--kohle);
  border-radius: 999px;
  padding: .2em .8em;
  box-shadow: var(--schatten);
  white-space: nowrap;
}
.hud__level .mono { font-size: .7em; opacity: .7; }
.hud__kette { flex: 1; min-width: 0; }
.kette { width: 100%; height: 40px; display: block; overflow: visible; }
.kette__seil { fill: none; stroke: var(--kohle); stroke-width: 3; stroke-linecap: round; }
.kette__wimpel { fill: var(--creme); stroke: var(--kohle); stroke-width: 1.5; }
.kette__wimpel:nth-child(even) { fill: var(--fladen); }
.kette__burg { fill: var(--stein); stroke: var(--kohle); stroke-width: 2; }
.kette__fahne { fill: var(--banner); stroke: var(--kohle); stroke-width: 2; transform: translateX(20px); transition: transform .25s linear; }
.kette__mast { fill: none; stroke: var(--kohle); stroke-width: 2.5; stroke-linecap: round; }
.hud__zaehler {
  position: absolute;
  left: 50%;
  top: calc(var(--rand) + 64px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  color: var(--creme);
  text-shadow: 0 3px 0 var(--kohle), 0 6px 0 rgba(43, 37, 33, .3);
  font-family: var(--schrift-display);
}
.hud__zaehler b { font-size: clamp(2.4rem, 8vh, 4rem); font-weight: 400; transition: transform .12s ease; }
.hud__zaehler b.pop { transform: scale(1.25); }
.hud__zaehler span { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
#btn-pause { position: absolute; right: var(--rand); top: calc(var(--rand) + 52px); }
/* Power-up-Inventar unten links: Zähler + Restzeit-Ring (Tasten 1/2/3) */
.hud__power {
  position: absolute;
  left: var(--rand);
  bottom: var(--rand);
  display: flex;
  gap: 10px;
  pointer-events: auto;
}
.power-knopf {
  --farbe: #FFD23F;
  --rest: 0;
  position: relative;
  width: 60px;
  height: 60px;
  padding: 0;
  border: 3px solid var(--kohle);
  border-radius: 50%;
  background: var(--creme);
  box-shadow: var(--schatten);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .08s ease, opacity .15s ease;
  touch-action: manipulation;
}
.power-knopf[data-art="magnet"] { --farbe: #E23B2B; }
.power-knopf[data-art="schild"] { --farbe: #3B8BEB; }
.power-knopf svg { width: 30px; height: 30px; fill: var(--kohle); }
.power-knopf__zahl {
  position: absolute;
  right: -6px;
  top: -6px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--farbe);
  border: 2px solid var(--kohle);
  font-family: var(--schrift-display);
  font-size: .9rem;
  line-height: 20px;
  color: var(--kohle);
}
.power-knopf kbd { position: absolute; bottom: -8px; font-size: .62rem; padding: 0 .3em; line-height: 1.2; }
.power-knopf__ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(var(--farbe) calc(var(--rest) * 360deg), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  opacity: 0;
  pointer-events: none;
}
.power-knopf--aktiv { background: var(--farbe); }
.power-knopf--aktiv .power-knopf__ring { opacity: 1; }
.power-knopf--aktiv svg { fill: var(--weiss); }
.power-knopf--leer { opacity: .45; }
.power-knopf:not([disabled]):active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(43, 37, 33, .28); }
.power-knopf:not([disabled]):not(.power-knopf--aktiv) { animation: power-bereit 1.4s ease-in-out infinite; }
@keyframes power-bereit { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.power-knopf:focus-visible { outline: 4px solid var(--weiss); outline-offset: 2px; }
.power-knopf[disabled] { cursor: default; }

/* Sprung-Knopf: groß unten rechts (Daumen), Tastatur: Leertaste/↑ */
.hud__sprung {
  position: absolute;
  right: var(--rand);
  bottom: var(--rand);
  width: 84px;
  height: 84px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.hud__sprung svg { width: 34px; height: 34px; }
.hud__sprung:active, .hud__sprung.gedrueckt { transform: translateY(3px) scale(.96); }
.hud__hinweis {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) scale(.6);
  font-family: var(--schrift-display);
  font-size: clamp(1.6rem, 6vh, 2.6rem);
  color: var(--creme);
  text-shadow: 0 3px 0 var(--kohle);
  opacity: 0;
  transition: opacity .2s ease, transform .2s cubic-bezier(.2, 1.6, .5, 1);
  white-space: nowrap;
}
.hud__hinweis.an { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.hud__hinweis--schlecht { color: var(--tomate); }
.hud__hinweis--klein { font-size: clamp(1rem, 3.4vh, 1.5rem); top: 42%; white-space: normal; text-align: center; width: min(92vw, 520px); }   /* nach .hud__hinweis, sonst gewinnt dessen nowrap */
.hud__popups { position: fixed; inset: 0; overflow: hidden; }
.popup {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translateX(-50%);
  font-family: var(--schrift-display);
  font-size: 1.6rem;
  color: var(--creme);
  text-shadow: 0 2px 0 var(--kohle);
  animation: popup-hoch .9s ease-out forwards;
}
.popup--schlecht { color: var(--tomate); }
.popup--muenze { color: var(--fladen); }
@keyframes popup-hoch {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -70px) scale(1); }
}

/* Sieges-Banner */
.banner {
  position: absolute;
  left: 50%;
  top: 31%;
  transform: translate(-50%, -50%) scale(.4) rotate(-6deg);
  font-family: var(--schrift-display);
  font-size: clamp(1.8rem, min(9vh, 10.5vw), 4.5rem);   /* auch an 390 px passt 'Neu: Springen!' in eine Zeile */
  color: var(--fladen);
  text-shadow: 0 4px 0 var(--kohle), 0 8px 0 rgba(43, 37, 33, .35);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity .25s ease, transform .45s cubic-bezier(.2, 1.8, .4, 1);
}
.banner.an { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-6deg); }

/* Kurzmeldung (Shop) */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--rand) + 8px);
  transform: translate(-50%, 20px);
  font-family: var(--schrift-display);
  font-size: 1.05rem;
  color: var(--creme);
  background: var(--kohle);
  border-radius: 999px;
  padding: .5em 1.2em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  white-space: nowrap;
  max-width: calc(100% - 2 * var(--rand));
}
.toast.an { opacity: 1; transform: translate(-50%, 0); }

/* Wischen-Anleitung beim ersten Level */
.hud__hand {
  position: absolute;
  left: 50%;
  bottom: 22%;
  width: 56px;
  height: 56px;
  margin-left: -28px;
  fill: var(--creme);
  stroke: var(--kohle);
  stroke-width: 1.5;
  animation: hand-wisch 1.6s ease-in-out infinite;
  filter: drop-shadow(0 3px 0 rgba(43, 37, 33, .4));
}
@keyframes hand-wisch { 0%, 100% { transform: translateX(-50px); } 50% { transform: translateX(50px); } }
/* Hand nach oben (Springen) */
.hud__hand[data-art="springen"] { animation: hand-sprung 1.3s ease-in-out infinite; bottom: 26%; }
@keyframes hand-sprung { 0%, 100% { transform: translateY(30px); opacity: .8; } 45% { transform: translateY(-40px); opacity: 1; } 60% { transform: translateY(-40px); opacity: 0; } 61% { transform: translateY(30px); opacity: 0; } }

/* ---------- Mobil ---------- */
@media (max-width: 40rem) {
  .levelraster { gap: 7px; }   /* 5 Spalten bleiben (60 px Kacheln) – Gruppen zu je 10/30 fuellen so jede Reihe */
  .textlink { font-size: .85rem; padding-inline: 4px; }
  .tafel__kopf h2 { font-size: 1.6rem; white-space: nowrap; }
  .hud__level .mono { display: none; }
  .hud__level, .hud__muenzen { font-size: .95rem; padding: .2em .6em; }
  .hud__meter b { font-size: clamp(1.9rem, 6vh, 3rem); }
  .hud__meter span { font-size: .66rem; }
  .karte__symbol { font-size: 1.7rem; }
  .karte__text { font-size: .7rem; }
  .power-knopf { width: 52px; height: 52px; }
  .power-knopf svg { width: 26px; height: 26px; }
  .hud__sprung { width: 76px; height: 76px; }
  .schmiede-karte__text { font-size: .72rem; }
  .start__mitte { padding-top: max(1dvh, calc(8dvh - var(--sicher-hoehe))); }   /* Spielen + Truppenzug + zwei Reihen Knoepfe muessen mit Fuss auf 844 px passen */
  .start__reihe { gap: 8px; }
  .start__reihe .knopf { padding-inline: .9em; font-size: .95rem; }
  .hinweis { display: none; }
  .knopf { white-space: normal; }
}
@media (max-height: 620px) {
  .start__mitte { padding-top: max(1dvh, calc(4dvh - var(--sicher-hoehe))); }
  .hud__zaehler { top: calc(var(--rand) + 52px); }
}

/* ---------- Reduzierte Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
  .knopf, .level-kachel, .skin-karte, .spiess__fleisch, .hud__hinweis, body { transition: none; }
  .popup { animation-duration: .01s; }
  .hud__hand, .hud__hand[data-art="springen"] { animation: none; }
  .power-knopf:not([disabled]):not(.power-knopf--aktiv) { animation: none; }
}

/* Die Zahl schwebt als Sprite über der Kolonie – kein zweiter Zähler im HUD */
.hud__zaehler { display: none !important; }

/* Fuß mit drei Links (Spielhalle · Impressum · Datenschutz): auf schmalen Handys eigene Zeile, sonst wird er abgeschnitten */
@media (max-width: 27rem) { .start__fuss { flex-wrap: wrap; } .start__fuss .rechtliches { order: 9; flex-basis: 100%; justify-content: center; } }

/* iPhone als Homescreen-App (Statusleiste „black-translucent", viewport-fit=cover): Der Sicherheitsabstand ist die
   LAGE von #ui, kein Padding – die Bildschirme darin sind absolut (inset: 0) und ignorieren Padding; sonst lag das
   Menü unter Uhrzeit und WLAN. Abgedunkelte Ebenen reichen per Rand-Schatten trotzdem bis unter die Statusleiste. */
/* Höhe, die Statusleiste + Home-Balken wegnehmen (Abstände in dvh zählen sonst die ganze Bildschirmhöhe) */
:root { --sicher-hoehe: calc(env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)); }
:root { --sicher-rand: max(env(safe-area-inset-top, 0px), env(safe-area-inset-right, 0px), env(safe-area-inset-bottom, 0px), env(safe-area-inset-left, 0px)); }
.schirm--dialog { box-shadow: 0 0 0 var(--sicher-rand) rgba(43, 37, 33, .45); }
.tafel { box-shadow: 0 0 0 var(--sicher-rand) rgba(43, 37, 33, .5); }
.tafel--shop { box-shadow: none; }
