/* ==========================================================================
   Kinderseite – Wachsmalstift- & Kreide-Optik
   Eigene, bewusst andere Bildsprache als der Rest der Website: warmes
   Papier-Cremeweiss + bunte Wachsmalstift-Farben, dazwischen ein
   "Kreidetafel"-Abschnitt in dunklem Grün mit hellen Kreide-Doodles.
   Header/Footer bleiben unverändert im normalen Website-Design, nur der
   Hauptbereich (.kids-main) bekommt diesen Look.
   ========================================================================== */

:root {
  --kids-paper: #fdf6e3;
  --kids-paper-dot: rgba(45, 74, 58, 0.06);
  --kids-ink: #2d4a3a;
  --kids-red: #a74d4a;
  --kids-teal: #2f8f84;
  --kids-yellow: #e8a33d;
  --kids-pink: #f0a8ab;
  --kids-chalk-bg: #2d4a3a;
  --kids-tile-bg: #eef2ea;
}

.kids-main {
  font-family: "Patrick Hand", "Lora", sans-serif;
  font-size: 1.12rem;
  background: var(--kids-paper);
  background-image: radial-gradient(var(--kids-paper-dot) 1.4px, transparent 1.4px);
  background-size: 14px 14px;
  color: var(--kids-ink);
  overflow-x: hidden;
}

/* WICHTIG: css/style.css setzt global "p { color: var(--text-inverse-soft) }"
   (fast weiss, gedacht für den dunkelgrünen Hintergrund im Rest der Website).
   Das überschreibt auf dieser hellen Papier-Seite jede Vererbung von
   .kids-main und machte Fliesstext praktisch unsichtbar. Hier explizit mit
   höherer Spezifität zurücksetzen. Der Kreidetafel-Abschnitt (dunkler
   Hintergrund) bekommt seine eigene helle Textfarbe. */
.kids-main p { color: var(--kids-ink); }
.kids-section-chalk p { color: var(--kids-paper); }

.kids-h1, .kids-h2 {
  font-family: "Caveat", "Fraunces", cursive;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.1;
  color: var(--kids-ink);
  overflow-wrap: break-word;
}

.kids-h1 { font-size: 3.8rem; }
.kids-h2 { font-size: 2.9rem; margin-bottom: 0.3rem; }
.kids-h2-light { color: var(--kids-paper); }

.kids-eyebrow {
  display: inline-block;
  font-family: "Patrick Hand", sans-serif;
  font-size: 1.18rem;
  font-weight: 400;
  color: var(--kids-red);
  background: #fff;
  border: 2px dashed var(--kids-red);
  border-radius: 999px;
  padding: 0.25rem 1rem;
  margin-bottom: 0.8rem;
  transform: rotate(-2deg);
}
.kids-eyebrow-light { color: var(--kids-paper); background: rgba(255,255,255,0.08); border-color: var(--kids-paper); }

.kids-section { position: relative; padding: 4rem 0; }
.kids-section-paper { background: transparent; }
.kids-section-chalk, .kids-section-fairy, .kids-hero { overflow: hidden; }

/* ---------- Kachel-Raster: alle Aktivitäten nebeneinander statt
   untereinander. Jede bisherige volle Breite-Section wird hier zu einer
   einzelnen Karte in einem 2-spaltigen Raster (1 Spalte auf dem Handy). ---------- */
