:root {
  --night: #0b1638;
  --night-2: #1a2b63;
  --gold: #ffd45e;
  --gold-deep: #e8a317;
  --red: #c8323c;
  --green: #1f7a4d;
  --snow: #f4f7ff;
  --emma: #e85d9c;
  --enno: #3aa0e8;
  --radius: 16px;
  font-family: "Nunito", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: var(--snow);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse at 50% -10%, #2c4596 0%, var(--night-2) 35%, var(--night) 75%) fixed;
  min-height: 100vh;
  overflow-x: hidden;
}
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.screen { position: relative; z-index: 1; }
[hidden] { display: none !important; }

h1, h2, h3 { font-weight: 800; letter-spacing: .01em; margin: 0; }
h1 span { display: block; font-size: .55em; color: var(--gold); font-weight: 700; }

.btn {
  font: inherit; font-weight: 800; font-size: 1.05rem;
  border: 0; border-radius: 999px; padding: .75rem 1.4rem; cursor: pointer;
  background: var(--red); color: #fff;
  box-shadow: 0 4px 0 #8a1f27, 0 8px 20px rgba(0,0,0,.35);
  transition: transform .1s, box-shadow .1s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a1f27; }
.btn.gold { background: var(--gold); color: #5a3a00; box-shadow: 0 4px 0 var(--gold-deep), 0 8px 20px rgba(0,0,0,.35); }
.btn.ghost { background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.btn.ghost:active { box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.link { background: none; border: 0; color: rgba(255,255,255,.55); font: inherit; cursor: pointer; text-decoration: underline; }
.error { color: #ffb3b8; min-height: 1.4em; margin: .5rem 0 0; }
.hint { color: rgba(255,255,255,.8); font-size: .95rem; }

/* Login */
#login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card {
  text-align: center; background: rgba(255,255,255,.08); backdrop-filter: blur(6px);
  border: 2px solid rgba(255,255,255,.2); border-radius: 24px; padding: 2rem 1.5rem; width: min(420px, 100%);
}
.login-card h1 { font-size: 2rem; margin-bottom: 1.5rem; }
.big-star { font-size: 4rem; animation: twinkle 2.5s ease-in-out infinite; }
#login-form { display: grid; gap: .8rem; }
#login-form input {
  font: inherit; font-size: 1.2rem; text-align: center; padding: .7rem; border-radius: 12px;
  border: 2px solid rgba(255,255,255,.4); background: rgba(0,0,0,.25); color: #fff;
}

/* Kopf */
.top { text-align: center; padding: 1.5rem 1rem .5rem; }
.top h1 { font-size: clamp(1.8rem, 5vw, 3rem); text-shadow: 0 3px 12px rgba(0,0,0,.5); }
.subtitle { color: rgba(255,255,255,.85); margin: .6rem 0 1rem; font-size: 1.1rem; }
.top-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

/* Türen */
.doors {
  display: grid; gap: clamp(.5rem, 1.5vw, 1rem);
  grid-template-columns: repeat(6, 1fr);
  width: min(1000px, 100%); margin: 1.5rem auto; padding: 0 1rem;
}
@media (max-width: 720px) { .doors { grid-template-columns: repeat(4, 1fr); } }
.door {
  position: relative; aspect-ratio: 3 / 4; border: 0; padding: 0; cursor: pointer;
  border-radius: var(--radius); font: inherit; color: #fff; perspective: 600px;
  background: transparent;
}
.door .leaf {
  position: absolute; inset: 0; border-radius: var(--radius);
  display: grid; place-items: center; transform-origin: left center;
  transition: transform .8s cubic-bezier(.3,.7,.3,1);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.25), 0 6px 14px rgba(0,0,0,.4);
}
.door:nth-child(4n+1) .leaf { background: linear-gradient(160deg, #d6434d, #8f1f28); }
.door:nth-child(4n+2) .leaf { background: linear-gradient(160deg, #2a9160, #145236); }
.door:nth-child(4n+3) .leaf { background: linear-gradient(160deg, #3d5bb8, #1d2f73); }
.door:nth-child(4n+4) .leaf { background: linear-gradient(160deg, #c9952b, #7d5a10); }
.door .n { font-size: clamp(1.6rem, 4.5vw, 2.6rem); font-weight: 900; text-shadow: 0 2px 6px rgba(0,0,0,.5); }
.door .deco { position: absolute; top: 6px; right: 8px; font-size: .9rem; opacity: .9; }
.door .behind {
  position: absolute; inset: 0; border-radius: var(--radius);
  background: radial-gradient(circle at 50% 40%, #fff6cf 0%, var(--gold) 35%, #b97a0b 100%);
  display: grid; place-items: center; color: #5a3a00; font-weight: 900;
}
.door .behind .mini { display: flex; gap: .3rem; font-size: clamp(.8rem, 2.2vw, 1.05rem); }
.door .behind .mini b { background: rgba(255,255,255,.75); border-radius: 8px; padding: .1rem .4rem; }
.door .behind .mini .e { color: var(--emma); }
.door .behind .mini .o { color: var(--enno); }
.door.locked { cursor: default; }
.door.locked .leaf { filter: saturate(.55) brightness(.75); }
.door.locked .deco::after { content: "🔒"; }
.door.ready .leaf { animation: glow 1.6s ease-in-out infinite alternate; }
.door.ready .deco::after { content: "✨"; }
.door.today .leaf { outline: 3px dashed var(--gold); outline-offset: 3px; }
.door.opened .leaf { transform: rotateY(-78deg); }
.door.opening .leaf { transform: rotateY(-100deg); }
.door.wiggle { animation: wiggle .5s; }

@keyframes glow { from { box-shadow: inset 0 0 0 3px rgba(255,255,255,.3), 0 0 6px var(--gold); } to { box-shadow: inset 0 0 0 3px var(--gold), 0 0 24px var(--gold); } }
@keyframes wiggle { 20%, 60% { transform: rotate(-4deg); } 40%, 80% { transform: rotate(4deg); } }
@keyframes twinkle { 50% { transform: scale(1.15) rotate(8deg); filter: drop-shadow(0 0 16px var(--gold)); } }
@keyframes pop { 0% { transform: scale(.2) rotate(-20deg); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.foot { text-align: center; padding: 1rem 0 2rem; }

/* Dialoge */
.dialog {
  width: min(760px, 94vw); max-height: 92vh; border: 0; border-radius: 24px; padding: 1.5rem;
  background: linear-gradient(170deg, #20357a, #0f1c47); color: var(--snow);
  box-shadow: 0 0 0 3px rgba(255,212,94,.5), 0 20px 60px rgba(0,0,0,.6);
  text-align: center;
}
.dialog::backdrop { background: rgba(3, 8, 25, .75); backdrop-filter: blur(3px); }
.dialog .close {
  position: absolute; top: .7rem; right: .9rem; background: rgba(255,255,255,.12); color: #fff;
  border: 0; width: 2.4rem; height: 2.4rem; border-radius: 50%; font-size: 1.1rem; cursor: pointer;
}
.dialog h2 { font-size: 1.7rem; margin: .2rem 2rem 1rem; }
.day-badge { margin: 0; color: var(--gold); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .85rem; }
.media { border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.media video { width: 100%; height: 100%; display: block; background: #000; }
.placeholder {
  width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: .5rem;
  background: radial-gradient(circle at 50% 45%, #2f4aa3, #0b1638 70%);
}
.placeholder .ph-star { font-size: 4rem; animation: twinkle 2s ease-in-out infinite; }
.placeholder p { margin: 0; color: rgba(255,255,255,.8); }
.story-text { font-size: 1.15rem; line-height: 1.5; margin: 1rem .5rem 1.2rem; }

.numbers { display: flex; gap: 1rem; justify-content: center; margin: .5rem 0 .3rem; flex-wrap: wrap; }
.num-card {
  width: 140px; padding: .9rem .5rem 1rem; border-radius: 18px; display: grid; gap: .2rem;
  animation: pop .7s cubic-bezier(.3,1.4,.5,1) both;
}
.num-card.enno { animation-delay: .35s; }
.num-card.emma { background: linear-gradient(160deg, #ff8cc0, var(--emma)); box-shadow: 0 6px 20px rgba(232,93,156,.5); }
.num-card.enno { background: linear-gradient(160deg, #8fd0ff, var(--enno)); box-shadow: 0 6px 20px rgba(58,160,232,.5); }
.num-card .who { font-weight: 800; font-size: 1.1rem; }
.num-card .num { font-size: 3.6rem; font-weight: 900; line-height: 1; text-shadow: 0 3px 8px rgba(0,0,0,.3); }

/* Sammelkarte */
.card-table-wrap { overflow-x: auto; }
.card-table { border-collapse: separate; border-spacing: 3px; margin: 0 auto; font-weight: 800; }
.card-table th, .card-table td { min-width: 2.1rem; padding: .35rem .3rem; border-radius: 8px; text-align: center; }
.card-table th { color: var(--gold); font-size: .85rem; }
.card-table td { background: rgba(255,255,255,.08); }
.card-table td.who { text-align: left; padding-right: .6rem; background: none; }
.card-table tr.emma td.v { background: rgba(232,93,156,.35); }
.card-table tr.enno td.v { background: rgba(58,160,232,.35); }
.card-table td.q { color: rgba(255,255,255,.35); }

/* Tresor */
.locks { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
@media (max-width: 560px) { .locks { grid-template-columns: 1fr; } }
.lock { border-radius: 20px; padding: 1rem; display: grid; gap: .6rem; justify-items: center; }
.lock.emma { background: rgba(232,93,156,.18); box-shadow: inset 0 0 0 2px var(--emma); }
.lock.enno { background: rgba(58,160,232,.18); box-shadow: inset 0 0 0 2px var(--enno); }
.lock .dial { font-size: 3rem; transition: transform .6s; }
.lock.open .dial { transform: rotate(360deg) scale(1.2); }
.lock input {
  font: inherit; font-size: 1.6rem; font-weight: 900; text-align: center; width: 8rem; padding: .4rem;
  border-radius: 12px; border: 2px solid rgba(255,255,255,.4); background: rgba(0,0,0,.3); color: #fff;
}
.lock.shake { animation: shake .45s; }
.lock-msg { min-height: 1.4em; margin: 0; font-weight: 700; }
.lock.open input, .lock.open button { display: none; }
.code-board { margin-top: 1.2rem; }
.code { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; margin: .6rem 0; }
.code span {
  width: 2.8rem; height: 3.6rem; display: grid; place-items: center; border-radius: 10px;
  font-size: 2rem; font-weight: 900; background: rgba(255,255,255,.08); color: rgba(255,255,255,.3);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.2);
}
.code span.e { background: var(--emma); color: #fff; animation: pop .6s both; }
.code span.o { background: var(--enno); color: #fff; animation: pop .6s both; }
.final { font-size: 1.3rem; font-weight: 800; color: var(--gold); }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(150%);
  background: #fff; color: #1a2b63; font-weight: 800; padding: .8rem 1.3rem; border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0,0,0,.4); transition: transform .3s; z-index: 10; max-width: 92vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }

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