/* =============================================
   BIRTHDAY WISH — PREMIUM DARK THEME
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Poppins:wght@300;400;600;700&display=swap');

/* ======================== */
/* RESET & BASE             */
/* ======================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1033 25%, #2d1b4e 50%, #1a1033 75%, #0a0a1a 100%);
    background-attachment: fixed;
    font-family: 'Poppins', sans-serif;
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

.song {
    display: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ======================== */
/* STARS BACKGROUND         */
/* ======================== */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.8); }
}

/* ======================== */
/* PIN LOCK SCREEN (PINK)   */
/* ======================== */
.pin-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    background: linear-gradient(160deg, #ffb6c1 0%, #ffc0cb 30%, #ffcce0 50%, #ffd6e7 70%, #ffe4f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pin-screen.hidden {
    display: none;
}

/* Floating Hearts Background */
.pin-hearts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.floating-heart {
    position: absolute;
    bottom: -50px;
    font-size: 20px;
    opacity: 0;
    animation: heartFloat linear infinite;
}

@keyframes heartFloat {
    0% { transform: translateY(0) rotate(0deg) scale(0.5); opacity: 0; }
    10% { opacity: 0.6; transform: translateY(-10vh) rotate(15deg) scale(1); }
    90% { opacity: 0.4; }
    100% { transform: translateY(-110vh) rotate(-30deg) scale(0.8); opacity: 0; }
}

/* Decorative Stars */
.pin-stars-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.pin-star {
    position: absolute;
    color: #d63384;
    font-size: 18px;
    opacity: 0.4;
    animation: pinStarPulse 3s ease-in-out infinite;
}

.pin-star:nth-child(even) {
    animation-delay: 1.5s;
    font-size: 14px;
    opacity: 0.3;
}

@keyframes pinStarPulse {
    0%, 100% { opacity: 0.2; transform: scale(0.8) rotate(0deg); }
    50% { opacity: 0.6; transform: scale(1.3) rotate(180deg); }
}

/* PIN Container (flexbox layout) */
.pin-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 50px;
    z-index: 2;
    position: relative;
    padding: 40px;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 30px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 8px 40px rgba(214, 51, 132, 0.15), 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid rgba(255, 255, 255, 0.6);
    max-width: 720px;
    width: 90%;
}

/* Left: Profile Picture */
.pin-profile-side {
    flex-shrink: 0;
    text-align: center;
}

.pin-heart-frame {
    position: relative;
    display: inline-block;
}

.heart-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 230px;
    height: 230px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: heartRingSpin 20s linear infinite;
}

.heart-ring span {
    position: absolute;
    font-size: 14px;
    filter: drop-shadow(0 0 3px rgba(255, 0, 80, 0.3));
}

/* Position hearts in a circle */
.heart-ring span:nth-child(1) { transform: rotate(0deg) translateY(-108px); }
.heart-ring span:nth-child(2) { transform: rotate(22.5deg) translateY(-108px); }
.heart-ring span:nth-child(3) { transform: rotate(45deg) translateY(-108px); }
.heart-ring span:nth-child(4) { transform: rotate(67.5deg) translateY(-108px); }
.heart-ring span:nth-child(5) { transform: rotate(90deg) translateY(-108px); }
.heart-ring span:nth-child(6) { transform: rotate(112.5deg) translateY(-108px); }
.heart-ring span:nth-child(7) { transform: rotate(135deg) translateY(-108px); }
.heart-ring span:nth-child(8) { transform: rotate(157.5deg) translateY(-108px); }
.heart-ring span:nth-child(9) { transform: rotate(180deg) translateY(-108px); }
.heart-ring span:nth-child(10) { transform: rotate(202.5deg) translateY(-108px); }
.heart-ring span:nth-child(11) { transform: rotate(225deg) translateY(-108px); }
.heart-ring span:nth-child(12) { transform: rotate(247.5deg) translateY(-108px); }
.heart-ring span:nth-child(13) { transform: rotate(270deg) translateY(-108px); }
.heart-ring span:nth-child(14) { transform: rotate(292.5deg) translateY(-108px); }
.heart-ring span:nth-child(15) { transform: rotate(315deg) translateY(-108px); }
.heart-ring span:nth-child(16) { transform: rotate(337.5deg) translateY(-108px); }

@keyframes heartRingSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.pin-profile-img-wrap {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 4px 20px rgba(214, 51, 132, 0.25);
    position: relative;
    background: #ffe4f0;
}