.kids-tiles-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 1.8rem;
  max-width: 1040px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem 1.5rem;
}
@media (min-width: 760px) {
  .kids-tiles-grid { grid-template-columns: repeat(2, 1fr); }
}
.kids-section.kids-tile {
  padding: 2.2rem 1.7rem;
  margin: 0;
  background: var(--kids-tile-bg);
  color: var(--kids-ink);
  border: 3px solid var(--kids-ink);
  border-radius: 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
/* Die Kreidetafel-Fakten hatten ursprünglich einen dunklen Hintergrund mit
   heller Schrift für eine volle Section – als helle Kachel braucht sie
   normale dunkle Schrift, sonst unlesbar (helle Schrift auf hellem Grund). */
.kids-section-chalk.kids-tile {
  background: var(--kids-tile-bg);
  background-image: none;
  color: var(--kids-ink);
}
.kids-section-chalk.kids-tile .kids-facts li { border-color: rgba(45, 74, 58, 0.3); }
.kids-tile .container { max-width: none; margin: 0; padding: 0; }
.kids-tile .kids-doodle-lg { width: 110px; height: 110px; }
.kids-tile .kids-doodle-md { width: 90px; height: 90px; }

.kids-section-chalk {
  background: var(--kids-chalk-bg);
  color: var(--kids-paper);
  background-image: radial-gradient(rgba(255,255,255,0.045) 1.2px, transparent 1.2px);
  background-size: 12px 12px;
}

/* pointer-events:none, da diese Textblöcke keine eigenen klickbaren Elemente
   enthalten – ohne das würde ihre (unsichtbare) Box über den Versteck-Zähnen
   liegen und deren Klicks abfangen, nur weil sie wegen des
   "Zahnfee-fliegt-hinter-den-Text"-Effekts ein z-index bekommen haben. */
.kids-section-header { text-align: center; max-width: 640px; margin: 0 auto 1.5rem auto; position: relative; z-index: 1; pointer-events: none; }

/* ---------- Hero ---------- */
.kids-hero {
  position: relative;
  padding: 5rem 0 4.5rem 0;
  text-align: center;
}
.kids-hero-inner { max-width: 680px; margin: 0 auto; position: relative; z-index: 1; pointer-events: none; }
.kids-lead { font-size: 1.3rem; margin: 0.6rem 0 1.6rem 0; }
.kids-lead-small { font-size: 1.04rem; opacity: 0.75; margin-top: -0.6rem; }

.kids-btn {
  display: inline-block;
  font-family: "Patrick Hand", sans-serif;
  font-size: 1.3rem;
  background: var(--kids-yellow);
  color: var(--kids-ink);
  padding: 0.7rem 1.8rem;
  border: 3px solid var(--kids-ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.kids-btn:hover { transform: rotate(-2deg) scale(1.04); }

/* ---------- Doodles (dekorative, wiederverwendete SVG-Symbole) ---------- */
.kids-doodle {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}
.kids-doodle-xs { width: 42px; height: 42px; }
.kids-doodle-sm { width: 80px; height: 80px; }
.kids-doodle-md { width: 130px; height: 130px; }
.kids-doodle-lg { width: 190px; height: 190px; }
.kids-hero-fairy { width: 190px; height: 190px; }

/* Leichte Schwebe-/Wackel-Bewegung, in drei Geschwindigkeiten, damit es nicht
   synchron und starr wirkt. */
@keyframes kidsFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}
.kids-float { animation: kidsFloat 4s ease-in-out infinite; }
.kids-float-slow { animation: kidsFloat 6.5s ease-in-out infinite; }
.kids-float-fast { animation: kidsFloat 2.6s ease-in-out infinite; }

/* Versteckte Zähne (Mini-Spiel): anklickbar, auch wenn .kids-doodle sonst
   pointer-events:none hat. */
.kids-hidden-tooth { pointer-events: auto; cursor: pointer; opacity: 0.8; transition: transform 0.2s ease; }
.kids-hidden-tooth:hover { transform: scale(1.15) !important; }
.kids-hidden-tooth.kids-found {
  animation: kidsFoundPop 0.5s ease forwards;
  pointer-events: none;
}
@keyframes kidsFoundPop {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.6) rotate(15deg); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}

.kids-game-badge {
  position: fixed;
  top: 90px;
  right: 1rem;
  z-index: 400;
  background: #fff;
  border: 2px solid var(--kids-ink, #2d4a3a);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-family: "Patrick Hand", sans-serif;
  font-size: 1.08rem;
  color: #2d4a3a;
  box-shadow: var(--shadow);
  /* Dieses Element existiert nur in kinder.html, daher kein :has()-Scoping
     nötig – einfach immer sichtbar, sobald es im DOM ist. */
}

.kids-game-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 150%);
  z-index: 2200;
  background: var(--kids-yellow);
  color: var(--kids-ink);
  font-family: "Caveat", cursive;
  font-size: 1.55rem;
  font-weight: 700;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  border: 3px solid var(--kids-ink);
  box-shadow: var(--shadow-strong);
  transition: transform 0.4s ease;
  text-align: center;
  max-width: 90vw;
}
.kids-game-toast.kids-show { transform: translate(-50%, 0); }

