:root {
    --bg-dark: #050507;
    --text-mysterious: #e0e0e0;
    --accent-mysterious: #6c5ce7;
    --bg-birthday: #ffffff;
    --text-birthday: #2d3436;
    --accent-birthday: #ff7675;
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Cinzel', serif;
}

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

body {
    font-family: var(--font-main);
    overflow: hidden;
    background-color: var(--bg-dark);
}

#app {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Mysterious Countdown Theme Refinement */
#countdown-view {
    background: #050507;
    color: var(--text-mysterious);
}

.background-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.fog-layer {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle at center, rgba(108, 92, 231, 0.05) 0%, transparent 60%);
    filter: blur(80px);
}

.fog-1 {
    animation: fogMove 20s linear infinite;
}

.fog-2 {
    animation: fogMove 25s linear infinite reverse;
    background: radial-gradient(circle at center, rgba(130, 88, 159, 0.03) 0%, transparent 60%);
}

@keyframes fogMove {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(-5%, 5%) rotate(180deg);
    }

    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

.grain-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://www.transparenttextures.com/patterns/60-lines.png');
    opacity: 0.03;
    pointer-events: none;
}

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

.mysterious-text {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: 0.6rem;
    margin-bottom: 4rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(108, 92, 231, 0.3);
    max-width: 900px;
    margin: 0 auto 4rem auto;
    line-height: 1.4;
}

.wave-word {
    display: inline-block;
    white-space: nowrap;
    vertical-align: middle;
}

.wave-char {
    display: inline-block;
    animation: wave 4s infinite ease-in-out;
    will-change: transform;
}

@keyframes wave {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
        text-shadow: 0 0 15px rgba(108, 92, 231, 0.5);
    }
}

.timer {
    display: flex;
    gap: 3rem;
    justify-content: center;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, text-shadow 0.3s ease;
    cursor: default;
}

.time-block:hover {
    transform: scale(1.05);
    text-shadow: 0 0 25px rgba(108, 92, 231, 0.6);
}

.time-block span {
    font-size: 5rem;
    font-weight: 300;
    color: #fff;
    font-family: var(--font-main);
    letter-spacing: -2px;
}

.time-block label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    opacity: 0.4;
    margin-top: 1rem;
    font-weight: 700;
}

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

.magic-particle {
    position: absolute;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: magicFloat 10s ease-in-out infinite;
}

@keyframes magicFloat {
    0% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }

    20% {
        opacity: 0.6;
    }

    80% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

.magic-symbol {
    position: absolute;
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 10;
    animation: spawnSymbol 1s ease-out forwards;
    color: var(--accent-mysterious);
    text-shadow: 0 0 10px var(--accent-mysterious);
}

@keyframes spawnSymbol {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -150%) scale(1.5) rotate(360deg);
        opacity: 0;
    }
}

.charm {
    position: absolute;
    color: rgba(255, 255, 255, 0.2);
    font-size: 1.5rem;
    animation: drift 15s linear infinite;
}

@keyframes drift {
    from {
        transform: translateX(-10vw) rotate(0deg);
    }

    to {
        transform: translateX(110vw) rotate(360deg);
    }
}

/* Birthday Celebration Theme */
#birthday-view {
    background: radial-gradient(circle at center, #0a0a1a 0%, #020205 100%);
        color: #fff;
        overflow: hidden;
        flex-direction: column;
    }

    #birthday-canvas {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
    }

    #birthday-view .content {
        position: relative;
        z-index: 2;
        pointer-events: none;
}

.birthday-text {
    font-family: var(--font-heading);
    font-size: 6rem;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 0 10px 30px rgba(255, 118, 117, 0.4), 0 0 100px rgba(255, 255, 255, 0.4);
    letter-spacing: -2px;
    display: block;
        width: 100%;
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .word {
        display: inline-block;
        white-space: nowrap;
}

.birthday-text span:not(.word) {
    display: inline-block;
    opacity: 0;
    transform-origin: bottom;
    animation: growFromBaseline 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes growFromBaseline {
    0% {
        transform: scaleY(0);
        opacity: 0;
        filter: blur(5px);
    }

    100% {
        transform: scaleY(1);
        opacity: 1;
        filter: blur(0);
    }
}
@keyframes popAndGlow {
    0% {
        transform: scale(0.5) translateY(50px);
        opacity: 0;
        filter: blur(10px);
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
        filter: blur(0);
    }
}

.sub-text {
    font-size: 1.8rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
        animation: fadeInSlide 1s ease-out 0.8s backwards;
    }

    @keyframes fadeInSlide {
        0% {
            opacity: 0;
            transform: translateY(20px);
        }

        100% {
            opacity: 1;
            transform: translateY(0);
        }
}

.celebration-icon {
    font-size: 4rem;
    margin-top: 2rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .mysterious-text {
        font-size: 1.8rem;
        letter-spacing: 0.3rem;
        padding: 0 1rem;
        margin-bottom: 2rem;
    }

    .timer {
        gap: 1.5rem;
        flex-wrap: wrap;
        width: 100%;
        max-width: 350px;
        margin: 0 auto;
    }

    .time-block {
        flex: 1 1 40%;
        min-width: 80px;
    }

    .time-block span {
        font-size: 3rem;
    }

    .time-block label {
        font-size: 0.6rem;
        letter-spacing: 2px;
    }

    .birthday-text {
        font-size: 2.5rem;
        padding: 0 1rem;
        line-height: 1.2;
    }

    .sub-text {
        font-size: 1.1rem;
        padding: 0 1.5rem;
    }

    .celebration-icon {
        font-size: 3rem;
    }
}

@media (max-width: 400px) {
    .timer {
        gap: 1rem;
    }

    .time-block span {
        font-size: 2.2rem;
    }
}
