/* ============================================================================
   wort-maulwurf/styles.css - KARNEVALS-BUDE (Neubau 26.10.2026)

   Der Stil des Spiels, von aussen nach innen:
     1.  Farben und Grundregeln (Fasching-Violett, Magenta, Gold, Creme)
     1b. Seitenkulisse: kachelbare Karnevals-Nacht hinter allem (kulisse.svg)
     2.  Kopfzeile: die Karnevals-Konsole (Zuckerbäcker-Streifen, Goldkante)
     3.  Steuerleiste: die Kanzel der Bude
     4.  Ziel-Banner: das Lauflicht-Schild
     5.  Die Bude: Zeltdach mit Zuckerguss-Kante, Lichterkette, Bühnenwand
     6.  Der Tresen und die sechs Löcher
     7.  Der Maulwurf mit Narrenkappe und das Wort-Schild
     8.  Treffer-Badges, Start-/Ende-Billett, Hilfe-Fenster, Fuß
     9.  Dark Mode = Faschingsnacht (Seite dunkler, Bude bleibt beleuchtet)
    10.  Handy
    11.  Bedienziele >= 40 x 40 px (Regel 3.13.5) - STEHT AM ENDE

   Alles haengt an body.wmw_body bzw. an den .wmw_*-Klassen: die Optik liegt
   im Paket, nicht im Plattform-Stylesheet (AGENTS.md 3.10).
   ========================================================================== */

/* ---------- 1. Farben ---------- */
:root {
  --kv-nacht: #1d0b2e;
  --kv-nacht-2: #150822;
  --kv-violett: #3d0f52;
  --kv-violett-2: #2a0d3a;
  --kv-magenta: #e5378a;
  --kv-magenta-hell: #ff9ec8;
  --kv-magenta-tief: #8e1b6b;
  --kv-gold: #ffcf4d;
  --kv-gold-hell: #ffe9a8;
  --kv-gold-tief: #a5690c;
  --kv-tuerkis: #16c1b0;
  --kv-creme: #fff5de;
  --kv-creme-2: #ffeccd;
  --kv-tinte: #2e0b2b;
  --kv-holz: #a2672f;
  --kv-holz-2: #7a4720;
  --kv-holz-3: #5d3417;
  --kv-holz-kante: #3d2210;
  --kv-treffer: #2f7d32;
  --kv-fehler: #c62828;
  --kv-rund: 16px;
}

* { box-sizing: border-box; }

html { background: var(--kv-nacht); }

/* ---------- 1b. Seitenhintergrund: das Bühnenbild (26.10.2026) ----------
   Der Seitenrand zeigt EIN Bühnenbild statt einer Kachel (Wunsch der
   Lehrperson: „ich hasse diesen tile hintergrund"): eine Karnevals-Nacht mit
   einer Wimpelkette vom oberen Rand, Konfetti, Luftballons und zwei
   Riesenrad-Silhouetten (kulisse.svg, 1600 × 1000, Generator
   .zcode/wortmaulwurf-kulisse.cjs). Es wird mit `cover` einmal eingesetzt -
   KEIN repeat, deshalb darf es an den Rändern anschneiden. */
body.wmw_body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color: var(--kv-creme);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  background-color: var(--kv-nacht);
  background-image: url("kulisse.svg");
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
/* Dark Mode = tiefere Nacht: dieselbe Szene, eine dunkle Schicht darueber. */
html[data-theme="dark"] body.wmw_body {
  background-color: var(--kv-nacht-2);
  background-image:
    linear-gradient(rgba(9, 3, 15, .46), rgba(6, 2, 10, .58)),
    url("kulisse.svg");
  background-position: center top, center top;
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
}

.wmw_container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1000px;
  margin: 0 auto;
}
@supports (min-height: 100dvh) {
  body.wmw_body, .wmw_container { min-height: 100dvh; }
}

/* Die Zeichnung des Maulwurfs liegt einmal oben im Dokument und wird per
   <use> sechsmal eingesetzt. Sie darf KEINEN Platz einnehmen - sonst schiebt
   das leere SVG die ganze Seite um eine Zeilenhoehe nach unten. */
