/* ─────────── RESET & BASE ─────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --pink-light:  #ffd6e7;
    --pink-mid:    #ffadd2;
    --pink-dark:   #ff77b7;
    --pink-deeper: #f7518b;
    --lavender:    #e7d5ff;
    --purple-mid:  #d0a8ff;
    --purple:      #b57af0;
    --gold:        #ffe169;
    --gold-deep:   #f4b942;
    --cream:       #fff7f0;
    --white:       #ffffff;
    --mint:        #b8f5e0;
    --sky:         #cef5ff;
}

body {
    min-height: 100vh;
    background: radial-gradient(ellipse at 60% 0%, #ffeef8 0%, #f5e8ff 40%, #e8f5ff 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
}

/* ─────────── BOKEH BACKGROUND ─────────── */
.bg-bokeh {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.35;
    animation: bokehDrift linear infinite;
}

@keyframes bokehDrift {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(30px, -20px) scale(1.1); }
    66%  { transform: translate(-20px, 15px) scale(0.95); }
    100% { transform: translate(0, 0) scale(1); }
}

/* ─────────── FLOATING HEARTS & STARS ─────────── */
.floaties {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}
.floatie {
    position: absolute;
    font-size: 1.4rem;
    animation: floatUp linear infinite;
    opacity: 0;
}
@keyframes floatUp {
    0%   { transform: translateY(0)   rotate(0deg); opacity: 0; }
    10%  { opacity: 0.9; }
    90%  { opacity: 0.7; }
    100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

/* ─────────── SCENE ─────────── */
.scene {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    animation: sceneEntry 1.2s cubic-bezier(.22,1,.36,1) both;
}
@keyframes sceneEntry {
    from { opacity: 0; transform: translateY(60px) scale(0.85); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ─────────── CAKE WRAPPER ─────────── */
.cake-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(.34,1.56,.64,1);
    filter: drop-shadow(0 20px 30px rgba(247, 81, 139, 0.3));
}
.cake-wrap:hover { transform: translateY(-8px) scale(1.03); filter: drop-shadow(0 30px 40px rgba(247,81,139,0.45)); }
.cake-wrap:active { transform: scale(0.97); }

/* ─────────── TIERS ─────────── */
.tier {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Tier top frosting pad */
.tier-top {
    height: 14px;
    background: linear-gradient(180deg, var(--white) 0%, var(--pink-light) 100%);
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -4px 10px rgba(255,255,255,0.8);
    position: relative;
    z-index: 3;
}
.tier-1 .tier-top { width: 290px; }
.tier-2 .tier-top { width: 215px; }
.tier-3 .tier-top { width: 145px; }

/* Tier body */
.tier-body {
    position: relative;
    overflow: hidden;
    z-index: 2;
}
.tier-1 .tier-body { width: 290px; height: 95px; background: linear-gradient(160deg, var(--pink-mid) 0%, var(--pink-dark) 100%); border-radius: 0 0 12px 12px; margin-top: -2px; }
.tier-2 .tier-body { width: 215px; height: 80px; background: linear-gradient(160deg, var(--lavender) 0%, var(--purple-mid) 100%); border-radius: 0 0 10px 10px; margin-top: -2px; }
.tier-3 .tier-body { width: 145px; height: 65px; background: linear-gradient(160deg, var(--pink-light) 0%, var(--pink-mid) 100%); border-radius: 0 0 8px 8px; margin-top: -2px; }

/* Shine stripe on tier body */
.tier-body::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 8%;
    width: 84%;
    height: 12px;
    background: rgba(255,255,255,0.25);
    border-radius: 20px;
}

/* ─────────── DRIPS ─────────── */
.drip-strip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0 8px;
    z-index: 4;
}
.drip {
    display: block;
    width: 18px;
    background: var(--white);
    border-radius: 0 0 50% 50%;
    box-shadow: 0 4px 10px rgba(255,255,255,0.5);
    animation: dripDown 3s ease-in-out infinite alternate;
}
/* Stagger drip heights */
.tier-1 .drip:nth-child(1)  { height: 34px; animation-delay: 0s; }
.tier-1 .drip:nth-child(2)  { height: 20px; animation-delay: .2s; }
.tier-1 .drip:nth-child(3)  { height: 42px; animation-delay: .4s; }
.tier-1 .drip:nth-child(4)  { height: 18px; animation-delay: .6s; }
.tier-1 .drip:nth-child(5)  { height: 38px; animation-delay: .3s; }
.tier-1 .drip:nth-child(6)  { height: 26px; animation-delay: .7s; }
.tier-1 .drip:nth-child(7)  { height: 30px; animation-delay: .1s; }
.tier-1 .drip:nth-child(8)  { height: 22px; animation-delay: .5s; }
.tier-2 .drip:nth-child(1)  { height: 28px; animation-delay: .15s; }
.tier-2 .drip:nth-child(2)  { height: 40px; animation-delay: .35s; }
.tier-2 .drip:nth-child(3)  { height: 16px; animation-delay: .55s; }
.tier-2 .drip:nth-child(4)  { height: 36px; animation-delay: .75s; }
.tier-2 .drip:nth-child(5)  { height: 24px; animation-delay: .9s; }
.tier-2 .drip:nth-child(6)  { height: 32px; animation-delay: .05s; }
.tier-3 .drip:nth-child(1)  { height: 32px; animation-delay: .2s; }
.tier-3 .drip:nth-child(2)  { height: 18px; animation-delay: .5s; }
.tier-3 .drip:nth-child(3)  { height: 38px; animation-delay: .8s; }
.tier-3 .drip:nth-child(4)  { height: 22px; animation-delay: .3s; }

@keyframes dripDown {
    from { transform: scaleY(1); }
    to   { transform: scaleY(1.12) translateY(2px); }
}

/* ─────────── DECORATIVE DOTS ─────────── */
.tier-deco {
    position: absolute;
    bottom: 14px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    padding: 0 18px;
    pointer-events: none;
}
.dot {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: dotPulse 2s ease-in-out infinite alternate;
}
.tier-1 .dot { background: var(--gold); box-shadow: 0 0 8px var(--gold-deep); }
.tier-2 .dot { background: var(--pink-dark); box-shadow: 0 0 8px var(--pink-deeper); }
.tier-3 .dot { background: var(--purple); box-shadow: 0 0 8px var(--purple-mid); }
.dot:nth-child(odd)  { animation-delay: 0s; }
.dot:nth-child(even) { animation-delay: 0.5s; }
@keyframes dotPulse {
    from { transform: scale(1); opacity: 0.8; }
    to   { transform: scale(1.35); opacity: 1; }
}

/* ─────────── NUMBER CANDLES ─────────── */
.candles-row {
    display: flex;
    gap: 16px;
    z-index: 20;
    position: relative;
    margin-bottom: -12px; /* tuck slightly into top tier */
    filter: drop-shadow(0 10px 15px rgba(247,81,139,0.5));
}

.number-candle {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.num-body {
    font-family: 'Pacifico', cursive;
    font-size: 4.5rem;
    line-height: 1;
    margin-top: -1px;
    position: relative;
    z-index: 2;              /* in front of wick */
    background: linear-gradient(180deg, #ff8cc8 0%, #f7518b 50%, #bf2072 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 6px rgba(247,81,139,0.45));
    letter-spacing: -2px;
}

.wick {
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, #4a3000 0%, #8b5e1a 100%);
    border-radius: 2px 2px 0 0;
    position: relative;
    z-index: 0;              /* behind the number */
    margin-bottom: -25px;
}

/* ─────────── FLAMES ─────────── */
.flame-wrap {
    position: relative;
    width: 24px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 0;
}

.flame {
    position: absolute;
    border-radius: 50% 50% 30% 30%;
    transform-origin: center bottom;
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.flame.outer {
    width: 24px;
    height: 46px;
    bottom: 0;
    background: radial-gradient(ellipse at 50% 100%, #ffdd00 0%, #ff9d00 50%, #ff4d00 100%);
    animation: flickerOuter 0.5s ease-in-out infinite alternate;
    box-shadow: 0 0 20px 8px #ff9d0088, 0 0 40px 15px #ff4d0066;
}
.flame.inner {
    width: 14px;
    height: 34px;
    bottom: 0;
    background: radial-gradient(ellipse at 50% 100%, #fff7a0 0%, #ffd700 60%, #ff6600 100%);
    animation: flickerInner 0.4s ease-in-out infinite alternate;
}
.flame.core {
    width: 6px;
    height: 18px;
    bottom: 2px;
    background: radial-gradient(ellipse at 50% 100%, #ffffff 0%, #ffe680 80%);
    animation: flickerCore 0.3s ease-in-out infinite alternate;
}

@keyframes flickerOuter {
    0%   { transform: scaleX(1)    scaleY(1)    rotate(-2deg); }
    33%  { transform: scaleX(1.08) scaleY(1.05) rotate(1deg); }
    66%  { transform: scaleX(0.92) scaleY(1.08) rotate(-1deg); }
    100% { transform: scaleX(1.04) scaleY(0.96) rotate(2deg); }
}
@keyframes flickerInner {
    0%   { transform: scaleX(1)    scaleY(1); }
    50%  { transform: scaleX(1.1)  scaleY(1.08) rotate(1deg); }
    100% { transform: scaleX(0.95) scaleY(1.04) rotate(-1deg); }
}
@keyframes flickerCore {
    0%   { transform: scaleY(1); }
    100% { transform: scaleY(1.15); }
}

/* Flame blowout */
.flame-wrap.out .flame {
    opacity: 0;
    transform: scaleY(0) translateY(-20px);
}

/* Smoke after blowout */
.smoke-puff {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(180,180,180,0.6);
    animation: smokePuff 2.5s ease-out forwards;
}
@keyframes smokePuff {
    0%   { transform: translateX(-50%) translateY(0)   scale(1);   opacity: 0.7; }
    50%  { transform: translateX(-60%) translateY(-40px) scale(2.5); opacity: 0.35; }
    100% { transform: translateX(-40%) translateY(-80px) scale(4);   opacity: 0; }
}

/* ─────────── CONFETTI ─────────── */
.confetti-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
}
.c-piece {
    position: absolute;
    top: -20px;
    border-radius: 2px;
    animation: cFall linear forwards;
}
@keyframes cFall {
    0%   { transform: translateY(0) rotate(0deg);   opacity: 1; }
    85%  { opacity: 1; }
    100% { transform: translateY(110vh) rotate(600deg); opacity: 0; }
}

/* remove old aura – now using filter:drop-shadow on cake-wrap instead */

/* ─────────── BIRTHDAY TEXT ─────────── */
body {
    flex-direction: column;
    gap: 28px;
}

.birthday-text {
    text-align: center;
    z-index: 10;
    min-height: 2.2em;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bline {
    font-family: 'Pacifico', cursive;
    font-size: 1.6rem;
    background: linear-gradient(90deg, #f7518b, #b57af0, #ff9d00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(247,81,139,0.3));
    margin: 0;
    display: inline;
}

/* "Wilu" special italic gold styling */
.bline .name {
    font-style: italic;
    background: linear-gradient(90deg, #f4b942, #ff9d00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(244,185,66,0.5));
}

.cursor {
    font-family: 'Pacifico', cursive;
    font-size: 1.6rem;
    color: #f7518b;
    animation: blink 0.7s step-end infinite;
    line-height: 1;
    vertical-align: middle;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

