/* =====================================================================
   Mampfisch – Oberfläche
   Tokens: Unterwasser-Palette, Baloo 2 (Display) + Nunito (Text).
   Signatur-Element: die Wachstums-Blase im HUD (füllt sich, platzt).
   ===================================================================== */

@font-face {
  font-family: 'Baloo 2';
  src: url('fonts/Baloo2.woff2') format('woff2');
  font-weight: 400 800;
  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 {
  --lagune: #1FA3C9;
  --lagune-hell: #4FD3EC;
  --tiefe: #0B3D6B;
  --sand: #E9D8A6;
  --koralle: #FF6B6B;
  --koralle-dunkel: #D94F4F;
  --seegras: #2FB36B;
  --sonne: #FFE066;
  --sonne-dunkel: #D9B22A;
  --perle: #F6F2FF;
  --creme: #FFFDF7;
  --creme-dunkel: #E8E2D2;
  --kohle: #1B2430;
  --kohle-2: #33404F;
  --weiss: #FFFFFF;

  --schrift-display: 'Baloo 2', 'Arial Rounded MT Bold', 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(27, 36, 48, .28);
}

*, *::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(--lagune-hell) 0%, var(--tiefe) 100%);
  -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(11, 61, 107, .45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.mono {
  font-family: var(--schrift-display);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ---------- Knöpfe ---------- */
.knopf {
  font-family: var(--schrift-display);
  font-weight: 800;
  font-size: clamp(1.05rem, 2.4vh + .4rem, 1.4rem);
  letter-spacing: .02em;
  color: var(--kohle);
  background: var(--sonne);
  border: 3px solid var(--kohle);
  border-radius: 999px;
  padding: .5em 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: #FFEB8F; }
.knopf:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(27, 36, 48, .28); }
.knopf:focus-visible { outline: 4px solid var(--weiss); outline-offset: 2px; }
.knopf--gross {
  font-size: clamp(1.4rem, 3.4vh + .5rem, 2rem);
  padding: .45em 1.6em;
  flex-direction: column;
  gap: 0;
  min-width: min(100%, 300px);
}
.knopf--gross small {
  font-family: var(--schrift-text);
  font-weight: 800;
  font-size: .5em;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .75;
}
.knopf--arena { background: var(--koralle); color: var(--creme); }
.knopf--arena:hover { background: #FF8585; }
.knopf--arena small { opacity: .9; }
.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-weight: 800;
  font-size: 1.15rem;
  color: var(--kohle);
  background: var(--creme);
  border: 3px solid var(--kohle);
  border-radius: 999px;
  padding: .2em .9em .2em .55em;
  box-shadow: var(--schatten);
}
.ico-muenze { width: 1.35em; height: 1.35em; fill: var(--sonne); stroke: var(--kohle); stroke-width: 1.6; }
.ico-muenze__innen { fill: var(--sonne-dunkel); stroke: none; }

/* ---------- Startbildschirm ---------- */
.start { justify-content: space-between; align-items: center; text-align: center; overflow-y: auto; overscroll-behavior: contain; }   /* passt es nicht (quer, iPhone-App mit Statusleiste), wird gescrollt statt abgeschnitten */
.start__kopf { padding-top: calc(var(--luft) * 1.5); position: relative; }
.titel {
  margin: 0;
  position: relative;
  font-family: var(--schrift-display);
  font-weight: 800;
  font-size: clamp(2.9rem, min(15vw, 12vh), 6.4rem);
  line-height: .95;
  color: var(--creme);
  text-shadow: 0 4px 0 var(--kohle), 0 8px 0 rgba(27, 36, 48, .35);
  transform: rotate(-3deg);
  display: inline-block;
  padding: .1em .2em;
}
.titel__blase {
  position: absolute;
  right: -.1em;
  top: -.35em;
  width: .55em;
  height: .55em;
  border-radius: 50%;
  border: 3px solid var(--kohle);
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, .95) 0 18%, rgba(255, 255, 255, .25) 20% 100%);
  animation: blase-schweben 3.2s ease-in-out infinite;
}
.titel__blase::after {
  content: '';
  position: absolute;
  left: -.55em;
  top: .55em;
  width: .3em;
  height: .3em;
  border-radius: 50%;
  border: 3px solid var(--kohle);
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, .95) 0 18%, rgba(255, 255, 255, .25) 20% 100%);
}
@keyframes blase-schweben { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.18em); } }
.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(22dvh - 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;
}
.hinweis kbd { margin-inline: 1px; }
.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;
}
kbd {
  font-family: var(--schrift-display);
  font-weight: 800;
  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; }

