* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 50%, #16213e 100%);
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    color: #fff;
}

.skip-text a:hover {
    color: #00e6ff;
    text-decoration: underline;
}

/* ==================== BACKGROUND & CONTAINERS ==================== */

.background {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

body.intro-active .content {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-screen {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: radial-gradient(circle at 30% 20%, rgba(0, 212, 255, 0.18), transparent 45%),
                radial-gradient(circle at 80% 70%, rgba(255, 105, 180, 0.2), transparent 50%),
                linear-gradient(135deg, #080816 0%, #13132a 50%, #0f1b36 100%);
}

.intro-card {
    width: min(480px, 100%);
    padding: 28px 22px;
    border-radius: 16px;
    background: rgba(10, 18, 34, 0.8);
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
    text-align: center;
    backdrop-filter: blur(8px);
}

.intro-kicker {
    margin: 0 0 10px;
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: lowercase;
    color: rgba(255, 255, 255, 0.65);
}

.intro-title {
    margin: 0;
    font-size: clamp(1.45rem, 4.1vw, 2.15rem);
    letter-spacing: 1px;
    text-transform: none;
    background: linear-gradient(90deg, #00d4ff 0%, #00ffc2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.intro-question {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.9);
    animation: nudge 1.1s ease-in-out infinite;
    opacity: 0;
    transform: translateY(4px);
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.25s ease, margin 0.25s ease;
}

.intro-question.is-visible {
    opacity: 1;
    transform: translateY(0);
    max-height: 36px;
    margin: 10px 0 2px;
}

.intro-subtitle {
    margin: 14px 0 18px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.82);
    letter-spacing: 0.6px;
    text-transform: lowercase;
}

.intro-progress {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.intro-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.intro-screen.intro-ready .intro-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.intro-btn {
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
    text-transform: lowercase;
    cursor: pointer;
}

.intro-btn-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #00ffc2 100%);
    color: #031018;
    font-weight: 700;
}

.intro-btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.intro-progress-fill {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #00d4ff 0%, #00ffc2 100%);
    transition: width 0.35s ease;
}

body.intro-leaving .intro-screen {
    animation: introFadeOut 0.65s ease forwards;
}

@keyframes introFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(1.02);
    }
}

@keyframes nudge {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    75% {
        transform: translateX(2px);
    }
}

#confetti-container,
#sparkles-container,
#fireworks-container {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

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

@keyframes float {
    0% {
        bottom: -30px;
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        bottom: 110vh;
        opacity: 0;
        transform: rotate(-45deg) translateX(var(--drift, 0px));
    }
}

.content {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.content::-webkit-scrollbar {
    width: 5px;
}

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* ==================== HEADER ==================== */

.header {
    margin-top: 8px;
    margin-bottom: 20px;
    animation: fadeInDown 0.8s ease-out;
}

.barman-signature {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    animation: fadeInUp 1.2s ease-out 0.6s both;
}

.signature-divider {
    font-size: 1.2rem;
    color: rgba(0, 212, 255, 0.5);
    animation: pulse 2s ease-in-out 0.8s infinite;
}

.barman-wish {
    font-size: 0.95rem;
    color: rgba(0, 212, 255, 0.8);
    font-weight: 400;
    letter-spacing: 1.5px;
    font-style: italic;
    text-align: center;
    margin: 0;
}

.barman-name {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 4px;
    text-transform: uppercase;
    color: #00d4ff;
    text-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
    letter-spacing: 2px;
}

.birthday-text {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #00d4ff 0%, #0099ff 50%, #00d4ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInDown 1s ease-out;
    filter: drop-shadow(0 2px 10px rgba(0, 212, 255, 0.2));
}

.person-name {
    font-size: 2.2rem;
    font-weight: 500;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.95), rgba(0, 153, 255, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    min-height: 60px;
    text-transform: uppercase;
    animation: fadeInDown 1.2s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0 0 0;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.45), 0 0 18px rgba(0, 212, 255, 0.25);
    animation: fadeInDown 1.2s ease-out, nameGlow 2.4s ease-in-out infinite;
}

.person-age {
    font-size: 1rem;
    font-weight: 400;
    color: rgba(0, 212, 255, 0.7);
    letter-spacing: 1px;
    text-transform: lowercase;
    animation: fadeInDown 1.4s ease-out;
    margin: 10px 0 15px 0;
    font-style: italic;
    position: relative;
    z-index: 2;
}

/* ==================== MAIN SECTION ==================== */

.main-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    flex: 1;
    justify-content: center;
    margin: clamp(10px, 2.5vh, 26px) 0;
}

