:root {
  --gelb: #FFD166;
  --blau: #118AB2;
  --gruen: #06D6A0;
  --rosa: #EF476F;
  --lila: #9B5DE5;
  --creme: #FFFBF0;
  --text: #2D3142;
  --schatten: rgba(45, 49, 66, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(160deg, #E8F4FD 0%, var(--creme) 50%, #FFF5E6 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Startseite */
.hero {
  text-align: center;
  padding: 2rem 1rem 3rem;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  color: var(--blau);
  margin-bottom: 0.5rem;
}

.hero .subtitle {
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 2rem;
}

.hero-emoji {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: wobble 2s ease-in-out infinite;
}

@keyframes wobble {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.modus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.modus-karte {
  background: white;
  border-radius: 24px;
  padding: 2rem 1.5rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  border: 4px solid transparent;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 8px 24px var(--schatten);
}

.modus-karte:hover {
  transform: translateY(-4px);
  border-color: var(--gelb);
  box-shadow: 0 12px 32px var(--schatten);
}

.modus-karte .icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.modus-karte h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--blau);
}

.modus-karte p {
  color: #666;
  font-size: 1rem;
}

.modus-karte.spielen { border-top: 6px solid var(--gruen); }
.modus-karte.drucken { border-top: 6px solid var(--rosa); }

/* Header / Navigation */
.seiten-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.seiten-header h1 {
  font-size: 1.6rem;
  color: var(--blau);
}

.zurueck-link {
  color: var(--blau);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  background: white;
  box-shadow: 0 2px 8px var(--schatten);
}

.zurueck-link:hover {
  background: var(--gelb);
}

/* Themen-Auswahl */
.themen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.thema-btn {
  background: white;
  border: 3px solid #E8E8E8;
  border-radius: 16px;
  padding: 1rem 0.75rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  transition: all 0.2s;
  text-align: center;
}

.thema-btn:hover {
  border-color: var(--gelb);
  transform: scale(1.03);
}

.thema-btn.aktiv {
  border-color: var(--gruen);
  background: #E8FFF5;
}

.thema-btn .icon {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.thema-btn.mix {
  grid-column: 1 / -1;
  background: var(--gelb);
  border-color: var(--gelb);
  font-size: 1.1rem;
  padding: 1.25rem;
}

.start-btn {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
  background: var(--gruen);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(6, 214, 160, 0.4);
  transition: transform 0.2s;
}

.start-btn:hover {
  transform: scale(1.03);
}

.start-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}

/* Quiz-Bereich */
.quiz-bereich {
  background: white;
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 8px 32px var(--schatten);
  min-height: 400px;
}

.fortschritt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fortschritt-text {
  font-weight: 600;
  color: #666;
}

.sterne-anzeige {
  font-size: 1.5rem;
  letter-spacing: 2px;
}

.stern-leer { opacity: 0.3; }
.stern-voll { color: var(--gelb); }

.aufgabe-frage {
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 700;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--blau);
  line-height: 1.3;
}

.aufgabe-text {
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  text-align: center;
  margin: 1rem 0 1.5rem;
  color: var(--text);
  line-height: 1.5;
}

.visual-bereich {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.5rem 0;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Zehnerfeld */
.zehnerfeld {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 12px;
  background: #F0F4F8;
  border-radius: 12px;
  width: fit-content;
}

.zehnerfeld-klein {
  margin-top: 8px;
}

.feld-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #DDE4EC;
  border: 2px solid #B8C5D6;
}

.feld-dot.aktiv {
  background: var(--blau);
  border-color: var(--blau);
}

/* Sachaufgaben */
.sach-visual {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  max-width: 400px;
}

.sach-item {
  font-size: 2rem;
}

.sach-item-neu {
  opacity: 0.7;
  border: 2px dashed var(--gruen);
  border-radius: 8px;
  padding: 2px;
}

.sach-plus {
  font-size: 2rem;
  font-weight: bold;
  color: var(--rosa);
  margin: 0 8px;
}

/* Münzen */
.muenzen-visual {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.muenze {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #FFE066, #D4A017);
  border: 3px solid #B8860B;
  color: #5C4000;
  font-weight: 700;
}

.muenze-klein { width: 48px; height: 48px; font-size: 0.7rem; }
.muenze-mittel { width: 64px; height: 64px; font-size: 0.8rem; }
.muenze-gross { width: 80px; height: 80px; font-size: 0.9rem; }

/* Uhr */
.uhr-svg {
  width: 180px;
  height: 180px;
}

/* Formen */
.form-svg {
  width: 160px;
  height: 160px;
}

/* Zerlegung */
.zerlegung-visual {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 2rem;
  font-weight: 700;
}

.zerleg-zahl {
  background: var(--gelb);
  padding: 8px 20px;
  border-radius: 12px;
}

.zerleg-teil {
  background: var(--gruen);
  color: white;
  padding: 8px 16px;
  border-radius: 12px;
}

.zerleg-pfeil, .zerleg-plus {
  color: var(--rosa);
}

.folge-visual {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--lila);
}

/* Antworten */
.antwort-bereich {
  margin-top: 2rem;
}

.zahl-eingabe {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.zahl-eingabe input {
  font-size: 2.5rem;
  width: 120px;
  text-align: center;
  padding: 0.5rem;
  border: 4px solid var(--blau);
  border-radius: 16px;
  font-weight: 700;
}

.zahl-eingabe input:focus {
  outline: none;
  border-color: var(--gruen);
}

.optionen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.option-btn {
  padding: 1.25rem 1rem;
  font-size: 1.4rem;
  font-weight: 700;
  background: white;
  border: 4px solid #E0E0E0;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 70px;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--blau);
  background: #E8F4FD;
  transform: scale(1.03);
}

.option-btn:disabled {
  cursor: default;
}

.option-btn.richtig {
  border-color: var(--gruen);
  background: #D4FFF0;
}

.option-btn.falsch {
  border-color: var(--rosa);
  background: #FFE0E6;
}

.pruefen-btn {
  display: block;
  margin: 1.5rem auto 0;
  padding: 1rem 2.5rem;
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--blau);
  color: white;
  border: none;
  border-radius: 16px;
  cursor: pointer;
}

.pruefen-btn:hover {
  background: #0E7A9E;
}

/* Feedback */
.feedback {
  text-align: center;
  padding: 1.5rem;
  border-radius: 16px;
  margin-top: 1.5rem;
  font-size: 1.3rem;
  font-weight: 600;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.feedback.richtig {
  background: #D4FFF0;
  color: #0A7B5C;
}

.feedback.falsch {
  background: #FFF0E0;
  color: #B35C00;
}

.feedback .hilfe-text {
  font-size: 1rem;
  font-weight: 400;
  margin-top: 0.5rem;
  color: #666;
}

.weiter-btn {
  display: block;
  margin: 1rem auto 0;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--gruen);
  color: white;
  border: none;
  border-radius: 16px;
  cursor: pointer;
}

/* Belohnung */
.belohnung {
  text-align: center;
  padding: 3rem 1rem;
}

.belohnung h2 {
  font-size: 2.5rem;
  color: var(--gruen);
  margin-bottom: 1rem;
}

.belohnung .stern-regen {
  font-size: 4rem;
  margin: 1.5rem 0;
  animation: sternPop 0.6s ease;
}

@keyframes sternPop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.versteckt {
  display: none !important;
}

/* Arbeitsblatt */
.einstellungen {
  background: white;
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px var(--schatten);
}

.einstellungen h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--blau);
}

