/* ============================================================
   ANPASSBARE FARBEN – hier einfach ändern
   ============================================================ */
:root {
  --pink: #f7a6b8;
  --pink-deep: #e8899f;
  --pink-dark: #c45370;
  --cream: #fffaf6;
  --cream-panel: rgba(255, 250, 246, 0.92);
  --text: #5a3340;
  --text-soft: #7a5562;
  --white: #ffffff;
  --gold: #e8c06a;
  --gold-dark: #c9a046;
  --sage: #a8d5b5;
  --sky: #a8d8f0;
  --lavender: #d4c1e8;
  --error: #c94d6a;
  --shadow: 0 18px 45px rgba(196, 83, 112, 0.22);
  --shadow-soft: 0 10px 28px rgba(196, 83, 112, 0.14);
  --radius: 28px;
  --radius-sm: 16px;
  --font-script: "Dancing Script", cursive;
  --font-body: "Nunito", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  min-height: 100vh;
  background-color: var(--pink);
  background-image: url("assets/hintergrund.jpg");
  background-repeat: repeat;
  background-size: 420px auto;
  background-attachment: fixed;
  overflow-x: hidden;
}

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

.hidden { display: none !important; }

/* Herumfliegende Sparkles – stört keine Klicks */
.fx-sparkles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.fx-sparkle {
  position: absolute;
  opacity: 0.55;
  filter: drop-shadow(0 0 8px rgba(255, 220, 180, 0.6));
  animation: flySparkle linear infinite;
  will-change: transform, opacity;
}

/* Screens */
.screen {
  display: none;
  min-height: 100vh;
  position: relative;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 2.5rem;
}

.screen.active { display: flex; }
.screen[hidden] { display: none !important; }

/* Panels */
.panel {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
  background: var(--cream-panel);
  backdrop-filter: blur(4px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem;
  text-align: center;
  animation: fadeUp 0.7s ease-out;
}

.panel-narrow { max-width: 480px; }
.panel-wide { max-width: 720px; }

.script-title {
  font-family: var(--font-script);
  font-weight: 700;
  color: var(--pink-dark);
  line-height: 1.15;
  font-size: clamp(1.85rem, 5vw, 2.5rem);
  margin-bottom: 0.75rem;
}

.script-title.lg { font-size: clamp(2.2rem, 6vw, 3rem); }
.script-title.md { font-size: clamp(1.75rem, 4.5vw, 2.35rem); }

.eyebrow {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink-deep);
  margin-bottom: 0.35rem;
}

.lead {
  color: var(--text-soft);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.lead.soft { margin-bottom: 1.5rem; }

.highlight-box {
  background: rgba(247, 166, 184, 0.25);
  border-left: 4px solid var(--pink-deep);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 1rem;
}

.volume-hint {
  background: rgba(168, 216, 240, 0.35);
  border-left: 4px solid var(--sky);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.98rem;
  margin-bottom: 1rem;
}

.puzzle-nav {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0.75rem;
}

.btn-back {
  background: transparent;
  border: 2px solid rgba(232, 137, 159, 0.5);
  color: var(--pink-dark);
  min-height: 40px;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-back:hover {
  background: rgba(247, 166, 184, 0.2);
  border-color: var(--pink-deep);
}

.stack { display: flex; flex-direction: column; gap: 0.85rem; }

/* Bilder */
.deco {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

.banner-girlande {
  width: min(100%, 380px);
  margin: 0 auto 0.75rem;
  filter: drop-shadow(0 8px 20px rgba(196, 83, 112, 0.2));
}

.anim-sway { animation: sway 5s ease-in-out infinite; }

.sparkle-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  width: 95px;
  opacity: 0.85;
  animation: sparkleBlink 2.8s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(255, 200, 120, 0.45));
}

.s1 { top: 6%; left: 8%; width: 100px; }
.s2 { top: 14%; right: 10%; animation-delay: 0.6s; width: 85px; }
.s3 { bottom: 20%; left: 12%; animation-delay: 1.2s; width: 90px; }
.s4 { top: 8%; left: 5%; }
.s5 { top: 12%; right: 7%; animation-delay: 0.4s; }
.s6 { bottom: 18%; left: 8%; animation-delay: 0.9s; width: 60px; }
.s7 { bottom: 24%; right: 10%; animation-delay: 1.4s; }
.s8 { top: 10%; right: 12%; }
.s9 { bottom: 15%; left: 6%; animation-delay: 0.7s; }
.s10 { top: 6%; left: 10%; }
.s11 { top: 14%; right: 8%; animation-delay: 0.5s; }
.s12 { bottom: 20%; left: 14%; animation-delay: 1s; }
.s13 { bottom: 10%; right: 12%; animation-delay: 1.5s; width: 65px; }

/* Welcome – Happy Birthday Hero */
.welcome-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 640px;
}