/* ==================== CAKE ==================== */

.cake-container {
    margin: 0;
    display: flex;
    justify-content: center;
    animation: fadeInUp 1.3s ease-out;
}

.cake {
    position: relative;
    width: 160px;
    height: 130px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 20px 40px rgba(0, 212, 255, 0.15));
    z-index: 1;
}

.layers {
    position: relative;
    height: 100%;
}

.layer {
    position: absolute;
    width: 160px;
    height: 35px;
    left: 0;
    border-radius: 6px;
}

.layer-1 {
    bottom: 0;
    background: linear-gradient(180deg, #8B4513 0%, #654321 100%);
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.1), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.layer-2 {
    bottom: 40px;
    background: linear-gradient(180deg, #D2691E 0%, #8B4513 100%);
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.1), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.layer-3 {
    bottom: 80px;
    background: linear-gradient(180deg, #FF69B4 0%, #FFB6C1 100%);
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.2), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.frosting {
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 18px;
    background: linear-gradient(180deg, #FFB6C1 0%, #FFC0CB 100%);
    border-radius: 50% 50% 0 0;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.4);
}

.candles {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 22px;
    z-index: 10;
}

.candle {
    width: 10px;
    height: 26px;
    background: linear-gradient(180deg, #FFD700 0%, #FFA500 100%);
    border-radius: 5px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.candle:hover {
    filter: brightness(1.15);
}

.candle.blown .flame {
    display: none;
}

.candle.blown .smoke {
    display: block !important;
}

.flame {
    position: absolute;
    width: 13px;
    height: 16px;
    background: linear-gradient(180deg, #FF3333 0%, #FFD700 60%, #FFA500 100%);
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50% 50% 50% 0;
    animation: flicker 0.4s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(255, 100, 0, 0.8), 0 0 15px rgba(255, 200, 0, 0.5);
    filter: drop-shadow(0 0 3px rgba(255, 100, 0, 0.6));
}

.smoke {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(200, 200, 200, 0.7);
    top: -18px;
    left: 50%;
    border-radius: 50%;
    animation: rise 1s ease-in forwards;
    display: none;
}

@keyframes flicker {
    0%, 100% {
        height: 16px;
        top: -9px;
        box-shadow: 0 0 8px rgba(255, 100, 0, 0.8), 0 0 15px rgba(255, 200, 0, 0.5);
    }
    25% {
        height: 18px;
        top: -11px;
    }
    50% {
        height: 14px;
        top: -7px;
        box-shadow: 0 0 6px rgba(255, 100, 0, 0.6), 0 0 12px rgba(255, 200, 0, 0.4);
    }
    75% {
        height: 17px;
        top: -10px;
    }
}

@keyframes rise {
    0% {
        opacity: 0.7;
        transform: translateY(0) translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px) translateX(var(--tx, 0px));
    }
}

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

/* ==================== WISHES CONTAINER ==================== */

.wishes-container {
    width: min(600px, 100%);
    animation: fadeInUp 1.4s ease-out;
}

.wish-message {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 12px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.3px;
}

.secondary-message {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
    line-height: 1.5;
    letter-spacing: 0.3px;
}

/* ==================== BUTTONS ==================== */

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0 20px;
    margin-bottom: 12px;
    animation: fadeInUp 1.5s ease-out;
}

.party-button {
    padding: 13px 32px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
    position: relative;
    overflow: hidden;
    text-transform: lowercase;
    letter-spacing: 0.8px;
    animation: pulse 1s ease-in-out 1.8s infinite;
}

.party-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s ease;
}

.party-button:hover::before {
    left: 100%;
}

.party-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.5);
}

.party-button:active {
    transform: translateY(-1px);
}

.party-button.secondary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.2);
    animation: pulse 1s ease-in-out 2s infinite;
}