.pin-profile-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pin-profile-fallback {
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffb6c1, #ff69b4);
    font-size: 60px;
    position: absolute;
    top: 0;
    left: 0;
}

/* Right: Passcode Entry */
.pin-entry-side {
    text-align: center;
    flex-shrink: 0;
}

.pin-title {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #c2185b;
    margin-bottom: 18px;
    letter-spacing: 1px;
}

/* PIN Digit Boxes */
.pin-dots {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 12px;
}

.pin-box {
    width: 48px;
    height: 52px;
    border: 2.5px solid #e0a0b0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: #c2185b;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.pin-box.filled {
    border-color: #e91e63;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 12px rgba(233, 30, 99, 0.2);
}

.pin-box.filled::after {
    content: '●';
    font-size: 22px;
    color: #e91e63;
}

/* Shake Animation */
.pin-dots.shake {
    animation: pinShake 0.5s ease-in-out;
}

@keyframes pinShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-12px); }
    30% { transform: translateX(10px); }
    45% { transform: translateX(-8px); }
    60% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
}

/* Error Message */
.pin-error {
    min-height: 24px;
    font-size: 13px;
    color: #e91e63;
    font-weight: 500;
    margin-bottom: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pin-error.show {
    opacity: 1;
    animation: fadeInUp 0.3s ease-out;
}

/* Built-in Keypad */
.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 230px;
    margin: 0 auto;
}

.key-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 2px solid #e8b4c8;
    background: rgba(255, 255, 255, 0.75);
    font-size: 24px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: #880e4f;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.key-btn:focus {
    outline: none;
}

@media (hover: hover) {
    .key-btn:hover {
        background: rgba(255, 255, 255, 0.95);
        border-color: #e91e63;
        transform: scale(1.05);
        box-shadow: 0 4px 15px rgba(233, 30, 99, 0.2);
    }
}

.key-btn:active {
    transform: scale(0.92);
    background: #fce4ec;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.key-btn.key-clear {
    font-size: 13px;
    font-weight: 700;
    color: #ad1457;
    letter-spacing: 0.5px;
}

.key-btn.key-delete {
    font-size: 20px;
    color: #ad1457;
}

/* ======================== */
/* WRONG PIN POPUP          */
/* ======================== */
.wrong-pin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wrong-pin-overlay.show {
    display: flex;
    opacity: 1;
}

.wrong-pin-popup {
    background: linear-gradient(160deg, #fff5f7 0%, #ffe8ef 40%, #ffd6e7 100%);
    border-radius: 28px;
    padding: 35px 40px 30px;
    text-align: center;
    box-shadow:
        0 15px 50px rgba(214, 51, 132, 0.25),
        0 5px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.7);
    max-width: 340px;
    width: 85%;
    animation: popupBounceIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popupBounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.wrong-pin-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #d32f2f;
    margin-bottom: 18px;
    letter-spacing: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.wrong-pin-img {
    width: 180px;
    height: auto;
    margin: 0 auto 20px;
    display: block;
    border-radius: 12px;
}

.wrong-pin-hint {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #ad1457;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

.wrong-pin-btn {
    padding: 12px 45px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #e53935, #d32f2f);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.35);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.wrong-pin-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 22px rgba(211, 47, 47, 0.45);
}

.wrong-pin-btn:active {
    transform: scale(0.95);
}

/* ======================== */
/* GIFT REVEAL SCREEN       */
/* ======================== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: radial-gradient(ellipse at center, #1a1033 0%, #0a0a1a 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.loader-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

.gift-icon {
    font-size: 90px;
    animation: giftBounce 1.5s ease-in-out infinite;
    margin-bottom: 25px;
    filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.5));
}

@keyframes giftBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-18px) rotate(-5deg); }
    75% { transform: translateY(-18px) rotate(5deg); }
}

.loader-subtitle {
    font-family: 'Great Vibes', cursive;
    font-size: 34px;
    color: #ffd700;
    margin-bottom: 35px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    animation: fadeInUp 1s ease-out;
}

.loader button#play {
    width: auto;
    height: auto;
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    padding: 18px 55px;
    font-size: 22px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    background: linear-gradient(135deg, #ffd700, #ffaa00, #ffd700);
    background-size: 200% 200%;
    animation: shimmer 3s ease-in-out infinite, pulse 2s ease-in-out infinite;
    color: #1a1033;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 1px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4), 0 5px 20px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    text-transform: none;
}

.loader button#play:hover {
    transform: scale(1.08);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.6), 0 8px 30px rgba(0,0,0,0.4);
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.4), 0 5px 20px rgba(0,0,0,0.3); }
    50% { box-shadow: 0 0 50px rgba(255, 215, 0, 0.7), 0 8px 30px rgba(0,0,0,0.4); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ======================== */
/* CANVAS LAYERS            */
/* ======================== */
#fireworks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

#confetti {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    pointer-events: none;
    z-index: 4;
}

/* ======================== */
/* FLOATING BALLOONS        */
/* ======================== */
.balloons-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

.balloon {
    position: absolute;
    bottom: -150px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    opacity: 0;
    animation: floatUp linear infinite;
}

.balloon::after {
    content: '';
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.25);
}

