/* ═══════════════════════════════════════════════════════════════════
   eCoach Kindgerecht-Modus  ·  ec-kindgerecht.css
   Aktivierung: Klasse .ec-kindgerecht auf dem LE-Wrapper-Container
   ═══════════════════════════════════════════════════════════════════ */

/* ── Grundlage & Hintergrund ──────────────────────────────────────── */
.ec-kindgerecht {
  background: linear-gradient(145deg, #FFF9C4 0%, #FCE4EC 55%, #E3F2FD 100%);
  font-family: 'Nunito', 'Quicksand', 'Comic Sans MS', cursive, sans-serif;
  font-size: 1.15rem;
  line-height: 1.85;
  border-radius: 24px;
  padding: 28px 24px;
  min-height: 100%;
  position: relative;
  overflow-x: hidden;
}

/* ── Überschriften ────────────────────────────────────────────────── */
.ec-kindgerecht h1,
.ec-kindgerecht h2,
.ec-kindgerecht h3 {
  font-family: 'Nunito', 'Quicksand', cursive, sans-serif;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #7B2FBE;
  text-shadow: 2px 2px 0 rgba(255, 200, 0, 0.35);
}

.ec-kindgerecht h1 { font-size: 1.9rem; }
.ec-kindgerecht h2 { font-size: 1.55rem; }
.ec-kindgerecht h3 { font-size: 1.3rem; color: #E91E8C; }

/* ── Fliesstext ───────────────────────────────────────────────────── */
.ec-kindgerecht p {
  font-size: 1.15rem;
  line-height: 1.85;
  color: #333;
  margin-bottom: 1em;
}

.ec-kindgerecht strong { color: #7B2FBE; font-weight: 800; }
.ec-kindgerecht em    { color: #E91E8C; font-style: normal; font-weight: 700; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.ec-kindgerecht .ec-button,
.ec-kindgerecht .ec-nav-button {
  background: linear-gradient(135deg, #FF69B4 0%, #FFD700 100%);
  color: white !important;
  border: 3px solid rgba(255,255,255,0.8);
  border-radius: 50px;
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 0 0 3px rgba(255,105,180,0.25);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
  display: inline-block;
  text-decoration: none;
}

.ec-kindgerecht .ec-button:hover,
.ec-kindgerecht .ec-nav-button:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 10px 0 rgba(0,0,0,0.15), 0 0 0 4px rgba(255,105,180,0.35);
}

.ec-kindgerecht .ec-button:active,
.ec-kindgerecht .ec-nav-button:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 rgba(0,0,0,0.15);
}

/* Weiter-Button bekommt extra Glanz */
.ec-kindgerecht .ec-button-primary {
  background: linear-gradient(135deg, #4CAF50 0%, #2196F3 100%);
  animation: ec-btn-pulse 2.5s ease-in-out infinite;
}

@keyframes ec-btn-pulse {
  0%, 100% { box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 0 0 3px rgba(33,150,243,0.25); }
  50%       { box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 0 0 7px rgba(33,150,243,0.15); }
}

/* ── Fortschrittsbalken ───────────────────────────────────────────── */
.ec-kindgerecht .ec-progress-track {
  background: rgba(255,255,255,0.7);
  border-radius: 50px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
  overflow: hidden;
}

.ec-kindgerecht .ec-progress-bar {
  height: 100%;
  border-radius: 50px;
  background: linear-gradient(90deg,
    #FF69B4 0%,
    #FFD700 25%,
    #4CAF50 50%,
    #2196F3 75%,
    #9C27B0 100%);
  background-size: 200% 100%;
  animation: ec-rainbow-scroll 3s linear infinite;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ec-rainbow-scroll {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ── Kacheln ──────────────────────────────────────────────────────── */
.ec-kindgerecht .ec-tile {
  border-radius: 20px;
  border: 3px solid white;
  box-shadow: 0 8px 0 rgba(0,0,0,0.1);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  background: white;
  overflow: hidden;
  cursor: pointer;
}

.ec-kindgerecht .ec-tile:hover {
  transform: translateY(-8px) rotate(-1.5deg);
  box-shadow: 0 16px 0 rgba(0,0,0,0.1);
}

.ec-kindgerecht .ec-tile:nth-child(odd):hover  { transform: translateY(-8px) rotate(-1.5deg); }
.ec-kindgerecht .ec-tile:nth-child(even):hover { transform: translateY(-8px) rotate(1.5deg); }

.ec-kindgerecht .ec-tile:nth-child(1) { border-top: 6px solid #FF69B4; }
.ec-kindgerecht .ec-tile:nth-child(2) { border-top: 6px solid #FFD700; }
.ec-kindgerecht .ec-tile:nth-child(3) { border-top: 6px solid #4CAF50; }
.ec-kindgerecht .ec-tile:nth-child(4) { border-top: 6px solid #2196F3; }
.ec-kindgerecht .ec-tile:nth-child(5) { border-top: 6px solid #9C27B0; }
.ec-kindgerecht .ec-tile:nth-child(6) { border-top: 6px solid #FF5722; }

/* ── Drag & Drop ──────────────────────────────────────────────────── */
.ec-kindgerecht .ec-drag-item,
.ec-kindgerecht .ec-sort-item {
  background: white;
  border: 3px solid #FFD700;
  border-radius: 16px;
  padding: 14px 20px;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 5px 0 rgba(255,180,0,0.45);
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
}

.ec-kindgerecht .ec-drag-item:hover,
.ec-kindgerecht .ec-sort-item:hover {
  transform: scale(1.05) rotate(1deg);
  box-shadow: 0 9px 0 rgba(255,180,0,0.45);
}

.ec-kindgerecht .ec-drag-item.dragging,
.ec-kindgerecht .ec-sort-item.dragging {
  cursor: grabbing;
  transform: scale(1.1) rotate(3deg);
  box-shadow: 0 15px 25px rgba(0,0,0,0.2);
  opacity: 0.9;
  z-index: 999;
}

.ec-kindgerecht .ec-drop-zone {
  border: 3px dashed #FF69B4;
  border-radius: 16px;
  background: rgba(255,105,180,0.05);
  min-height: 62px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.ec-kindgerecht .ec-drop-zone.drag-over {
  background: rgba(255,105,180,0.18);
  border-style: solid;
  border-color: #FF1493;
  transform: scale(1.02);
}

/* ── Avatar-Sprechblase ───────────────────────────────────────────── */
.ec-kindgerecht .ec-avatar-bubble {
  background: linear-gradient(135deg, #EDE7F6, #F3E5F5);
  border: 3px solid #CE93D8;
  border-radius: 20px 20px 20px 4px;
  padding: 16px 22px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #4A148C;
  box-shadow: 0 5px 15px rgba(156,39,176,0.15);
}

/* ── Feedback-Sterne ──────────────────────────────────────────────── */
.ec-kindgerecht .ec-star-rating .ec-star {
  font-size: 2.8rem;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: grayscale(1) opacity(0.5);
}

.ec-kindgerecht .ec-star-rating .ec-star:hover,
.ec-kindgerecht .ec-star-rating .ec-star.active {
  transform: scale(1.4) rotate(-8deg);
  filter: grayscale(0) opacity(1);
}

/* ── Abschluss-Seite ──────────────────────────────────────────────── */
.ec-kindgerecht .ec-finish-screen {
  text-align: center;
  animation: ec-finish-pop 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes ec-finish-pop {
  0%  { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  70% { transform: scale(1.08) rotate(2deg); }
  100%{ transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════
   ERFOLGS-ANIMATION  (JS setzt .ec-kindgerecht-success)
   ═══════════════════════════════════════════════════════════════════ */

.ec-kindgerecht .ec-step-content.ec-kindgerecht-success {
  animation: ec-success-bounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 0 5px #4CAF50, 0 0 25px rgba(76,175,80,0.45) !important;
  border-radius: 16px;
}

@keyframes ec-success-bounce {
  0%  { transform: scale(1); }
  35% { transform: scale(1.07); }
  65% { transform: scale(0.97); }
  100%{ transform: scale(1); }
}

/* Stern-Burst (per JS erzeugt und in den Container eingefügt) */
.ec-star-burst {
  position: absolute;
  pointer-events: none;
  font-size: 2rem;
  animation: ec-star-fly 0.9s ease-out forwards;
  z-index: 9999;
  line-height: 1;
}

@keyframes ec-star-fly {
  0%  { transform: scale(0) rotate(0deg);    opacity: 1; }
  55% { opacity: 1; }
  100%{ transform: scale(2) translateY(-80px) rotate(200deg); opacity: 0; }
}

/* ── Falsche Antwort: Zittern ─────────────────────────────────────── */
.ec-kindgerecht .ec-step-content.ec-kindgerecht-wrong {
  animation: ec-shake 0.5s ease-in-out;
  box-shadow: 0 0 0 5px #F44336, 0 0 20px rgba(244,67,54,0.35) !important;
  border-radius: 16px;
}

@keyframes ec-shake {
  0%, 100% { transform: translateX(0); }
  15%  { transform: translateX(-10px) rotate(-1.5deg); }
  30%  { transform: translateX(10px) rotate(1.5deg); }
  45%  { transform: translateX(-7px); }
  60%  { transform: translateX(7px); }
  75%  { transform: translateX(-4px); }
  90%  { transform: translateX(4px); }
}

/* Einzelne Antworten korrekt / falsch */
.ec-kindgerecht .ec-answer-correct {
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9) !important;
  border-color: #4CAF50 !important;
  color: #1B5E20 !important;
}

.ec-kindgerecht .ec-answer-wrong {
  background: linear-gradient(135deg, #FFEBEE, #FFCDD2) !important;
  border-color: #F44336 !important;
  color: #B71C1C !important;
}

/* ═══════════════════════════════════════════════════════════════════
   GLITZER / SPARKLES  (HTML wird per JS in .ec-sparkle-container
   geschrieben, der Container sitzt fixed hinter allem)
   ═══════════════════════════════════════════════════════════════════ */

.ec-sparkle-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.ec-sparkle {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  opacity: 0;
  animation: ec-sparkle-anim ease-in-out infinite;
}

/* Positionen + Farben der 12 Sparkles */
.ec-sparkle:nth-child(1)  { background:#FFD700; left: 7%; top:14%; animation-delay:0s;   animation-duration:2.8s; }
.ec-sparkle:nth-child(2)  { background:#FF69B4; left:22%; top:72%; animation-delay:0.4s; animation-duration:3.2s; }
.ec-sparkle:nth-child(3)  { background:#4CAF50; left:65%; top: 8%; animation-delay:0.8s; animation-duration:2.5s; }
.ec-sparkle:nth-child(4)  { background:#2196F3; left:80%; top:60%; animation-delay:1.2s; animation-duration:3.5s; }
.ec-sparkle:nth-child(5)  { background:#FF5722; left:42%; top:88%; animation-delay:1.6s; animation-duration:2.9s; }
.ec-sparkle:nth-child(6)  { background:#9C27B0; left:91%; top:30%; animation-delay:2.0s; animation-duration:3.1s; }
.ec-sparkle:nth-child(7)  { background:#FFD700; left:15%; top:50%; animation-delay:2.4s; animation-duration:2.7s; }
.ec-sparkle:nth-child(8)  { background:#FF69B4; left:55%; top:40%; animation-delay:0.2s; animation-duration:3.3s; }
.ec-sparkle:nth-child(9)  { background:#4CAF50; left:35%; top:25%; animation-delay:1.0s; animation-duration:2.6s; }
.ec-sparkle:nth-child(10) { background:#2196F3; left:72%; top:80%; animation-delay:1.8s; animation-duration:3.0s; }
.ec-sparkle:nth-child(11) { background:#FF5722; left: 5%; top:90%; animation-delay:0.6s; animation-duration:2.4s; }
.ec-sparkle:nth-child(12) { background:#9C27B0; left:48%; top: 5%; animation-delay:1.4s; animation-duration:3.4s; }

@keyframes ec-sparkle-anim {
  0%  { transform: scale(0) rotate(  0deg); opacity: 0; }
  30% { transform: scale(1.6) rotate( 90deg); opacity: 1; }
  65% { transform: scale(1.0) rotate(180deg); opacity: 0.6; }
  100%{ transform: scale(0) rotate(360deg); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   KONFETTI-REGEN  (Einzelteile per JS erzeugt)
   ═══════════════════════════════════════════════════════════════════ */

.ec-confetti-piece {
  position: fixed;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  top: -24px;
  pointer-events: none;
  z-index: 9999;
  animation: ec-confetti-fall linear forwards;
}

@keyframes ec-confetti-fall {
  0%   { transform: translateY(0) rotate(  0deg) scale(1);   opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg) scale(0.4); opacity: 0; }
}
