/* ==============================
   Dubai Birthday — WOW Edition
   ============================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --gold: #ffd700; --cyan: #00e5ff; --magenta: #ff00cc;
}

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    background: #020008;
    font-family: 'Outfit', sans-serif;
    color: #fff;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* ── Background ─────────────────────── */
#bg-layer { position: fixed; inset: 0; z-index: 0; }

#dubai-bg {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center 30%;
    animation: bgZoom 40s ease-in-out infinite alternate;
    will-change: transform;
}
@keyframes bgZoom {
    from { transform: scale(1); }
    to   { transform: scale(1.06); }
}
#bg-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(
        to top,
        rgba(2,0,15,0.85) 0%,
        rgba(3,0,12,0.28) 28%,
        rgba(0,0,0,0.06)  58%,
        rgba(0,0,0,0.1)   100%
    );
}

/* CSS twinkling stars */
body::before {
    content: '';
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background-image:
        radial-gradient(1.5px 1.5px at  4% 10%, #fff, transparent),
        radial-gradient(1px   1px   at 16%  5%, #ffd, transparent),
        radial-gradient(2px   2px   at 24% 25%, #ff0, transparent),
        radial-gradient(1px   1px   at 36%  8%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 48% 18%, #0ff, transparent),
        radial-gradient(1px   1px   at 60%  4%, #fff, transparent),
        radial-gradient(2px   2px   at 70% 22%, #f0f, transparent),
        radial-gradient(1px   1px   at 82%  9%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 91% 16%, #ffd, transparent),
        radial-gradient(1px   1px   at 97% 32%, #fff, transparent);
    background-size: 100% 55%;
    background-repeat: no-repeat;
    animation: starBlink 8s ease-in-out infinite alternate;
    will-change: opacity;
}
@keyframes starBlink { from { opacity: 0.3; } to { opacity: 1; } }

/* ── Canvas ─────────────────────────── */
#c { position: fixed; inset: 0; z-index: 2; pointer-events: none; will-change: contents; }

/* ── Laser SVG ──────────────────────── */
#laser-svg {
    position: fixed; inset: 0; width: 100%; height: 100%;
    z-index: 3; pointer-events: none;
}
.laser {
    stroke-width: 0.28; stroke-linecap: round;
    opacity: 0; transition: opacity 0.4s ease;
    filter: drop-shadow(0 0 1px currentColor);
}
.laser.on { opacity: 1; animation: laserFlicker 0.7s ease-in-out infinite alternate; }
.lc { stroke: var(--cyan);    color: var(--cyan);    }
.lm { stroke: var(--magenta); color: var(--magenta); }
.lg { stroke: var(--gold);    color: var(--gold);    }
@keyframes laserFlicker { from { opacity: 0.45; } to { opacity: 1; } }

/* ── UI layout ──────────────────────── */
#ui {
    position: fixed; inset: 0; z-index: 10;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    pointer-events: none;
    gap: clamp(4px, 1.5vw, 10px);
    padding: 0 16px;
}

/* ── Star rows ──────────────────────── */
.sparkle-row {
    font-size: clamp(1rem, 3.5vw, 1.6rem);
    letter-spacing: 8px;
    opacity: 0;
    animation: fadeUp 1s ease 0.9s both, starsFloat 3.5s ease-in-out 2s infinite;
}
#stars-row2 { animation-delay: 1.1s, 2.2s; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0);    }
}
@keyframes starsFloat {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-7px); }
}

/* ── "Happy Birthday" ───────────────── */
#hb {
    font-family: 'Cinzel Decorative', serif;
    font-size: clamp(1.6rem, 6.5vw, 5rem);
    line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, #ffd700 50%, #ffaa00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(255,215,0,0.6))
            drop-shadow(0 2px 8px rgba(0,0,0,0.5));
    opacity: 0;
    animation:
        titleIn 1.4s cubic-bezier(0.19,1,0.22,1) 1.3s both,
        titlePulse 4s ease-in-out 3s infinite alternate;
}
@keyframes titleIn {
    from { opacity: 0; transform: scale(0.75) translateY(20px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}
@keyframes titlePulse {
    from { filter: drop-shadow(0 0 16px rgba(255,215,0,0.45)) drop-shadow(0 2px 8px rgba(0,0,0,0.5)); }
    to   { filter: drop-shadow(0 0 34px rgba(255,215,0,0.85)) drop-shadow(0 2px 8px rgba(0,0,0,0.5)); }
}

/* ── "Jennish" — flowing rainbow shimmer ── */
#name {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(4.2rem, 17vw, 10.5rem);
    line-height: 1;
    letter-spacing: 4px;

    /* Flowing rainbow gradient — shifts continuously */
    background: linear-gradient(
        90deg,
        #ff00cc 0%,
        #ff69b4 12%,
        #ffd700 25%,
        #ffffff 38%,
        #00e5ff 50%,
        #b15cff 62%,
        #ff00cc 75%,
        #ff69b4 88%,
        #ffd700 100%
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    /* Multi-layer glow for depth */
    filter:
        drop-shadow(0 0 25px rgba(255,0,200,0.75))
        drop-shadow(0 0 55px rgba(0,229,255,0.45))
        drop-shadow(0 0 90px rgba(255,215,0,0.3))
        drop-shadow(0 4px 12px rgba(0,0,0,0.6));

    opacity: 0;
    animation:
        nameIn 1.8s cubic-bezier(0.19,1,0.22,1) 2.3s both,
        rainbowFlow 3.5s linear 4.1s infinite,
        nameGlow 2.8s ease-in-out 4.1s infinite alternate;
}
@keyframes nameIn {
    from {
        opacity: 0;
        transform: scale(1.5) translateY(-10px);
        filter: drop-shadow(0 0 80px rgba(255,0,200,1)) brightness(2);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: drop-shadow(0 0 25px rgba(255,0,200,0.75))
                drop-shadow(0 0 55px rgba(0,229,255,0.45))
                drop-shadow(0 0 90px rgba(255,215,0,0.3))
                drop-shadow(0 4px 12px rgba(0,0,0,0.6));
    }
}
@keyframes rainbowFlow {
    from { background-position: 0% center;    }
    to   { background-position: 250% center;  }
}
@keyframes nameGlow {
    from {
        filter: drop-shadow(0 0 20px rgba(255,0,200,0.6))
                drop-shadow(0 0 45px rgba(0,229,255,0.35))
                drop-shadow(0 4px 12px rgba(0,0,0,0.6));
    }
    to {
        filter: drop-shadow(0 0 38px rgba(255,0,200,0.95))
                drop-shadow(0 0 80px rgba(0,229,255,0.65))
                drop-shadow(0 0 110px rgba(255,215,0,0.45))
                drop-shadow(0 4px 12px rgba(0,0,0,0.6));
    }
}

/* ── Sub-line ───────────────────────── */
#sub {
    font-size: clamp(0.85rem, 2.8vw, 1.15rem);
    font-weight: 300;
    color: rgba(255,255,255,0.78);
    letter-spacing: 2px;
    opacity: 0;
    animation: fadeUp 1.2s ease 3.1s both;
}

/* ── Floating hearts/emojis (DOM, CSS animated) ── */
.floater {
    position: fixed;
    bottom: -40px;
    pointer-events: none;
    z-index: 6;
    animation: floatUp var(--dur, 5s) ease-out forwards;
    font-size: var(--sz, 18px);
    opacity: 0.9;
    will-change: transform, opacity;
}
@keyframes floatUp {
    0%   { transform: translateY(0)       rotate(0deg);   opacity: 0.9; }
    70%  { opacity: 0.7; }
    100% { transform: translateY(-95vh)   rotate(var(--rot, 20deg)); opacity: 0; }
}

/* ── Responsive ─────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
    #stars-row, #stars-row2, #sub { display: none; }
    #hb   { font-size: 1.5rem; }
    #name { font-size: 3.2rem; }
}