.balloon::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid currentColor;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg) scale(0.8);
        opacity: 0;
    }
    5% {
        opacity: 0.75;
        transform: translateY(-5vh) translateX(0) rotate(0deg) scale(1);
    }
    50% {
        opacity: 0.75;
    }
    95% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-130vh) translateX(var(--drift, 30px)) rotate(var(--rotation, 15deg)) scale(0.9);
        opacity: 0;
    }
}

/* ======================== */
/* MAIN CONTENT WRAPPER     */
/* ======================== */
.main {
    position: relative;
    z-index: 6;
    min-height: 100vh;
}

.content-wrapper {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px 120px;
}

/* ======================== */
/* PROFILE PICTURE          */
/* ======================== */
.profile-section {
    text-align: center;
    padding-top: 20px;
    margin-bottom: 15px;
    position: relative;
}

.profile-glow-ring {
    display: inline-block;
    padding: 5px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #ff6b9d, #c44dff, #4dafff, #ffd700, #ff6b9d);
    box-shadow:
        0 0 25px rgba(196, 77, 255, 0.4),
        0 0 50px rgba(255, 107, 157, 0.2),
        0 0 80px rgba(77, 175, 255, 0.15);
}

.profile-frame {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid #0a0a1a;
    position: relative;
    background: #1a1033;
}

.profile-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-fallback {
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #c44dff, #ff6b9d);
    font-size: 80px;
    font-family: 'Great Vibes', cursive;
    color: #fff;
    text-shadow: 0 0 20px rgba(255,255,255,0.3);
    position: absolute;
    top: 0;
    left: 0;
}

.profile-sparkles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 280px;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    font-size: 16px;
    animation: sparkleFloat 3s ease-in-out infinite;
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.sparkle.s1 { top: 5%; left: 50%; animation-delay: 0s; }
.sparkle.s2 { top: 30%; right: 2%; animation-delay: 0.5s; }
.sparkle.s3 { top: 70%; right: 2%; animation-delay: 1s; }
.sparkle.s4 { bottom: 5%; left: 50%; animation-delay: 1.5s; }
.sparkle.s5 { top: 70%; left: 2%; animation-delay: 2s; }
.sparkle.s6 { top: 30%; left: 2%; animation-delay: 2.5s; }

@keyframes sparkleFloat {
    0%, 100% { opacity: 0.2; transform: scale(0.7); }
    50% { opacity: 1; transform: scale(1.4); }
}

/* ======================== */
/* NEON GLOWING NAME        */
/* ======================== */
.name-section {
    text-align: center;
    margin-bottom: 25px;
}

.neon-name {
    font-family: 'Great Vibes', cursive;
    font-size: 85px;
    font-weight: 400;
    color: #fff;
    text-shadow:
        0 0 7px #fff,
        0 0 10px #fff,
        0 0 21px #fff,
        0 0 42px #ff6b9d,
        0 0 82px #ff6b9d,
        0 0 92px #ff6b9d,
        0 0 102px #ff6b9d,
        0 0 151px #ff6b9d;
    animation: neonPulse 2.5s ease-in-out infinite alternate;
    letter-spacing: 3px;
    line-height: 1.1;
}

@keyframes neonPulse {
    0% {
        text-shadow:
            0 0 7px #fff,
            0 0 10px #fff,
            0 0 21px #fff,
            0 0 42px #ff6b9d,
            0 0 82px #ff6b9d,
            0 0 92px #ff6b9d;
    }
    100% {
        text-shadow:
            0 0 4px #fff,
            0 0 8px #fff,
            0 0 18px #fff,
            0 0 35px #c44dff,
            0 0 65px #c44dff,
            0 0 75px #c44dff;
    }
}

