/* =====================================================================
   Kinderzimmer-Kommando – Oberfläche
   Tokens: Spielzeugkiste – Kohle-Kontur, Papier, Holz, Grundfarben der vier Flieger, Zauber-Lila der Gegner.
   Schriften: Lilita One (Display, Zahlen, Knöpfe) + Nunito (Text).
   Signatur-Element: der Aufzieh-Schlüssel – als Lade-Knopf dreht er sich beim Aufziehen, drei Kerben leuchten.
   Safe Area: #ui ist per top/right/bottom/left an env(safe-area-inset-*) gebunden (Homescreen-App auf dem iPhone).
   ===================================================================== */

@font-face { font-family: 'Lilita One'; src: url('fonts/LilitaOne.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Lilita One'; src: url('fonts/LilitaOne-ext.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Nunito'; src: url('fonts/Nunito.woff2') format('woff2'); font-weight: 200 1000; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito'; src: url('fonts/Nunito-ext.woff2') format('woff2'); font-weight: 200 1000; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --kohle: #2B2521;
  --kohle-2: #4A4440;
  --papier: #FFF8E7;
  --papier-dunkel: #EADFC4;
  --holz: #D9A05B;
  --holz-dunkel: #B07A45;
  --tomate: #E55934;
  --himmel: #4D9DE0;
  --senf: #FFC93C;
  --senf-hell: #FFE08A;
  --gras: #7BC74D;
  --zauber: #B03CFF;
  --zauber-hell: #E5A8FF;
  --rosa: #FF6BC1;
  --weiss: #FFFFFF;

  --schrift-display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --schrift-text: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --rand: clamp(12px, 3.5vw, 28px);
  --radius: 20px;
  --schatten: 0 5px 0 rgba(43, 37, 33, .9);
  --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));
  --sicher-hoehe: calc(env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px));

  /* Spielfeld im #ui (setzt main.js) */
  --fx: 0px; --fy: 0px; --fb: 100%; --fh: 100%; --fk: 540px; --leiste: 110px;
}

*, *::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: #8FD3F4;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
input, textarea { -webkit-user-select: text !important; user-select: text !important; }
[hidden] { display: none !important; }

#buehne { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
/* misst die sicheren Ränder (main.js liest das Padding) – #ui selbst wird im gedrehten Spiel verschoben */
#sicher-probe { position: fixed; top: 0; left: 0; width: 0; height: 0; visibility: hidden; pointer-events: none;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }

#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, .55);
  box-shadow: 0 0 0 var(--sicher-rand) rgba(43, 37, 33, .55);
  overflow-y: auto;
}

/* ---------- Knöpfe ---------- */
.knopf {
  font-family: var(--schrift-display);
  font-size: clamp(1.05rem, 2.2vh + .45rem, 1.35rem);
  letter-spacing: .02em;
  color: var(--kohle);
  background: var(--senf);
  border: 3px solid var(--kohle);
  border-radius: 16px;
  padding: .45em 1.3em;
  min-height: 48px; min-width: 48px;
  box-shadow: var(--schatten);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  line-height: 1.1;
  max-width: 100%;
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
}
.knopf:hover { filter: brightness(1.07); }
.knopf:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(43, 37, 33, .9); }
.knopf:focus-visible, .sknopf:focus-visible, .chip:focus-visible { outline: 4px solid var(--weiss); outline-offset: 3px; }
.knopf:disabled { opacity: .45; cursor: default; transform: none; }
.knopf--gross { font-size: clamp(1.45rem, 3.4vh + .5rem, 2.1rem); padding: .4em 1.5em; flex-direction: column; gap: 0; min-width: min(100%, 300px); }
.knopf--gross small { font-family: var(--schrift-text); font-weight: 800; font-size: .48em; letter-spacing: .02em; opacity: .8; }
.knopf--blau { background: var(--himmel); color: var(--weiss); }
.knopf--gruen { background: var(--gras); }
.knopf--leise { background: var(--papier); }
.knopf--rund { border-radius: 50%; padding: 0; width: 52px; height: 52px; }
.knopf--klein { width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-width: 2.5px; box-shadow: 0 3px 0 rgba(43, 37, 33, .9); }
.knopf svg { width: 56%; height: 56%; fill: currentColor; }
.knopf[aria-pressed="true"] .ico-aus, .knopf[aria-pressed="false"] .ico-an { display: none; }
.knopf[aria-pressed="false"] { background: var(--papier-dunkel); }

