* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Quicksand', system-ui, sans-serif;
  color: #fff;
  background: radial-gradient(ellipse at top, #1d5c3a 0%, #0f3d27 45%, #07241a 100%) fixed;
  display: flex; justify-content: center;
}
canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#snow { z-index: 1; }
#fx { z-index: 50; }
main { position: relative; z-index: 2; width: min(440px, 92vw); padding: 28px 0 60px; text-align: center; }
h1 {
  font-family: 'Mountains of Christmas', cursive; font-size: clamp(2.4rem, 9vw, 3.4rem);
  margin: 8px 0 22px; color: #ffd86b;
  text-shadow: 0 2px 0 #9b111e, 0 0 24px rgba(255, 216, 107, .5);
}
.card {
  background: rgba(255, 255, 255, .1); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 20px; padding: 22px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs button {
  flex: 1; padding: 10px; border: 0; border-radius: 12px; cursor: pointer;
  background: rgba(0, 0, 0, .25); color: #fff; font: inherit; font-weight: 700;
}
.tabs button.active { background: #c8102e; box-shadow: 0 0 14px rgba(200, 16, 46, .7); }
form { display: grid; gap: 12px; }
input {
  padding: 14px; border-radius: 12px; border: 2px solid transparent; font: inherit; font-size: 1.05rem;
  background: rgba(255, 255, 255, .92); color: #222; text-align: center;
}
input:focus { outline: none; border-color: #ffd86b; }
.big {
  padding: 14px 22px; border: 0; border-radius: 14px; cursor: pointer; font: inherit; font-weight: 700; font-size: 1.15rem;
  color: #fff; background: linear-gradient(#e5303b, #a30f1c); box-shadow: 0 4px 0 #6d0a13, 0 8px 20px rgba(0, 0, 0, .4);
  transition: transform .1s;
}
.big:hover:not(:disabled) { transform: translateY(-2px); }
.big:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #6d0a13; }
.big:disabled { opacity: .6; cursor: default; }
.err { color: #ffb3b3; min-height: 1.3em; margin: 0; font-weight: 700; }
.hint, .small { font-size: .85rem; opacity: .8; }
.hello { font-size: 1.4rem; margin: 0 0 4px; }
.hello b { color: #ffd86b; }
.link { background: none; border: 0; color: #fff; opacity: .7; text-decoration: underline; cursor: pointer; margin-top: 26px; font: inherit; }
[hidden] { display: none !important; }

/* hat + slip */
.stage { position: relative; width: 260px; height: 260px; margin: 10px auto 0; }
#hat { position: absolute; bottom: 0; left: 10px; width: 240px; filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .5)); transform-origin: 50% 90%; cursor: pointer; }
#hat.shake { animation: shake .35s infinite; }
@keyframes shake {
  0% { transform: rotate(-9deg) translateY(0); } 25% { transform: rotate(7deg) translateY(-12px); }
  50% { transform: rotate(-6deg) translateY(0); } 75% { transform: rotate(9deg) translateY(-8px); } 100% { transform: rotate(-9deg); }
}
.slip {
  position: absolute; left: 90px; bottom: 120px; width: 80px; height: 100px; z-index: 0;
  background: #fffbe6; color: #9b111e; border-radius: 6px; display: grid; place-items: center;
  font-size: 2rem; font-weight: 700; box-shadow: 0 4px 10px rgba(0, 0, 0, .4); opacity: 0;
}
.slip.out { animation: slipOut 1s ease-out forwards; z-index: 3; }
@keyframes slipOut {
  0% { opacity: 1; transform: translateY(40px) rotate(0) scale(.7); }
  60% { opacity: 1; transform: translateY(-130px) rotate(-14deg) scale(1.1); }
  100% { opacity: 1; transform: translateY(-110px) rotate(8deg) scale(1.3); }
}

/* paper */
.paper {
  display: inline-block; background: #fffbe6; color: #9b111e; border-radius: 10px; padding: 18px 34px; margin: 10px 0;
  font-family: 'Mountains of Christmas', cursive; font-size: 2.4rem; font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45), inset 0 0 30px rgba(200, 160, 80, .25);
  transform: rotate(-2deg);
}
#overlay {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  background: rgba(0, 0, 0, .65); animation: fade .4s;
}
@keyframes fade { from { opacity: 0; } }
.big-paper { display: flex; flex-direction: column; padding: 34px 54px; font-size: clamp(2.6rem, 12vw, 4.5rem); max-width: 92vw; animation: unfold .9s cubic-bezier(.2, 1.3, .4, 1); }
.big-paper small { font-family: 'Quicksand', sans-serif; font-size: 1rem; color: #7a5c2e; }
@keyframes unfold { from { transform: scale(.1) rotateX(90deg) rotate(25deg); opacity: 0; } to { transform: scale(1) rotate(-2deg); opacity: 1; } }

#music {
  position: fixed; top: 14px; right: 14px; z-index: 60; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .4); background: rgba(0, 0, 0, .35); font-size: 1.3rem; cursor: pointer;
}
#music.off { opacity: .45; filter: grayscale(1); }

h2 { font-family: 'Mountains of Christmas', cursive; color: #ffd86b; margin: 0 0 12px; font-size: 2rem; }
#elves { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
#elves span { background: rgba(255, 255, 255, .15); border-radius: 20px; padding: 6px 14px; }
#adminList { list-style: none; padding: 0; text-align: left; }
#adminList li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, .15); }
#adminList button { margin-left: 4px; border: 0; border-radius: 8px; padding: 4px 8px; cursor: pointer; }
#adminLogin { margin-bottom: 8px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