.hb-hero {
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: scale(0.7) translateY(30px);
  transition: opacity 1s ease, transform 1.1s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.hb-hero.revealed {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.hb-img {
  width: min(100%, 420px);
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 12px 32px rgba(196, 83, 112, 0.25));
  animation: hbFloat 4s ease-in-out infinite;
}

.hb-stars {
  position: absolute;
  top: -10%;
  right: -5%;
  width: 90px;
  animation: sparkleBlink 2s ease-in-out infinite;
  pointer-events: none;
}

.anim-pop { animation: fadeUp 0.7s ease-out both; }
.delay-1 { animation-delay: 0.35s; }

.float-deco { position: absolute; width: 90px; animation: floatY 8s ease-in-out infinite; filter: drop-shadow(0 8px 16px rgba(196,83,112,0.18)); }
.fd-1 { left: 4%; top: 14%; }
.fd-2 { right: 5%; top: 20%; width: 100px; animation-delay: 1.2s; }
.fd-3 { left: 8%; bottom: 16%; width: 80px; animation-delay: 2.4s; }

.party-hat { position: absolute; width: 70px; animation: wiggle 5s ease-in-out infinite; }
.ph-1 { bottom: 12%; left: 6%; }
.ph-2 { bottom: 10%; right: 8%; animation-delay: 1s; width: 65px; }

/* Formular */
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.95rem 1.1rem;
  border: 2px solid rgba(232, 137, 159, 0.35);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--pink-deep);
  box-shadow: 0 0 0 4px rgba(232, 137, 159, 0.25);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.msg-error { color: var(--error); font-size: 0.92rem; min-height: 1.3em; }
.msg-hint { color: var(--text-soft); font-size: 0.95rem; min-height: 1.4em; margin: 0.5rem 0; }
.success-text { color: var(--pink-dark); font-weight: 600; font-size: 1.1rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.9rem 1.75rem;
  border: none;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.btn-primary {
  background: linear-gradient(135deg, var(--pink-deep) 0%, var(--pink-dark) 100%);
  color: var(--white);
  box-shadow: 0 8px 22px rgba(196, 83, 112, 0.35);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(196, 83, 112, 0.42); }
.btn-primary:active { transform: translateY(0); }

.btn-primary.disabled,
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-lg { min-height: 52px; padding: 1rem 2rem; font-size: 1.05rem; }

.link-btn {
  background: none; border: none; color: var(--pink-dark);
  text-decoration: underline; cursor: pointer; font-family: var(--font-body);
  font-size: 0.95rem; margin: 0.5rem 0 1rem;
}

/* Torte & Kerzen */
.cake-stage {
  position: relative;
  max-width: 420px;
  margin: 0 auto 1rem;
}

.cake-stage-ring {
  max-width: 460px;
  aspect-ratio: 1;
  margin: 0 auto 1rem;
}

.cake-stage-ring .cake-img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 52%;
  z-index: 2;
}

.cake-stage-ring .candles-layer { z-index: 3; }
.cake-stage-ring .blow-layer { z-index: 4; }

.cake-img {
  width: 100%;
  display: block;
  filter: drop-shadow(0 14px 30px rgba(196, 83, 112, 0.2));
}