.birthday-badge {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 32px;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.15), rgba(196, 77, 255, 0.15));
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 30px;
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #ffd700;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeInUp 1s ease-out 0.5s both;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* ======================== */
/* BANNER                   */
/* ======================== */
.banner-section {
    text-align: center;
    margin-bottom: 25px;
}

.banner-img {
    max-width: 380px;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.3));
    animation: bannerFloat 4s ease-in-out infinite;
}

@keyframes bannerFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ======================== */
/* TYPED TEXT SECTION        */
/* ======================== */
.typed-section {
    text-align: center;
    margin-bottom: 40px;
    min-height: 70px;
}

.type-wrap {
    font-size: 22px;
    color: #e0c3fc;
    font-weight: 300;
}

.type-wrap .typed-cursor {
    color: #ffd700;
    font-weight: 100;
}

.typing {
    display: none;
}

/* ======================== */
/* CAKE & CANDLES           */
/* ======================== */
.cake-section {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.cake-wrapper {
    position: relative;
    display: inline-block;
    max-width: 280px;
}

.cake-img {
    width: 100%;
    border-radius: 16px;
    filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.25));
}

.candles-row {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin-bottom: -5px;
    position: relative;
    z-index: 2;
}

.candle {
    width: 8px;
    height: 38px;
    background: linear-gradient(to bottom, #fff5d6, #ffd700, #e6a800);
    border-radius: 3px 3px 1px 1px;
    position: relative;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.3);
}

.flame-wrap {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.5s ease;
}

.flame {
    width: 12px;
    height: 20px;
    background: radial-gradient(ellipse at bottom, #ffd700 0%, #ff6348 40%, #ff4500 70%, transparent 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker 0.15s ease-in-out infinite alternate;
    box-shadow:
        0 0 8px #ffd700,
        0 0 18px #ff6348,
        0 0 35px rgba(255, 99, 72, 0.4),
        0 -5px 15px rgba(255, 215, 0, 0.6);
}

@keyframes flicker {
    0% { transform: scale(1, 1) rotate(-2deg); opacity: 1; }
    25% { transform: scale(0.95, 1.05) rotate(1deg); }
    50% { transform: scale(1.02, 0.95) rotate(-1deg); opacity: 0.95; }
    75% { transform: scale(0.98, 1.02) rotate(2deg); }
    100% { transform: scale(1, 0.97) rotate(-1deg); opacity: 1; }
}

.flame.blown {
    animation: blowOut 0.6s ease-out forwards !important;
}

@keyframes blowOut {
    0% { opacity: 1; transform: scale(1); box-shadow: 0 0 8px #ffd700, 0 0 18px #ff6348; }
    30% { opacity: 0.7; transform: scale(1.3, 0.4) translateY(-5px); }
    60% { opacity: 0.3; transform: scale(0.5, 0.2) translateY(-15px); box-shadow: none; }
    100% { opacity: 0; transform: scale(0) translateY(-25px); box-shadow: none; }
}

.smoke {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(180, 180, 200, 0.6);
    border-radius: 50%;
    left: 50%;
    top: -22px;
    transform: translateX(-50%);
    animation: smokeRise 1.2s ease-out forwards;
    pointer-events: none;
}

@keyframes smokeRise {
    0% { opacity: 0.7; transform: translateX(-50%) translateY(0) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-50px) scale(4); }
}

.blow-btn {
    margin-top: 25px;
    padding: 14px 38px;
    font-size: 17px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    background: linear-gradient(135deg, #ff6b9d, #c44dff);
    background-size: 200% 200%;
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(196, 77, 255, 0.35);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    animation: shimmer 3s ease-in-out infinite;
}

.blow-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 0 45px rgba(196, 77, 255, 0.55);
}

.blow-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
    animation: none;
}

.blow-icon {
    font-size: 22px;
}

.wish-text {
    opacity: 0;
    transform: translateY(25px) scale(0.9);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 25px;
}

.wish-text.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.wish-text h2 {
    font-family: 'Great Vibes', cursive;
    font-size: 42px;
    color: #ffd700;
    text-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
    animation: wishGlow 2s ease-in-out infinite alternate;
}

@keyframes wishGlow {
    0% { text-shadow: 0 0 20px rgba(255, 215, 0, 0.4); }
    100% { text-shadow: 0 0 40px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 107, 157, 0.3); }
}

/* ======================== */
/* MESSAGE CARD (GLASS)     */
/* ======================== */
.message-section {
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: all 1.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.message-section.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.message-card {
    position: relative;
    padding: 45px 40px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(196, 77, 255, 0.08) 0%, transparent 60%);
    animation: cardGlow 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes cardGlow {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -30px); }
    66% { transform: translate(-30px, 30px); }
}