/* ---------- 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;
  -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: 800; letter-spacing: .01em; }
.anleitung__liste li > div > b:first-child { display: block; font-size: 1.05rem; margin-bottom: 2px; }
.anleitung__liste kbd { font-size: .8em; }
@media (min-width: 46rem) {
  .dialog.anleitung { width: min(100%, 860px); }
  .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; } }

/* ---------- Tafeln (Level, Shop) ---------- */
.tafel { padding: 0; background: rgba(11, 61, 107, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.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: 800;
  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;
}

.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: 10px 0 0;
  font-family: var(--schrift-display);
  font-weight: 800;
  font-size: 1.15rem;
  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 {
  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: 2px;
  font-family: var(--schrift-display);
  font-weight: 800;
  font-size: clamp(1.2rem, 4.5vw, 2rem);
  line-height: 1;
  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(--sonne); }
.level-kachel--boss:not(.level-kachel--gesperrt) { background: var(--koralle); color: var(--creme); }
.level-kachel--boss.level-kachel--aktuell { background: var(--koralle); }
.level-kachel--gesperrt { background: rgba(255, 253, 247, .75); border-color: rgba(27, 36, 48, .45); color: rgba(27, 36, 48, .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(10px, 3vw, 16px); height: clamp(10px, 3vw, 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(--sonne); }
.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: 600px;
  margin: 0 auto;
  width: 100%;
}
.skin-karte {
  border: 3px solid var(--kohle);
  border-radius: 18px;
  background: var(--creme);
  box-shadow: var(--schatten);
  padding: 8px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  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(--sonne); }
.skin-karte__bild { width: 100%; max-width: 128px; aspect-ratio: 16 / 10; object-fit: contain; }
.skin-karte__name { font-family: var(--schrift-display); font-weight: 800; font-size: clamp(.78rem, 2.6vw, .95rem); line-height: 1.1; max-width: 100%; overflow-wrap: anywhere; hyphens: auto; }
.skin-karte__preis {
  font-family: var(--schrift-display);
  font-weight: 800;
  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(--koralle-dunkel); }

/* ---------- 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: 800;
  font-size: clamp(1.7rem, 5vh, 2.5rem);
  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; min-width: 0; }
.ergebnis__kopf { margin: 0; font-size: .9rem; 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-weight: 800; font-size: 1.5rem; line-height: 1; }
.ergebnis--fehl h2 { color: var(--koralle-dunkel); }

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; padding: var(--rand); }
.hud .knopf { pointer-events: auto; }
.hud__zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: var(--luft); }
.hud__ziel {
  display: inline-flex;
  flex-direction: column;
  justify-self: start;
  max-width: 100%;
  font-family: var(--schrift-display);
  font-weight: 800;
  color: var(--kohle);
  background: var(--creme);
  border: 3px solid var(--kohle);
  border-radius: 18px;
  padding: .3em .8em .35em;
  box-shadow: var(--schatten);
  line-height: 1.15;
}
.hud__ziel .mono { font-size: .7rem; opacity: .7; }
.hud__ziel b { font-size: .95rem; }
.hud__stand { font-family: var(--schrift-display); font-weight: 800; font-size: 1.15rem; color: var(--lagune); }
.hud__stand:empty { display: none; }
.hud__rechts { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; justify-self: end; }
.hud__muenzen {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  font-family: var(--schrift-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--kohle);
  background: var(--creme);
  border: 3px solid var(--kohle);
  border-radius: 999px;
  padding: .15em .8em .15em .5em;
  box-shadow: var(--schatten);
  white-space: nowrap;
}
.hud__leben { display: inline-flex; gap: 4px; }
.leben { width: 34px; height: 26px; fill: var(--koralle); stroke: var(--kohle); stroke-width: 1.5; stroke-linejoin: round; filter: drop-shadow(0 3px 0 rgba(27, 36, 48, .3)); transition: transform .3s ease, opacity .3s ease; }
.leben__auge { fill: var(--kohle); stroke: none; }
.leben--weg { opacity: .25; transform: scale(.7); fill: var(--creme-dunkel); }

/* Wachstums-Blase: Signatur-Element */
.hud__blase { position: relative; width: clamp(64px, 11vh, 84px); height: clamp(64px, 11vh, 84px); display: grid; place-items: center; filter: drop-shadow(0 4px 0 rgba(27, 36, 48, .3)); }
.hud__blase svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.blase__glas { fill: rgba(255, 253, 247, .85); }
.blase__wasser { fill: var(--lagune); transition: none; }
.blase__rand { fill: none; stroke: var(--kohle); stroke-width: 4; }
.blase__glanz { fill: rgba(255, 255, 255, .85); }
.hud__blase b { position: relative; font-family: var(--schrift-display); font-weight: 800; font-size: clamp(1.6rem, 4.5vh, 2.2rem); line-height: 1; color: var(--kohle); text-shadow: 0 2px 0 rgba(255, 255, 255, .6); }
.hud__blase-label { position: absolute; bottom: -1.2em; left: 50%; transform: translateX(-50%); font-family: var(--schrift-display); font-weight: 800; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--creme); text-shadow: 0 2px 0 var(--kohle); white-space: nowrap; }
.hud__blase.platzt svg { animation: blase-platzt .7s cubic-bezier(.2, 1.6, .5, 1); }
.hud__blase.platzt::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 4px solid var(--creme);
  animation: blase-ring .7s ease-out forwards;
}
@keyframes blase-platzt { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 60% { transform: scale(.85); } 100% { transform: scale(1); } }
@keyframes blase-ring { 0% { transform: scale(.8); opacity: 1; } 100% { transform: scale(1.9); opacity: 0; } }

