/* emotion.css — Styles für die beiden Gefühls-/Selbstregulations-Spiele:
   „Schatz-Sammler" (js/spiele/schatz.js) und „Stopp-Tanz" (js/spiele/stopptanz.js).
   Nutzt die Farbvariablen aus app.css (--card, --ink, --primary, --accent,
   --success, --gold, --radius, --shadow). Alle Tippziele sind >= 56 px. */

/* =========================================================
   1. Schatz-Sammler
   ========================================================= */

.schatz-mitte {
  justify-content: flex-start;
  gap: 14px;
  padding-top: 4px;
}

/* --- Punktestand in der Kopfzeile --- */

.schatz-stand {
  display: flex;
  gap: 10px;
  align-items: center;
}

.schatz-zaehler {
  background: var(--card);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 20px;
  font-weight: 800;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.schatz-zaehler b { font-size: 22px; }

.schatz-zaehler-helfer { opacity: 0.45; }
.schatz-zaehler-helfer.aktiv {
  opacity: 1;
  background: linear-gradient(180deg, #fff, #fff2cd);
  outline: 3px solid var(--gold);
}

.schatz-blitz { animation: schatz-blitz 0.9s ease-in-out 2; }

@keyframes schatz-blitz {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

/* --- Sprech-Bauchbinde des Maskottchens --- */

.schatz-sagt,
.tanz-hinweis {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 18px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  max-width: 520px;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Spielbrett: 5 Spalten, Weg als Schlange --- */

.schatz-brett {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 420px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.schatz-feld {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: inset 0 -3px 0 rgba(45, 90, 40, 0.12);
}

.schatz-feld-ruhe { opacity: 0.6; font-size: 26px; }
.schatz-feld-start { background: linear-gradient(180deg, #fff, #e7f7dd); }

.schatz-feld-stern {
  background: linear-gradient(180deg, #fff9e3, #ffeeb4);
  outline: 3px solid var(--gold);
}

.schatz-feld-tor {
  background: linear-gradient(180deg, #e8f7ff, #c9e9ff);
  outline: 3px solid var(--accent);
  font-size: 26px;
}

.schatz-feld-tor.schatz-tor-auf {
  animation: schatz-torauf 1.2s ease-in-out 2;
}

@keyframes schatz-torauf {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 192, 46, 0); }
  50% { transform: scale(1.15); box-shadow: 0 0 22px var(--gold); }
}

/* --- Spielfigur (Maskottchen) --- */

.schatz-figur {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(45, 90, 40, 0.35));
}

.schatz-figur.schatz-huepf { animation: schatz-huepf 0.28s ease-out; }

@keyframes schatz-huepf {
  0% { transform: translateX(-50%) translateY(0) scale(1); }
  50% { transform: translateX(-50%) translateY(-16px) scale(1.08); }
  100% { transform: translateX(-50%) translateY(0) scale(1); }
}

/* --- Aktionsbereich: Würfel / Wahl / Abschluss --- */

.schatz-aktion {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 120px;
  width: 100%;
}

.schatz-wuerfel {
  width: 108px;
  height: 108px;
  min-height: 56px;
  border-radius: 28px;
  font-size: 58px;
  line-height: 1;
  background: linear-gradient(180deg, #fff, #ffe6c4);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.8), 0 6px 16px rgba(200, 110, 0, 0.32);
  outline: 4px solid var(--primary);
}

.schatz-wuerfel:active { transform: scale(0.93); }
.schatz-wuerfel:disabled { opacity: 0.75; }
.schatz-wuerfel.rollt { animation: schatz-rollt 0.6s linear; }

@keyframes schatz-rollt {
  0% { transform: rotate(0) scale(1); }
  50% { transform: rotate(200deg) scale(1.12); }
  100% { transform: rotate(360deg) scale(1); }
}

.schatz-wahl-reihe {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.schatz-wahl {
  min-width: 150px;
  min-height: 130px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: var(--ink);
}

.schatz-wahl:active { transform: scale(0.95); }
.schatz-wahl-bild { font-size: 46px; line-height: 1; }
.schatz-wahl-text { font-size: 17px; }

.schatz-wahl-sofort { outline: 4px solid #dbe7d2; }
.schatz-wahl-helfer { outline: 4px solid var(--accent); }

/* Modell-Lernen: das Maskottchen „zeigt" auf die Warte-Option */
.schatz-wahl.schatz-zeigt {
  animation: schatz-zeigt 1s ease-in-out infinite;
  outline-color: var(--gold);
}

@keyframes schatz-zeigt {
  0%, 100% { transform: scale(1); box-shadow: var(--shadow); }
  50% { transform: scale(1.06); box-shadow: 0 0 26px var(--gold); }
}

.schatz-ende {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.schatz-ende-zahl { font-size: 40px; font-weight: 900; }
.schatz-ende-warten {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}

/* =========================================================
   2. Stopp-Tanz
   ========================================================= */

.tanz-mitte {
  justify-content: flex-start;
  gap: 16px;
  padding-top: 6px;
}

.tanz-runden { display: flex; gap: 8px; }

.tanz-runden i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 0 0 2px rgba(45, 90, 40, 0.15);
  display: inline-block;
}

.tanz-runden i.ok { background: var(--success); }
.tanz-runden i.jetzt { background: var(--primary); transform: scale(1.3); }

/* --- Bühne: TANZEN (bunt, bewegt) vs. STOPP (ruhig, starr) --- */

.tanz-buehne {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius);
  padding: 26px 18px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: background 0.3s ease;
}

.tanz-symbol { font-size: 100px; line-height: 1; }

.tanz-wort {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--ink);
}

/* TANZEN: kräftige Farben + Bewegung — auch ohne Ton sofort erkennbar */
.tanz-buehne.tanzt {
  background: linear-gradient(135deg, #ffd76a, #ff9fc4 40%, #9fd8ff 75%, #b6f0c4);
  background-size: 300% 300%;
  animation: tanz-farben 3s ease-in-out infinite;
}

.tanz-buehne.tanzt .tanz-symbol { animation: tanz-wackel 0.6s ease-in-out infinite; }
.tanz-buehne.tanzt.tanz-schnell .tanz-symbol { animation-duration: 0.3s; }
.tanz-buehne.tanzt .tanz-wort { color: #7a3d00; }

@keyframes tanz-farben {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes tanz-wackel {
  0%, 100% { transform: rotate(-12deg) translateY(0) scale(1); }
  25% { transform: rotate(0deg) translateY(-12px) scale(1.08); }
  50% { transform: rotate(12deg) translateY(0) scale(1); }
  75% { transform: rotate(0deg) translateY(-8px) scale(1.05); }
}

/* STOPP: ruhige, kühle Fläche, absolut kein Bild in Bewegung */
.tanz-buehne.steht {
  background: linear-gradient(180deg, #e9eef3, #ccd8e2);
  outline: 6px solid #7d93a6;
}

.tanz-buehne.steht .tanz-symbol {
  animation: none;
  filter: grayscale(0.35);
}

.tanz-buehne.steht .tanz-wort {
  color: #3c5568;
  font-size: 40px;
  letter-spacing: 6px;
}

.tanz-hinweis { max-width: 460px; }

.tanz-aktion {
  display: flex;
  justify-content: center;
  min-height: 76px;
  width: 100%;
}

.tanz-start {
  min-height: 74px;
  min-width: 240px;
  border-radius: 999px;
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px rgba(100, 60, 10, 0.35);
  background: linear-gradient(180deg, #ffb35e, var(--primary) 45%, var(--primary-dark, #e56f00));
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.45), 0 6px 16px rgba(200, 110, 0, 0.35);
  animation: tanz-pulst 1.6s ease-in-out infinite;
}

.tanz-start:active { transform: scale(0.94); }

@keyframes tanz-pulst {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Rücksicht auf „weniger Bewegung"-Einstellung des Geräts:
   Die Regel bleibt über Farbe/Symbol/Text erkennbar. */
@media (prefers-reduced-motion: reduce) {
  .schatz-figur.schatz-huepf,
  .schatz-wuerfel.rollt,
  .schatz-wahl.schatz-zeigt,
  .schatz-feld-tor.schatz-tor-auf,
  .schatz-blitz,
  .tanz-start,
  .tanz-buehne.tanzt,
  .tanz-buehne.tanzt .tanz-symbol {
    animation: none;
  }
}

/* Kleine Displays (Handy hochkant) */
@media (max-width: 380px) {
  .schatz-brett { gap: 5px; padding: 8px; }
  .schatz-feld { border-radius: 12px; font-size: 18px; }
  .schatz-wahl { min-width: 132px; }
  .tanz-symbol { font-size: 76px; }
  .tanz-wort { font-size: 26px; }
}
