:root {
  --night: #12071f; --night2: #1f0d36; --plum: #2c1450;
  --pumpkin: #ff7a1a; --pumpkin2: #ffb347; --slime: #a6ff5c; --candy: #ff6fb5;
  --ghost: #f7f2ff; --muted: #b9a8d9; --line: rgba(255, 255, 255, .14);
  --card: rgba(31, 13, 54, .78); --danger: #ff5470;
  --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  font: 16px/1.6 'Mali', system-ui, sans-serif; color: var(--ghost);
  background: radial-gradient(120% 80% at 50% 0%, #3a1766 0%, var(--night2) 45%, var(--night) 100%) fixed var(--night);
}
body.locked { overflow: hidden; }
img, svg { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; border-radius: 999px; padding: .75em 1.4em;
  font-weight: 700; transition: transform .15s, box-shadow .2s, filter .2s; touch-action: manipulation;
}
.btn:active { transform: scale(.96); }
.btn-glow {
  background: linear-gradient(135deg, var(--pumpkin2), var(--pumpkin) 55%, #e8450c); color: #2a0e00;
  box-shadow: 0 0 0 0 rgba(255, 122, 26, .6), 0 8px 24px rgba(255, 122, 26, .35);
  animation: pulse 2.4s infinite;
}
.btn-glow:hover { filter: brightness(1.1); }
.btn-glow:disabled { filter: grayscale(.6); animation: none; cursor: progress; }
.btn-ghost { background: transparent; color: var(--slime); border: 2px dashed rgba(166, 255, 92, .5); width: 100%; }
.btn-ghost:hover { background: rgba(166, 255, 92, .08); }
.btn-ghost:disabled { opacity: .4; cursor: not-allowed; }
.btn-big { width: 100%; font-size: 1.25rem; padding: .9em; margin-top: .5rem; }
.icon-btn { background: rgba(255, 255, 255, .08); border: 1px solid var(--line); border-radius: 50%; width: 44px; height: 44px; cursor: pointer; font-size: 1.2rem; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 122, 26, .55), 0 8px 24px rgba(255, 122, 26, .35); } 50% { box-shadow: 0 0 0 12px rgba(255, 122, 26, 0), 0 8px 24px rgba(255, 122, 26, .35); } }
:focus-visible { outline: 3px solid var(--slime); outline-offset: 2px; }