.hud__zeit {
  position: absolute;
  left: 50%;
  top: calc(var(--rand) + clamp(64px, 11vh, 84px) + 22px);
  transform: translateX(-50%);
  font-family: var(--schrift-display);
  font-weight: 800;
  font-size: clamp(1.4rem, 4vh, 2rem);
  color: var(--creme);
  text-shadow: 0 3px 0 var(--kohle);
  letter-spacing: .04em;
}
.hud__zeit--knapp { color: var(--koralle); animation: zeit-puls .5s ease-in-out infinite alternate; }
@keyframes zeit-puls { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.15); } }

.rangliste {
  list-style: none;
  margin: 0;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(255, 253, 247, .9);
  border: 3px solid var(--kohle);
  border-radius: 14px;
  box-shadow: var(--schatten);
  font-family: var(--schrift-display);
  font-weight: 800;
  font-size: .85rem;
  min-width: 150px;
}
#hud-rangliste { position: absolute; right: var(--rand); top: var(--rand); }
.rangliste li { display: grid; grid-template-columns: 1.4em minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 1px 4px; border-radius: 8px; }
.rangliste li.rang--du { background: var(--sonne); }
.rangliste li.rang--weg { opacity: .45; }
.rang__platz { opacity: .6; }
.rang__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rangliste--ergebnis { width: 100%; font-size: 1rem; }