kbd {
  font-family: var(--schrift-display); font-size: .85em;
  display: inline-block; min-width: 1.6em; padding: .05em .35em; margin: 0 .08em;
  border: 2px solid var(--kohle); border-radius: 6px; background: var(--papier); box-shadow: 0 2px 0 var(--kohle);
  text-align: center; line-height: 1.3;
}
.textlink { color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Startbildschirm (über der Vorführung) ---------- */
.start {
  align-items: center; justify-content: space-between; text-align: center;
  overflow-y: auto;
  gap: clamp(8px, 2vh, 20px);
}
/* Abdunkeln unten über den GANZEN Bildschirm (fixed = Viewport), nicht nur über den sicheren Bereich */
.start::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, rgba(43, 37, 33, 0) 35%, rgba(43, 37, 33, .5) 100%); }
.start__kopf { margin-top: clamp(0px, 2vh, 24px); }
.start__ueber {
  display: inline-block; margin: 0 0 .4em;
  font-family: var(--schrift-display); font-size: clamp(.95rem, 2.4vh, 1.3rem); letter-spacing: .04em;
  color: var(--weiss); background: var(--zauber); border: 3px solid var(--kohle); border-radius: 12px; padding: .15em .7em;
  box-shadow: 0 4px 0 var(--kohle); transform: rotate(-2deg);
}
.titel { margin: 0; font-family: var(--schrift-display); font-weight: 400; line-height: .95; letter-spacing: .01em; }
.titel__zeile {
  display: block;
  font-size: clamp(2.2rem, min(9vw, 11vh), 5.2rem);
  color: var(--weiss);
  -webkit-text-stroke: 0; paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--kohle), 3px 0 0 var(--kohle), -3px 0 0 var(--kohle), 0 -3px 0 var(--kohle), 3px 3px 0 var(--kohle), -3px 3px 0 var(--kohle), 3px -3px 0 var(--kohle), -3px -3px 0 var(--kohle), 0 8px 0 rgba(43, 37, 33, .35);
}
.titel__zeile--2 { color: var(--senf); font-size: clamp(2.8rem, min(12vw, 14vh), 6.8rem); position: relative; display: inline-block; }
.titel__schluessel {
  position: absolute; right: -.95em; top: 50%; width: .9em; height: .9em; transform: translateY(-50%) rotate(90deg);
  animation: aufziehen-langsam 3s ease-in-out infinite;
}
.start__mitte { display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 2vh, 18px); width: min(100%, 520px); }
.start__reihe { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.start__fuss { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--weiss); text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.start__schalter { display: flex; gap: 10px; }
.rechtliches { display: flex; flex-wrap: wrap; justify-content: center; gap: .5em; font-size: .9rem; }
.rechtliches a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px; }   /* Tippfläche ≥ 40 px */
.rechtliches span { align-self: center; }
.credit { margin: 0; font-size: .72rem; opacity: .75; letter-spacing: .04em; }

/* Schlüssel-Grafik (Titel und Lade-Knopf) */
.schaft { fill: none; stroke: var(--kohle); stroke-width: 7; stroke-linecap: round; }
.fluegel { fill: var(--senf); stroke: var(--kohle); stroke-width: 3.5; stroke-linejoin: round; }
.nabe { fill: var(--holz); stroke: var(--kohle); stroke-width: 3; }
.stift { fill: none; stroke: var(--kohle); stroke-width: 4; stroke-linecap: round; }

/* ---------- Tafel (Vorbereitung) ---------- */
.tafel { background: rgba(255, 248, 231, .94); box-shadow: 0 0 0 var(--sicher-rand) rgba(255, 248, 231, .94); padding-bottom: 0; }
.tafel__kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tafel__kopf h2 { margin: 0; font-family: var(--schrift-display); font-weight: 400; font-size: clamp(1.5rem, 4vh, 2.2rem); text-align: center; }
.tafel__platz { width: 44px; }
.tafel__inhalt { flex: 1; overflow-y: auto; margin: 10px calc(-1 * var(--rand)) 0; padding: 4px var(--rand) 16px; }
.tafel__fuss { display: flex; justify-content: center; padding: 10px 0 var(--rand); }