/* ---------- Abenteuer-Pfad ("So läuft dein Besuch ab") ---------- */
.kids-trail {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding: 0.4rem 0;
}
.kids-trail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 21px;
  width: 0;
  border-left: 4px dashed var(--kids-red);
  opacity: 0.4;
}
/* Die Kacheln sind inzwischen immer schmal (Raster-Spalte statt volle
   Seitenbreite) – eine volle Breite pro Schritt statt Zickzack-Spalten
   nutzt den Platz besser aus, statt 40% leere Fläche pro Kästchen. */
.kids-trail-stop {
  position: relative;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0.9rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 0.8rem;
}
.kids-trail-left, .kids-trail-right { margin-right: 0; margin-left: 0; }
.kids-trail-num {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--kids-yellow);
  border: 3px solid var(--kids-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Caveat", cursive;
  font-size: 1.65rem;
  font-weight: 700;
}
.kids-trail-card {
  background: #fff;
  border: 3px solid var(--kids-ink);
  border-radius: 180px 15px 180px 15px / 15px 180px 15px 180px;
  padding: 0.4rem 0.9rem;
  flex: 1;
  min-width: 0;
  transition: transform 0.2s ease;
}
.kids-trail-stop:hover .kids-trail-card { transform: scale(1.04) rotate(-1deg); }
.kids-trail-card .kids-doodle-xs { position: static; display: inline-block; margin-bottom: 0.1rem; }
.kids-trail-card h3 { font-family: "Caveat", cursive; font-size: 1.7rem; margin: 0 0 0.1rem 0; text-transform: none; letter-spacing: 0; line-height: 1.1; }
.kids-trail-card p { font-size: 1.07rem; opacity: 0.85; margin: 0; line-height: 1.25; }

/* ---------- Zahnfee-Abschnitt ---------- */
.kids-fairy-grid {
  position: relative;
  z-index: 1;
  pointer-events: none;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.kids-fairy-text p { font-size: 1.22rem; }

/* ---------- Zahnputz-Mission ---------- */
/* Kein z-index hier (im Unterschied zu den reinen Text-Abschnitten oben):
   dieser Block enthält den echten Mission-Button – der muss klickbar
   bleiben, und ohne erhöhten z-index gibt es auch nichts, das die
   Versteck-Zähne im gleichen Abschnitt blockieren könnte. */
.kids-mission-inner { max-width: 520px; margin: 0 auto; text-align: center; position: relative; }
/* Statt 4 einzelner Kästchen: ein echtes Bild (putzen.jpg, 2x2-Raster mit
   einer Anleitung pro Ecke), bei dem per background-position immer nur die
   gerade aktive Ecke gezeigt wird – wechselt automatisch im Timer-Takt. */
.kids-mission-image {
  width: 100%;
  max-width: 360px;
  min-height: 160px;
  aspect-ratio: 704 / 384;
  margin: 0 auto 1.2rem auto;
  background-image: url("../Bilder/putzen.jpg");
  background-size: 200% 200%;
  background-position: 0% 0%;
  border: 4px solid var(--kids-ink);
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: background-position 0.5s ease;
}
.kids-mission-image.kids-quad-1 { background-position: 0% 0%; }
.kids-mission-image.kids-quad-2 { background-position: 100% 0%; }
.kids-mission-image.kids-quad-3 { background-position: 0% 100%; }
.kids-mission-image.kids-quad-4 { background-position: 100% 100%; }
.kids-mission-image.kids-pulse { animation: kidsMissionPulse 0.8s ease-in-out infinite; }
@keyframes kidsMissionPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
.kids-mission-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  margin: 0 auto 0.6rem auto;
  border-radius: 50%;
  background: var(--kids-paper);
  border: 5px solid var(--kids-red);
  font-family: "Caveat", cursive;
  font-size: 2.9rem;
  font-weight: 700;
  color: var(--kids-red);
}
.kids-mission-status { font-size: 1.18rem; min-height: 1.4em; font-weight: 700; }