.card-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.flower {
    position: absolute;
    font-size: 22px;
    opacity: 0.5;
    animation: flowerPulse 4s ease-in-out infinite;
}

.flower.tl { top: 15px; left: 20px; animation-delay: 0s; }
.flower.tr { top: 15px; right: 20px; animation-delay: 1s; }
.flower.bl { bottom: 15px; left: 20px; animation-delay: 2s; }
.flower.br { bottom: 15px; right: 20px; animation-delay: 3s; }

@keyframes flowerPulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.5; }
    50% { transform: scale(1.2) rotate(10deg); opacity: 0.8; }
}

.msg-title {
    font-family: 'Great Vibes', cursive;
    font-size: 40px;
    color: #ffd700;
    margin-bottom: 12px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.msg-divider {
    color: rgba(255, 215, 0, 0.3);
    font-size: 14px;
    margin: 15px 0;
    letter-spacing: 6px;
}

.msg-body {
    font-size: 16px;
    line-height: 2;
    color: #e0c3fc;
    font-weight: 300;
    max-width: 550px;
    margin: 0 auto;
}

.msg-signature {
    font-family: 'Great Vibes', cursive;
    font-size: 30px;
    color: #ff6b9d;
    margin-top: 8px;
    text-shadow: 0 0 12px rgba(255, 107, 157, 0.4);
}

/* ======================== */
/* BALLOON BORDER           */
/* ======================== */
.balloon-border {
    position: fixed;
    top: 100%;
    opacity: 0.45;
    z-index: 99999;
    pointer-events: none;
}

/* ======================== */
/* RESPONSIVE               */
/* ======================== */

/* PIN Screen Responsive */
@media (max-width: 768px) {
    .pin-container {
        flex-direction: column;
        gap: 25px;
        padding: 30px 25px;
        max-width: 400px;
    }

    .pin-profile-img-wrap {
        width: 140px;
        height: 140px;
    }

    .heart-ring {
        width: 185px;
        height: 185px;
    }

    .heart-ring span { font-size: 11px; }
    .heart-ring span:nth-child(1) { transform: rotate(0deg) translateY(-85px); }
    .heart-ring span:nth-child(2) { transform: rotate(22.5deg) translateY(-85px); }
    .heart-ring span:nth-child(3) { transform: rotate(45deg) translateY(-85px); }
    .heart-ring span:nth-child(4) { transform: rotate(67.5deg) translateY(-85px); }
    .heart-ring span:nth-child(5) { transform: rotate(90deg) translateY(-85px); }
    .heart-ring span:nth-child(6) { transform: rotate(112.5deg) translateY(-85px); }
    .heart-ring span:nth-child(7) { transform: rotate(135deg) translateY(-85px); }
    .heart-ring span:nth-child(8) { transform: rotate(157.5deg) translateY(-85px); }
    .heart-ring span:nth-child(9) { transform: rotate(180deg) translateY(-85px); }
    .heart-ring span:nth-child(10) { transform: rotate(202.5deg) translateY(-85px); }
    .heart-ring span:nth-child(11) { transform: rotate(225deg) translateY(-85px); }
    .heart-ring span:nth-child(12) { transform: rotate(247.5deg) translateY(-85px); }
    .heart-ring span:nth-child(13) { transform: rotate(270deg) translateY(-85px); }
    .heart-ring span:nth-child(14) { transform: rotate(292.5deg) translateY(-85px); }
    .heart-ring span:nth-child(15) { transform: rotate(315deg) translateY(-85px); }
    .heart-ring span:nth-child(16) { transform: rotate(337.5deg) translateY(-85px); }

    .pin-title {
        font-size: 17px;
        margin-bottom: 14px;
    }

    .key-btn {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .pin-keypad {
        max-width: 210px;
        gap: 8px;
    }

    .pin-box {
        width: 42px;
        height: 46px;
    }
}

@media (max-width: 480px) {
    .pin-container {
        padding: 22px 18px;
        gap: 18px;
    }

    .pin-profile-img-wrap {
        width: 110px;
        height: 110px;
    }

    .heart-ring {
        width: 150px;
        height: 150px;
    }

    .heart-ring span { font-size: 9px; }
    .heart-ring span:nth-child(1) { transform: rotate(0deg) translateY(-68px); }
    .heart-ring span:nth-child(2) { transform: rotate(22.5deg) translateY(-68px); }
    .heart-ring span:nth-child(3) { transform: rotate(45deg) translateY(-68px); }
    .heart-ring span:nth-child(4) { transform: rotate(67.5deg) translateY(-68px); }
    .heart-ring span:nth-child(5) { transform: rotate(90deg) translateY(-68px); }
    .heart-ring span:nth-child(6) { transform: rotate(112.5deg) translateY(-68px); }
    .heart-ring span:nth-child(7) { transform: rotate(135deg) translateY(-68px); }
    .heart-ring span:nth-child(8) { transform: rotate(157.5deg) translateY(-68px); }
    .heart-ring span:nth-child(9) { transform: rotate(180deg) translateY(-68px); }
    .heart-ring span:nth-child(10) { transform: rotate(202.5deg) translateY(-68px); }
    .heart-ring span:nth-child(11) { transform: rotate(225deg) translateY(-68px); }
    .heart-ring span:nth-child(12) { transform: rotate(247.5deg) translateY(-68px); }
    .heart-ring span:nth-child(13) { transform: rotate(270deg) translateY(-68px); }
    .heart-ring span:nth-child(14) { transform: rotate(292.5deg) translateY(-68px); }
    .heart-ring span:nth-child(15) { transform: rotate(315deg) translateY(-68px); }
    .heart-ring span:nth-child(16) { transform: rotate(337.5deg) translateY(-68px); }

    .pin-profile-fallback {
        font-size: 40px;
    }

    .key-btn {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }

    .pin-keypad {
        max-width: 190px;
        gap: 7px;
    }

    .pin-box {
        width: 38px;
        height: 42px;
    }

    .pin-title {
        font-size: 15px;
    }
}

/* Main Content Responsive */
@media (max-width: 768px) {
    .neon-name {
        font-size: 55px;
        text-shadow:
            0 0 7px #fff,
            0 0 21px #fff,
            0 0 42px #ff6b9d,
            0 0 82px #ff6b9d;
    }

    body {
        background-attachment: scroll;
    }

    .profile-frame {
        width: 150px;
        height: 150px;
    }

    .profile-sparkles {
        width: 220px;
        height: 220px;
    }

    .type-wrap {
        font-size: 18px;
    }

    .message-card {
        padding: 30px 25px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .msg-title {
        font-size: 32px;
    }

    .msg-body {
        font-size: 14px;
        line-height: 1.8;
    }

    .wish-text h2 {
        font-size: 32px;
    }

    .loader-subtitle {
        font-size: 26px;
    }

    .birthday-badge {
        font-size: 13px;
        padding: 8px 22px;
        letter-spacing: 3px;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }

    .candles-row {
        gap: 14px;
    }

    .banner-img {
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .neon-name {
        font-size: 42px;
        text-shadow:
            0 0 7px #fff,
            0 0 42px #ff6b9d,
            0 0 82px #ff6b9d;
        animation: none;
    }

    .profile-frame {
        width: 120px;
        height: 120px;
    }

    .profile-fallback {
        font-size: 55px;
    }

    .profile-sparkles {
        width: 180px;
        height: 180px;
    }

    .loader button#play {
        padding: 14px 38px;
        font-size: 18px;
    }

    .gift-icon {
        font-size: 65px;
    }

    .loader-subtitle {
        font-size: 22px;
        padding: 0 15px;
    }

    .birthday-badge {
        font-size: 11px;
        letter-spacing: 2px;
        padding: 6px 18px;
    }

    .blow-btn {
        padding: 12px 28px;
        font-size: 15px;
    }

    .msg-signature {
        font-size: 24px;
    }

    .cake-wrapper {
        max-width: 220px;
    }

    .candles-row {
        gap: 10px;
    }

    .candle {
        height: 30px;
        width: 6px;
    }

    .flame {
        box-shadow: 0 0 8px #ffd700;
    }
}

/* ======================== */
/* MOBILE PERFORMANCE       */
/* ======================== */
@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }

    .balloon, .floating-heart, .sparkle {
        will-change: transform, opacity;
    }

    .key-btn {
        touch-action: manipulation;
    }

    .profile-glow-ring {
        box-shadow:
            0 0 15px rgba(196, 77, 255, 0.3),
            0 0 30px rgba(255, 107, 157, 0.15);
    }

    .card-glow {
        animation: none;
        opacity: 0.5;
    }

    .flame {
        box-shadow:
            0 0 8px #ffd700,
            0 0 15px #ff6348;
    }
}