.wmw_zeichnung {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- 2. Kopfzeile: die Karnevals-Konsole ----------
   Drei Zonen (GUI 3.13.2): links "Alle Spiele", mittig Logo + Titel, rechts
   Sprachwahl + Dark-Mode-Pille. Oben laeuft ein Zuckerbaecker-Streifen
   (Magenta/Creme) wie ein Zeltdach ueber die Leiste. */
.wmw_header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .8rem;
  padding: 18px 1rem .6rem;
  border-radius: 0 0 18px 18px;
  border-bottom: 3px solid var(--kv-magenta-tief);
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 207, 77, .16) 0 12%, transparent 13%),
    radial-gradient(circle at 84% 74%, rgba(0, 0, 0, .28) 0 10%, transparent 11%),
    linear-gradient(180deg, #4a1264 0%, var(--kv-violett) 55%, var(--kv-violett-2) 100%);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 207, 77, .22);
  color: var(--kv-creme);
}
/* Der Zeltdach-Streifen oben (Magenta/Creme im 34-px-Takt wie das Zeltdach). */
.wmw_header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 10px;
  background: repeating-linear-gradient(90deg,
    var(--kv-magenta) 0 34px, var(--kv-creme) 34px 68px);
  border-radius: 0 0 0 0;
  opacity: .92;
}
html[data-theme="dark"] .wmw_header {
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 207, 77, .10) 0 12%, transparent 13%),
    linear-gradient(180deg, #2c0b3d 0%, #1f0829 55%, #170620 100%);
  border-bottom-color: #5e0f47;
}

.wmw_marke {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: .55rem;
  min-width: 0;
}
.wmw_marke img {
  display: block;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .55));
}
.wmw_marke h1 {
  margin: 0;
  font-size: 1.32rem;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -.01em;
  color: var(--kv-gold-hell);
  white-space: nowrap;
  text-shadow: 0 2px 0 #4a0d38, 0 0 16px rgba(255, 207, 77, .30);
}

/* Zurueck-Pille: Creme-Schild mit Magenta-Schrift und Goldkante. */
.wmw_header .jupi_nav_back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 2px solid var(--kv-gold-tief);
  background: var(--kv-creme);
  color: var(--kv-magenta-tief);
  font-size: .92rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .35);
  transition: background .15s ease, transform .12s ease;
}
.wmw_header .jupi_nav_back:hover { background: var(--kv-gold-hell); transform: translateY(-1px); }
html[data-theme="dark"] .wmw_header .jupi_nav_back {
  background: #2c0b3d; color: var(--kv-gold); border-color: var(--kv-gold-tief);
}
html[data-theme="dark"] .wmw_header .jupi_nav_back:hover { background: #3d1150; }

.wmw_werkzeuge {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
}
.wmw_werkzeuge .jupi_sprachen_select {
  height: 40px;
  min-height: 40px;
  max-width: 11rem;
  padding: 0 10px;
  border-radius: 999px;
  border: 2px solid var(--kv-gold-tief);
  background: #2a0b38;
  color: var(--kv-creme);
  font: inherit;
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
}
.wmw_werkzeuge .jupi_sprachen_select:hover { border-color: var(--kv-gold); }
.wmw_werkzeuge .jupi_sprachen_select option { background: #2a0b38; color: var(--kv-creme); }

/* Dark-Mode-Pille 74 x 40 px mit goldenem Knopf. */
.wmw_theme_switch {
  position: relative;
  width: 74px;
  height: 40px;
  min-width: 74px;
  min-height: 40px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 2px solid var(--kv-gold-tief);
  border-radius: 999px;
  background: #2a0b38;
  cursor: pointer;
}
.wmw_theme_switch:hover { border-color: var(--kv-gold); }
.wmw_theme_switch .jts_thumb {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--kv-gold-hell), var(--kv-gold) 60%, var(--kv-gold-tief));
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
html[data-theme="dark"] .wmw_theme_switch .jts_thumb { left: 4px; transform: translateX(32px); }
.wmw_theme_switch .jts_icon { font-size: 13px; line-height: 1; z-index: 1; }

/* ---------- 3. Hauptbereich + Steuerleiste (Kanzel) ---------- */
.wmw_main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px 4px;
}