#btn-pause { position: absolute; right: var(--rand); bottom: var(--rand); }
/* ---------- Online-Arena: Startknöpfe, Lobby (Update 2) ---------- */
.start__doppel { display: flex; gap: calc(var(--luft) * .7); flex-wrap: wrap; justify-content: center; }
.knopf--online { background: var(--koralle); color: var(--creme); }
.knopf--online:hover { background: #FF8585; }
.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: 800; 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); -webkit-user-select: text !important; user-select: text !important; }
.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(--sonne); 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(--sonne); text-shadow: 0 4px 0 var(--kohle); background: rgba(27, 36, 48, .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: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--creme); color: var(--kohle); border: 3px solid var(--kohle); border-radius: 14px; padding: 4px 14px 4px 8px; font-weight: 800; text-align: left; min-height: 44px; }
.lobby__spieler li b { font-family: var(--schrift-display); font-weight: 800; 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 .lobby__fisch img { display: block; width: 40px; height: 25px; object-fit: contain; }
.lobby__spieler li.lobby__ich { outline: 3px solid var(--koralle); 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%; }
.chip { font-family: var(--schrift-display); font-weight: 800; 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(--sonne); }
.chip:focus-visible { outline: 4px solid var(--creme); outline-offset: 2px; }
.lobby__info { margin: 0; font-weight: 800; text-shadow: 0 2px 0 var(--kohle); }
.rangliste li.rang--mensch .rang__name { color: #B36B00; }
/* Schwanzschlag-Knopf (Update 2): unten links, Pausenring läuft ab */
#btn-dash { position: absolute; left: var(--rand); bottom: var(--rand); width: 64px; height: 64px; background: var(--sonne); }
#btn-dash::before { content: ''; position: absolute; inset: -5px; border-radius: 50%; background: conic-gradient(rgba(27, 36, 48, .55) var(--rest, 0%), transparent 0); z-index: -1; }
#btn-dash.bereit::before { background: none; }
#btn-dash.bereit { box-shadow: 0 0 0 4px rgba(255, 224, 102, .35), var(--schatten); }
#btn-dash svg { width: 32px; height: 32px; }
.hud__serie { position: absolute; left: calc(100% + 8px); top: 4px; display: flex; flex-direction: column; align-items: center; padding: 4px 10px; border-radius: 14px; background: var(--sonne); border: 3px solid var(--kohle); color: var(--kohle); box-shadow: var(--schatten); white-space: nowrap; }
.hud__serie b { font-family: var(--schrift-display); font-weight: 800; font-size: 1.3rem; line-height: 1; }
.hud__serie span { font-size: .65rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.hud__serie.an { animation: serie-pop .35s cubic-bezier(.2, 1.6, .5, 1); }
@keyframes serie-pop { 0% { transform: scale(.6); } 100% { transform: scale(1); } }
.hud__hinweis {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%) scale(.6);
  font-family: var(--schrift-display);
  font-weight: 800;
  font-size: clamp(1.4rem, 5vh, 2.4rem);
  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);
  text-align: center;
  max-width: calc(100% - 2 * var(--rand));
  line-height: 1.1;
}
.hud__hinweis.an { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.hud__hinweis--schlecht { color: var(--koralle); }
.hud__popups { position: fixed; inset: 0; overflow: hidden; }
.popup {
  position: absolute;
  transform: translateX(-50%);
  font-family: var(--schrift-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--creme);
  text-shadow: 0 2px 0 var(--kohle);
  white-space: nowrap;
  animation: popup-hoch .9s ease-out forwards;
}
.popup--gut { color: var(--sonne); }
.popup--schlecht { color: var(--koralle); }
.popup--muenze { color: var(--sonne); }
@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: 30%;
  transform: translate(-50%, -50%) scale(.4) rotate(-6deg);
  font-family: var(--schrift-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 9vh, 4.5rem);
  color: var(--sonne);
  text-shadow: 0 4px 0 var(--kohle), 0 8px 0 rgba(27, 36, 48, .35);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  line-height: 1;
  max-width: calc(100% - 2 * var(--rand));
  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-weight: 800;
  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); }

