/* Gemeinsamer Look: Tannenwand bei Nacht, Bogentüren in Weinrot mit Goldrahmen. */
:root {
  color-scheme: dark;
  --night: #0c231d;
  --fir: #14382d;
  --fir-light: #2f6b4f;
  --berry: #a3202f;
  --berry-deep: #6f1220;
  --gold: #e8b85a;
  --gold-deep: #a9792a;
  --snow: #f6efe2;
  --snow-dim: #b9c4b6;
  --room: #2a1408;
  --glow: #ffd98a;
  --error: #ffb3a6;
  --font-display: "Berkshire Swash", "Georgia", serif;
  --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; margin: 0; }
body {
  background: radial-gradient(120% 80% at 50% 0%, var(--fir) 0%, var(--night) 70%) var(--night);
  background-attachment: fixed;
  color: var(--snow);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: clip;
}
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.eyebrow { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
h1 { font-family: var(--font-display); font-weight: 400; line-height: 1.05; margin: 0; text-wrap: balance; color: var(--snow); }

.doors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.9rem, 4vw, 2.5rem); margin: 0 auto; width: 100%; }
.slot { display: flex; flex-direction: column; gap: .7rem; align-items: center; text-align: center; min-width: 0; }
.slot-date { font-weight: 700; }
.slot-state { color: var(--snow-dim); }
.slot-state.is-open { color: var(--gold); }

/* Das Türchen: Rahmen, Raum dahinter, Türblatt */
.door { display: block; width: 100%; container-type: inline-size; background: none; border: 0; padding: 0; color: inherit; font: inherit; }
button.door { cursor: pointer; }
.door:focus-visible { outline: 3px solid var(--glow); outline-offset: 6px; border-radius: 8px; }
.frame {
  display: block; position: relative; aspect-ratio: 3 / 4.3;
  border-radius: 50% 50% 4cqw 4cqw / 34% 34% 3cqw 3cqw;
  background: linear-gradient(160deg, var(--gold), var(--gold-deep));
  padding: 4cqw; perspective: 320cqw;
  box-shadow: 0 3cqw 8cqw rgba(0, 0, 0, .45);
}
.room, .leaf { position: absolute; inset: 4cqw; border-radius: 50% 50% 2cqw 2cqw / 33% 33% 2cqw 2cqw; }
.room { display: block; overflow: hidden; background: radial-gradient(circle at 50% 62%, var(--gold-deep) 0%, var(--room) 70%); }
.rays {
  position: absolute; left: 50%; top: 58%; width: 220%; aspect-ratio: 1; translate: -50% -50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 217, 138, .55) 0deg 9deg, rgba(255, 217, 138, 0) 9deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 62%); mask: radial-gradient(circle, #000 0%, transparent 62%);
  opacity: 0; transition: opacity 1.2s ease .5s;
}
.prize { position: absolute; inset: 22% 12% 8% 12%; display: grid; place-items: center; opacity: 0; scale: .2; transition: opacity .5s ease .15s, scale 1s cubic-bezier(.2, 1.7, .4, 1) .15s; }
.prize svg { width: 100%; height: 100%; }
.leaf {
  display: block; transform-origin: 0 50%;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .22), rgba(0, 0, 0, 0) 18%, rgba(255, 255, 255, .06) 60%, rgba(0, 0, 0, .18)),
    linear-gradient(180deg, var(--berry), var(--berry-deep));
  box-shadow: inset 0 0 0 1cqw rgba(0, 0, 0, .18);
  transition: transform 1.7s cubic-bezier(.6, .05, .25, 1), filter 1.7s ease;
}
.wreath { position: absolute; left: 50%; top: 13%; width: 66%; aspect-ratio: 1; translate: -50% 0; display: grid; place-items: center; }
.wreath svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.day { position: relative; font-family: var(--font-display); font-size: 25cqw; line-height: 1; color: var(--snow); text-shadow: 0 .6cqw 0 rgba(0, 0, 0, .3); }
.plaque {
  position: absolute; left: 50%; bottom: 13%; translate: -50% 0; white-space: nowrap;
  padding: 1.6cqw 5cqw; border-radius: 1.5cqw; font-size: 7.5cqw; font-weight: 700; letter-spacing: .08em;
  color: var(--room); background: linear-gradient(180deg, var(--glow), var(--gold));
}
.knob { position: absolute; right: 7%; top: 58%; width: 9cqw; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--glow), var(--gold-deep)); box-shadow: 0 .8cqw 1.5cqw rgba(0, 0, 0, .4); transition: box-shadow .5s ease; }
.knob::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1.6cqw; height: 4.5cqw; translate: -50% -50%; border-radius: 1cqw; background: var(--room); transition: rotate .6s ease; }

