/* ==========================================================
   Orange Day – Mobile Quiz Design
   Farben, Typo, Deko-Ebene, Komponenten, Bewegung
   ========================================================== */

:root {
  /* Palette – abgeleitet aus dem Mini-Design */
  --cream:      #FFEBD9;   /* Hintergrund */
  --cream-2:    #FFF5EC;   /* Karten */
  --peach:      #FFD0A8;   /* Kreis 1 */
  --apricot:    #FFD995;   /* Kreis 2 */
  --marigold:   #F2B200;   /* Linien */
  --tangerine:  #FF9A4D;
  --orange:     #FF7A1A;   /* Primär */
  --burnt:      #E2560F;   /* Primär dunkel */
  --rust:       #B8430C;
  --ink:        #4A2A14;   /* Text */
  --ink-soft:   #8A5A3A;

  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow: 0 10px 30px -12px rgba(226, 86, 15, .35);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);

  --font: "Times New Roman", Times, serif;
}

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

html, body { margin: 0; height: 100%; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* ---------- Deko-Ebene (Kreise + Linien) ---------- */
.decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.decor .layer {               /* für leichte Parallaxe per JS */
  position: absolute;
  inset: 0;
  transition: transform .6s var(--ease-out);
}

.blob {
  position: absolute;
  border-radius: 50%;
  animation: drift 14s ease-in-out infinite alternate;
  will-change: transform;
}
.blob.peach   { background: var(--peach); }
.blob.apricot { background: var(--apricot); }
.blob.tang    { background: var(--tangerine); opacity: .35; }

/* Positionen wie im Mini-Design: oben rechts zwei, unten links zwei */
.b1 { width: 62vw; height: 62vw; top: -34vw; left: 20vw;  animation-duration: 16s; }
.b2 { width: 60vw; height: 60vw; top: -32vw; right: -22vw; animation-duration: 19s; animation-delay: -4s; }
.b3 { width: 56vw; height: 56vw; bottom: -18vw; left: -16vw; animation-duration: 17s; animation-delay: -7s; }
.b4 { width: 62vw; height: 62vw; bottom: -40vw; left: 18vw;  animation-duration: 21s; animation-delay: -2s; }
.b5 { width: 14vw; height: 14vw; top: 42%;  right: -4vw;  animation-duration: 11s; }

/* Linien – hängen von oben, schwingen sanft (wie Schnüre) */
.line {
  position: absolute;
  top: -2vh;
  width: 2px;
  background: var(--marigold);
  transform-origin: top center;
  border-radius: 2px;
  animation: sway 7s ease-in-out infinite alternate;
}
.l1 { left: 5%;  height: 68vh; animation-duration: 8s; }
.l2 { left: 10%; height: 68vh; --tilt: -2deg; animation-duration: 6.5s; animation-delay: -2s; }
.l3 { left: 0;   height: 72vh; --tilt: -14deg; animation-duration: 9s; animation-delay: -3s; }

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(2.5vw, 1.5vw) scale(1.04); }
  100% { transform: translate(-2vw, 3vw) scale(.97); }
}
@keyframes sway {
  from { transform: rotate(calc(var(--tilt, 0deg) - 2deg)); }
  to   { transform: rotate(calc(var(--tilt, 0deg) + 2deg)); }
}

/* ---------- Layout ---------- */
.page {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  max-width: 480px;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.spacer { flex: 1; }

/* ---------- Kopfzeile / Fortschritt ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-left: 18%;          /* Platz für die Linien links */
}

.brand {
  font-weight: 700;
  letter-spacing: .02em;
  font-size: 18px;
  font-style: italic;
  color: var(--burnt);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--orange);
  animation: pulse 2.4s ease-in-out infinite;
}

.progress {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .7);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--marigold), var(--orange));
  animation: grow 1s var(--ease-out) both .2s;
}
.step {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

@keyframes grow  { from { width: 0; } }
@keyframes pulse {
  0%, 100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(255, 122, 26, .45); }
  50%      { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(255, 122, 26, 0); }
}

