/* =====================================================================
   Döner Runner – Oberfläche
   Design-Tokens: Palette aus der Dönerbude, Lilita One (Display) +
   Nunito (Text). Signatur-Element: der Dönerspieß als Fortschrittsleiste.
   ===================================================================== */

@font-face {
  font-family: 'Lilita One';
  src: url('fonts/LilitaOne.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 {
  --fladen: #E8B65B;
  --fladen-dunkel: #C9932F;
  --fleisch: #8C4A25;
  --rotkohl: #7B2D6B;
  --tomate: #D93B2B;
  --salat: #6CB84B;
  --creme: #F6F0DC;
  --creme-dunkel: #E4D9BC;
  --kohle: #2B2521;
  --kohle-2: #3D342E;
  --weiss: #FFFDF7;

  /* Himmel je Tageszeit – wird per data-tageszeit am body umgeschaltet */
  --himmel-oben: #5FA8E8;
  --himmel-unten: #FBE8C8;

  --schrift-display: 'Lilita One', 'Arial Black', Impact, system-ui, sans-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: #F7A86B; --himmel-unten: #5B3A8C; }
body[data-tageszeit="nacht"] { --himmel-oben: #1B1740; --himmel-unten: #4A2C7A; }
body[data-tageszeit="morgen"] { --himmel-oben: #F6B8C8; --himmel-unten: #FFE2B8; }
body[data-tageszeit="gewitter"] { --himmel-oben: #2E3A4E; --himmel-unten: #6C7A8C; }
body[data-tageszeit="wueste"] { --himmel-oben: #F2C46B; --himmel-unten: #FBE1A8; }
body.blitz { background: #E8F0FF; transition: none; }

*, *::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: #F2C46B; }
.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.3rem, 3vh + .4rem, 1.8rem);
  padding: .4em 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) * .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); }
.untertitel {
  margin: calc(var(--luft) * .5) 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: calc(var(--luft) * .7); 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: #3B8BEB; }
.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;
}
.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; }
.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--sesam::after {
  content: '';
  position: absolute;
  inset: 6px 12px;
  background:
    radial-gradient(circle, var(--weiss) 1.5px, transparent 2px) 0 0 / 9px 7px,
    radial-gradient(circle, var(--weiss) 1.5px, transparent 2px) 4px 3px / 9px 7px;
}
.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); }

