/* Lern-Held — Bausteine der freien Startseite, der neuen Übungen,
   der Spiele zu zweit und der Ruhe-Ecke. Ergänzt app.css. */

/* ============ STARTSEITE: freie Auswahl (kein Wochenplan) ============ */

.lern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 14px;
  margin-bottom: 6px;
}

.lern-karte {
  position: relative;
  background: var(--card);
  border: 3px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 10px 12px;
  min-height: 136px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  animation: rein 0.4s backwards;
}

.lern-karte:active { transform: scale(0.96); border-color: var(--accent); }

.lern-karte .lk-icon { font-size: 46px; line-height: 1; }
.lern-karte .lk-titel { font-size: 15px; line-height: 1.2; text-align: center; color: var(--ink); }
.lern-karte .lk-muenzen { font-size: 14px; font-weight: 800; color: #b8860b; }

/* Level-Abzeichen: der Stolz-Faktor. Sitzt oben rechts wie in einem Spiel. */
.lern-karte .lk-level {
  position: absolute;
  top: -10px;
  right: -6px;
  background: linear-gradient(180deg, #ffd166, var(--gold));
  color: #6b4e00;
  font-size: 13px;
  font-weight: 900;
  border-radius: 999px;
  padding: 3px 10px;
  border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(180, 120, 0, 0.35);
}

.lern-karte .lk-balken {
  display: block;
  width: 72%;
  height: 7px;
  border-radius: 999px;
  background: #e4eefa;
  overflow: hidden;
}

.lern-karte .lk-balken > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #6aaee8);
  transition: width 0.6s ease;
}

.offline-karte { border-color: #ffd98a; background: linear-gradient(180deg, #fffaf0, #fff); }
.ruhe-karte { border-color: #b9d8f5; background: linear-gradient(180deg, #f2f9ff, #fff); }

.tages-hinweis, .wartet-hinweis {
  background: rgba(255, 255, 255, 0.78);
  border: 2px dashed var(--rand);
  border-radius: 16px;
  padding: 10px 14px;
  margin: 12px 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
}

.wartet-hinweis { border-color: #ffd98a; background: #fff8e8; color: #8a6300; }

/* Level-Aufstieg im Jubel-Bildschirm */
.level-aufstieg {
  font-size: 34px;
  font-weight: 900;
  color: var(--magenta);
  text-shadow: 0 2px 0 #fff, 0 0 22px rgba(255, 192, 46, 0.8);
  animation: pop 0.7s;
}

.jubel-level {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--ink-soft);
  width: 100%;
  max-width: 280px;
  margin: 6px auto 0;
}

.jubel-level .fortschritt-balken { flex: 1; }

/* ============ ÜBUNGEN: Rechnen und Gerecht teilen ============ */

.rechen-bild {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--card);
  border: 3px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  max-width: 460px;
}

.rechen-gruppe {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  font-size: 38px;
  line-height: 1.1;
  max-width: 185px;
}

/* Beim Minus bleiben die weggenommenen Teile sichtbar, aber durchgestrichen —
   so bleibt die Ausgangsmenge begreifbar. */
.rechen-gruppe.weg { opacity: 0.42; filter: grayscale(0.7); position: relative; }
.rechen-gruppe.weg::after {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  top: 50%;
  height: 4px;
  border-radius: 2px;
  background: var(--danger);
  transform: rotate(-8deg);
}

.rechen-zeichen { font-size: 40px; font-weight: 900; color: var(--accent); }

.rechen-aufgabe {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--magenta);
}

.teil-schale {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  font-size: 40px;
  background: var(--card);
  border: 3px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  min-height: 74px;
  max-width: 420px;
}

.teil-freunde { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.teil-freund { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.teil-freund .tf-kopf { font-size: 44px; line-height: 1; }

.teil-freund .tf-teller {
  min-width: 62px;
  min-height: 36px;
  font-size: 20px;
  border-radius: 999px;
  border: 3px dashed var(--rand);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
}

.teil-freund .tf-teller.gefuellt {
  border-style: solid;
  border-color: var(--success);
  background: #e4f8ec;
}

/* ============ SPIELE ZU ZWEIT ============ */

.memory-zug { display: flex; gap: 10px; justify-content: center; margin-bottom: 6px; flex-wrap: wrap; }

.zug-spieler {
  background: var(--card);
  border: 3px solid var(--rand);
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 800;
  font-size: 15px;
  opacity: 0.55;
}

.zug-spieler.dran {
  opacity: 1;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255, 138, 30, 0.2);
}

.spieler-wahl {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 3px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 20px;
  font-weight: 800;
}

.spieler-wahl .sw-icon { font-size: 40px; }
.spieler-wahl .spieler-name { font-size: 24px; color: var(--magenta); min-width: 150px; }
.spieler-wahl .sw-tausch { font-size: 26px; opacity: 0.7; }

/* Das Abklatschen beendet JEDE Partie — Verlieren wird so zur Nebensache. */
.abklatsch-hand {
  font-size: 84px;
  line-height: 1;
  background: var(--card);
  border: 4px solid var(--gold);
  border-radius: 50%;
  width: 140px;
  height: 140px;
  margin: 14px auto 0;
  display: block;
  box-shadow: 0 8px 20px rgba(180, 120, 0, 0.3);
  animation: klatschpuls 1.4s ease-in-out infinite;
}

.abklatsch-hand.geklatscht { animation: none; border-color: var(--success); transform: scale(1.08); }
.abklatsch-hand:disabled { opacity: 1; filter: none; }

@keyframes klatschpuls {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 20px rgba(180, 120, 0, 0.3); }
  50% { transform: scale(1.07); box-shadow: 0 10px 28px rgba(255, 192, 46, 0.6); }
}

/* ============ RUHE-ECKE ============ */

.ruhe-voll, .tagebuch-voll { gap: 12px; position: relative; }

.vulkan {
  position: relative;
  width: 210px;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vulkan-berg {
  font-size: 120px;
  line-height: 1;
  position: relative;
  z-index: 2;
  transition: transform 1s ease;
}

/* Die Glut atmet mit: beim Einatmen wächst sie, beim Ausatmen wird sie ruhig */
.vulkan-glut {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 120, 30, 0.85), rgba(255, 60, 30, 0) 70%);
  transform: scale(0.75);
  transition: transform 4s ease-in-out, opacity 4s ease-in-out;
}

