/* Birthday dynamic page - modern + 3D-ish */
:root{
  --bg0:#050510;
  --bg1:#11143a;
  --card: rgba(255,255,255,0.06);
  --card2: rgba(0,0,0,0.25);
  --line: rgba(255,255,255,0.10);
  --txt:#f7f7ff;
  --muted:#b8bcff;
  --g1:#ffcf71;
  --g2:#ff6cab;
  --g3:#7366ff;
  --shadow: 0 22px 70px rgba(0,0,0,.65);
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--txt);
  background:
    radial-gradient(900px 500px at 10% 10%, rgba(255,108,171,0.22), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(115,102,255,0.22), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(255,207,113,0.16), transparent 60%),
    radial-gradient(circle at top, #1b1b3a 0, #050510 45%, #000 100%);
  overflow-x:hidden;
}

.zero-mode{
  animation: bgPulse 1.15s ease-in-out infinite;
}
@keyframes bgPulse{
  0%,100%{filter:saturate(1) brightness(1)}
  50%{filter:saturate(1.18) brightness(1.06)}
}

.shake{
  animation: shake .12s linear 8;
}
@keyframes shake{
  0%{transform:translate(0,0)}
  25%{transform:translate(1px,-1px)}
  50%{transform:translate(-1px,1px)}
  75%{transform:translate(1px,1px)}
  100%{transform:translate(0,0)}
}

.floaters{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:10;
}
.floaters span{
  position:absolute;
  bottom:-30px;
  opacity:0;
  animation: floatUp 4.8s ease-in-out infinite;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.35));
}
.floaters.hearts span{
  animation-duration: 6.2s;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,0.45));
}
@keyframes floatUp{
  0%{transform:translateY(0) rotate(0deg) scale(.9); opacity:0}
  15%{opacity:1}
  70%{opacity:1}
  100%{transform:translateY(-105vh) rotate(18deg) scale(1.08); opacity:0}
}

/* Big flash overlay when zero hits */
.zero-flash{
  position:fixed;
  inset:0;
  z-index: 30;
  pointer-events:none;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,207,113,0.55), transparent 60%),
    radial-gradient(circle at 70% 20%, rgba(255,108,171,0.55), transparent 60%),
    radial-gradient(circle at 50% 60%, rgba(115,102,255,0.55), transparent 60%);
  animation: zflash 1.1s ease-out forwards;
  mix-blend-mode: screen;
}
@keyframes zflash{
  0%{opacity:0; filter: blur(0px) saturate(1.2)}
  18%{opacity:1; filter: blur(0px) saturate(1.4)}
  100%{opacity:0; filter: blur(2px) saturate(1.1)}
}

/* Banner */
.zero-banner{
  position:fixed;
  left:50%;
  top: 12%;
  transform: translateX(-50%);
  z-index: 40;
  width:min(720px, 92vw);
  pointer-events:none;
}
.zb-inner{
  border-radius: 26px;
  padding: 14px 14px 16px;
  text-align:center;
  border: 1px solid rgba(255,255,255,0.14);
  background: linear-gradient(135deg, rgba(0,0,0,0.25), rgba(255,255,255,0.06));
  backdrop-filter: blur(10px);
  box-shadow: 0 26px 80px rgba(0,0,0,0.65);
  animation: bannerIn 6.5s ease-in-out forwards;
}
.zb-top{
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
}
.zb-big{
  margin-top: 6px;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 1000;
  background: linear-gradient(135deg, var(--g1), var(--g2), var(--g3));
  -webkit-background-clip:text;
  background-clip:text;
  color: transparent;
  text-shadow: 0 0 28px rgba(255,108,171,0.25);
}
.zb-name{
  margin-top: 2px;
  font-size: clamp(1.6rem, 4.4vw, 2.6rem);
  font-weight: 1000;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 0 40px rgba(115,102,255,0.30);
}
@keyframes bannerIn{
  0%{opacity:0; transform: translateY(-18px) scale(0.98)}
  12%{opacity:1; transform: translateY(0) scale(1)}
  80%{opacity:1}
  100%{opacity:0; transform: translateY(-12px) scale(0.985)}
}

