/* ---------- Grundlagen ---------- */
:root {
  color-scheme: light;

  /* Papier und Tinte */
  --papier: #F5F0E4;
  --papier-2: #EAE1CE;
  --weiss: #FFFCF4;
  --tinte: #2B2723;
  --tinte-weich: #7A7065;
  --linie: #D9CBB2;

  /* Stifte aus der Schublade */
  --stift: #D4503C;
  --stift-dunkel: #B03B29;
  --stift-hell: #F7DBD3;

  --gruen: #6E8B52;
  --gruen-hell: #E2EAD4;

  --blau: #3E5F8A;
  --blau-hell: #DCE4F0;

  --gelb: #E0A42B;
  --gelb-hell: #F9EACB;

  --schrift-hand: "Caveat", "Bradley Hand", cursive;
  --schrift-text: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --r-s: 10px;
  --r-m: 16px;
  --r-l: 22px;
  --r-xl: 28px;

  /* Versetzte Schatten statt Weichzeichner: sieht nach ausgeschnittenem
     Papier aus und nicht nach Baukasten. */
  --schatten-s: 2px 2px 0 rgba(43,39,35,.09);
  --schatten-m: 3px 3px 0 rgba(43,39,35,.11);
  --schatten-l: 6px 6px 0 rgba(43,39,35,.13);

  --feder: cubic-bezier(.34, 1.56, .64, 1);
  --sanft: cubic-bezier(.22, .8, .36, 1);
}

* { box-sizing: border-box; }

/* hidden muss staerker sein als display-Regeln weiter unten */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--schrift-text);
  font-size: 16px;
  line-height: 1.6;
  color: var(--tinte);
  background: var(--papier);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Weiche Farbflächen im Hintergrund */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .42;
  pointer-events: none;
}
body::before {
  width: 46vw; height: 46vw; min-width: 320px; min-height: 320px;
  top: -14vw; right: -12vw;
  background: radial-gradient(circle, var(--stift-hell), transparent 70%);
  animation: schweben 22s var(--sanft) infinite alternate;
}
body::after {
  width: 40vw; height: 40vw; min-width: 280px; min-height: 280px;
  bottom: -16vw; left: -10vw;
  background: radial-gradient(circle, var(--gruen-hell), transparent 70%);
  animation: schweben 28s var(--sanft) infinite alternate-reverse;
}
@keyframes schweben {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(3vw, 4vh, 0) scale(1.12); }
}

h1, h2, h3 {
  font-family: var(--schrift-hand);
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.15;
  margin: 0;
}

a { color: inherit; }

::selection { background: var(--stift-hell); }

/* ---------- Layout ---------- */
.seite {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 22px 64px;
}

.kopf {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}
.kopf h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1; }

/* Kleines Schildchen mit dem aktuellen Stand, angeklebt statt untertitelt. */
.schild {
  margin-left: auto;
  align-self: center;
  font-family: var(--schrift-hand);
  font-size: 1.05rem;
  color: var(--tinte-weich);
  background: var(--papier-2);
  border: 2px solid var(--linie);
  border-radius: var(--r-s);
  padding: 2px 12px 1px;
  transform: rotate(1.5deg);
  white-space: nowrap;
}
.schild:empty { display: none; }

/* Zurück-Pfeil */
.zurueck {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: none;
  border-radius: 50%;
  background: var(--weiss);
  border: 2px solid var(--linie);
  box-shadow: 2px 2px 0 var(--linie);
  text-decoration: none;
  font-size: 1.15rem;
  color: var(--tinte);
  transition: transform .35s var(--feder), box-shadow .3s, background .2s;
}
.zurueck:hover { transform: translateX(-3px) scale(1.06); box-shadow: var(--schatten-m); background: var(--stift-hell); }
.zurueck:active { transform: scale(.94); }

/* ---------- Karten ---------- */
.karte {
  background: var(--weiss);
  border: 2px solid var(--linie);
  border-radius: var(--r-l);
  box-shadow: var(--schatten-m);
  padding: 26px;
}


/* ---------- Knöpfe ---------- */
.knopf {
  appearance: none;
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--stift);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  border-color: var(--stift-dunkel);
  box-shadow: 3px 3px 0 var(--stift-dunkel);
  transition: transform .18s var(--sanft), box-shadow .18s var(--sanft), background .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.knopf:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--stift-dunkel); background: var(--stift-dunkel); }
/* Beim Druecken sackt der Knopf auf seinen Schatten - wie ein echter Stempel. */
.knopf:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--stift-dunkel); }
.knopf:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: 2px 2px 0 var(--linie); border-color: var(--linie); }

.knopf.stumm {
  background: var(--weiss);
  color: var(--tinte);
  border-color: var(--linie);
  box-shadow: 3px 3px 0 var(--linie);
}
.knopf.stumm:hover { background: var(--papier-2); box-shadow: 4px 4px 0 var(--linie); }
.knopf.stumm:active { box-shadow: 0 0 0 var(--linie); }
.knopf.stumm:disabled { box-shadow: 2px 2px 0 var(--linie); }

.knopf.klein { padding: 9px 17px; font-size: .88rem; }

/* Welle beim Klick */
.welle {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255,255,255,.45);
  animation: welle .6s var(--sanft) forwards;
  pointer-events: none;
}
.knopf.stumm .welle { background: rgba(228,112,92,.22); }
@keyframes welle { to { transform: scale(3.2); opacity: 0; } }

/* ---------- Eingabefelder ---------- */
.feld { margin-bottom: 16px; }
.feld label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--tinte-weich);
  margin-bottom: 6px;
  letter-spacing: .02em;
}
.feld input {
  width: 100%;
  font: inherit;
  padding: 13px 16px;
  border-radius: var(--r-s);
  border: 2px solid var(--linie);
  background: var(--papier);
  color: var(--tinte);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.feld input:focus {
  outline: none;
  border-color: var(--stift);
  background: var(--weiss);
  box-shadow: 3px 3px 0 var(--stift-hell);
}

/* Sichtbarer Fokus für Tastatur */
:focus-visible { outline: 3px solid var(--blau); outline-offset: 3px; }

/* ---------- Hinweise ---------- */
.hinweis {
  border-radius: var(--r-m);
  padding: 13px 17px;
  font-size: .9rem;
  margin-bottom: 16px;
  border: 2px solid transparent;
}
.hinweis.fehler { background: var(--stift-hell); border-color: #F3C7BD; color: #90301E; }
.hinweis.info   { background: var(--blau-hell); border-color: #DBD2EE; color: #4F3F78; }
.hinweis.gut    { background: var(--gruen-hell); border-color: #C8E0D5; color: #2F5F4B; }

/* ---------- Ladepunkte ---------- */
.punkte { display: inline-flex; gap: 5px; align-items: center; }
.punkte span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--stift);
  animation: huepf 1.3s var(--sanft) infinite;
}
.punkte span:nth-child(2) { animation-delay: .16s; }
.punkte span:nth-child(3) { animation-delay: .32s; }
@keyframes huepf {
  0%, 60%, 100% { transform: translateY(0); opacity: .35; }
  30% { transform: translateY(-7px); opacity: 1; }
}

/* ---------- Einblenden ---------- */
.rein { animation: rein .6s var(--sanft) backwards; }
@keyframes rein {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Konfetti ---------- */
#konfetti {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 60;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