.wmw_panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 8px 14px;
  border-radius: 14px;
  border: 2px solid var(--kv-gold-tief);
  background:
    radial-gradient(circle at 90% 20%, rgba(255, 207, 77, .10) 0 14%, transparent 15%),
    linear-gradient(180deg, #3a1049 0%, #260b31 100%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 207, 77, .20);
}
html[data-theme="dark"] .wmw_panel {
  background:
    radial-gradient(circle at 90% 20%, rgba(255, 207, 77, .07) 0 14%, transparent 15%),
    linear-gradient(180deg, #250a30 0%, #180621 100%);
}

.wmw_stats_gruppe {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.wmw_stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 46px;
}
.wmw_stat label {
  margin-bottom: 1px;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--kv-gold);
}
.wmw_stat span {
  font-size: 1.22rem;
  font-weight: 900;
  line-height: 1.15;
  color: var(--kv-creme);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.wmw_leben_herzen { font-size: 1.05rem !important; letter-spacing: 1.5px; }

.wmw_controls_gruppe {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wmw_select {
  height: 40px;
  min-height: 40px;
  max-width: 100%;
  padding: 0 10px;
  border-radius: 10px;
  border: 2px solid var(--kv-gold-tief);
  background: var(--kv-creme);
  color: var(--kv-tinte);
  font: inherit;
  font-size: .88rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .35);
}
.wmw_select:hover { border-color: var(--kv-gold); }
html[data-theme="dark"] .wmw_select { background: #2c0b3d; color: var(--kv-creme); }

.wmw_btn_icon {
  min-width: 42px;
  min-height: 42px;
  height: 42px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 2px solid var(--kv-gold-tief);
  background: var(--kv-creme);
  color: var(--kv-tinte);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .35);
  transition: transform .12s ease, background .15s ease;
}
.wmw_btn_icon:hover { background: var(--kv-gold-hell); transform: translateY(-1px); }
html[data-theme="dark"] .wmw_btn_icon { background: #2c0b3d; color: var(--kv-gold); }
html[data-theme="dark"] .wmw_btn_icon:hover { background: #3d1150; }

/* ---------- 4. Ziel-Banner: das Lauflicht-Schild ----------
   Ein beleuchtetes Schild ueber der Bude: Creme-Flaeche, Magenta-Rahmen,
   Goldkante und zwei Reihen Lauflicht-Birnen (Verlaeufe, keine Bilder). */
.wmw_ziel_banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 3px solid var(--kv-gold);
  background: linear-gradient(180deg, #fff9e8 0%, #ffe6bd 100%);
  box-shadow:
    0 0 0 3px var(--kv-magenta-tief),
    0 10px 24px rgba(0, 0, 0, .5),
    inset 0 0 26px rgba(255, 207, 77, .40);
  color: var(--kv-tinte);
}
.wmw_ziel_banner::before,
.wmw_ziel_banner::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  height: 9px;
  background-image: radial-gradient(circle, var(--kv-gold-hell) 0 2.4px, rgba(255, 207, 77, .9) 3px, transparent 4.6px);
  background-size: 22px 9px;
  background-repeat: repeat-x;
  opacity: .95;
  pointer-events: none;
}
.wmw_ziel_banner::before { top: 3px; }
.wmw_ziel_banner::after { bottom: 3px; }

.wmw_ziel_text {
  position: relative;
  z-index: 1;
  font-size: 1.18rem;
  font-weight: 900;
  letter-spacing: -.01em;
  line-height: 1.25;
  color: #7a0f4f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7);
}

.wmw_ziel_zeitbalken_wrapper {
  position: relative;
  z-index: 1;
  flex: none;
  width: 150px;
  height: 14px;
  padding: 2px;
  border-radius: 999px;
  border: 2px solid var(--kv-magenta-tief);
  background: #2a0b38;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .7);
  overflow: hidden;
}
.wmw_ziel_zeitbalken {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--kv-magenta) 0%, var(--kv-gold) 70%, var(--kv-gold-hell) 100%);
  box-shadow: 0 0 10px rgba(255, 207, 77, .8);
  transition: width .3s linear;
}

/* ---------- 5. Die Bude ---------- */
.wmw_stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 400px;
  max-height: 640px;
  border-radius: 22px;
  border: 4px solid var(--kv-holz-kante);
  background: #260b31;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55), inset 0 0 0 2px rgba(255, 207, 77, .16);
  overflow: hidden;
}

/* Zeltdach: Magenta/Creme-Streifen im 34-px-Takt. */
.wmw_dach {
  position: relative;
  flex: none;
  height: 46px;
  background:
    repeating-linear-gradient(90deg, var(--kv-magenta) 0 34px, var(--kv-creme) 34px 68px);
  border-bottom: 3px solid #7a1055;
  box-shadow: inset 0 -8px 14px rgba(0, 0, 0, .22);
  z-index: 3;
}
/* Zuckerguss-Kante: die Zacken sitzen im selben Takt wie die Streifen. */
.wmw_dach::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -14px;
  height: 14px;
  background-image:
    radial-gradient(circle at 17px 0, var(--kv-magenta) 0 16px, transparent 17px),
    radial-gradient(circle at 51px 0, var(--kv-creme) 0 16px, transparent 17px);
  background-size: 68px 14px;
  background-repeat: repeat-x;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .35));
}