.wahl { display: grid; gap: clamp(10px, 2.2vh, 20px); align-content: start; max-width: 980px; margin-inline: auto; width: 100%; }
.wahl__gruppe { border: 0; margin: 0; padding: 0; min-width: 0; }
.wahl__gruppe legend { font-family: var(--schrift-display); font-size: 1.15rem; margin-bottom: 6px; padding: 0; }
.wahl__text { margin: 8px 0 0; font-size: .95rem; font-weight: 700; color: var(--kohle-2); min-height: 2.6em; }

.chip {
  font: inherit; color: var(--kohle); cursor: pointer;
  background: var(--weiss); border: 3px solid var(--kohle); border-radius: 14px; box-shadow: 0 4px 0 var(--kohle);
  padding: 8px 10px; min-height: 48px; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
  transition: transform .08s ease, box-shadow .08s ease;
}
.chip:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--kohle); }
.chip[aria-pressed="true"] { background: var(--senf); }
.chip:disabled { opacity: .45; cursor: default; }
.chip b { font-family: var(--schrift-display); font-weight: 400; font-size: 1.15rem; line-height: 1.1; }
.chip small { font-size: .78rem; font-weight: 800; color: var(--kohle-2); line-height: 1.15; }

.stufen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stufen .chip[data-stufe="pro"] { background: var(--kohle); color: var(--weiss); }
.stufen .chip[data-stufe="pro"] small { color: var(--zauber-hell); }
.stufen .chip[data-stufe="pro"][aria-pressed="true"] { background: var(--zauber); }
.schiffe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.schiffe canvas { width: 72px; height: 44px; }
.raeume { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.raeume .chip { min-height: 64px; }
.raeume .chip .nr { font-family: var(--schrift-display); font-size: 1.5rem; line-height: 1; }
.raeume .chip:disabled .nr::after { content: ' 🔒'; font-size: .7em; }

@media (max-width: 40rem) {
  .stufen, .schiffe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raeume { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
}

/* ---------- Dialoge ---------- */
.dialog {
  width: min(100%, 440px);
  max-height: calc(var(--ui-h, calc(100dvh - var(--sicher-hoehe))) - 2 * var(--rand));   /* --ui-h: Höhe von #ui, auch im gedrehten Spiel */
  overflow-y: auto;
  background: var(--papier); border: 4px solid var(--kohle); border-radius: 24px; box-shadow: 0 8px 0 var(--kohle);
  padding: clamp(14px, 3vh, 26px) clamp(16px, 4vw, 28px);
  display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 1.8vh, 14px); text-align: center;
}
.dialog h2 { margin: 0; font-family: var(--schrift-display); font-weight: 400; font-size: clamp(1.7rem, 5vh, 2.5rem); line-height: 1.05; }
.dialog__reihe { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ergebnis__kopf { margin: 0; font-family: var(--schrift-display); letter-spacing: .08em; color: var(--kohle-2); font-size: .95rem; }
.ergebnis__text { margin: 0; font-weight: 700; }
.ergebnis__werte { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; width: 100%; }
.ergebnis__werte div { background: var(--weiss); border: 3px solid var(--kohle); border-radius: 14px; padding: 6px 4px; }
.ergebnis__werte dt { font-size: .78rem; font-weight: 800; color: var(--kohle-2); }
.ergebnis__werte dd { margin: 0; font-family: var(--schrift-display); font-size: clamp(1.1rem, 3vh, 1.5rem); }
.ergebnis__rekord { margin: 0; font-family: var(--schrift-display); font-size: 1.3rem; color: var(--weiss); background: var(--rosa); border: 3px solid var(--kohle); border-radius: 12px; padding: .1em .7em; transform: rotate(-2deg); }
.anleitung { width: min(100%, 620px); text-align: left; align-items: stretch; }
.anleitung h2 { text-align: center; }
.anleitung__liste { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: .98rem; line-height: 1.4; }
.anleitung__liste li > b:first-child { font-family: var(--schrift-display); font-weight: 400; font-size: 1.08rem; display: block; }
.anleitung .knopf { align-self: center; position: sticky; bottom: 0; }   /* bleibt sichtbar, auch wenn der Text scrollt */

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; font-family: var(--schrift-display); color: var(--weiss); }
.hud__oben {
  position: absolute; left: var(--hx, var(--fx)); top: var(--fy); width: var(--hb, var(--fb));
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: 6px 8px 0;
  --hud-gr: clamp(13px, calc(var(--fk) * .036), 22px);
  font-size: var(--hud-gr);
}
.hud__oben .knopf { pointer-events: auto; flex: none; }
.hud__spieler { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.spieler {
  display: flex; align-items: center; gap: .45em;
  background: rgba(43, 37, 33, .62); border-radius: 12px; padding: .2em .6em .2em .35em;
  line-height: 1; white-space: nowrap;
  border: 2px solid var(--farbe, var(--tomate));
}
.spieler__punkte { min-width: 4.2em; text-align: right; letter-spacing: .02em; }
.spieler__leben, .spieler__bomben, .spieler__schild { display: inline-flex; align-items: center; gap: .1em; }
.spieler svg { width: 1em; height: 1em; }
.spieler .herz { fill: #FF5A7A; stroke: var(--kohle); stroke-width: 2; }
.spieler .pip { width: .5em; height: .7em; border-radius: 3px; background: var(--himmel); border: 1.5px solid var(--weiss); }
.spieler .pip.leer { background: transparent; opacity: .5; }
.spieler__waffe { font-size: .82em; padding: .15em .45em; border-radius: 8px; color: var(--kohle); background: var(--waffe, var(--senf)); }
.spieler.tot { opacity: .55; }
.hud__boss { position: absolute; left: 50%; top: calc(var(--hud-gr) * 2.6); transform: translateX(-50%); width: min(46%, 420px); text-align: center; }
.hud__boss b { display: block; font-weight: 400; font-size: .85em; text-shadow: 0 2px 0 var(--kohle), 2px 0 0 var(--kohle), -2px 0 0 var(--kohle), 0 -2px 0 var(--kohle); margin-bottom: 3px; }
.hud__bossbalken { height: .7em; border: 2px solid var(--kohle); border-radius: 99px; background: rgba(43, 37, 33, .55); overflow: hidden; }
.hud__bossbalken i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--zauber), var(--rosa)); transform-origin: left; }
.hud__banner {
  position: absolute; left: calc(var(--fx) + var(--fb) * .05); width: calc(var(--fb) * .9); top: calc(var(--fy) + var(--fh) * .3);   /* 90 %: Platz für das Aufploppen (scale 1,08) */
  text-align: center; font-size: clamp(22px, calc(var(--fk) * .085), 54px); line-height: 1.05; padding: 0 8px;
  color: var(--weiss);
  text-shadow: 0 4px 0 var(--kohle), 3px 0 0 var(--kohle), -3px 0 0 var(--kohle), 0 -3px 0 var(--kohle), 3px 3px 0 var(--kohle), -3px 3px 0 var(--kohle), 3px -3px 0 var(--kohle), -3px -3px 0 var(--kohle);
  opacity: 0; transform: scale(.7);
}
.hud__banner.zeigen { animation: banner 2.4s ease forwards; }
.hud__banner.warnung { color: var(--rosa); }