/* ---------- Typo ---------- */
.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--burnt);
}
h1 {
  margin: 0;
  font-size: clamp(38px, 12vw, 56px);
  line-height: 1;
  letter-spacing: -.02em;
  font-weight: 700;
}
h1 .accent { color: var(--orange); }
h2 {
  margin: 0;
  font-size: clamp(24px, 7vw, 30px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.01em;
  text-wrap: balance;
}
p.lead {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ---------- Karte ---------- */
.card {
  background: rgba(255, 245, 236, .82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- Antworten ---------- */
.answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0; padding: 0; list-style: none;
}

.answer {
  position: relative;
  overflow: hidden;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  min-height: 60px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  font: 600 17px/1.3 var(--font);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--peach);
  transition: transform .25s var(--ease-bounce), box-shadow .25s, background .3s, border-color .3s, color .3s, opacity .3s;
}
.answer:active { transform: translateY(3px) scale(.98); box-shadow: 0 1px 0 var(--peach); }
.answer:focus-visible { outline: 3px solid var(--marigold); outline-offset: 3px; }

.answer .key {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--cream);
  color: var(--burnt);
  font-size: 15px;
  font-weight: 700;
  transition: background .3s, color .3s, transform .4s var(--ease-bounce);
}

.answer.is-picked { border-color: var(--orange); }

.answer.is-correct {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 4px 0 var(--rust);
  animation: pop .5s var(--ease-bounce);
}
.answer.is-correct .key { background: #fff; color: var(--orange); transform: rotate(360deg); }

.answer.is-wrong {
  background: var(--cream);
  border-color: var(--burnt);
  color: var(--rust);
  animation: shake .45s ease;
}
.answer.is-dim { background: #FFF8F2; color: rgba(74, 42, 20, .38); box-shadow: 0 4px 0 rgba(255, 208, 168, .5); }
.answer.is-dim .key { opacity: .5; }
.answers.is-locked .answer { pointer-events: none; }

@keyframes pop   { 0% { transform: scale(1); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); } 40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(3px); }
}

/* Tipp-Welle */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 154, 77, .35);
  transform: scale(0);
  animation: ripple .6s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* Feedback-Text */
.feedback {
  min-height: 24px;
  margin: 0;
  font-weight: 600;
  font-size: 16px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .35s, transform .35s var(--ease-out);
}
.feedback.show { opacity: 1; transform: none; }
.feedback.good { color: var(--burnt); }
.feedback.bad  { color: var(--rust); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 0 24px;
  border: 0;
  border-radius: 99px;
  background: var(--orange);
  color: #fff;
  font: 700 18px var(--font);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--burnt), var(--shadow);
  transition: transform .2s var(--ease-bounce), box-shadow .2s, opacity .4s, visibility .4s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--burnt); }
.btn:focus-visible { outline: 3px solid var(--marigold); outline-offset: 4px; }
.btn .arrow { transition: transform .3s var(--ease-bounce); }
.btn:hover .arrow { transform: translateX(4px); }

.btn.ghost {
  background: transparent;
  color: var(--burnt);
  box-shadow: inset 0 0 0 2px var(--tangerine);
}
.btn.ghost:active { transform: scale(.98); }

/* Weiter-Button bleibt verborgen, bis geantwortet wurde */
.btn.is-waiting { opacity: 0; visibility: hidden; transform: translateY(16px); }
.btn.is-ready   { animation: rise .55s var(--ease-bounce) both; }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } }

/* ---------- Ergebnis ---------- */
.score-ring {
  --size: 200px;
  width: var(--size); height: var(--size);
  margin: 8px auto;
  position: relative;
  display: grid; place-items: center;
}
.score-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 14; stroke-linecap: round; }
.score-ring .track { stroke: rgba(255, 255, 255, .8); }
.score-ring .fill  {
  stroke: var(--orange);
  stroke-dasharray: var(--c);
  stroke-dashoffset: var(--c);
  transition: stroke-dashoffset 1.6s var(--ease-out) .3s;
}
.score-num {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.score-num small {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 6px;
}

/* Konfetti-Punkte */
.confetti {
  position: fixed;
  top: -20px;
  width: 10px; height: 10px;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translate(var(--dx), 110vh) rotate(540deg); }
}

/* ---------- Einblend-Animation (gestaffelt) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: enter .7s var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 90ms + 80ms);
}
@keyframes enter { to { opacity: 1; transform: none; } }

/* Seitenwechsel */
body.leaving .page { animation: leave .35s ease-in forwards; }
@keyframes leave { to { opacity: 0; transform: translateY(-14px); } }

/* Schwebendes Element */
.float { animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }

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

/* ==========================================================
   Erweiterungen: mehr Hintergrund-Elemente
   ========================================================== */
.ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--marigold);
  opacity: .55;
  animation: drift 18s ease-in-out infinite alternate, spin 40s linear infinite;
}
.ring.dashed { border-style: dashed; border-color: var(--tangerine); opacity: .5; }
.r1 { width: 30vw; height: 30vw; top: 30%; right: -10vw; }
.r2 { width: 18vw; height: 18vw; top: 62%; left: 58%; animation-duration: 13s, 30s; }
.r3 { width: 46vw; height: 46vw; bottom: 6vh; right: -24vw; animation-duration: 22s, 60s; }

.dot-f {
  position: absolute;
  border-radius: 50%;
  animation: floaty 9s ease-in-out infinite alternate;
}
.d1 { width: 10px; height: 10px; background: var(--orange);   top: 22%; left: 70%; }
.d2 { width: 6px;  height: 6px;  background: var(--marigold); top: 48%; left: 30%; animation-duration: 7s; animation-delay: -2s; }
.d3 { width: 14px; height: 14px; background: var(--tangerine);top: 76%; left: 82%; animation-duration: 11s; animation-delay: -5s; }
.d4 { width: 8px;  height: 8px;  background: var(--burnt);    top: 12%; left: 44%; animation-duration: 8s;  animation-delay: -3s; }
.d5 { width: 5px;  height: 5px;  background: var(--orange);   top: 88%; left: 50%; animation-duration: 6s; }
.d6 { width: 12px; height: 12px; background: var(--apricot);  top: 36%; left: 8%;  animation-duration: 10s; animation-delay: -6s; }