/* ---------- intro ---------- */
#intro {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; text-align: center; padding: 24px;
  background: radial-gradient(circle at 50% 60%, #2b0f4a, #07020d 70%); overflow: hidden;
  transition: transform 1s cubic-bezier(.7, 0, .3, 1), opacity 1s;
}
#intro.gone { transform: translateY(-105%); opacity: 0; pointer-events: none; }
.flash { position: absolute; inset: 0; background: #e9e2ff; opacity: 0; animation: lightning 5s 1s infinite; pointer-events: none; }
@keyframes lightning { 0%, 88%, 100% { opacity: 0; } 89% { opacity: .85; } 90% { opacity: 0; } 92% { opacity: .55; } 94% { opacity: 0; } }
.intro-body { position: relative; z-index: 2; }
.intro-pumpkin { width: 150px; height: 140px; animation: rise 1.2s .2s cubic-bezier(.2, 1.6, .4, 1) both; filter: drop-shadow(0 0 30px rgba(255, 122, 26, .6)); }
.intro-pumpkin .face, .done-pumpkin .face { animation: flicker 1.8s infinite; }
@keyframes flicker { 0%, 100% { opacity: 1; } 40% { opacity: .65; } 45% { opacity: 1; } 70% { opacity: .8; } }
@keyframes rise { from { transform: translateY(120px) scale(.4); opacity: 0; } }
.drip {
  font: 400 clamp(3rem, 14vw, 7rem)/1 'Creepster', cursive; margin: .2em 0 0; letter-spacing: .04em;
  color: var(--pumpkin); text-shadow: 0 0 18px rgba(255, 122, 26, .7), 0 4px 0 #7a2400;
  animation: drop-in 1s .6s both;
}
@keyframes drop-in { from { transform: translateY(-60px) scaleY(1.4); opacity: 0; filter: blur(8px); } }
.intro-sub { font-size: clamp(1.3rem, 5vw, 2rem); font-weight: 700; color: var(--slime); margin: .2em 0 1.2em; text-shadow: 0 0 14px rgba(166, 255, 92, .6); animation: fade-up .8s 1.2s both; }
#enter { font-size: 1.15rem; animation: fade-up .8s 1.6s both, pulse 2.4s 2.4s infinite; }
.intro-hint { color: var(--muted); font-size: .9rem; animation: fade-up .8s 2s both; }
@keyframes fade-up { from { transform: translateY(20px); opacity: 0; } }
.intro-ghost { position: absolute; width: 110px; height: 130px; opacity: .9; z-index: 1; }
.ig1 { left: -120px; top: 18%; animation: peek-l 6s 1.5s infinite; }
.ig2 { right: -120px; bottom: 14%; animation: peek-r 7s 3s infinite; transform: scaleX(-1); }
@keyframes peek-l { 0%, 100% { transform: translateX(0) rotate(0); } 20%, 45% { transform: translateX(150px) rotate(12deg); } 60% { transform: translateX(0); } }
@keyframes peek-r { 0%, 100% { transform: scaleX(-1) translateX(0); } 20%, 45% { transform: scaleX(-1) translateX(150px) rotate(12deg); } 60% { transform: scaleX(-1) translateX(0); } }
.web { position: absolute; top: 0; width: 180px; height: 180px; opacity: .35;
  background: repeating-radial-gradient(circle at 0 0, transparent 0 22px, #fff 23px 24px), repeating-conic-gradient(from 0deg at 0 0, transparent 0 10deg, #fff 10deg 10.6deg);
  -webkit-mask: radial-gradient(circle at 0 0, #000 60%, transparent 72%); mask: radial-gradient(circle at 0 0, #000 60%, transparent 72%); }
.web-l { left: 0; } .web-r { right: 0; transform: scaleX(-1); }

/* ---------- sky ---------- */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.stars { position: absolute; inset: 0; opacity: .8;
  background-image: radial-gradient(1.5px 1.5px at 10% 20%, #fff, transparent), radial-gradient(1px 1px at 30% 60%, #fff, transparent), radial-gradient(1.5px 1.5px at 70% 10%, #fff, transparent), radial-gradient(1px 1px at 85% 45%, #fff, transparent), radial-gradient(1px 1px at 50% 30%, #fff, transparent), radial-gradient(1.5px 1.5px at 20% 85%, #fff, transparent), radial-gradient(1px 1px at 90% 80%, #fff, transparent);
  animation: twinkle 4s infinite alternate; }
@keyframes twinkle { to { opacity: .35; } }
.moon { position: absolute; top: 6vh; right: 8vw; width: clamp(80px, 18vw, 160px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffbe6, #ffe08a 60%, #f0b44c); box-shadow: 0 0 60px 20px rgba(255, 224, 138, .25), 0 0 140px 60px rgba(255, 179, 71, .12); }
.bat { position: absolute; width: 60px; height: 30px; animation: fly 14s linear infinite; }
.bat use { animation: flap .25s ease-in-out infinite alternate; transform-origin: 50% 50%; }
.b1 { top: 12%; animation-delay: 0s; } .b2 { top: 28%; width: 40px; animation-duration: 18s; animation-delay: -6s; }
.b3 { top: 8%; width: 34px; animation-duration: 22s; animation-delay: -12s; } .b4 { top: 40%; width: 50px; animation-duration: 16s; animation-delay: -3s; }
@keyframes fly { 0% { transform: translate(-80px, 0); } 25% { transform: translate(25vw, -30px); } 50% { transform: translate(50vw, 20px); } 75% { transform: translate(75vw, -20px); } 100% { transform: translate(calc(100vw + 80px), 10px); } }
@keyframes flap { to { transform: scaleY(.35); } }
.floaty { position: absolute; width: 80px; height: 96px; opacity: .22; animation: float 7s ease-in-out infinite; }
.g1 { left: 4vw; top: 55vh; } .g2 { right: 6vw; top: 75vh; width: 56px; animation-delay: -3s; }
@keyframes float { 50% { transform: translateY(-26px) rotate(-6deg); } }
.spider { position: absolute; left: 12vw; top: 0; width: 2px; height: 22vh; background: rgba(255, 255, 255, .35); transform-origin: top; animation: dangle 6s ease-in-out infinite; }
.spider span { position: absolute; bottom: -14px; left: -11px; width: 24px; height: 18px; border-radius: 50%; background: #0b0414; box-shadow: 0 0 0 2px rgba(255, 255, 255, .15); }
.spider span::before, .spider span::after { content: ''; position: absolute; top: 5px; width: 4px; height: 4px; border-radius: 50%; background: var(--candy); left: 6px; }
.spider span::after { left: 14px; }
@keyframes dangle { 0%, 100% { transform: scaleY(1) rotate(2deg); } 50% { transform: scaleY(1.5) rotate(-3deg); } }
.fog { position: absolute; left: -50%; width: 200%; height: 40vh; bottom: -10vh; opacity: .35; background: radial-gradient(ellipse at 30% 60%, rgba(200, 180, 255, .45), transparent 60%), radial-gradient(ellipse at 70% 70%, rgba(166, 255, 92, .15), transparent 55%); animation: drift 30s linear infinite alternate; }
.f2 { bottom: -18vh; opacity: .25; animation-duration: 45s; animation-direction: alternate-reverse; }
@keyframes drift { to { transform: translateX(25%); } }

/* ---------- layout ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 760px; margin: 0 auto; padding: 14px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ghost); text-decoration: none; font-size: .78rem; line-height: 1.3; }
.brand img { background: #fff; border-radius: 50%; padding: 3px; }
main { max-width: 760px; margin: 0 auto; padding: 0 16px 40px; }
.hero { text-align: center; padding: 18px 0 26px; }
.tag { display: inline-block; margin: 0; padding: .25em .9em; border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--slime); background: rgba(166, 255, 92, .1); border: 1px solid rgba(166, 255, 92, .35); }
.title { font: 400 clamp(3.2rem, 15vw, 6.5rem)/1 'Creepster', cursive; margin: .25em 0 .05em; color: var(--pumpkin); text-shadow: 0 0 22px rgba(255, 122, 26, .55), 0 5px 0 #7a2400; }
.title span { display: inline-block; animation: wobble 3s ease-in-out infinite; }
.title span:nth-child(2) { animation-delay: .3s; color: var(--ghost); text-shadow: 0 0 22px rgba(200, 180, 255, .7), 0 5px 0 #4b2a7a; }
.title span:nth-child(3) { animation-delay: .6s; }
@keyframes wobble { 50% { transform: translateY(-6px) rotate(-2deg); } }
.subtitle { font-size: clamp(1.4rem, 5.5vw, 2rem); font-weight: 700; margin: 0; color: var(--slime); text-shadow: 0 0 14px rgba(166, 255, 92, .5); }
.lead { color: var(--muted); max-width: 30em; margin: .6em auto 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: clamp(16px, 4vw, 28px); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.card h2 { display: flex; align-items: center; gap: .4em; font-size: 1.3rem; margin: 0 0 .7em; }
.card h2:not(:first-child) { margin-top: 1.6em; }
.h-ico { width: 30px; height: 34px; flex: none; }
.muted { color: var(--muted); font-size: .9rem; margin: -.5em 0 1em; }

/* ---------- member fields ---------- */
.member { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 16px; margin: 0 0 14px; background: rgba(255, 255, 255, .03); animation: pop-in .45s cubic-bezier(.2, 1.5, .4, 1); }
.member.out { animation: pop-out .3s forwards; }
@keyframes pop-in { from { transform: scale(.85) translateY(10px); opacity: 0; } }
@keyframes pop-out { to { transform: scale(.85); opacity: 0; } }
.member legend { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-weight: 700; color: var(--pumpkin2); }
.rm { border: 0; background: rgba(255, 84, 112, .18); color: var(--danger); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }
.member:first-of-type .rm { display: none; }
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.c-prefix { grid-column: span 2; } .c-first { grid-column: span 2; } .c-last { grid-column: span 2; }
.c-cls { grid-column: span 2; } .c-no { grid-column: span 1; } .c-nick { grid-column: span 3; }
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .c-prefix, .c-nick { grid-column: span 2; } .c-first, .c-last, .c-cls, .c-no { grid-column: span 1; }
}
label > span { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 3px; }
input, select {
  width: 100%; min-height: 46px; padding: .55em .8em; border-radius: 12px; font-size: 16px;
  background: rgba(10, 4, 20, .6); border: 1.5px solid rgba(255, 255, 255, .16); transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus { outline: none; border-color: var(--pumpkin); box-shadow: 0 0 0 3px rgba(255, 122, 26, .25); }
.invalid { border-color: var(--danger) !important; animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
select option { background: var(--night2); }
.team { display: block; margin-top: 14px; padding: 14px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(255, 111, 181, .12), rgba(166, 255, 92, .08)); border: 1px solid rgba(255, 111, 181, .35); animation: pop-in .45s; }
.team > span { font-weight: 700; color: var(--candy); font-size: 1rem; }

/* ---------- photo points ---------- */
.points { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.point { position: relative; display: block; aspect-ratio: 3/4; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 2px dashed rgba(255, 179, 71, .5); background: rgba(255, 122, 26, .06); transition: transform .2s, border-color .2s; }
.point:hover { transform: translateY(-3px) rotate(-1deg); border-color: var(--pumpkin); }
.point input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.point:focus-within { outline: 3px solid var(--slime); outline-offset: 2px; }
.point .ph { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 4px; padding: 10px; }
.point .ph b { font-size: 2.2rem; line-height: 1; }
.point .ph small { color: var(--muted); }
.point .num { position: absolute; top: 8px; left: 8px; z-index: 2; background: var(--pumpkin); color: #2a0e00; font-weight: 700; font-size: .8rem; padding: 2px 10px; border-radius: 999px; }
.point .name { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 20px 10px 8px; font-size: .85rem; font-weight: 600; background: linear-gradient(transparent, rgba(0, 0, 0, .8)); }
.point img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.point.has { border-style: solid; border-color: var(--slime); }
.point.has .ph, .point.up .ph { display: none; }
.point.up::after { content: ''; position: absolute; top: 8px; right: 8px; z-index: 2; width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .3); border-top-color: var(--pumpkin); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.point.has::after { content: '✓'; position: absolute; top: 8px; right: 8px; z-index: 2; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--slime); color: #12300a; font-weight: 700; animation: pop-in .4s; }
.point.invalid { border-color: var(--danger); }
.err { color: var(--danger); font-weight: 600; min-height: 1.6em; margin: 1em 0 0; text-align: center; }

/* ---------- footer ---------- */
.foot { text-align: center; padding: 30px 16px calc(30px + env(safe-area-inset-bottom)); color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); background: rgba(7, 2, 13, .6); }
.foot img { background: #fff; border-radius: 50%; padding: 3px; }
.foot p { margin: .3em 0; } .foot b { color: var(--pumpkin2); font-size: 1.05rem; }

/* ---------- success ---------- */
#done { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(7, 2, 13, .88); animation: fade .4s; overflow: hidden; }
@keyframes fade { from { opacity: 0; } }
.done-card { position: relative; z-index: 2; text-align: center; max-width: 420px; padding: 28px 22px; border-radius: 28px; background: linear-gradient(160deg, var(--plum), var(--night2)); border: 2px solid var(--pumpkin); box-shadow: 0 0 60px rgba(255, 122, 26, .35); animation: pop-in .7s .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.done-card h2 { font: 400 3rem/1 'Creepster', cursive; color: var(--slime); margin: .1em 0 .2em; text-shadow: 0 0 18px rgba(166, 255, 92, .6); }
.done-pumpkin { width: 110px; height: 100px; animation: bounce 1s infinite alternate; }
@keyframes bounce { to { transform: translateY(-10px) rotate(4deg); } }
.done-sub { font-size: 1.3rem; font-weight: 700; color: var(--pumpkin2); margin: 0 0 1.2em; }
.swoop { position: absolute; z-index: 3; width: 200px; height: 240px; left: -220px; top: 30%; animation: swoop 1.6s cubic-bezier(.5, 0, .5, 1) forwards; pointer-events: none; }
@keyframes swoop { 0% { transform: translate(0, 0) rotate(20deg) scale(.6); } 45% { transform: translate(60vw, -12vh) rotate(-10deg) scale(1.4); } 100% { transform: translate(130vw, -60vh) rotate(-25deg) scale(.5); opacity: 0; } }
.burst { position: absolute; inset: 0; pointer-events: none; }
.burst svg, .burst i { position: absolute; left: 50%; top: 50%; width: 34px; height: 18px; font-style: normal; font-size: 26px; animation: boom 1.6s cubic-bezier(.1, .8, .3, 1) forwards; }
@keyframes boom { from { transform: translate(-50%, -50%) scale(.2); opacity: 1; } to { transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); opacity: 0; } }

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