/* Luftkampf (offene Variante) - mobil zuerst.
   Gestaltung nach dem Design-Handoff vom 2026-09-28: Karopapier, dicke Sticker-Kanten,
   harte Schatten ohne Blur, Lilita One + Baloo 2 (beide vom eigenen Server).
   Gedacht für Handy/Tablet im Hochformat: alle Tipp-Ziele >= 44px, Eingabefelder 16px
   (sonst zoomt iOS hinein), kein Hover als einziger Weg, Platz für Notch/Home-Balken. */

@font-face {
  font-family: "Lilita One"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/static/fonts/lilitaone-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Baloo 2"; font-weight: 500 800; font-style: normal; font-display: swap;
  src: url("/static/fonts/baloo2-latin.woff2") format("woff2");
}

:root {
  --ink: #1b1b3a; --rot: #e8322b; --blau: #2f5fe8; --gelb: #ffd23f; --mint: #3ddc97;
  --papier: #eaf3ff; --papier-linie: #c9dcf7;
  --tint-rot: #ffe3e1; --tint-blau: #e1eaff; --tint-treffer: #fff3c4;
  --anzeige: "Lilita One", "Arial Black", system-ui, sans-serif;
  --text: "Baloo 2", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; min-height: 100dvh; color: var(--ink); font-family: var(--text); font-weight: 600;
  line-height: 1.35; background-color: var(--papier); touch-action: manipulation;
  background-image:
    linear-gradient(var(--papier-linie) 1.5px, transparent 1.5px),
    linear-gradient(90deg, var(--papier-linie) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  display: flex; flex-direction: column;
}
body.spielseite { transition: background-color .3s; }
body.spielseite[data-zug="0"] { background-color: var(--tint-rot); }
body.spielseite[data-zug="1"] { background-color: var(--tint-blau); }
body.spielseite[data-zug="treffer"] { background-color: var(--tint-treffer); }

.seite {
  flex: 1; width: 100%; max-width: 480px; margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px))
           20px calc(16px + env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 18px; min-width: 0;
}
.fuss {
  text-align: center; font-size: 13px; padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  color: #4b4f7a;
}
.fuss a { color: inherit; padding: 6px 2px; }

/* ------------------------------------------------------------------ Kopf */
.kopf { text-align: center; padding-top: 6px; }
.kopf.klein-kopf { padding-top: 0; }
.aufkleber {
  display: inline-block; background: var(--gelb); border: 3px solid var(--ink); border-radius: 999px;
  padding: 3px 14px; font-weight: 800; font-size: 14px; box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-3deg); margin-bottom: 12px;
}
.titel {
  font-family: var(--anzeige); font-weight: 400; margin: 0; line-height: .88; letter-spacing: .01em;
  font-size: clamp(40px, 15.5vw, 84px); transform: rotate(-3deg); display: inline-block; max-width: 100%;
}
.klein-kopf .titel { font-size: clamp(36px, 13vw, 60px); }
.titel .luft, .titel .kampf { -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--ink); }
.titel .luft { color: var(--blau); } .titel .kampf { color: var(--rot); }
.untertitel {
  display: inline-block; margin: 16px 0 0; background: #fff; border: 3px solid var(--ink);
  border-radius: 16px; padding: 8px 14px; font-weight: 800; font-size: 16px;
  box-shadow: 4px 4px 0 var(--ink); transform: rotate(1.5deg);
}

/* ------------------------------------------------------------------ Knöpfe */
.gross-knopf, .knopf {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px;
  font-family: var(--anzeige); font-weight: 400; color: var(--ink); text-decoration: none;
  border: 3px solid var(--ink); border-radius: 20px; cursor: pointer;
  background: #fff; box-shadow: 0 5px 0 var(--ink); padding: 10px 20px; font-size: 22px;
  transition: transform .06s, box-shadow .06s;
}
.gross-knopf { background: var(--gelb); font-size: clamp(26px, 8vw, 34px); padding: 14px 20px;
  box-shadow: 0 6px 0 var(--ink); min-height: 64px; }