/* Halbkreis rechts am Rand */
.arc {
  position: absolute;
  width: 60vw; height: 60vw;
  right: -36vw; top: 50%;
  border-radius: 50%;
  background: var(--tangerine);
  opacity: .22;
  animation: drift 15s ease-in-out infinite alternate;
}

/* Rechte Linien */
.l4 { left: auto; right: 9%; height: 26vh; --tilt: 6deg;  animation-duration: 7.5s; }
.l5 { left: auto; right: 5%; height: 18vh; --tilt: -3deg; animation-duration: 6s; animation-delay: -1s; }

/* kleine Kreuze */
.plus {
  position: absolute;
  width: 14px; height: 14px;
  animation: spin 12s linear infinite, floaty 8s ease-in-out infinite alternate;
}
.plus::before, .plus::after {
  content: ""; position: absolute; inset: 6px 0; background: var(--burnt); border-radius: 2px;
}
.plus::after { inset: 0 6px; }
.p1 { top: 18%; left: 84%; }
.p2 { top: 68%; left: 22%; animation-duration: 16s, 10s; }

@keyframes spin   { to { rotate: 360deg; } }
@keyframes floaty { to { translate: 6px -18px; } }

/* ==========================================================
   Mini-Button oben rechts (Prozentzahl)
   ========================================================== */
.score-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 6px;
  border-radius: 99px;
  background: #fff;
  color: var(--burnt);
  font: 700 15px var(--font);
  text-decoration: none;
  box-shadow: 0 3px 0 var(--peach), 0 6px 18px -8px rgba(226, 86, 15, .5);
  font-variant-numeric: tabular-nums;
  transition: transform .25s var(--ease-bounce);
}
.score-chip:active { transform: scale(.94); }
.chip-ring {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: conic-gradient(var(--orange) calc(var(--pct, 0) * 1%), var(--cream) 0);
  transition: --pct .8s;
  position: relative;
}
.chip-ring::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.score-chip.bump { animation: pop .6s var(--ease-bounce); }
.score-chip.goal { background: var(--orange); color: #fff; box-shadow: 0 3px 0 var(--rust); }
.score-chip.goal .chip-ring::after { background: var(--orange); }

/* ==========================================================
   Prozent-Seite
   ========================================================== */
.score-num { font-size: 60px; }
.score-num .pct { font-size: 30px; }

.goodie {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.goodie.locked { background: rgba(255, 255, 255, .6); color: var(--ink-soft); }
.goodie.open {
  background: linear-gradient(135deg, var(--orange), var(--burnt));
  color: #fff;
  box-shadow: 0 8px 0 var(--rust), var(--shadow);
  animation: stamp .7s var(--ease-bounce) 1.2s both, glow 2.4s ease-in-out 2s infinite;
}
.goodie strong { font-size: 24px; }
.goodie .live {
  font-size: 14px; opacity: .9;
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 6px;
}
.goodie .live::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes stamp { from { opacity: 0; transform: scale(1.4) rotate(-6deg); } }
@keyframes glow  { 50% { box-shadow: 0 8px 0 var(--rust), 0 0 0 10px rgba(255, 122, 26, .18); } }

.quiz-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.quiz-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #fff;
  font-size: 17px;
}
.quiz-list .tag { font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.tag.ok   { background: var(--orange); color: #fff; }
.tag.no   { background: var(--cream);  color: var(--rust); }
.tag.open { background: var(--apricot); color: var(--ink); text-decoration: none; }

@property --pct { syntax: "<number>"; inherits: true; initial-value: 0; }

/* ==========================================================
   Fortschrittsbalken mit 75-%-Meilenstein (Goodie)
   ========================================================== */
.goalbar {
  --fill: 0%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0 0 18%;
}
.gb-track {
  position: relative;
  flex: 1;
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .75);
}
.gb-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--marigold), var(--orange));
  transition: width 1s var(--ease-out);
}
.gb-mark {
  position: absolute;
  top: 50%;
  width: 2px; height: 20px;
  margin-left: -1px;
  transform: translateY(-50%);
  background: var(--burnt);
  border-radius: 2px;
}
.gb-gift {
  position: absolute;
  bottom: 14px; left: 50%;
  margin-left: -13px;         /* zentriert ohne transform, damit nichts seitlich springt */
  width: 26px; height: 26px;
  display: grid; place-items: center;
  font-size: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 0 var(--peach);
  animation: gift-bob 2.8s ease-in-out infinite;
}
@keyframes gift-bob { 50% { transform: translateY(-3px); } }
.goalbar.reached .gb-gift {
  background: var(--orange);
  box-shadow: 0 2px 0 var(--rust), 0 0 0 6px rgba(255, 122, 26, .2);
  animation: gift-bob 1.6s ease-in-out infinite;
}
.gb-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  min-width: 30px;
  text-align: right;
}