.door.unlocking .knob { box-shadow: 0 0 6cqw 2cqw var(--glow); }
.door.unlocking .knob::after { rotate: 90deg; }
.door.rattle .leaf { animation: rattle .13s linear infinite; }
.door.rattle .frame { animation: glowpulse .9s ease-in-out infinite; }
.door.ajar .leaf { transform: rotateY(-26deg); transition-duration: 1.3s; }
.door.ajar .frame { box-shadow: 0 0 14cqw 3cqw rgba(255, 217, 138, .55); }
.door.ajar .rays { opacity: .7; }
.door.open .leaf { transform: rotateY(-104deg); filter: brightness(.55); transition-duration: 1.9s; }
.door.open .rays { opacity: 1; animation: spin 26s linear infinite; }
.door.open .gift { opacity: 1; scale: 1; }
.door.wobble .gift { animation: wobble .3s ease-in-out infinite; }
.door.popped .gift-lid { translate: 30% -260%; rotate: 40deg; opacity: 0; }
.door.popped .gift-box { translate: 0 130%; opacity: 0; }
.door.popped .prize { opacity: 1; scale: 1; }
.door.instant .leaf, .door.instant .prize, .door.instant .rays { transition: none; }
.door.instant .gift { display: none; }
.gift { position: absolute; inset: 40% 22% 9% 22%; display: block; opacity: 0; scale: .6; transition: opacity .8s ease .9s, scale .9s cubic-bezier(.2, 1.4, .4, 1) .9s; }
.gift-lid, .gift-box { position: absolute; display: block; transition: translate .9s cubic-bezier(.3, .6, .4, 1), rotate .9s ease, opacity .5s ease .4s; }
.gift-lid { left: -7%; right: -7%; top: 0; height: 24%; border-radius: 1.5cqw; background: linear-gradient(90deg, var(--fir-light) 0 40%, var(--glow) 40% 60%, var(--fir-light) 60%); box-shadow: 0 1cqw 2cqw rgba(0, 0, 0, .35); z-index: 1; }
.gift-lid::before, .gift-lid::after { content: ""; position: absolute; bottom: 95%; width: 22%; aspect-ratio: 1.3; border: 2.2cqw solid var(--glow); border-radius: 50%; }
.gift-lid::before { right: 50%; rotate: -20deg; }
.gift-lid::after { left: 50%; rotate: 20deg; }
.gift-box { left: 0; right: 0; top: 24%; bottom: 0; border-radius: 0 0 1.5cqw 1.5cqw; background: linear-gradient(90deg, var(--fir-light) 0 40%, var(--gold) 40% 60%, var(--fir-light) 60%); }
.door.shake .leaf { animation: shake .45s ease; }
@keyframes spin { to { rotate: 360deg; } }
@keyframes rattle { 25% { translate: -1.2% 0; rotate: -.4deg; } 75% { translate: 1.2% 0; rotate: .4deg; } }
@keyframes glowpulse { 50% { box-shadow: 0 0 12cqw 2cqw rgba(255, 217, 138, .6); } }
@keyframes wobble { 25% { rotate: -7deg; translate: -4% 0; } 75% { rotate: 7deg; translate: 4% 0; } }
@keyframes countpop { 0% { opacity: 0; scale: 2.2; } 25% { opacity: 1; scale: 1; } 80% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: .6; } }
@keyframes shake { 20% { translate: -3% 0; } 40% { translate: 3% 0; } 60% { translate: -2% 0; } 80% { translate: 2% 0; } }
@keyframes rise { from { opacity: 0; translate: 0 1rem; } }

.btn {
  padding: .8rem 1.3rem; border-radius: .6rem; border: 0; cursor: pointer;
  font: 700 1rem var(--font-body); color: var(--room);
  background: linear-gradient(180deg, var(--glow), var(--gold));
}
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn:focus-visible, .link:focus-visible { outline: 3px solid var(--snow); outline-offset: 3px; }
.link { background: none; border: 0; padding: .6rem; cursor: pointer; color: var(--snow-dim); font: 500 1rem var(--font-body); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--snow); }

@media (prefers-reduced-motion: reduce) {
  .leaf, .prize, .rays, .knob::after { transition-duration: .01s !important; transition-delay: 0s !important; }
  .door.open .rays, .door.shake .leaf, .door.rattle .leaf, .door.rattle .frame, .door.wobble .gift, .reveal { animation: none; }
  .gift, .gift-lid, .gift-box { transition-duration: .01s !important; transition-delay: 0s !important; }
}
