/* Pico-Werbedetektiv — Aquarell-Look der Schatzfinder Akademie */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --creme: #fdf6e3;
  --creme-tief: #f6ead0;
  --wald: #2e5339;
  --wald-hell: #4a7a58;
  --gold: #d9a441;
  --gold-hell: #ffe9b0;
  --rot: #c0392b;
  --tinte: #3b2f23;
  --schatten: 0 6px 18px rgba(59, 47, 35, 0.18);
}

html, body { height: 100%; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--tinte);
  background:
    radial-gradient(1200px 600px at 20% -10%, #fff8e6 0%, transparent 60%),
    radial-gradient(900px 500px at 90% 110%, #f0e2c4 0%, transparent 55%),
    var(--creme);
  min-height: 100dvh;
  overscroll-behavior: none;
}

#app { max-width: 820px; margin: 0 auto; padding: 12px 14px calc(20px + env(safe-area-inset-bottom)); min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- Kopf ---------- */
.kopf { display: flex; align-items: center; gap: 12px; padding: 6px 0 12px; }
.kopf__titel { font-family: 'Alegreya', serif; font-size: clamp(19px, 4.6vw, 30px); font-weight: 800; color: var(--wald); flex: 1; text-align: center; }
.kopf__zurueck, .kopf__mute {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--wald);
  background: #fff; color: var(--wald); font-size: 20px; display: grid; place-items: center;
  text-decoration: none; cursor: pointer; box-shadow: var(--schatten); flex-shrink: 0;
}
.kopf__zurueck:active, .kopf__mute:active { transform: scale(0.92); }

/* ---------- Screens ---------- */
#screen { flex: 1; display: flex; flex-direction: column; }
.mitte { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 10px 0 30px; }
.mitte > * { max-width: 100%; }
.mitte h2 { font-family: 'Alegreya', serif; font-size: clamp(24px, 6vw, 38px); color: var(--wald); }
.mitte p { font-size: 16px; max-width: 48ch; line-height: 1.5; }
.start__bild { width: min(44vw, 210px); border-radius: 24px; box-shadow: var(--schatten); border: 4px solid #fff; transform: rotate(-2deg); }

.stufen { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; width: 100%; }
.btn {
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 16px;
  border: none; border-radius: 999px; padding: 13px 24px; cursor: pointer;
  background: var(--wald); color: var(--gold-hell); box-shadow: var(--schatten);
  transition: transform 0.12s ease;
}
.btn:active { transform: scale(0.94); }
.btn--gold { background: linear-gradient(145deg, #e7b653, var(--gold)); color: #4a3a12; }
.btn--zart { background: #fff; color: var(--wald); border: 2px solid var(--wald); }
.btn small { display: block; font-weight: 700; font-size: 12px; opacity: 0.85; }
.stufe-best { font-size: 13px; color: #7a6a52; margin-top: 4px; }

/* ---------- Fall-Ansicht ---------- */
.leiste { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding-bottom: 12px; }
.leiste__chip {
  background: #fff; border: 2px solid var(--creme-tief); border-radius: 999px;
  padding: 6px 14px; font-weight: 800; font-size: 14px; color: var(--wald);
  box-shadow: 0 3px 8px rgba(59,47,35,0.08);
}
.leiste__chip b { color: var(--gold); }

.fall { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.fall__akte {
  align-self: flex-start; background: var(--gold-hell); border: 2px solid var(--gold);
  border-radius: 10px 10px 0 0; padding: 5px 16px; font-weight: 900; font-size: 13px;
  letter-spacing: 0.06em; text-transform: uppercase; color: #7a5a1c; margin-bottom: -14px;
  margin-left: 12px; z-index: 2; position: relative;
}
.fall__bild {
  width: 100%; border-radius: 20px; box-shadow: var(--schatten);
  border: 4px solid #fff; display: block; aspect-ratio: 4 / 3; object-fit: cover;
  background: #fff;
}
.fall__frage {
  background: #fff; border: 2px solid var(--gold); border-radius: 16px;
  padding: 14px 18px; font-weight: 800; font-size: 16px; line-height: 1.45;
  box-shadow: 0 4px 12px rgba(59,47,35,0.1);
}
.antworten { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.antwort {
  border: 2px solid var(--wald); border-radius: 16px; background: #fff;
  padding: 13px 14px; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 10px;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 15px; color: var(--tinte);
  box-shadow: 0 3px 8px rgba(59,47,35,0.1);
  transition: transform 0.12s ease, background 0.2s ease;
}
.antwort:active { transform: scale(0.97); }
.antwort__icon { font-size: 24px; flex-shrink: 0; }
.antwort--falsch { background: #f7e3e0; border-color: #c99; opacity: 0.7; pointer-events: none; }
.antwort--richtig { background: #e9f2e4; border-color: var(--wald-hell); }

.aufloesung {
  background: #eef2e4; border: 2px solid var(--wald-hell); border-radius: 18px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
  animation: aufplopp 0.35s ease;
}
@keyframes aufplopp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.aufloesung__titel { font-family: 'Alegreya', serif; font-weight: 800; font-size: 19px; color: var(--wald); }
.aufloesung__text { font-size: 15px; line-height: 1.5; }
.aufloesung__stempel {
  align-self: flex-end; transform: rotate(-8deg);
  border: 3px solid var(--rot); color: var(--rot); border-radius: 10px;
  padding: 4px 12px; font-weight: 900; letter-spacing: 0.1em; font-size: 14px;
}

/* ---------- Fall-Akte (Stempel-Übersicht) ---------- */
.akte { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.akte__stempel {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-size: 20px; background: #fff; border: 2px dashed #c9b888;
}
.akte__stempel--geloest { border: 2px solid var(--wald-hell); background: #e9f2e4; }

/* ---------- Sprechblase / Sieg / Konfetti ---------- */
.blase {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #fff; border: 2px solid var(--gold); border-radius: 16px;
  padding: 10px 18px; font-weight: 800; color: var(--wald); font-size: 15px;
  box-shadow: var(--schatten); max-width: 90vw; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 50;
}
.blase.zeigen { opacity: 1; transform: translateX(-50%) translateY(-6px); }

.sterne { font-size: clamp(38px, 10vw, 56px); letter-spacing: 6px; }
.sieg__werte { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.rang {
  font-family: 'Alegreya', serif; font-size: clamp(20px, 5vw, 28px);
  font-weight: 800; color: #7a5a1c; background: var(--gold-hell);
  border: 2px solid var(--gold); border-radius: 999px; padding: 8px 22px;
}
.rekord { color: var(--rot); font-weight: 900; }

.konfetti {
  position: fixed; width: 10px; height: 14px; top: -20px; z-index: 60;
  pointer-events: none; border-radius: 3px;
  animation: fallen linear forwards;
}
@keyframes fallen {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.6; }
}

@media (max-width: 560px) {
  #app { padding: 8px 8px calc(14px + env(safe-area-inset-bottom)); }
  .antworten { grid-template-columns: 1fr; }
}