/* Balloons */
.balloons{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index: 12;
}
.balloon{
  position:absolute;
  bottom:-120px;
  width: 54px;
  height: 70px;
  border-radius: 999px 999px 999px 999px / 105% 105% 85% 85%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.65), rgba(255,255,255,0) 35%),
              linear-gradient(180deg, rgba(255,255,255,0.15), rgba(0,0,0,0.05)),
              var(--balloon, #ff6cab);
  filter: drop-shadow(0 22px 30px rgba(0,0,0,0.45));
  animation: balloonUp 7.4s ease-in-out forwards;
}
.balloon::after{
  content:"";
  position:absolute;
  left:50%;
  top: 98%;
  width:2px;
  height: 140px;
  background: rgba(255,255,255,0.35);
  transform: translateX(-50%);
}
@keyframes balloonUp{
  0%{transform: translateY(0) rotate(-2deg); opacity:0}
  10%{opacity:1}
  100%{transform: translateY(-110vh) rotate(6deg); opacity:0}
}

.page{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:20px 14px 70px;
  gap:16px;
  position: relative;
  z-index: 2;
}

.bg-orbs span{
  position:fixed;
  inset:auto;
  width:520px;height:520px;border-radius:999px;
  filter: blur(40px);
  opacity:.22;
  z-index:-2;
  animation: drift 12s ease-in-out infinite;
}
.bg-orbs span:nth-child(1){left:-120px;top:-120px;background: radial-gradient(circle at 30% 30%, var(--g2), transparent 60%)}
.bg-orbs span:nth-child(2){right:-160px;top:-160px;background: radial-gradient(circle at 30% 30%, var(--g3), transparent 60%); animation-delay:-4s}
.bg-orbs span:nth-child(3){left:20%;bottom:-240px;background: radial-gradient(circle at 30% 30%, var(--g1), transparent 60%); animation-delay:-7s}
@keyframes drift{0%,100%{transform:translate(0,0) scale(1)}50%{transform:translate(24px,18px) scale(1.05)}}

.card{
  width:min(980px, 100%);
  border-radius:26px;
  background: linear-gradient(135deg, rgba(10,12,40,0.92), rgba(20,8,35,0.95));
  border:1px solid var(--line);
  box-shadow: var(--shadow);
  padding:18px 16px;
  position: relative;
  z-index: 3;
}

.hero-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

h1{
  font-size: clamp(1.9rem, 4.8vw, 3.2rem);
  line-height:1.1;
  letter-spacing: .01em;
  text-shadow: 0 0 28px rgba(115,102,255,.25);
}
.subtitle{
  margin-top:8px;
  color:var(--muted);
  max-width: 58ch;
  line-height:1.45;
}

.admin-dot{
  width:38px;height:38px;border-radius:999px;
  display:grid;place-items:center;
  text-decoration:none;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.65);
  opacity:.22;
  transition: opacity .18s ease, transform .18s ease, border-color .18s ease;
  flex:0 0 auto;
}
.admin-dot:hover{opacity:.95;transform:translateY(-1px);border-color:rgba(255,207,113,0.35)}

.countdown{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}
.cd-box{
  background: radial-gradient(circle at top left, rgba(255,108,171,0.14), rgba(12,10,40,0.96));
  border:1px solid rgba(255,255,255,0.07);
  border-radius:18px;
  padding:14px 10px;
  text-align:center;
  box-shadow: 0 18px 35px rgba(0,0,0,.45);
  transform: translateZ(0);
}
.cd-num{
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--g1), var(--g2), var(--g3));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  letter-spacing: .02em;
}
.cd-lbl{
  margin-top:4px;
  font-size:.78rem;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:#aeb4ff;
}

.cd-status{
  margin-top:10px;
  color:#d2d6ff;
  min-height: 22px;
}

.media{margin-top:14px}
.main-image{
  width:100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 22px;
  border:1px solid rgba(255,255,255,0.10);
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  transform: perspective(900px) rotateX(1.5deg);
}
.image-placeholder{
  width:100%;
  height: 240px;
  border-radius: 22px;
  border:1px dashed rgba(255,255,255,0.20);
  display:grid;
  place-items:center;
  color: rgba(255,255,255,0.65);
  background: rgba(0,0,0,0.18);
}