.candles-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.candle {
  position: absolute;
  width: 10px;
  height: 28px;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.candle-wax {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 18px;
  background: linear-gradient(180deg, #fff8f0 0%, #ffe8d8 30%, var(--pink-deep) 100%);
  border-radius: 2px 2px 3px 3px;
  box-shadow: inset -1px 0 2px rgba(0,0,0,0.08);
}

.candle-wick {
  position: absolute;
  bottom: 17px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 4px;
  background: #3a2a1a;
  border-radius: 1px;
}

.candle-glow {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  background: radial-gradient(circle, rgba(255, 200, 80, 0.45) 0%, transparent 70%);
  border-radius: 50%;
  animation: glowPulse 1.2s ease-in-out infinite alternate;
}

.candle-flame {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 16px;
}

.flame-outer {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 90%, #ff9933 0%, #ff6600 45%, transparent 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flameFlicker 0.45s ease-in-out infinite alternate;
}

.flame-inner {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 8px;
  background: radial-gradient(circle at 50% 80%, #ffffaa 0%, #ffcc44 60%, transparent 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flameInner 0.35s ease-in-out infinite alternate-reverse;
}

.candle.out .candle-flame,
.candle.out .candle-glow { opacity: 0; transform: translateX(-50%) scale(0); transition: 0.35s; }
.candle.out .candle-wax { background: linear-gradient(180deg, #eee 0%, #ccc 100%); }

.blow-layer {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  touch-action: none;
}

.progress-text {
  font-weight: 600;
  color: var(--pink-dark);
  margin-bottom: 1rem;
}

/* Geschenke */
.gifts-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
  margin: 1.25rem 0;
}

.gift-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 150px;
  transition: transform 0.35s;
  filter: drop-shadow(0 10px 22px rgba(196,83,112,0.18));
}

.gift-btn img { width: 100%; display: block; pointer-events: none; }

.gift-btn span {
  position: absolute;
  bottom: -1.25rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-script);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--pink-dark);
}

.gift-btn:not(.locked):hover { transform: translateY(-8px) scale(1.04); }
.gift-btn.locked { opacity: 0.45; cursor: not-allowed; }
.gift-btn.opened { opacity: 0.8; pointer-events: none; }
.gift-btn.pop { animation: giftPop 0.55s ease; }

.hints-stack { display: flex; flex-direction: column; gap: 0.75rem; margin: 1rem 0; text-align: left; }

.hint-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  border-left: 4px solid var(--pink-deep);
  box-shadow: var(--shadow-soft);
  animation: fadeUp 0.5s ease-out;
}

.hint-card strong { color: var(--pink-dark); font-family: var(--font-script); font-size: 1.25rem; }

.answer-block { margin-top: 1.25rem; text-align: left; }
.answer-block label { text-align: center; }

.success-box { margin-top: 1rem; text-align: center; }

/* Rubbelkarte */
.scratch-box {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  aspect-ratio: 16/10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.scratch-hidden {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--cream) 0%, #fff5ef 100%);
  font-family: var(--font-script);
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  color: var(--text);
  text-align: center;
  line-height: 1.45;
}

#scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.scratch-box.revealed { animation: glow 1s ease-out; }

/* Kartenspiel (einfaches Blackjack) */
.bj-table {
  background: linear-gradient(145deg, #2d6a4f 0%, #1b4332 100%);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1rem;
  margin: 1rem 0;
  color: var(--white);
  box-shadow: var(--shadow-soft);
}

.bj-round {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.bj-score {
  display: flex;
  justify-content: center;
  gap: 2rem;
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
}

.bj-pick-label {
  margin-bottom: 0.65rem;
  font-weight: 600;
}

.pick-cards {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.pick-card {
  cursor: pointer;
  border: none;
  transition: transform 0.2s;
}

.pick-card:hover:not(:disabled) {
  transform: translateY(-8px) scale(1.05);
}

.card-face-down {
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

[class*="card-back-"] {
  background-blend-mode: overlay;
}

.card-back-rose {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.12) 0 6px, transparent 6px 12px),
    linear-gradient(145deg, #f7a6b8 0%, #e8899f 45%, #c45370 100%);
}

.card-back-gold {
  background:
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.15) 0 6px, transparent 6px 12px),
    linear-gradient(145deg, #f5e6a8 0%, #e8c06a 50%, #c9a046 100%);
}

.card-back-sky {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.14) 0 6px, transparent 6px 12px),
    linear-gradient(145deg, #c5ebff 0%, #a8d8f0 50%, #6eb5d0 100%);
}

.card-back-sage {
  background:
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.14) 0 6px, transparent 6px 12px),
    linear-gradient(145deg, #ccebd4 0%, #a8d5b5 50%, #7fb896 100%);
}

.card-back-lavender {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.14) 0 6px, transparent 6px 12px),
    linear-gradient(145deg, #ede4ff 0%, #d4c1e8 50%, #a888c8 100%);
}