.party-button.secondary:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.4);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ==================== FOOTER ==================== */

.footer {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    text-transform: lowercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    animation: fadeInUp 1.6s ease-out;
}

.footer p {
    margin: 0;
}

/* ==================== ANIMATIONS ==================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes nameGlow {
    0%, 100% {
        text-shadow: 0 0 8px rgba(0, 212, 255, 0.45), 0 0 18px rgba(0, 212, 255, 0.25);
    }
    50% {
        text-shadow: 0 0 14px rgba(0, 212, 255, 0.72), 0 0 28px rgba(0, 212, 255, 0.5);
    }
}

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

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

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ==================== PARTICLE EFFECTS ==================== */

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    opacity: 0.9;
}

.sparkle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

.firework {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

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

@media (max-width: 768px) {
    .intro-question {
        font-size: 0.9rem;
        letter-spacing: 0.6px;
    }

    .birthday-text {
        font-size: 2.8rem;
        letter-spacing: 2px;
    }

    .person-name {
        font-size: 1.6rem;
    }

    .person-age {
        font-size: 0.9rem;
    }

    .wish-message {
        font-size: 1rem;
    }

    .secondary-message {
        font-size: 0.85rem;
    }

    .cake {
        width: 140px;
        height: 115px;
    }

    .layer {
        width: 140px;
        height: 32px;
    }

    .candles {
        gap: 18px;
    }

    .party-button {
        padding: 12px 26px;
        font-size: 0.85rem;
    }

    .main-section {
        gap: 18px;
        margin: 10px 0;
    }

    .header {
        margin-bottom: 14px;
    }

    .content {
        padding: 16px 14px;
    }
}


@media (max-width: 480px) {
    .birthday-text {
        font-size: 2rem;
        letter-spacing: 1.5px;
    }

    .person-name {
        font-size: 1.3rem;
    }

    .person-age {
        font-size: 0.8rem;
    }

    .wish-message {
        font-size: 0.9rem;
    }

    .secondary-message {
        font-size: 0.8rem;
    }

    .cake {
        width: 120px;
        height: 100px;
    }

    .layer {
        width: 120px;
        height: 28px;
    }

    .candles {
        gap: 15px;
        top: -30px;
    }

    .candle {
        width: 8px;
        height: 22px;
    }

    .party-button {
        padding: 11px 22px;
        font-size: 0.8rem;
    }

    .button-group {
        gap: 10px;
    }

    .footer {
        font-size: 0.75rem;
    }

    .content {
        padding: 14px 12px;
    }

    .main-section {
        gap: 14px;
        margin: 8px 0;
    }

    .barman-signature {
        gap: 10px;
        margin-top: 18px;
    }
}

@media (max-height: 850px) {
    .birthday-text {
        font-size: clamp(2rem, 5.5vh, 3rem);
    }

    .person-name {
        font-size: clamp(1.15rem, 3.2vh, 1.8rem);
        min-height: 42px;
    }

    .cake {
        width: 130px;
        height: 106px;
    }

    .layer {
        width: 130px;
        height: 30px;
    }

    .layer-2 {
        bottom: 34px;
    }

    .layer-3 {
        bottom: 68px;
    }

    .candles {
        top: -30px;
        gap: 16px;
    }

    .wish-message {
        font-size: 1rem;
        line-height: 1.45;
    }

    .secondary-message {
        font-size: 0.85rem;
        line-height: 1.35;
    }
}