/* Lichterkette: Draht mit Birnen, die warm leuchten. */
.wmw_girlande {
  position: relative;
  flex: none;
  height: 20px;
  margin-top: 6px;
  background-image:
    radial-gradient(circle at 10px 9px, #fff6c4 0 3px, rgba(255, 207, 77, .65) 3.4px, rgba(255, 207, 77, .16) 6px, transparent 8px),
    linear-gradient(180deg, transparent 5px, rgba(255, 245, 222, .22) 5px, rgba(255, 245, 222, .22) 6px, transparent 6px);
  background-size: 40px 20px, 100% 20px;
  background-repeat: repeat-x, no-repeat;
  animation: wmw_glühen 3.2s ease-in-out infinite;
}

/* Buehnenwand: Zeltstoff mit weichen Falten, warm von oben beleuchtet.
   Grid + place-items: center - so sitzt der Tresen mittig in der Buehne, und
   seine Hoehe kommt aus .wmw_gitter (clamp auf die Fensterhoehe), nicht aus
   Prozenten: align-items: center schaltet das Strecken ab, height:100%
   loest in dieser Flex-Kette nicht auf (beides im Browser gemessen). */
.wmw_buehne {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 10px 18px 18px;
  background:
    radial-gradient(130% 80% at 50% 0%, rgba(229, 55, 138, .26) 0%, transparent 62%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .20) 0 3px, transparent 3px 52px),
    linear-gradient(180deg, #431259 0%, #340f45 52%, #240b2e 100%);
}
html[data-theme="dark"] .wmw_buehne {
  background:
    radial-gradient(130% 80% at 50% 0%, rgba(229, 55, 138, .18) 0%, transparent 62%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .26) 0 3px, transparent 3px 52px),
    linear-gradient(180deg, #2c0b3d 0%, #22082e 52%, #170620 100%);
}

/* ---------- 6. Tresen und Löcher ---------- */
.wmw_gitter {
  width: 100%;
  max-width: 880px;
  /* Die Hoehe folgt der Fensterhoehe: auf kleinen Notebooks bleibt der Tresen
     flach, auf grossen Bildschirmen stattlich - ohne Prozenthoehen durch die
     Flex-Kette (die loesen dort nicht auf, im Browser gemessen). */
  height: clamp(300px, 52vh, 430px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 8px 16px;
  padding: 14px 18px 16px;
  border-radius: 18px;
  border: 3px solid var(--kv-holz-kante);
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 118px),
    linear-gradient(180deg, #b0793c 0%, var(--kv-holz-2) 58%, var(--kv-holz-3) 100%);
  box-shadow:
    0 12px 0 rgba(0, 0, 0, .33),
    0 18px 28px rgba(0, 0, 0, .40),
    inset 0 3px 0 rgba(255, 224, 170, .38),
    inset 0 -14px 26px rgba(0, 0, 0, .35);
}
html[data-theme="dark"] .wmw_gitter {
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .16) 0 2px, transparent 2px 118px),
    linear-gradient(180deg, #8b5c2b 0%, #5f3719 58%, #452711 100%);
}

.wmw_loch {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 128px;
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Die Maske schneidet unten ab: der Maulwurf verschwindet hinter dem Tresen,
   nach oben darf er beliebig weit auftauchen. */
.wmw_loch_maske {
  position: relative;
  width: 100%;
  height: 100%;
  /* Bezugsgroesse fuer den Maulwurf: cqh = Prozent der Zellenhoehe. */
  container-type: size;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  clip-path: inset(-320px -60px 0 -60px);
}

/* Das dunkle Loch (hinter dem Maulwurf). */
.wmw_loch_tiefe {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 16px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 28%, #0c0412 0%, #1b0a25 60%, #33123c 100%);
  box-shadow:
    inset 0 8px 14px rgba(0, 0, 0, .85),
    inset 0 -3px 0 rgba(255, 207, 77, .18),
    0 2px 0 rgba(255, 224, 170, .22);
  z-index: 1;
}

/* Die vordere Lochlippe (vor dem Maulwurf): untere Haelfte des Holzrings. */
.wmw_loch_lippe {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 16px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(180deg, #b0793c 0%, var(--kv-holz-2) 55%, var(--kv-holz-3) 100%);
  clip-path: inset(52% 0 0 0);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .30);
  z-index: 4;
  pointer-events: none;
}

/* Tasten-Tipp als Goldmuenze: welche Ziffer dieses Loch oeffnet. */
.wmw_taste_tipp {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--kv-gold-hell), var(--kv-gold) 60%, #d99a17 100%);
  color: #4a2a12;
  font-size: .74rem;
  font-weight: 900;
  box-shadow: 0 2px 0 var(--kv-gold-tief), 0 3px 7px rgba(0, 0, 0, .45);
  opacity: .92;
  pointer-events: none;
}

/* ---------- 7. Der Maulwurf und sein Wort-Schild ---------- */
.wmw_maulwurf {
  position: absolute;
  bottom: 0;
  z-index: 2;
  /* Der Maulwurf sitzt unten in der Zelle; das Wort-Schild fuellt die
     Zellenbreite, die Zeichnung waechst mit der Zellenhoehe (cqh).
     WICHTIG: keine Hoehe auf 100 % setzen - dann verteilt Flex den
     Restplatz und das Schild rutscht nach oben (im Browser gemessen).
     Ohne Hoehe gilt: Schild-Unterkante = padding-bottom. */
  width: min(88%, 230px);
  padding-bottom: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Standardmaessig im Loch versteckt */
  transform: translateY(150%);
  transition: transform .2s cubic-bezier(.18, .89, .32, 1.25);
  pointer-events: none; /* Klick geht an den Container .wmw_loch */
}
.wmw_maulwurf.wmw_aktiv { transform: translateY(0); }
.wmw_maulwurf.wmw_abtauchen {
  transform: translateY(150%);
  transition: transform .18s cubic-bezier(.4, 0, 1, 1);
}
.wmw_maulwurf.wmw_treffer_anim { animation: wmw_pop_hit .35s ease forwards; }
.wmw_maulwurf.wmw_fehler_anim { animation: wmw_wobble_miss .35s ease forwards; }

.wmw_maulwurf_svg {
  display: block;
  /* Hoehe aus der Zellenhoehe (cqh): der Rest bleibt fuer das Wort-Schild und
     den Abstand zur Lochlippe. Die Breite kommt aus dem Seitenverhaeltnis -
     ohne aspect-ratio bliebe sie bei width:auto auf 0 und die Zeichnung waere
     unsichtbar (im Browser gemessen: 0 px breit). */
  height: min(176px, calc(100cqh - 68px));
  aspect-ratio: 170 / 142;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .45));
}