/* Mehrspieler im HUD: die anderen nur mit Leben und Punkten */
.spieler:not(.ich) .spieler__waffe, .spieler:not(.ich) .spieler__schild { display: none; }
.spieler__name { font-size: .8em; max-width: 6em; overflow: hidden; text-overflow: ellipsis; }
.hud__rangliste {
  position: absolute; right: calc(100% - var(--fx) - var(--fb) + 8px); top: calc(var(--fy) + 58px);
  margin: 0; padding: 4px 8px; list-style: none; font-size: clamp(12px, calc(var(--fk) * .03), 17px);
  background: rgba(43, 37, 33, .6); border-radius: 12px; min-width: 9em;
}
.hud__rangliste li { display: grid; grid-template-columns: 1.4em minmax(0, 1fr) auto; gap: .4em; line-height: 1.5; }
.hud__rangliste li.ich { color: var(--senf); }
.hud__rangliste li.fertig { opacity: .6; }
.hud__rangliste b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud__rangliste i { font-style: normal; text-align: right; }
.hud__hostpause { position: absolute; left: var(--fx); width: var(--fb); top: calc(var(--fy) + var(--fh) * .45); text-align: center; font-size: clamp(18px, calc(var(--fk) * .05), 30px); text-shadow: 0 3px 0 var(--kohle), 2px 0 0 var(--kohle), -2px 0 0 var(--kohle), 0 -2px 0 var(--kohle); }