/* ---------- 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__spiess { flex: 1; min-width: 0; }
.spiess { width: 100%; height: 40px; display: block; overflow: visible; }
.spiess__stab { fill: #B9B4A8; stroke: var(--kohle); stroke-width: 2; }
.spiess__griff { fill: var(--kohle-2); stroke: var(--kohle); stroke-width: 2; }
.spiess__spitze { fill: #DAD5C8; stroke: var(--kohle); stroke-width: 2; }
.spiess__fleisch { fill: var(--fleisch); stroke: var(--kohle); stroke-width: 2; transform: translateX(20px); transition: transform .25s linear; }
.spiess__fleisch-innen { fill: #B5693A; stroke: none; }
.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 b.zu-wenig { color: var(--tomate); }
.hud__zaehler span { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
#btn-pause { position: absolute; right: var(--rand); bottom: var(--rand); }
.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__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(2.4rem, 9vh, 4.5rem);
  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--ducken { animation-name: hand-runter; }
.hud__hand--springen { animation-name: hand-hoch; }
@keyframes hand-runter { 0%, 100% { transform: translateY(-34px); opacity: .6; } 50% { transform: translateY(34px); opacity: 1; } }
@keyframes hand-hoch { 0%, 100% { transform: translateY(34px); opacity: .6; } 50% { transform: translateY(-34px); opacity: 1; } }
.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); } }

/* ---------- Mobil ---------- */
@media (max-width: 40rem) {
  .levelraster { gap: 6px; }
  .level-kachel { border-radius: 14px; border-width: 2px; }
  .level-kachel .sterne svg { width: 10px; height: 10px; }
  .level-kachel__rekord { font-size: .55rem; }
  .start__mitte { padding-top: max(1dvh, calc(5dvh - var(--sicher-hoehe))); gap: 8px; }
  .start__reihe { gap: 8px; }
  .start .knopf--gross { font-size: clamp(1.2rem, 2.6vh + .4rem, 1.7rem); padding-block: .35em; }
  .start .knopf { font-size: clamp(.95rem, 2vh + .3rem, 1.2rem); padding-inline: 1.1em; }
  .hud__power { top: calc(var(--rand) + 118px); }
  .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; }
  .start__mitte { padding-top: max(1dvh, calc(22dvh - var(--sicher-hoehe))); }
  .hinweis { display: none; }
  .knopf { white-space: normal; }
}
/* Vier grosse Knoepfe (Spielen, Nachtschicht, Profi-Schicht, Zusammen spielen) muessen auf 390x844 samt Fuss passen */
@media (max-width: 34rem) {
  .start .knopf--gross { font-size: clamp(1.15rem, 2.6vh + .3rem, 1.5rem); padding: .32em 1.3em; }
  .start__mitte { gap: calc(var(--luft) * .5); padding-top: max(1dvh, calc(13dvh - var(--sicher-hoehe))); }
}
@media (max-height: 620px) {
  .start__mitte { padding-top: max(1dvh, calc(8dvh - 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--ducken { animation-name: hand-runter; }
.hud__hand--springen { animation-name: hand-hoch; }
@keyframes hand-runter { 0%, 100% { transform: translateY(-34px); opacity: .6; } 50% { transform: translateY(34px); opacity: 1; } }
@keyframes hand-hoch { 0%, 100% { transform: translateY(34px); opacity: .6; } 50% { transform: translateY(-34px); opacity: 1; } }
.hud__hand { animation: none; }
}

/* ---------- Update: Welten, Rekorde, Power-ups, Nachtschicht, Bestenliste ---------- */
.levelraster__welt {
  grid-column: 1 / -1;
  margin: 10px 0 0;
  font-family: var(--schrift-display);
  font-size: 1.05rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--creme);
  text-shadow: 0 2px 0 var(--kohle);
}
.levelraster__welt:first-child { margin-top: 0; }
.level-kachel { position: relative; }
.level-kachel__rekord {
  position: absolute;
  right: 6px;
  top: 4px;
  font-size: .65rem;
  letter-spacing: .02em;
  color: var(--kohle-2);
  opacity: .8;
}
.ergebnis__rekord { margin: 0; font-family: var(--schrift-display); font-size: 1rem; color: var(--kohle-2); }
.ergebnis__rekord--neu { color: var(--tomate); font-size: 1.2rem; animation: rekord-pop .6s cubic-bezier(.2, 1.6, .5, 1); }
@keyframes rekord-pop { from { transform: scale(.4); } to { transform: scale(1); } }
.knopf--pro { background: var(--kohle); color: var(--creme); border-color: var(--tomate); box-shadow: 0 6px 0 rgba(217, 59, 43, .55); }
.knopf--pro:hover { background: #3D2A2A; }
.knopf--pro small { color: #FFB3A8; opacity: .95; }
.reiter { display: flex; justify-content: center; gap: 8px; }

/* ---------- Zusammen spielen: Lobby + Rangliste (Update 6) ---------- */
.knopf--zusammen { background: var(--salat); }
.knopf--zusammen:hover { background: #7FCB5C; }
.lobby-schirm .tafel__inhalt { overscroll-behavior: contain; }
.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: 400; 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: 400; 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 .brotchen { width: 24px; height: 14px; border: 2px solid var(--kohle); border-radius: 12px 12px 8px 8px / 10px 10px 6px 6px; }
.lobby__spieler li.lobby__ich { outline: 3px solid var(--tomate); 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: 400; 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__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.rang__wert::after { content: none; }
.rangliste__liste li.rang--weg { opacity: .55; }
.reiter__knopf { font-family: var(--schrift-display); font-size: 1rem; padding: .35em 1em; border: 3px solid var(--kohle); border-radius: 999px; background: var(--creme); color: var(--kohle); box-shadow: var(--schatten); cursor: pointer; min-height: 40px; }
.reiter__knopf.aktiv { background: var(--fladen); }
.reiter__knopf:focus-visible { outline: 4px solid var(--weiss); outline-offset: 2px; }
.knopf--nacht { background: var(--kohle-2); color: var(--creme); }
.knopf--nacht:hover { background: #4A4038; }
.knopf--nacht small { opacity: .85; }
.knopf--nacht[disabled] { opacity: .6; }

.hud__power {
  --farbe: #3B8BEB;
  --rest: 1;
  position: absolute;
  left: 50%;
  top: calc(var(--rand) + 140px);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--creme);
  border: 3px solid var(--kohle);
  border-radius: 999px;
  box-shadow: var(--schatten);
  font-family: var(--schrift-display);
  font-size: .95rem;
  color: var(--kohle);
}
.hud__power-ring {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: conic-gradient(var(--farbe) calc(var(--rest) * 360deg), var(--creme-dunkel) 0);
  border: 2px solid var(--kohle);
}
.hud__hinweis--klein { font-size: clamp(1.05rem, 3vh, 1.5rem); top: 52%; }
.hud__meter {
  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__meter b { font-size: clamp(2.4rem, 8vh, 4rem); font-weight: 400; }
.hud__meter span { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.hud__meter em { font-style: normal; color: var(--fladen); }
/* Verwarnungen des Chefs: drei Marken unter der Meterzahl */
.hud__verwarnungen { display: flex; gap: 8px; margin-top: 8px; }
.hud__verwarnungen i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--kohle); background: var(--creme); box-shadow: 0 3px 0 rgba(43, 37, 33, .35); position: relative; transition: background .2s ease; }
.hud__verwarnungen i::after { content: '!'; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--schrift-display); font-size: .95rem; line-height: 1; color: var(--kohle); opacity: .25; }
.hud__verwarnungen i.an { background: var(--tomate); }
.hud__verwarnungen i.an::after { color: var(--creme); opacity: 1; }
.hud__verwarnungen i.neu { animation: verwarnung-puls .5s ease-out; }
@keyframes verwarnung-puls { 0% { transform: scale(1); } 35% { transform: scale(1.5); } 100% { transform: scale(1); } }

.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; }
.dialog .bestenliste__hinweis { color: var(--tomate); text-shadow: none; }
.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: 800 1.05rem var(--schrift-text);
  color: var(--kohle);
  background: var(--weiss);
  border: 3px solid var(--kohle);
  border-radius: 999px;
  padding: .45em 1em;
  min-height: 48px;
  width: min(100%, 220px);
  text-align: center;
}
.bestenliste input:focus-visible, .bestenliste__eintrag input:focus-visible { outline: 4px solid var(--fladen); outline-offset: 2px; }

/* Gewitter: Regen als CSS-Schicht über dem Himmel, unter dem Canvas */
body[data-tageszeit="gewitter"]::before {
  content: '';
  position: fixed;
  inset: -20% 0 0 0;
  pointer-events: none;
  background: repeating-linear-gradient(105deg, transparent 0 14px, rgba(255, 255, 255, .18) 14px 15px, transparent 15px 32px);
  animation: regen .9s linear infinite;
}
@keyframes regen { from { transform: translateY(-40px); } to { transform: translateY(40px); } }
@media (prefers-reduced-motion: reduce) { body[data-tageszeit="gewitter"]::before { animation: none; } .ergebnis__rekord--neu { animation: none; } }
.knopf--gesperrt { opacity: .65; }
.bestenliste__hinweis--gut { color: #4E9A34 !important; }

/* iOS: -webkit-user-select:none am body verhindert, dass Eingabefelder den Fokus (und die Tastatur) bekommen */
input, textarea { -webkit-user-select: text !important; user-select: text !important; -webkit-touch-callout: default; touch-action: manipulation; }
button, a, label { touch-action: manipulation; }
.tafel .bestenliste { pointer-events: auto; }

/* 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; }