/* Das Wort-Schild: Cremekarton mit Magenta-Rahmen und Bonbon-Streifen. */
.wmw_schild {
  position: relative;
  z-index: 3;
  width: 100%;
  /* Das Schild sitzt an der BRUST, nicht im Gesicht: es ueberlappt die
     Zeichnung nur um ein Fuenftel, damit Augen und Schnauze frei bleiben. */
  margin-top: -26px;
  padding: 8px 8px 7px;
  border-radius: 12px;
  border: 3px solid var(--kv-magenta-tief);
  background: linear-gradient(180deg, #fffaf0 0%, var(--kv-creme-2) 100%);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .30), 0 9px 18px rgba(0, 0, 0, .42);
}
.wmw_schild::before {
  content: "";
  position: absolute;
  inset: 2px 2px auto 2px;
  height: 5px;
  border-radius: 8px 8px 0 0;
  background: repeating-linear-gradient(90deg,
    var(--kv-magenta) 0 8px, var(--kv-gold) 8px 16px);
  opacity: .92;
}
.wmw_loch:nth-child(odd) .wmw_schild { transform: rotate(-1deg); }
.wmw_loch:nth-child(even) .wmw_schild { transform: rotate(1deg); }

.wmw_wort {
  display: block;
  max-width: 100%;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: -.01em;
  text-align: center;
  color: var(--kv-tinte);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Fokus: das Loch bekommt einen goldenen Ring (Tastaturbedienung). */
.wmw_loch:focus-visible .wmw_loch_tiefe {
  box-shadow: 0 0 0 3px var(--kv-gold-hell), inset 0 8px 14px rgba(0, 0, 0, .85);
}

/* ---------- 8a. Treffer-Badges ---------- */
/* Das Badge haengt AM Maulwurf (Kind von .wmw_maulwurf) und schwebt ueber
   der Kappe - so erscheint "+10" dort, wo der Treffer passiert.
   Zentriert wird ueber left/right + margin, nicht ueber transform: die
   Animation selbst arbeitet mit transform (translateY/scale). */
.wmw_badge {
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: max-content;
  z-index: 8;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 1.3rem;
  font-weight: 900;
  opacity: 0;
  transform: translateY(0) scale(.6);
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
}
.wmw_badge_plus {
  background: linear-gradient(180deg, #9ce88a, #3f9c2e);
  color: #0d2408;
  border: 2px solid #d6ffc7;
}
.wmw_badge_minus {
  background: linear-gradient(180deg, #ff9a9a, #c62828);
  color: #2b0606;
  border: 2px solid #ffd7d7;
}
.wmw_badge.wmw_badge_anim { animation: wmw_badge_float .65s cubic-bezier(.18, .89, .32, 1.28) forwards; }

@keyframes wmw_pop_hit {
  0%   { transform: translateY(0) scale(1); }
  40%  { transform: translateY(-10px) scale(1.1); }
  100% { transform: translateY(150%) scale(.9); }
}
@keyframes wmw_wobble_miss {
  0%   { transform: translateY(0) rotate(0deg); }
  25%  { transform: translateY(0) rotate(-6deg) scale(.95); }
  50%  { transform: translateY(0) rotate(6deg) scale(.95); }
  75%  { transform: translateY(22px) rotate(-3deg); }
  100% { transform: translateY(150%) rotate(0deg); }
}
@keyframes wmw_badge_float {
  0%   { opacity: 0; transform: translateY(10px) scale(.6); }
  30%  { opacity: 1; transform: translateY(-10px) scale(1.15); }
  75%  { opacity: 1; transform: translateY(-26px) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) scale(.85); }
}
@keyframes wmw_glühen {
  0%, 100% { opacity: .95; }
  50%      { opacity: .60; }
}

/* ---------- 8b. Start- und Ende-Billett ---------- */
[hidden],
.wmw_overlay[hidden] { display: none !important; }

.wmw_overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  overflow: auto;
  background: radial-gradient(80% 70% at 50% 38%, rgba(61, 15, 82, .74) 0%, rgba(13, 4, 20, .92) 100%);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.wmw_overlay_karte {
  position: relative;
  width: min(100%, 460px);
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  text-align: center;
  border-radius: 18px;
  border: 3px solid var(--kv-gold);
  background: linear-gradient(180deg, #fffaf0 0%, var(--kv-creme-2) 100%);
  box-shadow:
    0 0 0 3px var(--kv-magenta-tief),
    0 18px 44px rgba(0, 0, 0, .6);
  color: var(--kv-tinte);
}

/* Billett-Kopf: zwei Sterne mit gestrichelter Linie dazwischen. */
.wmw_billett_kopf {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: var(--kv-magenta-tief);
}
.wmw_billett_stern { font-size: .8rem; line-height: 1; }
.wmw_billett_linie {
  flex: 1;
  height: 0;
  border-top: 2px dashed rgba(142, 27, 107, .45);
}

.wmw_overlay_titel {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.15;
  font-weight: 900;
  color: var(--kv-magenta-tief);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
.wmw_overlay_text {
  margin: 0;
  font-size: .96rem;
  line-height: 1.45;
  color: #4a2340;
}

/* Label + Auswahlfeld gehoeren in eine gemeinsame Huelle (Fallstrick 5). */
.wmw_feld {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  text-align: left;
}
.wmw_feld label {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--kv-magenta-tief);
}
.wmw_feld .wmw_select { width: 100%; }
.wmw_feld_info {
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.35;
  color: #6b2350;
}

.wmw_overlay_sterne { font-size: 1.9rem; letter-spacing: 4px; line-height: 1; }
.wmw_overlay_punkte_gross {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  color: var(--kv-magenta-tief);
  font-variant-numeric: tabular-nums;
}
.wmw_punkte_label {
  font-size: .95rem;
  font-weight: 800;
  color: #6b2350;
}
.wmw_rekord {
  padding: 4px 12px;
  border-radius: 999px;
  border: 2px solid var(--kv-gold-tief);
  background: var(--kv-gold-hell);
  color: #6b4a04;
  font-size: .95rem;
  font-weight: 900;
}

.wmw_stats_tabelle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  padding: 10px 0;
  border-top: 2px dashed rgba(142, 27, 107, .35);
  border-bottom: 2px dashed rgba(142, 27, 107, .35);
}
.wmw_stat_box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.wmw_stat_box_wert { font-size: 1.35rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.wmw_wert_treffer { color: var(--kv-treffer); }
.wmw_wert_fehler { color: var(--kv-fehler); }
.wmw_stat_box_label { font-size: .78rem; font-weight: 700; color: #6b2350; }

.wmw_btn_primaer {
  width: 100%;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 3px solid var(--kv-gold);
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5ba6 0%, var(--kv-magenta) 55%, #b31667 100%);
  color: #fffaf0;
  font: inherit;
  font-size: 1.06rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 #7a1055, 0 10px 20px rgba(0, 0, 0, .35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}
.wmw_btn_primaer:hover { transform: translateY(-2px); filter: brightness(1.06); }
.wmw_btn_primaer:active { transform: translateY(2px); box-shadow: 0 2px 0 #7a1055; }

.wmw_btn_sekundaer {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 2px solid var(--kv-magenta-tief);
  border-radius: 999px;
  background: transparent;
  color: var(--kv-magenta-tief);
  font: inherit;
  font-size: .94rem;
  font-weight: 800;
  cursor: pointer;
}
.wmw_btn_sekundaer:hover { background: rgba(142, 27, 107, .10); }

/* ---------- 8c. Hilfe-Fenster ---------- */
.wmw_dialog {
  width: min(92vw, 560px);
  max-height: 88dvh;
  overflow: auto;
  padding: 20px 24px 22px;
  border: 3px solid var(--kv-gold);
  border-radius: 20px;
  background: linear-gradient(180deg, #fffaf0 0%, var(--kv-creme-2) 100%);
  color: var(--kv-tinte);
  box-shadow: 0 0 0 3px var(--kv-magenta-tief), 0 26px 54px rgba(0, 0, 0, .65);
}
.wmw_dialog::backdrop {
  background: rgba(12, 4, 18, .74);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.wmw_dialog_kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.wmw_dialog_kopf h2 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.2;
  font-weight: 900;
  color: var(--kv-magenta-tief);
}
.wmw_dialog_zu_form { margin: 0; }
.wmw_dialog_zu {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--kv-magenta-tief);
  border-radius: 50%;
  background: var(--kv-creme);
  color: var(--kv-magenta-tief);
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
}
.wmw_dialog_zu:hover { background: var(--kv-gold-hell); }
.wmw_dialog ul {
  margin: 0 0 14px;
  padding-left: 20px;
  font-size: .94rem;
  line-height: 1.55;
}
.wmw_dialog li { margin-bottom: 7px; }
.wmw_lernsatz {
  margin: 0;
  padding: 10px 14px;
  border-left: 5px solid var(--kv-magenta);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 207, 77, .28);
  color: #4a2340;
  font-size: .9rem;
  line-height: 1.45;
}

/* ---------- 8d. Fuß ---------- */
.wmw_fuss {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 16px;
  background: transparent;
  border-top: 0;
  border-radius: 0;
}
.wmw_fuss span { color: #e6cfe8; text-align: center; }
.wmw_fuss a { color: var(--kv-gold-hell); }
html[data-theme="dark"] .wmw_fuss span { color: #cfb9d6; }
/* jupi.css malt den Fuss im Dunkelmodus grau - hier haengt er auf der
   Karnevals-Nacht und muss durchsichtig bleiben (gleiche Spezifitaet,
   spaetere Quelle: styles.css laedt nach jupi.css). */
html[data-theme="dark"] .wmw_fuss {
  background: transparent;
  border-top: 0;
}
@media (max-width: 720px) {
  /* Am Handy passt der Fuss in eine Zeile, wenn er etwas kleiner steht -
     sonst bricht "läuft offline" allein in eine zweite Zeile. */
  .wmw_fuss { padding: 8px 12px 12px; }
  .wmw_fuss span { font-size: .76rem; line-height: 1.35; }
}

/* ---------- 9. Dark Mode: Bude bleibt beleuchtet ---------- */
html[data-theme="dark"] .wmw_ziel_banner {
  background: linear-gradient(180deg, #fff3d4 0%, #ffdcaa 100%);
  box-shadow:
    0 0 0 3px #6b1150,
    0 10px 24px rgba(0, 0, 0, .6),
    inset 0 0 26px rgba(255, 207, 77, .35);
}
html[data-theme="dark"] .wmw_schild {
  background: linear-gradient(180deg, #fff6e2 0%, #ffe3ba 100%);
}

/* ---------- 10. Handy ---------- */
@media (max-width: 720px) {
  .wmw_header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "marke marke"
      "zurueck werkzeug";
    gap: 6px 8px;
    padding: 16px 10px 8px;
  }
  .wmw_marke { grid-area: marke; justify-self: center; }
  .wmw_marke h1 { font-size: 1.12rem; }
  .wmw_marke img { width: 34px; height: 34px; }
  .wmw_header .jupi_nav_back { grid-area: zurueck; justify-self: start; padding: 0 12px; font-size: .84rem; }
  .wmw_werkzeuge { grid-area: werkzeug; justify-self: end; }
  .wmw_werkzeuge .jupi_sprachen_select { max-width: 7rem; font-size: .78rem; }

  .wmw_main { padding: 8px 10px 2px; gap: 8px; }
  .wmw_panel { padding: 7px 10px; gap: 8px 10px; }
  .wmw_stats_gruppe { gap: 10px; }
  .wmw_stat span { font-size: 1.06rem; }
  .wmw_controls_gruppe { flex: 1 1 100%; justify-content: flex-end; }
  .wmw_select { flex: 1 1 auto; min-width: 0; }

  .wmw_ziel_banner { padding: 10px 12px; gap: 8px; }
  .wmw_ziel_text { font-size: 1rem; }
  .wmw_ziel_zeitbalken_wrapper { width: 84px; }

  .wmw_stage { min-height: 380px; border-width: 3px; border-radius: 18px; }
  .wmw_dach { height: 32px; }
  .wmw_dach::after { bottom: -10px; height: 10px; background-size: 68px 10px; }
  .wmw_girlande { height: 16px; margin-top: 4px; background-size: 32px 16px, 100% 16px; }

  .wmw_buehne { padding: 8px 10px 12px; }
  .wmw_gitter {
    height: clamp(250px, 44vh, 350px);
    gap: 6px 10px;
    padding: 10px 10px 12px;
    border-radius: 14px;
    box-shadow: 0 8px 0 rgba(0, 0, 0, .30), 0 12px 20px rgba(0, 0, 0, .35), inset 0 3px 0 rgba(255, 224, 170, .34);
  }
  .wmw_loch { min-height: 104px; }
  .wmw_loch_tiefe, .wmw_loch_lippe { height: 42px; bottom: 10px; }
  .wmw_maulwurf { width: min(94%, 148px); padding-bottom: 32px; }
  .wmw_maulwurf_svg { height: 104px; }
  .wmw_schild { margin-top: -20px; padding: 6px 5px 5px; border-width: 2px; }
  .wmw_wort { font-size: .88rem; }
  .wmw_taste_tipp { min-width: 20px; height: 20px; font-size: .66rem; }
  .wmw_badge { font-size: 1.05rem; padding: 3px 9px; }

  .wmw_overlay_karte { padding: 16px 16px 18px; gap: 11px; }
  .wmw_overlay_titel { font-size: 1.3rem; }
  .wmw_overlay_punkte_gross { font-size: 2rem; }
  .wmw_dialog { padding: 16px 16px 18px; }
}

@media (max-width: 420px) {
  .wmw_marke h1 { font-size: 1rem; }
  .wmw_werkzeuge .jupi_sprachen_select { max-width: 6.2rem; font-size: .72rem; }
  .wmw_gitter { gap: 4px 8px; padding: 8px 8px 10px; }
  .wmw_maulwurf { width: min(96%, 122px); padding-bottom: 26px; }
  .wmw_maulwurf_svg { height: 86px; }
  .wmw_wort { font-size: .78rem; }
  .wmw_schild { padding: 5px 4px 4px; margin-top: -16px; }
  .wmw_ziel_text { font-size: .92rem; }
  .wmw_ziel_zeitbalken_wrapper { width: 68px; }
}

@media (max-width: 360px) {
  .wmw_werkzeuge { gap: .3rem; }
  .wmw_werkzeuge .jupi_sprachen_select { max-width: 5.4rem; font-size: .68rem; }
  .wmw_wort { font-size: .72rem; }
}

/* ---------- 11. Bedienziele >= 40 x 40 px (Regel 3.13.5) ----------
   Steht bewusst am ENDE: die spaetere Grundregel aus jupi.css darf die
   Groessen nicht mehr ueberschreiben. */
.wmw_body button,
.wmw_body select,
.wmw_body .jupi_nav_back {
  min-width: 40px;
  min-height: 40px;
}
.wmw_body .wmw_loch { min-height: 96px; }

/* Ruhige Fassung: keine Blink- und Wackelbewegungen. */
@media (prefers-reduced-motion: reduce) {
  .wmw_girlande { animation: none; }
  .wmw_maulwurf,
  .wmw_theme_switch .jts_thumb,
  .wmw_ziel_zeitbalken,
  .wmw_btn_primaer,
  .wmw_btn_icon { transition: none; }
  .wmw_maulwurf.wmw_treffer_anim,
  .wmw_maulwurf.wmw_fehler_anim,
  .wmw_badge.wmw_badge_anim { animation-duration: .01s; }
}