.card-back-coral {
  background:
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.14) 0 6px, transparent 6px 12px),
    linear-gradient(145deg, #ffe0d8 0%, #ffb4a8 50%, #e87868 100%);
}

.card-back-pattern {
  font-family: var(--font-script);
  font-size: 2rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.card-face-down .card-back-pattern::before {
  content: "✦ ";
}

.card-face-down .card-back-pattern::after {
  content: " ✦";
}

.card-back-dealer {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.1) 0 6px, transparent 6px 12px),
    linear-gradient(145deg, #9b8ec4 0%, #6b5b95 100%);
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.card-back-dealer .card-val {
  color: rgba(255, 255, 255, 0.35);
}

.bj-vs-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.bj-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.bj-hand { text-align: center; }

.bj-label {
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  opacity: 0.85;
}

.bj-vs {
  font-family: var(--font-script);
  font-size: 1.5rem;
  font-weight: 700;
  opacity: 0.7;
}

.playing-card {
  width: 72px;
  height: 100px;
  background: var(--white);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  margin: 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.6);
  position: relative;
  overflow: hidden;
}

.playing-card::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.card-face-rose { background: linear-gradient(160deg, #fff5f8 0%, #f7a6b8 100%); border-color: #e8899f; }
.card-face-gold { background: linear-gradient(160deg, #fffbf0 0%, #f0dea8 100%); border-color: #e8c06a; }
.card-face-sky { background: linear-gradient(160deg, #f0faff 0%, #a8d8f0 100%); border-color: #7ec8e8; }
.card-face-sage { background: linear-gradient(160deg, #f4fff7 0%, #a8d5b5 100%); border-color: #8ec4a0; }
.card-face-lavender { background: linear-gradient(160deg, #faf7ff 0%, #d4c1e8 100%); border-color: #b9a0d4; }
.card-face-peach { background: linear-gradient(160deg, #fff8f3 0%, #ffc9a8 100%); border-color: #f0a878; }
.card-face-mint { background: linear-gradient(160deg, #f0fffa 0%, #9ee8d4 100%); border-color: #6fd4b8; }
.card-face-coral { background: linear-gradient(160deg, #fff5f3 0%, #ffb4a8 100%); border-color: #e8897a; }

.card-face-rose .card-val { color: #c45370; }
.card-face-gold .card-val { color: #a68b4b; }
.card-face-sky .card-val { color: #4a8fb0; }
.card-face-sage .card-val { color: #4a8f6a; }
.card-face-lavender .card-val { color: #7a5a9e; }
.card-face-peach .card-val { color: #c47840; }
.card-face-mint .card-val { color: #3a9e80; }
.card-face-coral .card-val { color: #c45350; }

.card-face-rose::before,
.card-face-gold::before,
.card-face-sky::before,
.card-face-sage::before,
.card-face-lavender::before,
.card-face-peach::before,
.card-face-mint::before,
.card-face-coral::before {
  border-color: rgba(90, 51, 64, 0.12);
}

.playing-card.deal-pop { animation: dealPop 0.45s ease-out; }

.card-val {
  font-family: var(--font-script);
  font-size: 2.2rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.bj-status {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
  min-height: 2.5em;
  line-height: 1.4;
}

.bj-table .btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--text);
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

/* Memory */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  max-width: 480px;
  margin: 0.75rem auto 1.25rem;
}

.memory-timer {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pink-dark);
  text-align: center;
  margin: 0.5rem 0 0;
  font-variant-numeric: tabular-nums;
}

.memory-card {
  width: 100%;
  aspect-ratio: 3/4;
  position: relative;
  display: block;
  overflow: hidden;
  perspective: 900px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 12px;
}

.memory-inner {
  position: absolute;
  inset: 0;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}

.memory-card.flipped .memory-inner,
.memory-card.matched .memory-inner { transform: rotateY(180deg); }

.memory-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.memory-back {
  background: linear-gradient(145deg, var(--pink-dark) 0%, #8b3a52 100%);
  border: 2px solid rgba(255,255,255,0.25);
}

.memory-pattern {
  font-size: 2rem;
  color: rgba(255,255,255,0.5);
  animation: sparkleBlink 2s ease-in-out infinite;
}

.memory-front {
  transform: rotateY(180deg);
  background: var(--white);
  border: 2px solid rgba(232,137,159,0.4);
}

.memory-front.is-image {
  background: linear-gradient(160deg, #fff8f5 0%, var(--cream) 100%);
  border-color: rgba(232, 137, 159, 0.45);
  padding: 0.35rem;
}

.memory-img {
  display: block;
  max-width: 88%;
  max-height: 88%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
  pointer-events: none;
}

.memory-word {
  font-family: var(--font-script);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--pink-dark);
}

.memory-symbol {
  font-size: 2.8rem;
  line-height: 1;
}

.memory-card.matched .memory-inner {
  animation: matchPulse 0.5s ease-out;
}

.memory-card:not(.flipped):not(.matched):hover .memory-inner {
  transform: scale(1.04);
}

/* Team-Buchstaben */
.team-slots {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  margin: 1rem 0 1.25rem;
}

.team-slot {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px dashed rgba(232, 137, 159, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-script);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--pink-deep);
  background: rgba(255,255,255,0.7);
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}

.team-slot.filled {
  border-style: solid;
  border-color: var(--pink-deep);
  background: var(--white);
  animation: slotPop 0.4s ease-out;
}

/* Kreise */
.circles-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 1.25rem 0;
}

.circle-btn {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.8);
  font-family: var(--font-script);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  animation: floatY 4s ease-in-out infinite;
  transition: transform 0.25s;
  padding: 0.5rem;
  line-height: 1.1;
}

.circle-btn:nth-child(1) { background: var(--pink-deep); animation-delay: 0s; }
.circle-btn:nth-child(2) { background: var(--sky); color: var(--text); animation-delay: 0.4s; }
.circle-btn:nth-child(3) { background: var(--sage); color: var(--text); animation-delay: 0.8s; }
.circle-btn:nth-child(4) { background: var(--lavender); color: var(--text); animation-delay: 1.2s; }
.circle-btn:nth-child(5) { background: var(--gold-dark); animation-delay: 1.6s; }

.circle-btn:hover:not(.done) { transform: scale(1.08); }
.circle-btn.revealed { animation: none; }
.circle-btn.used { opacity: 0.45; pointer-events: none; transform: scale(0.92); }
.circle-btn.hint-pop { animation: slotPop 0.45s ease-out; }

#team-hint-box { margin-bottom: 1rem; text-align: left; }

/* Ballons */
.balloons-banner {
  width: min(100%, 320px);
  margin: 0 auto 1rem;
  filter: drop-shadow(0 8px 18px rgba(196,83,112,0.15));
}

.balloons-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1rem;
  margin: 1rem 0 0.75rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.balloon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 100px;
  transition: transform 0.3s;
  filter: drop-shadow(0 10px 20px rgba(196,83,112,0.2));
  animation: balloonBob 3.5s ease-in-out infinite;
}

.anim-float { animation: floatY 5s ease-in-out infinite; }

.balloon-btn img { width: 100%; pointer-events: none; }
.balloon-btn:hover:not(.popped) { transform: translateY(-10px) scale(1.05); }

.balloon-btn.popped {
  opacity: 0;
  transform: scale(1.5);
  pointer-events: none;
  animation: balloonPop 0.4s ease-out forwards;
}

@keyframes balloonPop {
  0% { opacity: 1; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.25); }
  100% { opacity: 0; transform: scale(1.6); }
}

/* Finale */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.final-panel { max-width: 680px; }

.final-gift-icon {
  width: min(100%, 140px);
  margin: 0 auto 0.75rem;
  filter: drop-shadow(0 10px 24px rgba(196, 83, 112, 0.2));
}

.final-intro {
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
}

.final-sentence-box {
  background: var(--white);
  border: 2px dashed rgba(232, 137, 159, 0.5);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin: 0 auto 1.5rem;
  max-width: 36rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85), 0 8px 24px rgba(196, 83, 112, 0.1);
}

.final-sentence-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pink-deep);
  text-align: center;
  margin-bottom: 0.65rem;
}

.final-sentence {
  font-family: var(--font-script);
  font-size: clamp(1.25rem, 3.2vw, 1.75rem);
  color: var(--text);
  line-height: 1.6;
  text-align: center;
  margin: 0;
}

.final-sentence .final-word {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  margin: 0 0.05rem;
  border-radius: 6px;
  color: var(--pink-dark);
  font-weight: 700;
  background: rgba(247, 166, 184, 0.35);
}

.final-gift-reveal {
  margin-bottom: 1.25rem;
}

.final-gift-label {
  font-family: var(--font-script);
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 700;
  color: var(--pink-dark);
  text-align: center;
  margin-bottom: 0.85rem;
}

.final-ticket-frame {
  background: linear-gradient(160deg, #fff8f5 0%, #fff0f4 100%);
  border: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 0.85rem;
  max-width: 500px;
  margin: 0 auto;
  box-shadow:
    0 12px 32px rgba(196, 83, 112, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  position: relative;
}

.final-ticket-frame::before {
  content: "🎁";
  position: absolute;
  top: -1.1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.75rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.final-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.behappy-img { width: min(100%, 320px); margin: 0 auto 1rem; filter: drop-shadow(0 10px 24px rgba(196,83,112,0.18)); }

.ticket-preview {
  display: block;
  width: min(100%, 480px);
  margin: 0 auto 1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  cursor: pointer;
  pointer-events: auto;
  max-height: none;
}

.ticket-open-btn {
  margin-top: 0;
}

.stars-deco { width: 120px; margin: 0 auto 0.5rem; }

.music-toggle {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--pink-deep);
  background: var(--cream-panel);
  box-shadow: var(--shadow-soft);
  font-size: 1.2rem;
  cursor: pointer;
}

.music-toggle[hidden] { display: none; }

/* Animationen */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

@keyframes flySparkle {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(0.8);
    opacity: 0.2;
  }
  15% { opacity: 0.7; }
  50% {
    transform: translate(40vw, -30vh) rotate(180deg) scale(1.1);
    opacity: 0.85;
  }
  85% { opacity: 0.5; }
  100% {
    transform: translate(-20vw, 20vh) rotate(360deg) scale(0.7);
    opacity: 0.15;
  }
}

@keyframes dealPop {
  0% { transform: scale(0.3) rotateY(90deg); opacity: 0; }
  100% { transform: scale(1) rotateY(0); opacity: 1; }
}

@keyframes flameFlicker {
  from { transform: scale(1) rotate(-2deg); opacity: 1; }
  to { transform: scale(0.88) rotate(2deg); opacity: 0.88; }
}

@keyframes flameInner {
  from { transform: translateX(-50%) scale(1); }
  to { transform: translateX(-50%) scale(0.75); }
}

@keyframes glowPulse {
  from { opacity: 0.6; transform: translateX(-50%) scale(1); }
  to { opacity: 1; transform: translateX(-50%) scale(1.15); }
}

@keyframes sparkleBlink {
  0%, 100% { opacity: 0.35; transform: scale(0.85) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(12deg); }
}

@keyframes sway {
  0%, 100% { transform: rotate(-1.5deg); }
  50% { transform: rotate(1.5deg); }
}

@keyframes hbFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-100%); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slotPop {
  0% { transform: scale(0.6); opacity: 0.5; }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes matchPulse {
  0% { transform: rotateY(180deg) scale(1); }
  50% { transform: rotateY(180deg) scale(1.08); }
  100% { transform: rotateY(180deg) scale(1); }
}

@keyframes balloonBob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(6deg); }
}

@keyframes giftPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.1) rotate(-3deg); }
  100% { transform: scale(1); }
}

@keyframes glow {
  0%, 100% { box-shadow: var(--shadow-soft); }
  50% { box-shadow: 0 0 30px rgba(232, 192, 106, 0.55); }
}

.shake { animation: shake 0.4s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@media (max-width: 600px) {
  .panel { padding: 1.5rem 1.25rem; }
  .cake-stage-ring { max-width: 320px; }
  .gift-btn { width: 120px; }
  .pick-cards { gap: 0.6rem; }
  .playing-card { width: 62px; height: 88px; }
  .card-val { font-size: 1.6rem; }
  .card-back-pattern { font-size: 1.6rem; }
  .memory-grid { gap: 0.55rem; max-width: 340px; grid-template-columns: repeat(4, 1fr); }
  .memory-word { font-size: 1.1rem; }
  .memory-symbol { font-size: 2.2rem; }
  .circle-btn { width: 76px; height: 76px; font-size: 1.35rem; }
  .team-slot { width: 44px; height: 44px; font-size: 1.3rem; }
  .balloon-btn { width: 82px; }
  .float-deco { width: 70px; opacity: 0.85; }
  .hb-img { width: min(100%, 320px); }
}

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