/* Kampagnenspiel „geklärt" */

:root {
  --blau: #0069b4;
  --dunkelblau: #003560;
  --orange: #e87722;
  --gruen: #2e9e44;
  --gruen-hell: #e6f5e9;
  --rot: #d23a2f;
  --rot-hell: #fdecea;
  --tinte: #10263b;
  --leise: #4f6275;
  --weiss: #fff;
  --verlauf: linear-gradient(20deg, #1d70b7 32.71%, #00a7e3 56.82%, #94c122 102.19%);
  --schatten: 0 10px 30px rgba(0, 40, 80, .25);
  --radius: 20px;
  color-scheme: light;
}

@font-face { font-family: "Overpass"; src: url("../assets/fonts/Overpass-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Overpass", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--tinte);
  background: var(--verlauf) fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img { display: block; max-width: 100%; height: auto; }

button { font: inherit; color: inherit; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--weiss); outline-offset: 3px; }

/* ---------- Rahmen ---------- */

.app {
  position: relative;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
}

.ansicht {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}

.ansicht h1 {
  margin: 0;
  font-size: clamp(1.75rem, 7vw, 2.15rem);
  line-height: 1.15;
  font-weight: 700;
  color: var(--weiss);
}

.schliessen, .zurueck {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, .22);
  color: var(--weiss);
  cursor: pointer;
}
.schliessen svg, .zurueck svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
}