/* ---------- Toast ---------- */
.toast {
  position: absolute; left: 50%; bottom: 18px; transform: translate(-50%, 0) scale(.85); opacity: 0; visibility: hidden; pointer-events: none;   /* Ruhezustand bleibt im Bild (gedreht wäre „unten" sonst links außerhalb) */
  max-width: calc(100% - 32px); padding: .5em 1em; border-radius: 14px; border: 3px solid var(--kohle);
  background: var(--papier); font-weight: 800; box-shadow: 0 4px 0 var(--kohle); transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.toast.an { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }

/* ---------- Lobby ---------- */
.lobby__wahl { display: grid; gap: 14px; justify-items: center; max-width: 520px; margin: 0 auto; text-align: center; }
.lobby__name { display: grid; gap: 4px; font-family: var(--schrift-display); font-size: 1.1rem; width: min(100%, 320px); }
.lobby__name input, .lobby__beitreten input {
  font: 800 1.15rem var(--schrift-text); color: var(--kohle); background: var(--weiss);
  border: 3px solid var(--kohle); border-radius: 12px; padding: .45em .7em; min-height: 48px; width: 100%;
}
.lobby__beitreten input { width: 6.5em; text-transform: uppercase; letter-spacing: .2em; text-align: center; font-family: var(--schrift-display); }
.lobby__name input:focus-visible, .lobby__beitreten input:focus-visible { outline: 4px solid var(--himmel); outline-offset: 2px; }
.lobby__oder { font-family: var(--schrift-display); color: var(--kohle-2); }
.lobby__beitreten { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; font-family: var(--schrift-display); }
.lobby__tipp { margin: 0; font-size: .95rem; line-height: 1.45; color: var(--kohle-2); }
.lobby__raum { display: grid; gap: clamp(10px, 2vh, 16px); max-width: 980px; margin: 0 auto; }
.lobby__kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.lobby__label { margin: 0; font-family: var(--schrift-display); color: var(--kohle-2); }
.lobby__code { margin: 0; font-family: var(--schrift-display); font-size: clamp(2.2rem, 7vh, 3.4rem); letter-spacing: .18em; line-height: 1; }
.lobby__status { margin: 0; font-weight: 800; }
.lobby__status.fehler { color: var(--tomate); }
.lobby__spieler { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lobby__spieler li { display: grid; justify-items: center; gap: 2px; padding: 6px; border: 3px solid var(--kohle); border-radius: 14px; background: var(--weiss); text-align: center; min-width: 0; }
.lobby__spieler li.frei { border-style: dashed; opacity: .5; background: transparent; }
.lobby__spieler li.ich { background: var(--senf-hell); }
.lobby__spieler .flieger { height: 54px; display: grid; place-items: center; }
.lobby__spieler b { font-family: var(--schrift-display); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.lobby__spieler i { font-style: normal; font-size: .8rem; font-weight: 800; color: var(--kohle-2); }
.lobby__einst { display: grid; gap: clamp(10px, 2vh, 16px); }
.lobby__modus { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lobby__info { margin: 0; font-weight: 700; color: var(--kohle-2); }
.schiffe--klein canvas { width: 64px; height: 39px; }
.raeume--klein .chip { min-height: 52px; }

/* ---------- Rangliste (Wettkampf) ---------- */
.rangliste { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 6px; }
.rangliste li { display: grid; grid-template-columns: 2em minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; padding: 6px 10px; border: 3px solid var(--kohle); border-left: 10px solid var(--farbe, var(--senf)); border-radius: 12px; background: var(--weiss); }
.rangliste li.ich { background: var(--senf-hell); }
.rangliste .platz { font-family: var(--schrift-display); font-size: 1.3rem; grid-row: span 2; }
.rangliste b { font-family: var(--schrift-display); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rangliste .pkt { font-family: var(--schrift-display); grid-row: span 2; }
.rangliste small { font-size: .78rem; font-weight: 800; color: var(--kohle-2); }

@media (max-width: 40rem) {
  .lobby__spieler { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Bestenliste ---------- */
.bestenliste { display: grid; gap: 12px; align-content: start; max-width: 720px; margin-inline: auto; width: 100%; }
.bestenliste__art { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bestenliste__info { margin: 0; font-size: .92rem; font-weight: 700; color: var(--kohle-2); }
.bestenliste__liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bestenliste__liste li { display: grid; grid-template-columns: 2.4em minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 6px 12px; border: 3px solid var(--kohle); border-radius: 12px; background: var(--weiss); }
.bestenliste__liste li:nth-child(1) { background: #FFE89A; } .bestenliste__liste li:nth-child(2) { background: #EDEDF2; } .bestenliste__liste li:nth-child(3) { background: #F6D7B8; }
.bestenliste__liste li.ich { outline: 4px solid var(--zauber); outline-offset: -1px; }
.bestenliste__liste .platz, .bestenliste__liste .pkt { font-family: var(--schrift-display); font-size: 1.15rem; }
.bestenliste__liste b { font-family: var(--schrift-display); font-weight: 400; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bestenliste__liste small { font-size: .78rem; font-weight: 700; color: var(--kohle-2); }
.bestenliste__liste li.bestenliste__leer { display: block; text-align: center; font-weight: 800; background: transparent; border-style: dashed; }
.eintrag { width: 100%; display: grid; gap: 6px; text-align: left; font-weight: 800; }
.eintrag__zeile { display: flex; gap: 8px; }
.eintrag input { flex: 1; min-width: 0; font: 800 1.05rem var(--schrift-text); color: var(--kohle); background: var(--weiss); border: 3px solid var(--kohle); border-radius: 12px; padding: .4em .6em; min-height: 46px; }
.eintrag input:focus-visible { outline: 4px solid var(--himmel); outline-offset: 2px; }
.eintrag__hinweis { margin: 0; font-size: .9rem; min-height: 1.2em; }
.eintrag__hinweis.fehler { color: var(--tomate); }
.eintrag.fertig .eintrag__zeile { display: none; }

/* ---------- Steuer-Knöpfe (Handy) ---------- */
.steuerung { position: absolute; display: flex; align-items: center; gap: clamp(8px, 2vh, 16px); pointer-events: none; }
.steuerung.links { left: 0; top: var(--fy); height: var(--fh); width: var(--leiste); flex-direction: column; justify-content: flex-end; padding-bottom: 6px; }
.steuerung.ueber { left: calc(var(--fx) + 6px); bottom: calc(100% - var(--fy) - var(--fh) + 6px); flex-direction: column; opacity: .82; }
.steuerung.unten { left: var(--fx); width: var(--fb); bottom: 0; height: var(--leiste); flex-direction: row; justify-content: flex-start; padding-left: 10px; }
.sknopf {
  pointer-events: auto; position: relative;
  width: 58px; height: 58px; border-radius: 50%;
  border: 3px solid var(--kohle); background: var(--papier); box-shadow: 0 4px 0 var(--kohle);
  display: grid; place-items: center; padding: 0; cursor: pointer; color: var(--kohle);
  touch-action: none;
}
.sknopf svg { width: 64%; height: 64%; }
.sknopf.gedrueckt { transform: translateY(3px); box-shadow: 0 1px 0 var(--kohle); }
.sknopf--bombe { width: 52px; height: 52px; }
.sknopf--bombe .kissen { fill: var(--weiss); stroke: var(--kohle); stroke-width: 3; }
.sknopf--bombe .naht { fill: none; stroke: var(--papier-dunkel); stroke-width: 2; }
.sknopf--bombe .feder { fill: var(--weiss); stroke: var(--kohle); stroke-width: 1.5; }
.sknopf--bombe b { position: absolute; right: -6px; top: -6px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--tomate); color: var(--weiss); border: 2px solid var(--kohle); font-family: var(--schrift-display); font-weight: 400; font-size: 13px; line-height: 18px; }
.sknopf--bombe.leer { opacity: .45; }
.sknopf--kreisel .kreisel { fill: var(--zauber-hell); stroke: var(--kohle); stroke-width: 3; stroke-linejoin: round; }
.sknopf--kreisel .streifen { fill: none; stroke: var(--weiss); stroke-width: 3; }
.sknopf--kreisel.fehlt { opacity: .35; }
.sknopf--kreisel.seite { background: var(--zauber-hell); }
.sknopf--laden { width: 78px; height: 78px; background: var(--senf); --lade: 0; }
.laden__ring {
  position: absolute; inset: -9px; border-radius: 50%;
  background: conic-gradient(var(--zauber) calc(var(--lade) * 360deg), rgba(255, 255, 255, .35) 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));
}
.laden__schluessel { width: 70%; height: 70%; transform-origin: 50% 50%; }
.sknopf--laden.gedrueckt .laden__schluessel { animation: aufziehen .45s linear infinite; }
.laden__kerben { position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; }
.laden__kerben i { width: 7px; height: 7px; border-radius: 50%; background: rgba(43, 37, 33, .3); }
.sknopf--laden.stufe-1 .laden__kerben i:nth-child(-n+1),
.sknopf--laden.stufe-2 .laden__kerben i:nth-child(-n+2),
.sknopf--laden.stufe-3 .laden__kerben i { background: var(--zauber); box-shadow: 0 0 6px var(--zauber); }
.sknopf--laden.stufe-3 { background: var(--senf-hell); }

@keyframes aufziehen { 0% { transform: perspective(200px) rotateY(0); } 100% { transform: perspective(200px) rotateY(360deg); } }
@keyframes aufziehen-langsam { 0%, 60%, 100% { transform: translateY(-50%) rotate(90deg); } 70% { transform: translateY(-50%) rotate(90deg) rotateX(70deg); } 80% { transform: translateY(-50%) rotate(90deg) rotateX(0); } 90% { transform: translateY(-50%) rotate(90deg) rotateX(-70deg); } }
@keyframes banner { 0% { opacity: 0; transform: scale(.6); } 12% { opacity: 1; transform: scale(1.08); } 20% { transform: scale(1); } 80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.04); } }

/* Flache Bedienfläche (Handy quer / gedreht, Klasse aus main.js): Ergebnis zweispaltig – links Werte, rechts Knöpfe */
.flach .dialog { gap: 8px; padding: 12px 18px; }
.flach .dialog h2 { font-size: 1.7rem; }
.flach .knopf--gross { font-size: 1.35rem; padding: .3em 1.2em; }
.flach .dialog.ergebnis { width: min(100%, 760px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: row dense; column-gap: 20px; row-gap: 8px; align-items: center; justify-items: center; }
.flach .ergebnis > * { grid-column: 1; }
.flach .ergebnis > #erg-rangliste, .flach .ergebnis > #erg-eintrag, .flach .ergebnis > #erg-rekord, .flach .ergebnis > #btn-erg-haupt, .flach .ergebnis > .dialog__reihe { grid-column: 2; }
.flach .ergebnis__werte dd { font-size: 1.15rem; }
.flach .anleitung { width: min(100%, 760px); }

@media (prefers-reduced-motion: reduce) {
  .titel__schluessel, .sknopf--laden.gedrueckt .laden__schluessel { animation: none; }
  .hud__banner.zeigen { animation: banner-ruhig 2.4s linear forwards; }
  @keyframes banner-ruhig { 0%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
}
@media (max-height: 420px) {
  .knopf--gross { font-size: 1.4rem; }
  .start__ueber { display: none; }
}

/* Flugrichtung (03.10.2026): zwei Chips nebeneinander, großer Pfeil */
.richtungen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.richtungen .chip { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.richtungen .pfeil { font-family: 'Lilita One', sans-serif; font-size: 1.8rem; line-height: 1; }

/* Update 4: Boss-Turm – zweiter großer Knopf auf dem Startbildschirm (dunkel, lila Schimmer = Endgegner), Phasen-Kerben im Boss-Balken */
.start__haupt { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; }
.start__haupt .knopf--gross { min-width: 0; flex: 1 1 210px; }
.knopf--turm { background: var(--kohle-2); color: var(--weiss); box-shadow: var(--schatten), inset 0 0 0 3px rgba(176, 60, 255, .55); }
.knopf--turm small { color: var(--zauber-hell); opacity: 1; }
.wahl__turm { margin: 0; line-height: 1.45; }
.hud__bossbalken { position: relative; }
.hud__bossbalken .kerbe { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1.5px; background: var(--kohle); border-left: 1px solid rgba(255, 255, 255, .7); }
.hud__boss.atem .hud__bossbalken { animation: bossWut .2s linear infinite; }
@keyframes bossWut { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .hud__boss.atem .hud__bossbalken { animation: none; } }
.bestenliste__art { grid-template-columns: repeat(2, minmax(0, 1fr)); }