.vulkan.ein .vulkan-glut { transform: scale(1.45); opacity: 1; transition-duration: 4s; }
.vulkan.aus .vulkan-glut { transform: scale(0.6); opacity: 0.45; transition-duration: 6s; }
.vulkan.ein .vulkan-berg { transform: scale(1.08); }
.vulkan.aus .vulkan-berg { transform: scale(0.97); }
.vulkan.ruhig .vulkan-glut { opacity: 0.12; transform: scale(0.5); }

.atem-text {
  font-size: 24px;
  font-weight: 800;
  color: var(--magenta);
  min-height: 1.4em;
  text-align: center;
}

.atem-runden { display: flex; gap: 12px; font-size: 30px; }
.atem-runden span { opacity: 0.3; }
.atem-runden span.ok { opacity: 1; }

.mikro-knopf {
  font-size: 56px;
  line-height: 1;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #e7f3ff);
  border: 4px solid var(--accent);
  box-shadow: 0 8px 18px rgba(30, 90, 150, 0.3);
}

.mikro-knopf.hoert { border-color: var(--danger); animation: klatschpuls 1.1s ease-in-out infinite; }

.tagebuch-liste {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tagebuch-zeile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 2px solid var(--rand);
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 15px;
  text-align: left;
}

.tagebuch-zeile .tb-text { flex: 1; }

@keyframes rein {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ============ GESCHICHTEN ============ */

.geschichte-mitte { justify-content: flex-start; padding-top: 8px; gap: 12px; }

.geschichte-wahl {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 420px;
}

.geschichte-karte {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 3px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  animation: rein 0.4s backwards;
  min-height: 76px;
}

.geschichte-karte:active { transform: scale(0.97); border-color: var(--accent); }
.geschichte-karte .gk-icon { font-size: 40px; line-height: 1; }
.geschichte-karte .gk-titel { flex: 1; font-size: 17px; line-height: 1.25; }

.geschichte-karte .gk-hoeren {
  font-size: 24px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eaf4ff;
}

.geschichte-buehne { display: flex; justify-content: center; }

/* Der Erzähltext: groß und ruhig — er wird ohnehin vorgelesen, die Schrift
   ist vor allem für die Eltern, die mitlesen. */
.geschichte-text {
  background: var(--card);
  border: 3px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  font-size: 19px;
  line-height: 1.5;
  max-width: 480px;
  min-height: 5em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.geschichte-text.geschichte-frage {
  background: linear-gradient(180deg, #fff8e8, #fff);
  border-color: var(--gold);
  font-weight: 800;
  color: var(--magenta);
}

/* Das Maskottchen "holt Luft", solange die Sprachausgabe noch geladen wird.
   Ohne dieses Signal wirken ein bis zwei Sekunden Stille wie ein kaputter Knopf. */
.m-figur.holt-luft { animation: luftholen 1s ease-in-out infinite; }

@keyframes luftholen {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 6px 12px rgba(30, 80, 130, 0.28)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 8px 18px rgba(255, 138, 30, 0.55)); }
}

/* ============ MASKOTTCHEN-VORSTELLUNG ============ */

/* Zurück-Knopf oben links in der Vorstellung. Klebt am oberen Rand, damit er
   auch bei langem Text und kleinem Bildschirm immer erreichbar bleibt. */
.wahl-zurueck {
  position: sticky;
  top: 0;
  align-self: flex-start;
  z-index: 3;
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--rand);
  box-shadow: var(--shadow);
  color: var(--accent);
  margin-bottom: -8px;
}

.wahl-zurueck:active { transform: scale(0.93); border-color: var(--accent); }

/* Häkchen auf den Karten: „den habe ich schon gehört" */
.wahl-karte { position: relative; }

.wahl-karte.gehoert {
  border-color: var(--success);
  background: linear-gradient(180deg, #f3fdf8, #fff);
}

.wahl-karte .wahl-haken {
  position: absolute;
  top: -10px;
  right: -6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(20, 120, 80, 0.35);
}

/* Beim Zurückkommen aus einer Vorstellung sollen die Karten einfach dastehen */
.wahl-karte.ohne-einflug { animation: none; }