/* ---------- Zahn-Fakten (Kreidetafel) ---------- */
.kids-facts {
  position: relative;
  z-index: 1;
  pointer-events: none;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 720px;
  display: grid;
  gap: 1rem;
}
.kids-facts li {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.25rem;
  padding: 0.9rem 1.3rem;
  border: 2px dashed rgba(253, 246, 227, 0.55);
  border-radius: 14px;
}
.kids-fact-icon { width: 46px; height: 46px; flex-shrink: 0; }

/* ---------- Mal-Ecke / Drucken ---------- */
.kids-section-print .container { text-align: center; }
.kids-print-single {
  max-width: 700px;
  margin: 2rem auto 0 auto;
}
.kids-print-single-img {
  width: 100%;
  height: auto;
  border: 4px solid var(--kids-ink);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
  margin-bottom: 1.2rem;
}

@media print {
  body > *:not(.kids-main), .kids-game-badge, .kids-game-toast,
  .kids-hero, .kids-section-header, .kids-trail, .kids-fairy-grid,
  .kids-section-fairy, .kids-section-game, .kids-section-chalk,
  .kids-section-mission, .kids-facts,
  .kids-section-print .kids-eyebrow, .kids-section-print .kids-h2,
  .kids-section-print > .container > p, .kids-print-btn, .kids-doodle {
    display: none !important;
  }
  .kids-print-single-img { border: none; box-shadow: none; max-width: 100%; }
  .kids-section-print.kids-tile { border: none; box-shadow: none; background: none; padding: 0; }
}

/* ---------- Hinweis-Box (Hero) ---------- */
.kids-hint-box {
  display: inline-block;
  background: #fff;
  border: 3px dashed var(--kids-teal);
  border-radius: 18px;
  padding: 0.9rem 1.4rem;
  margin-top: 0.4rem;
  text-align: center;
}
.kids-hint-box p { margin: 0.2rem 0; font-size: 1.1rem; }
.kids-hint-surprise { font-family: "Caveat", cursive; font-size: 1.45rem; color: var(--kids-red); }

/* ---------- Tic Tac Toe ---------- */
.kids-ttt-inner { position: relative; max-width: 380px; margin: 0 auto; text-align: center; }
/* Echtes "wie auf Papier gemalt"-Gitter: nur die Linien ZWISCHEN den Feldern
   (klassisches #-Raster), keine einzelnen abgerundeten Kästchen. */
.kids-ttt-board {
  position: relative;
  width: 56%;
  max-width: 210px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 1.2rem auto;
}
.kids-ttt-cell {
  aspect-ratio: 1;
  background: transparent;
  border: 4px solid var(--kids-ink);
  border-radius: 0;
  font-family: "Caveat", cursive;
  font-size: clamp(2.2rem, 10.5vw, 3.6rem);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.kids-ttt-cell:nth-child(-n+3) { border-top: none; }
.kids-ttt-cell:nth-child(n+7) { border-bottom: none; }
.kids-ttt-cell:nth-child(3n+1) { border-left: none; }
.kids-ttt-cell:nth-child(3n) { border-right: none; }
.kids-ttt-cell:disabled { cursor: default; }
.kids-ttt-cell:not(:disabled):hover { background: rgba(232, 163, 61, 0.15); }
.kids-ttt-cell.kids-ttt-x { color: var(--kids-red); }
.kids-ttt-cell.kids-ttt-o { color: var(--kids-teal); }
.kids-ttt-cell.kids-ttt-win { background: var(--kids-yellow); }
.kids-ttt-status { font-size: 1.18rem; min-height: 1.4em; margin-bottom: 0.5rem; }

.kids-fireworks { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 5; }
.kids-spark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: kidsSpark 1.1s ease-out forwards;
}
@keyframes kidsSpark {
  0% { transform: translate(-50%, -50%) translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) scale(0.3); opacity: 0; }
}