.einstellungs-gruppe {
  margin-bottom: 1.25rem;
}

.einstellungs-gruppe label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
}

.checkbox-grid label:hover {
  background: #F5F5F5;
}

.anzahl-auswahl {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.anzahl-btn {
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border: 3px solid #E0E0E0;
  border-radius: 12px;
  background: white;
  cursor: pointer;
}

.anzahl-btn.aktiv {
  border-color: var(--blau);
  background: #E8F4FD;
}

.aktions-leiste {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.aktions-leiste button {
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

.btn-neu { background: var(--gelb); color: var(--text); }
.btn-drucken { background: var(--blau); color: white; }
.btn-loesung { background: white; border: 2px solid var(--blau) !important; color: var(--blau); }

/* Arbeitsblatt Vorschau */
.arbeitsblatt-vorschau {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 16px var(--schatten);
}

.arbeitsblatt-kopf {
  border-bottom: 2px solid #333;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.arbeitsblatt-kopf h2 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.kopf-zeile {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 1rem;
}

.kopf-zeile span {
  border-bottom: 1px solid #999;
  min-width: 150px;
  padding-bottom: 2px;
}

.aufgaben-liste {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 2rem;
}

.aufgabe-druck {
  font-size: 1.05rem;
  line-height: 1.6;
  break-inside: avoid;
}

.aufgabe-druck .nr {
  font-weight: 700;
  color: var(--blau);
  margin-right: 0.25rem;
}

.aufgabe-druck .loesung {
  color: var(--gruen);
  font-weight: 600;
  margin-top: 0.25rem;
}

.loesungsblatt {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 3px dashed #ccc;
}

.loesungsblatt h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--gruen);
}

/* Druck-Styles */
@media print {
  body {
    background: white;
  }

  .no-print {
    display: none !important;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .arbeitsblatt-vorschau {
    box-shadow: none;
    padding: 0;
  }

  .aufgaben-liste {
    gap: 1rem 1.5rem;
  }

  .loesungsblatt {
    page-break-before: always;
  }
}

@media (max-width: 600px) {
  .aufgaben-liste {
    grid-template-columns: 1fr;
  }

  .quiz-bereich {
    padding: 1.25rem;
  }
}

/* Stufen-Auswahl */
.stufen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
  text-align: left;
}

.stufen-karte {
  background: white;
  border-radius: 24px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  border: 4px solid transparent;
  box-shadow: 0 8px 24px var(--schatten);
  transition: transform 0.2s, border-color 0.2s;
  display: block;
}

.stufen-karte:hover {
  transform: translateY(-4px);
}

.stufen-karte .icon {
  font-size: 2.5rem;
  margin: 0.5rem 0;
}

.stufen-karte h2 {
  font-size: 1.2rem;
  color: var(--blau);
  margin-bottom: 0.35rem;
}

.stufen-karte p {
  color: #666;
  font-size: 0.95rem;
}

.stufen-alter {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  background: #F0F4F8;
  color: #555;
}

.stufe-klein { border-top: 6px solid var(--rosa); }
.stufe-mittel { border-top: 6px solid var(--lila); }
.stufe-hj1 { border-top: 6px solid var(--gruen); }
.stufe-hj2 { border-top: 6px solid var(--blau); }

/* Lernspiele 2–4 / 4–6 */
.lern-body {
  background: linear-gradient(160deg, #FFF0F5 0%, #F0F8FF 50%, #FFF9E6 100%);
}

.lern-hinweis {
  text-align: center;
  color: #666;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.lern-modus-leiste {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.lern-modus-btn {
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  border: 3px solid #E8E8E8;
  border-radius: 16px;
  background: white;
  cursor: pointer;
  min-height: 56px;
  transition: all 0.2s;
}

.lern-modus-btn:hover {
  border-color: var(--gelb);
  transform: scale(1.03);
}

.lern-modus-btn.aktiv {
  border-color: var(--gruen);
  background: #E8FFF5;
}

.lern-modus-btn.sprech {
  background: var(--gelb);
  border-color: var(--gelb);
  font-size: 1.4rem;
  padding: 1rem 1.5rem;
}

.lern-inhalt {
  min-height: 380px;
}

.lern-karte {
  background: white;
  border-radius: 28px;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 8px 32px var(--schatten);
}

.lern-grosszahl {
  font-size: clamp(5rem, 20vw, 8rem);
  font-weight: 800;
  color: var(--blau);
  line-height: 1;
  margin-bottom: 1rem;
}

.lern-grossbuchstabe {
  font-size: clamp(5rem, 20vw, 7rem);
  font-weight: 800;
  color: var(--rosa);
  line-height: 1;
}

.lern-emoji-gross {
  font-size: clamp(4rem, 15vw, 6rem);
  margin: 1rem 0;
}

.lern-wort {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1rem;
}

.lern-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.lern-nav-btn {
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
  border: 3px solid var(--blau);
  border-radius: 50%;
  background: white;
  cursor: pointer;
  color: var(--blau);
}

.lern-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.lern-wiederhol-btn {
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--gelb);
  border: none;
  border-radius: 16px;
  cursor: pointer;
}

.zaehl-bild {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 1rem 0;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.zaehl-item {
  font-size: clamp(2rem, 8vw, 3rem);
}

.spiel-frage {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blau);
  margin-bottom: 1rem;
}

.spiel-hinweis {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
}

.lern-optionen-gross {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

.lern-tipp-btn {
  min-height: 90px;
  font-size: 2.5rem;
  font-weight: 800;
  border: 4px solid #E0E0E0;
  border-radius: 20px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.lern-tipp-btn.buchstabe {
  font-size: 2.2rem;
  color: var(--rosa);
}

.lern-tipp-btn:hover:not(:disabled) {
  border-color: var(--blau);
  transform: scale(1.05);
}

.lern-tipp-btn.richtig {
  border-color: var(--gruen);
  background: #D4FFF0;
}

.lern-tipp-btn.falsch {
  border-color: var(--rosa);
  background: #FFE0E6;
}

.lern-tipp-btn:disabled {
  cursor: default;
}

.lern-feedback {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 16px;
  animation: fadeIn 0.3s ease;
}

.lern-feedback.richtig {
  background: #D4FFF0;
  color: #0A7B5C;
}

.lern-feedback.falsch {
  background: #FFF0E0;
  color: #B35C00;
}