/* ---------- Mobil ---------- */
@media (max-width: 40rem) {
  .textlink { font-size: .85rem; padding-inline: 4px; }
  .tafel__kopf h2 { font-size: 1.6rem; white-space: nowrap; }
  .hud__ziel .mono { display: none; }
  .hud__ziel b { font-size: .8rem; }
  .hud__ziel { padding: .25em .6em; border-radius: 14px; }
  .hud__muenzen { font-size: .9rem; padding: .1em .6em .1em .4em; }
  .leben { width: 26px; height: 20px; }
  .start__mitte { padding-top: max(1dvh, calc(14dvh - var(--sicher-hoehe))); }
  .hinweis { display: none; }
  .knopf { white-space: normal; }
  .rangliste { min-width: 120px; font-size: .75rem; padding: 4px 6px; }
  #hud-rangliste { top: calc(var(--rand) + 92px); }
  .banner { font-size: clamp(2rem, 7vh, 3rem); }
}
@media (max-height: 620px) {
  .start__mitte { padding-top: max(1dvh, calc(6dvh - var(--sicher-hoehe))); }
}

/* ---------- Reduzierte Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
  .knopf, .level-kachel, .skin-karte, .hud__hinweis, .leben, body { transition: none; }
  .popup { animation-duration: .01s; }
  .titel__blase, .hud__zeit--knapp, .hud__blase.platzt svg { animation: none; }
}

/* 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(11, 61, 107, .45); }
.tafel { box-shadow: 0 0 0 var(--sicher-rand) rgba(11, 61, 107, .55); }

/* ---------- Update 3: „Immer größer!" (Zahlen), Duell, Bestenliste ---------- */
input, textarea { -webkit-user-select: text !important; user-select: text !important; }
.start__mitte { width: min(100%, 620px); }
.start__mitte > .knopf--endlos { width: 100%; }
.start__doppel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.start__doppel .knopf--gross { min-width: 0; width: 100%; font-size: clamp(1.15rem, 2.5vh + .45rem, 1.7rem); padding: .4em .5em; white-space: normal; }
/* Hauptknopf: das Grün der fressbaren Zahlen */
.knopf--endlos { position: relative; background: linear-gradient(180deg, #8CF59A 0%, #3CC77A 100%); font-size: clamp(1.55rem, 4vh + .5rem, 2.4rem); padding: .4em 1em; }
.knopf--endlos:hover { background: linear-gradient(180deg, #A4FFB0 0%, #4BD889 100%); }
.neu-marke { position: absolute; top: -14px; right: 16px; font-family: var(--schrift-text); font-size: .38em; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--creme); background: var(--koralle); border: 2.5px solid var(--kohle); border-radius: 999px; padding: .15em .75em; transform: rotate(6deg); box-shadow: 0 3px 0 rgba(27, 36, 48, .3); }
.knopf--duell { background: var(--lagune); color: var(--creme); }
.knopf--duell:hover { background: var(--lagune-hell); color: var(--kohle); }
.knopf--duell small { opacity: .9; }
.start__reihe--vier { display: grid; grid-template-columns: repeat(4, auto); justify-content: center; }
.start__reihe--vier .knopf { padding-inline: .9em; }
@media (max-width: 34rem) {
  .start__reihe--vier { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .start__reihe--vier .knopf { width: 100%; }
  .neu-marke { top: -12px; right: 10px; }
}

/* HUD im Zahlen-Modus: Zahl in der Blase, links Rekord bzw. Gegner, rechts Rettung + Power-ups */
.hud__blase--zahl b { font-size: clamp(1.45rem, 4vh, 2rem); }
.hud__blase--zahl b.zahl--mittel { font-size: clamp(1.05rem, 3vh, 1.45rem); }
.hud__blase--zahl b.zahl--klein { font-size: clamp(.8rem, 2.2vh, 1.05rem); }
.hud__ziel--rekord b, .hud__ziel--gegner b { font-size: 1.35rem; line-height: 1; }
.hud__ziel.hud__ziel--rekord .mono, .hud__ziel.hud__ziel--gegner .mono { display: block; font-size: .62rem; letter-spacing: .08em; }
.hud__ziel--neu { background: var(--sonne); animation: rekord-puls 1.2s ease-in-out infinite; }
@keyframes rekord-puls { 50% { transform: scale(1.06); } }
.hud__ziel--gefahr b { color: var(--koralle-dunkel); }
.hud__ziel--beute b { color: #1E9E57; }
.hud__rettung { display: inline-flex; align-items: center; gap: .35em; font-family: var(--schrift-display); font-weight: 800; font-size: .85rem; color: var(--kohle); background: var(--creme); border: 3px solid var(--kohle); border-radius: 999px; padding: .1em .7em .1em .3em; box-shadow: var(--schatten); white-space: nowrap; transition: opacity .3s ease, transform .3s ease; }
.rettung-blase { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 18%, #FFF3B0 30%, #FFD84D 100%); border: 2.5px solid var(--kohle); }
.hud__rettung.verbraucht { opacity: .45; transform: scale(.9); }
.hud__rettung.verbraucht .rettung-blase { background: var(--creme-dunkel); }
.hud__rettung.verbraucht b { text-decoration: line-through; }
.hud__power { display: flex; gap: 6px; }
.hud__power:empty { display: none; }
.power { --rest: 100%; position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--kohle) var(--rest), rgba(27, 36, 48, .25) 0); box-shadow: var(--schatten); }
.power::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--creme); }
.power svg { position: relative; width: 22px; height: 22px; }
.popup--gold { color: #FFC83D; font-size: 1.8rem; }

/* Duell: Gegner wählen */
.duell-wahl { width: min(100%, 460px); }
.duell-wahl__text { margin: 0; font-weight: 700; }
.duell-wahl .lobby__label { text-shadow: none; color: var(--kohle-2); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.duell-wahl__stufen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.duell-wahl__stufen .knopf { width: 100%; padding-inline: .4em; }
.duell-wahl__stufen [data-stufe="leicht"] { background: #8CF59A; }
.duell-wahl__stufen [data-stufe="schwer"] { background: var(--koralle); color: var(--creme); }
.duell-wahl .knopf--gross { width: 100%; }
.duell-wahl__bilanz { margin: 0; font-size: .85rem; font-weight: 700; color: var(--kohle-2); }
.duell-wahl__bilanz:empty { display: none; }

/* Bestenliste (Tafel) */
.bestenliste { max-width: 480px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: calc(var(--luft) * .7); color: var(--creme); text-align: center; padding-bottom: var(--luft); }
.bestenliste__kopf { margin: 0; font-family: var(--schrift-display); font-weight: 800; font-size: 1.1rem; text-shadow: 0 2px 0 var(--kohle); }
.bestenliste__eigen { margin: 0; font-weight: 800; text-shadow: 0 2px 0 var(--kohle); }
.bestenliste__eigen:empty { display: none; }
.bestenliste__liste { list-style: none; margin: 0; padding: 8px; display: flex; flex-direction: column; gap: 2px; background: rgba(255, 253, 247, .94); color: var(--kohle); border: 3px solid var(--kohle); border-radius: 16px; box-shadow: var(--schatten); font-family: var(--schrift-display); font-weight: 800; font-size: 1.05rem; text-align: left; }
.bestenliste__liste:empty { display: none; }
.bestenliste__liste li { display: grid; grid-template-columns: 2em minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 3px 8px; border-radius: 10px; }
.bestenliste__liste li:nth-child(-n+3) .rang__platz { opacity: 1; color: var(--sonne-dunkel); }
.bestenliste__liste li.bl--du { background: var(--sonne); }
.bestenliste__status { margin: 0; font-weight: 700; opacity: .85; }
.bestenliste__status:empty { display: none; }

/* Ergebnis: Spitzname für die Bestenliste */
.ergebnis__eintrag { width: 100%; display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: .85rem; }
.ergebnis__eintrag-zeile { display: flex; gap: 6px; }
.ergebnis__eintrag input { flex: 1 1 auto; min-width: 0; font-family: var(--schrift-display); font-weight: 800; font-size: 1.1rem; color: var(--kohle); background: var(--weiss); border: 3px solid var(--kohle); border-radius: 999px; padding: .3em .9em; min-height: 44px; text-align: center; }
.ergebnis__eintrag input:focus-visible { outline: 4px solid var(--lagune); outline-offset: 1px; }
.ergebnis__eintrag .knopf { flex: 0 0 auto; }
.ergebnis__eintrag-status { margin: 0; font-weight: 700; color: var(--kohle-2); min-height: 1.2em; }
.ergebnis__eintrag-status:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .hud__ziel--neu { animation: none; } }

/* Zahlen-Modus: Hinweise unter dem eigenen Fisch (Bildmitte), Combo unter der Blase auf schmalen Schirmen, Rettung als Symbol */
.hud--zahl .hud__hinweis { top: 74%; font-size: clamp(1.2rem, 4vh, 2rem); }
@media (max-width: 40rem) {
  .hud__blase--zahl .hud__serie { left: 0; right: 0; margin-inline: auto; width: max-content; top: calc(100% + 1.45em); flex-direction: row; gap: 6px; padding: 2px 10px; }
  .hud__blase--zahl .hud__serie b { font-size: 1.05rem; }
  .hud__rettung { padding: .15em; }
  .hud__rettung b { display: none; }
}

/* Dialoge nie breiter als der Bildschirm: die Grid-Spur richtet sich sonst nach dem breitesten Inhalt (Ergebnis mit Namensfeld
   wurde auf 390 px 420 px breit, „Eintragen" und Münzen rechts abgeschnitten) */
.schirm--dialog { grid-template-columns: minmax(0, 1fr); }
.dialog { max-width: 100%; min-width: 0; }
.ergebnis__eintrag input { width: 0; }
.ergebnis__eintrag .knopf { padding-inline: .9em; }
.ergebnis__text { overflow-wrap: anywhere; }
@media (max-width: 40rem) { .hud--zahl .hud__hinweis { font-size: clamp(1.05rem, 3vh, 1.5rem); max-width: 80%; } }
/* Ergebnis quer (Handy, 390 px hoch): mit Namensfeld lag „Menü" unter dem Bildrand – kompakter und notfalls scrollbar */
.dialog.ergebnis { max-height: calc(100dvh - 2 * var(--rand) - var(--sicher-hoehe)); overflow-y: auto; overscroll-behavior: contain; }
@media (max-height: 500px) {
  .dialog.ergebnis { gap: 6px; padding-block: 10px; }
  .dialog.ergebnis h2 { font-size: 1.5rem; }
  .ergebnis__werte dd { font-size: 1.2rem; }
  .ergebnis__werte div { padding-block: 3px; }
  .dialog.ergebnis .knopf--gross { font-size: 1.15rem; padding-block: .25em; }
  .ergebnis__eintrag input { min-height: 40px; padding-block: .15em; }
}
@media (max-height: 500px) {
  /* „Nochmal!" und „Menü" nebeneinander statt untereinander (spart eine ganze Knopfzeile) */
  .dialog.ergebnis { flex-flow: row wrap; justify-content: center; align-content: flex-start; }
  .dialog.ergebnis > * { flex: 0 0 100%; }
  .dialog.ergebnis > #btn-erg-weiter, .dialog.ergebnis > .dialog__reihe { flex: 0 1 auto; }
  .dialog.ergebnis > .sterne { justify-content: center; }
}