/* ---------- Zahnputz-Mission: Box + Icons ---------- */
.kids-mission-box {
  background: #fff;
  border: 4px solid var(--kids-ink);
  border-radius: 40px 15px 40px 15px / 15px 40px 15px 40px;
  box-shadow: var(--shadow);
  padding: 1.8rem 1.5rem;
  max-width: 460px;
  margin: 0 auto;
  transform: rotate(-0.6deg);
}
.kids-mission-explain { font-size: 1.1rem; margin-bottom: 1.2rem; }

/* ---------- Grosse Feier (alle 8 Zähne gefunden) ---------- */
.kids-confetti {
  position: fixed;
  top: -20px;
  width: 10px;
  height: 16px;
  z-index: 2100;
  pointer-events: none;
  animation: kidsConfettiFall linear forwards;
}
@keyframes kidsConfettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(calc(var(--spin, 1) * 540deg)); opacity: 0.9; }
}

/* Statt nur auf der Stelle zu wippen: jedes Doodle fliegt während der Feier
   in einem Kreis um seine eigene Position und dreht sich dabei gleichzeitig
   um sich selbst – wirkt dadurch viel wilder/lebendiger. Radius und Tempo
   leicht pro Grösse variiert, damit nicht alle exakt synchron kreisen. */
body.kids-party .kids-doodle:not(.kids-found) {
  animation: kidsPartyOrbit 1.1s linear infinite !important;
}
body.kids-party .kids-doodle-sm:not(.kids-found) { animation-duration: 1.4s !important; }
body.kids-party .kids-doodle-md:not(.kids-found),
body.kids-party .kids-doodle-lg:not(.kids-found) { animation-duration: 1.8s !important; }

@keyframes kidsPartyOrbit {
  0%   { transform: rotate(0deg) translateX(36px) rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) translateX(36px) rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) translateX(36px) rotate(360deg) scale(1); }
}

/* ---------- Responsive ---------- */
.mobile-br { display: none; }

@media (max-width: 760px) {
  .mobile-br { display: block; }
  .kids-h1 { font-size: 2.8rem; }
  .kids-h2 { font-size: 2.25rem; }
  .kids-hero { padding: 3.5rem 0 3rem 0; }
  .kids-doodle-lg { width: 90px; height: 90px; opacity: 0.6; }
  .kids-doodle-md { width: 80px; height: 80px; }
  .kids-section { padding: 3rem 0; }
  .kids-game-badge { top: auto; bottom: 1rem; right: 0.6rem; }
  /* Die frei schwebenden Hero-Doodles einzeln fein abgestimmt, statt der
     generischen Grössenklassen – sonst wirkt die Fee zu dominant und der
     Zahn zu gross, während die Biene fast verschwindet. */
  .kids-hero-fairy { width: 80px; height: 80px; opacity: 0.75; }
  .kids-hero-tooth { width: 56px; height: 56px; }
  .kids-hero-bee { width: 50px; height: 50px; }
  /* Kacheln auf dem Handy kompakter, sonst scrollt man ewig. */
  .kids-tiles-grid { gap: 1.1rem; padding: 0.6rem 1rem 2rem 1rem; }
  .kids-section.kids-tile { padding: 1.3rem 1.1rem; border-radius: 22px; }
  .kids-tile .kids-section-header { margin-bottom: 1rem; }
  /* Icons in den Abenteuer-Pfad-Kärtchen kleiner, Abstand zum Text -20%. */
  .kids-trail-card .kids-doodle-xs { width: 32px; height: 32px; margin-bottom: 0.08rem; }
}

@media (max-width: 420px) {
  .kids-h1 { font-size: 2.35rem; }
  .kids-doodle-lg, .kids-doodle-md { display: none; }
  .kids-hero-fairy { width: 62px; height: 62px; }
  .kids-hero-tooth { width: 48px; height: 48px; }
  .kids-hero-bee { width: 44px; height: 44px; }
}