.knopf.gelb { background: var(--gelb); }
.knopf.hell { background: #fff; }
.knopf.klein { font-size: 17px; min-height: 44px; padding: 8px 16px; border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink); }
.gross-knopf:active, .knopf:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.gross-knopf:focus-visible, .knopf:focus-visible, .feld:focus-visible, .textlink:focus-visible,
.lk-wuerfel:focus-visible, .lk-jet-feld:focus-visible, .fuss a:focus-visible {
  outline: 4px solid var(--blau); outline-offset: 3px;
}
.knopf:disabled { opacity: .55; cursor: default; }
.textlink { color: var(--blau); font-weight: 800; text-align: center; padding: 10px; }

/* ------------------------------------------------------------------ Formular */
.neu-panel { display: none; scroll-margin-top: 12px; }
.neu-panel:target, .neu-panel.offen { display: block; }
.karte-form {
  background: #fff; border: 3px solid var(--ink); border-radius: 20px; padding: 16px;
  box-shadow: 5px 5px 0 var(--ink); display: flex; flex-direction: column; gap: 10px;
}
.feld-label { font-family: var(--anzeige); font-weight: 400; font-size: 19px; }
.feld {
  width: 100%; border: 3px solid var(--ink); border-radius: 12px; padding: 10px 12px;
  font: 800 20px var(--text); color: var(--ink); background: #fff; min-height: 52px;
}
.feld-hinweis { margin: -4px 0 0; font-size: 14px; color: #4b4f7a; }
.haken { display: flex; align-items: center; gap: 12px; font-size: 16px; min-height: 44px; }
.haken input { width: 26px; height: 26px; accent-color: var(--blau); flex: none; }
.meldung.fehler {
  margin: 0; background: #fdeceb; border: 3px solid var(--rot); border-radius: 12px;
  padding: 8px 12px; font-weight: 800; color: #8a1410;
}
.honigtopf { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.einladung { margin: 0; font-size: 18px; }
.fehlerkarte p { margin: 0; font-size: 18px; }

/* ------------------------------------------------------------------ Abschnitte */
.abschnitt { display: flex; flex-direction: column; gap: 12px; }
.abschnitt-titel { font-family: var(--anzeige); font-weight: 400; font-size: 28px; margin: 0;
  transform: rotate(-1.5deg); transform-origin: left; }
.pause { margin: 0; background: #fff3c4; border: 3px solid var(--ink); border-radius: 14px; padding: 8px 12px; }
.liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.eintrag, .leer {
  background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 10px 12px;
  box-shadow: 3px 3px 0 var(--ink); display: flex; align-items: center; justify-content: space-between;
  gap: 10px; min-width: 0;
}
.eintrag.beendet { opacity: .65; }
.eintrag-text { display: flex; flex-direction: column; min-width: 0; }
.eintrag-text strong { overflow-wrap: anywhere; font-size: 17px; }
.eintrag .status { font-size: 14px; color: #4b4f7a; }
.eintrag .knopf { flex: none; }
.leer { justify-content: center; text-align: center; box-shadow: none; border-style: dashed; }

.regeln { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.regel {
  display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center;
  border: 3px solid var(--ink); border-radius: 18px; padding: 10px 14px 10px 10px;
  box-shadow: 4px 4px 0 var(--ink);
}
.regel h3 { font-family: var(--anzeige); font-weight: 400; font-size: 20px; margin: 0 0 2px; line-height: 1.1; }
.regel p { margin: 0; font-size: 15px; line-height: 1.3; }
.regel .nr {
  width: 48px; height: 48px; border-radius: 50%; background: #fff; border: 3px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--anzeige); font-size: 26px; color: var(--ink);
}
.regel.gelb { background: var(--gelb); transform: rotate(-1.2deg); }
.regel.blau { background: var(--blau); color: #fff; transform: rotate(1deg); }
.regel.blau .nr { color: var(--blau); }
.regel.rot { background: var(--rot); color: #fff; transform: rotate(-1deg); }
.regel.rot .nr { color: var(--rot); }
.regel.mint { background: var(--mint); transform: rotate(1.2deg); }
.regel.weiss { background: #fff; transform: rotate(-.8deg); }
.tipp { margin: 4px 0 0; background: var(--ink); color: #fff; border-radius: 18px; padding: 12px 16px; font-size: 15px; }
.tipp b { font-family: var(--anzeige); font-weight: 400; font-size: 20px; color: var(--gelb); margin-right: 4px; }
.text-seite { background: #fff; border: 3px solid var(--ink); border-radius: 20px; padding: 16px;
  box-shadow: 5px 5px 0 var(--ink); font-size: 16px; }
.text-seite ul { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }

/* ================================================================== SPIEL */
.lk-leiste { display: flex; align-items: center; gap: 10px; }
.lk-zurueck {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--ink); border-radius: 14px; background: #fff; color: var(--ink);
  text-decoration: none; font-size: 22px; font-weight: 800; box-shadow: 0 3px 0 var(--ink);
}
.lk-leiste-titel { font-family: var(--anzeige); font-weight: 400; font-size: 22px; }
.lk-conn { margin-left: auto; font-size: 16px; color: #8a8fb5; }
.lk-conn.ok { color: #1f9d55; } .lk-conn.off { color: var(--rot); }
.lk-zuschauer { font-size: 14px; background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 10px; }

.lk-punktetafel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.lk-chip {
  border: 3px solid var(--ink); border-radius: 16px; padding: 6px 10px; min-width: 0;
  box-shadow: 3px 3px 0 var(--ink); display: flex; flex-direction: column; gap: 3px;
  transition: transform .2s, opacity .2s;
}
.lk-chip.rot { background: var(--rot); } .lk-chip.blau { background: var(--blau); }
.lk-chip.inaktiv { transform: scale(.94); opacity: .7; }
.lk-chip .name { font-family: var(--anzeige); font-size: 18px; line-height: 1; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-chip .ich { font-family: var(--text); font-weight: 800; font-size: 12px; opacity: .9; }
.lk-chip .slots { display: flex; gap: 4px; }
.lk-chip .slot {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--ink);
  background: rgba(255,255,255,.35); font-size: 14px; font-weight: 800; line-height: 18px;
  text-align: center; color: var(--rot);
}
.lk-chip .slot.voll { background: var(--gelb); }
.lk-vs { font-family: var(--anzeige); font-size: 13px; text-align: center; color: var(--ink); }

.lk-zug-sticker {
  align-self: flex-start; background: #fff; border: 3px solid var(--ink); border-radius: 14px;
  padding: 3px 14px; font-family: var(--anzeige); font-size: 24px; box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-2deg); max-width: 100%; overflow-wrap: anywhere;
}
.lk-zug-sticker:empty { display: none; }

.lk-warten {
  background: #fff; border: 3px solid var(--ink); border-radius: 20px; padding: 16px;
  box-shadow: 5px 5px 0 var(--ink); display: flex; flex-direction: column; gap: 10px;
}
.lk-warten p { margin: 0; }
.lk-warten-titel { font-family: var(--anzeige); font-weight: 400; font-size: 26px; margin: 0; }
.lk-warten-knoepfe { display: grid; grid-template-columns: 1fr; gap: 12px; }

.lk-brett-karte {
  position: relative; background: #fff;
  background-image: linear-gradient(#dfe8f6 1.5px, transparent 1.5px), linear-gradient(90deg, #dfe8f6 1.5px, transparent 1.5px);
  background-size: 20px 20px; border: 3px solid var(--ink); border-radius: 22px;
  box-shadow: 5px 5px 0 var(--ink); padding: 8px 4px 12px;
}
.lk-spuren { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.lk-spur { display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 14px; padding: 2px 0; }
.lk-spur.waehlbar { cursor: pointer; background: rgba(255, 210, 63, .28); }
.lk-jet-feld { position: relative; z-index: 0; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.lk-jet-feld svg.lk-kreuz { position: absolute; inset: 2px; }
.lk-spur.waehlbar .lk-jet-feld.eigen::before {
  content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 3px dashed var(--ink);
  background: var(--gelb); z-index: -1; animation: lk-puls 1s ease-in-out infinite;
}
@keyframes lk-puls { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
/* Höhe der Kästchen passt sich der Bildschirmhöhe an: 18 Zeilen müssen auch auf kleinen
   Handys neben Punktetafel und Würfel ins Bild passen, ohne dass man scrollen muss. */
.lk-zelle {
  width: 86%; height: clamp(8px, calc((100dvh - 430px) / 20), 15px); border-radius: 5px;
  border: 2px solid #b9c6de; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden;
  background: rgba(255,255,255,.7);
}
.lk-zelle.belegt { border-color: var(--ink); }

.lk-banner {
  position: absolute; left: -8px; right: -8px; top: 34%; background: var(--gelb);
  border: 3px solid var(--ink); border-radius: 18px; padding: 10px 14px 12px;
  transform: rotate(-6deg); box-shadow: 6px 6px 0 var(--ink); display: flex; flex-direction: column;
  gap: 4px; z-index: 5; animation: lk-banner-ein .25s ease-out; pointer-events: none;
}
.lk-banner.hidden { display: none; }
.lk-banner .titel { font-family: var(--anzeige); font-size: 34px; line-height: .95; color: var(--rot);
  -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--ink); transform: none; }
.lk-banner .text { font-weight: 800; font-size: 14px; line-height: 1.2; }
@keyframes lk-banner-ein { from { transform: rotate(-6deg) scale(.7); opacity: 0; } to { transform: rotate(-6deg) scale(1); opacity: 1; } }

.lk-unten { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; }
.lk-unten:empty { display: none; }
.lk-wuerfel {
  width: 76px; height: 76px; background: var(--rot); border: 3px solid var(--ink); border-radius: 18px;
  box-shadow: 4px 4px 0 var(--ink); display: grid; grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr); padding: 9px; cursor: pointer; transform: rotate(-6deg);
}
.lk-wuerfel:disabled { cursor: default; opacity: .55; }
.lk-wuerfel.bereit { animation: lk-wippen 1.2s ease-in-out infinite; }
.lk-wuerfel.dreht { animation: lk-wuerfel-dreh .6s ease-in-out; }
@keyframes lk-wippen { 0%, 100% { transform: rotate(-6deg) scale(1); } 50% { transform: rotate(-3deg) scale(1.07); } }
@keyframes lk-wuerfel-dreh { 0% { transform: rotate(-6deg); } 50% { transform: rotate(200deg) scale(1.1); } 100% { transform: rotate(-6deg); } }
.lk-pip { display: flex; align-items: center; justify-content: center; }
.lk-pip span { width: 12px; height: 12px; border-radius: 50%; background: transparent; }
.lk-pip.voll span { background: #fff; }
.lk-bubble { background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 8px 12px; box-shadow: 3px 3px 0 var(--ink); min-width: 0; }
.lk-bubble .titel { font-family: var(--anzeige); font-size: 20px; line-height: 1.05; transform: none; display: block; }
.lk-bubble .text { font-size: 14px; line-height: 1.2; }

.lk-aktionen { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.lk-aktionen form { margin: 0; display: contents; }
.lk-aktionen .knopf.klein { align-self: center; }

.lk-sieg-karte {
  grid-column: 1 / -1; position: relative; background: var(--rot); border: 3px solid var(--ink);
  border-radius: 22px; box-shadow: 5px 5px 0 var(--ink); padding: 20px 18px; display: flex;
  flex-direction: column; align-items: flex-start; gap: 12px; overflow: hidden; width: 100%;
}
.lk-sieg-karte.blau { background: var(--blau); }
.lk-sieg-karte.unentschieden { background: #fff; }
.lk-pokal {
  width: 84px; height: 84px; border-radius: 50%; background: var(--gelb); border: 4px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink); display: flex; align-items: center; justify-content: center;
  transform: rotate(-8deg);
}
.lk-sieg-titel {
  font-family: var(--anzeige); font-size: clamp(30px, 10vw, 44px); line-height: .95; color: var(--gelb);
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-3deg); transform-origin: left; overflow-wrap: anywhere;
}
.lk-sieg-karte.unentschieden .lk-sieg-titel { color: var(--ink); text-shadow: none; -webkit-text-stroke: 0; }
.lk-sieg-spruch { background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 8px 14px;
  font-weight: 800; font-size: 16px; line-height: 1.2; transform: rotate(1deg); }

.toast.hidden { display: none; }
.toast {
  position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  width: min(440px, calc(100vw - 32px)); z-index: 100; cursor: pointer; background: #fff;
  border: 3px solid var(--ink); border-radius: 14px; padding: 12px 16px; box-shadow: 4px 4px 0 var(--ink);
  font-size: 16px; font-weight: 800; text-align: center;
}
.toast.error { border-color: var(--rot); background: #fdeceb; }

@media (min-width: 700px) {
  .seite { max-width: 520px; }
  .lk-zelle { height: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Nachtrag: Spielseite als Spalte, Spuren mittig ausrichten */
#lk-bereich { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
/* Die kürzere Mittelspur sitzt mittig zwischen den Außenspuren (wie im Handoff), statt
   oben zu kleben, während ihr eigenes Flugzeug mitten in der Luft schwebt. */
.lk-spur { justify-content: center; }