/* Seifenblasen (Deko) */
.blasen { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blase { position: absolute; width: var(--s); aspect-ratio: 1; background: url("../assets/img/seifenblase.svg") center / contain no-repeat; }
.ansicht-start > :not(.blasen) { position: relative; z-index: 1; }

/* ---------- Knöpfe ---------- */

.knopf {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 14px 20px;
  border: 0;
  border-radius: 0;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.knopf:active { transform: scale(.98); }
.knopf-haupt { background: var(--orange); color: var(--weiss); box-shadow: 0 6px 18px rgba(232, 119, 34, .45); }
.knopf-zweit { background: var(--weiss); color: var(--blau); }

/* ---------- 1 · Anleitung ---------- */

.ansicht-start { justify-content: space-between; }

.start-buehne {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.maskottchen-start {
  width: min(62%, 260px);
  align-self: center;
  animation: wippen 3s ease-in-out infinite;
}

.sprechblase {
  position: relative;
  padding: 20px 20px 18px;
  border-radius: 0;
  background: var(--weiss);
  box-shadow: var(--schatten);
}
.sprechblase::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  border: 12px solid transparent;
  border-top: 0;
  border-bottom-color: var(--weiss);
  transform: translateX(-50%);
}
.sprechblase h1 { color: var(--dunkelblau); margin-bottom: 12px; }

.anleitung { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 1.02rem; line-height: 1.4; }
.anleitung li { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; }
.pfeil {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 0;
  background: #e8f2fa; color: var(--blau); font-weight: 700;
}
.pfeil-ja { background: var(--gruen-hell); color: var(--gruen); }
.pfeil-nein { background: var(--rot-hell); color: var(--rot); }

/* ---------- 2 · Kartenanzahl ---------- */

.ansicht-auswahl { gap: 24px; }
.ansicht-auswahl h1 { margin-top: 8px; }

.auswahl-liste { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.auswahl-knopf {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 0;
  background: var(--weiss);
  color: var(--dunkelblau);
  box-shadow: var(--schatten);
  cursor: pointer;
  transition: transform .15s ease;
}
.auswahl-knopf:active { transform: scale(.97); }
.auswahl-knopf strong { font-size: 2.6rem; line-height: 1; font-weight: 700; color: var(--blau); }
.auswahl-knopf span { font-size: 1rem; font-weight: 700; }
.auswahl-knopf:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 3 · Spiel ---------- */

.ansicht-spiel { gap: 12px; }

.spiel-kopf { display: flex; align-items: center; gap: 12px; }

.fortschritt { flex: 1; }
.fortschritt-text { margin: 0 0 6px; color: var(--weiss); font-weight: 700; font-size: 1.05rem; }
.fortschritt-balken { height: 8px; border-radius: 0; background: rgba(255, 255, 255, .3); overflow: hidden; }
.fortschritt-balken span { display: block; height: 100%; width: 0; border-radius: 0; background: var(--weiss); transition: width .35s ease; }

.stapel-bereich { flex: 1; display: grid; place-items: center; min-height: 0; }

.stapel {
  position: relative;
  width: min(86vw, 340px, 50dvh);
  aspect-ratio: 1 / 1;
}

.karte {
  position: absolute;
  inset: 0;
  border: 4px solid var(--weiss);
  border-radius: 0;
  overflow: hidden;
  background: var(--verlauf);
  box-shadow: var(--schatten);
  user-select: none;
  -webkit-user-select: none;
  transition: transform .3s ease, opacity .3s ease;
  will-change: transform;
}
.karte img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.karte-name {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  margin: 0;
  padding: 28px 12px 14px;
  font-size: clamp(1.15rem, 5vw, 1.4rem);
  font-weight: 700;
  text-align: center;
  color: var(--weiss);
  background: linear-gradient(to top, rgba(0, 53, 96, .55), rgba(0, 53, 96, 0));
}

.karte-oben { cursor: grab; touch-action: none; z-index: 3; }
.karte-oben.zieht { cursor: grabbing; transition: none; }
.karte-2 { z-index: 2; transform: translateY(14px) scale(.94); }
.karte-3 { z-index: 1; transform: translateY(28px) scale(.88); opacity: .7; }

.stempel {
  position: absolute;
  top: 22px;
  padding: 4px 14px;
  border: 4px solid currentColor;
  border-radius: 0;
  background: rgba(255, 255, 255, .9);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: .04em;
  opacity: 0;
  pointer-events: none;
}
.stempel-ja { left: 18px; color: var(--gruen); transform: rotate(-14deg); }
.stempel-nein { right: 18px; color: var(--rot); transform: rotate(14deg); }

.spiel-fuss {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.knopf-antwort {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 14px;
  border: 0;
  border-radius: 0;
  background: var(--weiss);
  box-shadow: var(--schatten);
  text-align: left;
  font-size: .85rem;
  line-height: 1.2;
  cursor: pointer;
  transition: transform .15s ease;
}
.knopf-antwort:active { transform: scale(.97); }
.knopf-antwort svg { flex: none; width: 34px; height: 34px; padding: 8px; fill: var(--weiss); }
.knopf-antwort strong { display: block; font-size: 1.15rem; }
.knopf-nein svg { background: var(--rot); }
.knopf-nein strong { color: var(--rot); }
.knopf-ja { flex-direction: row-reverse; text-align: right; }
.knopf-ja svg { background: var(--gruen); }
.knopf-ja strong { color: var(--gruen); }

.maskottchen-mini { width: 62px; }

/* Rückmeldung */

.rueckmeldung {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  padding: 16px 12px max(16px, env(safe-area-inset-bottom));
  background: rgba(0, 30, 60, .35);
  animation: einblenden .2s ease;
}

.rueckmeldung-karte {
  position: relative;
  width: 100%;
  padding: 84px 20px 20px;
  border-radius: 0;
  background: var(--weiss);
  box-shadow: var(--schatten);
  animation: hochfahren .3s cubic-bezier(.2, .9, .3, 1.2);
}

.maskottchen-rueckmeldung {
  position: absolute;
  top: -64px;
  left: 50%;
  width: 150px;
  transform: translateX(-50%);
}
.rueckmeldung.richtig .maskottchen-rueckmeldung { animation: huepfen .6s ease; }
.rueckmeldung.falsch .maskottchen-rueckmeldung { animation: wackeln .5s ease; }

.rueckmeldung-text { text-align: center; margin-bottom: 18px; }

.rueckmeldung-marke {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 14px;
  border-radius: 0;
  font-size: .95rem;
  font-weight: 700;
}
.richtig .rueckmeldung-marke { background: var(--gruen-hell); color: var(--gruen); }
.falsch .rueckmeldung-marke { background: var(--rot-hell); color: var(--rot); }

.rueckmeldung h2 { margin: 0 0 8px; font-size: 1.35rem; line-height: 1.25; color: var(--dunkelblau); }

.rueckmeldung-hinweis { margin: 0; color: var(--leise); font-size: .98rem; line-height: 1.45; }
.falsch .rueckmeldung-hinweis {
  padding: 12px 14px;
  border-radius: 0;
  background: #fff6ef;
  color: var(--tinte);
  font-size: 1.05rem;
  font-weight: 400;
}
.rueckmeldung-zusatz { margin: 10px 0 0; color: var(--leise); font-size: .9rem; }

/* ---------- 4 · Ergebnis ---------- */

.ansicht-ergebnis { overflow-y: auto; gap: 18px; }

.ergebnis-kopf { text-align: center; }
.maskottchen-herz { width: min(70%, 280px); margin: 20px auto 12px; animation: wippen 3s ease-in-out infinite; }
.ergebnis-zahl { margin: 10px 0 4px; color: var(--weiss); font-size: 1.15rem; font-weight: 700; }
.ergebnis-text { margin: 0; color: var(--weiss); font-size: 1rem; line-height: 1.45; }

.rueckblick { padding: 18px; border-radius: 0; background: var(--weiss); box-shadow: var(--schatten); }
.rueckblick h2 { margin: 0 0 12px; font-size: 1.15rem; color: var(--dunkelblau); }
.rueckblick-liste { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.rueckblick-liste li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; }
.rueckblick-liste img { width: 56px; height: 56px; border-radius: 0; }
.rueckblick-liste strong { display: block; color: var(--dunkelblau); }
.rueckblick-liste span { display: block; font-size: .92rem; color: var(--leise); line-height: 1.35; }
.rueckblick-liste em { display: block; font-style: normal; font-weight: 700; }
.rueckblick-liste .ist-ja { color: var(--gruen); }
.rueckblick-liste .ist-nein { color: var(--rot); }

.ergebnis-knoepfe { display: grid; gap: 10px; margin-top: auto; }

.toast {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  margin: 0;
  padding: 10px 18px;
  border-radius: 0;
  background: var(--dunkelblau);
  color: var(--weiss);
  font-weight: 700;
  transform: translateX(-50%);
}

/* ---------- Animationen ---------- */

@keyframes wippen { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes einblenden { from { opacity: 0; } to { opacity: 1; } }
@keyframes hochfahren { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes huepfen {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  35% { transform: translateX(-50%) translateY(-22px); }
  60% { transform: translateX(-50%) translateY(0); }
  80% { transform: translateX(-50%) translateY(-8px); }
}
@keyframes wackeln {
  0%, 100% { transform: translateX(-50%) rotate(0); }
  20% { transform: translateX(calc(-50% - 8px)) rotate(-6deg); }
  40% { transform: translateX(calc(-50% + 8px)) rotate(6deg); }
  60% { transform: translateX(calc(-50% - 5px)) rotate(-3deg); }
  80% { transform: translateX(calc(-50% + 5px)) rotate(3deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Größere Bildschirme: Spiel als zentriertes „Telefon" */
@media (min-width: 700px) and (min-height: 700px) {
  .app {
    height: min(900px, calc(100dvh - 48px));
    margin-top: max(24px, calc((100dvh - 900px) / 2));
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(0, 30, 60, .35);
    background: var(--verlauf);
  }
}