.actions{
  margin-top:14px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.btn, .surprise-btn{
  border:0;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 800;
  letter-spacing:.06em;
  text-transform:uppercase;
  cursor:pointer;
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease, opacity .14s ease;
}

.surprise-btn{
  color:#050510;
  background: linear-gradient(135deg, var(--g1), var(--g2), var(--g3));
  box-shadow: 0 18px 45px rgba(0,0,0,.6), 0 0 18px rgba(255,108,171,.35);
  min-width: 220px;
}
.btn{
  color:#050510;
  background: linear-gradient(135deg, rgba(255,207,113,0.95), rgba(255,108,171,0.95));
}

button[disabled]{opacity:.45;cursor:not-allowed;transform:none !important}
button:not([disabled]):hover{transform:translateY(-2px);filter:brightness(1.05)}

/* Glow when time = 0 */
.surprise-ready{
  animation: glow 1.2s ease-in-out infinite;
  box-shadow:
    0 18px 55px rgba(0,0,0,.65),
    0 0 26px rgba(255,108,171,.65),
    0 0 46px rgba(115,102,255,.55);
}
@keyframes glow{
  0%,100%{filter:brightness(1); transform: translateY(0) scale(1)}
  50%{filter:brightness(1.07); transform: translateY(-1px) scale(1.015)}
}

/* Wishes */
.wishes h2{
  font-size:1.3rem;
  margin-bottom:12px;
  color:#ffcfef;
}
.wishes-grid{
  display:grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1.3fr);
  gap:12px;
}
.wish-form{
  display:flex;
  flex-direction:column;
  gap:8px;
  background: rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
  padding:12px;
  border-radius:18px;
}
label{font-size:.78rem; letter-spacing:.10em; text-transform:uppercase; color:#aeb4ff}
input,textarea{
  width:100%;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.22);
  color:var(--txt);
  outline:none;
}
input:focus,textarea:focus{
  border-color: rgba(255,108,171,0.6);
  box-shadow: 0 0 0 2px rgba(255,108,171,0.12);
}
.wish-list{
  max-height: 320px;
  overflow:auto;
  padding-right:6px;
}
.wish{
  background: rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.07);
  border-radius:18px;
  padding:12px;
}
.wish + .wish{margin-top:10px}
.wish-head{display:flex;justify-content:space-between;gap:10px;margin-bottom:6px}
.wish-name{font-weight:900;color:var(--g1)}
.wish-date{font-size:.78rem;color:#9fa8ff}
.wish-msg{color:#d9ddff;line-height:1.45}
.muted{color:rgba(255,255,255,0.65)}

.footer{width:min(980px,100%); text-align:center; padding:6px 10px}

/* Confetti canvas */
#confetti{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index: 1; /* MUST be above body background to be visible */
}

/* Cake drop (at time=0) */
.cake-drop{
  position: fixed;
  left: 50%;
  top: -140px;
  transform: translateX(-50%);
  z-index: 45;
  width: min(280px, 78vw);
  height: auto;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 28px 90px rgba(0,0,0,0.65);
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  animation: cakeFall 1.25s cubic-bezier(.2,.9,.25,1.1) forwards;
}
.cake-drop img{
  width: 100%;
  display: block;
}
.cake-drop .cake-emoji{
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  font-size: 84px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,207,113,0.35), transparent 60%),
    radial-gradient(circle at 70% 25%, rgba(115,102,255,0.35), transparent 60%),
    rgba(0,0,0,0.18);
}
@keyframes cakeFall{
  0%{transform: translateX(-50%) translateY(0) rotate(-2deg) scale(0.96); opacity:0}
  12%{opacity:1}
  70%{transform: translateX(-50%) translateY(62vh) rotate(2deg) scale(1)}
  82%{transform: translateX(-50%) translateY(56vh) rotate(-1deg) scale(1.02)}
  92%{transform: translateX(-50%) translateY(60vh) rotate(0deg) scale(1)}
  100%{transform: translateX(-50%) translateY(58vh) rotate(0deg) scale(1)}
}

@media (max-width: 900px){
  .wishes-grid{grid-template-columns:1fr}
}
@media (max-width: 640px){
  .countdown{grid-template-columns: repeat(2, minmax(0,1fr))}
  .surprise-btn{min-width: 100%}
}

