/* ==========================================================================
   CONSTELLATION — Romantic Birthday Experience CSS
   Tailored for Ani Tri Astuti | 26th Birthday Celebration
   ========================================================================== */

:root {
    --bg-primary: #030712;
    --bg-secondary: #0b112c;
    --bg-tertiary: #111b3e;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-accent-gold: #fde047;
    --text-accent-cyan: #7dd3fc;
    --text-glow-gold: rgba(253, 224, 71, 0.6);
    --text-glow-cyan: rgba(56, 189, 248, 0.5);

    --gold-gradient: linear-gradient(135deg, #fffbeb 0%, #fde047 50%, #f59e0b 100%);
    --cyan-gradient: linear-gradient(135deg, #f0fdf4 0%, #7dd3fc 50%, #38bdf8 100%);
    --card-bg: rgba(11, 17, 44, 0.72);
    --card-border: rgba(255, 255, 255, 0.12);

    --font-heading: 'Cinzel', serif;
    --font-serif: 'Cormorant Garamond', serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- RESET & BASE --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    user-select: none;
    -webkit-user-select: none;
}

/* --- BACKGROUND CANVAS --- */
#universe-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: auto;
}

/* --- AUDIO CONTROLLER PILL --- */
.audio-controller {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 50;
}

.audio-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: var(--font-body);
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.audio-btn:hover {
    color: var(--text-primary);
    border-color: rgba(125, 211, 252, 0.4);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.audio-btn.playing {
    color: var(--text-accent-cyan);
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.audio-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.audio-btn.playing .audio-bar {
    width: 2px;
    background-color: var(--text-accent-cyan);
    border-radius: 1px;
    animation: soundWaves 1.2s ease-in-out infinite alternate;
}

.audio-bar:nth-child(1) { height: 4px; animation-delay: 0.1s; }
.audio-bar:nth-child(2) { height: 10px; animation-delay: 0.3s; }
.audio-bar:nth-child(3) { height: 6px; animation-delay: 0.2s; }

@keyframes soundWaves {
    0% { height: 3px; }
    100% { height: 12px; }
}

/* --- MAIN CONTAINER & SCENES --- */
#app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scene {
    position: absolute;
    width: 100%;
    max-width: 780px;
    padding: 24px;
    text-align: center;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.scene.hidden {
    display: none !important;
}

/* --- ELEGANT BUTTONS --- */
.celestial-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    padding: 14px 36px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 255, 255, 0.05);
    margin-top: 32px;
}

.celestial-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s ease;
}

.celestial-btn:hover {
    border-color: rgba(253, 224, 71, 0.6);
    color: #fffbeb;
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(253, 224, 71, 0.3);
}

.celestial-btn:hover::before {
    left: 100%;
}

.celestial-btn:active {
    transform: translateY(1px);
}

/* --- SCENE 1: OPENING --- */
.poetic-line {
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 4vw, 2.1rem);
    font-weight: 400;
    font-style: italic;
    line-height: 1.6;
    color: rgba(248, 250, 252, 0.9);
    letter-spacing: 0.02em;
    margin-bottom: 12px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.poetic-line.gold {
    color: var(--text-accent-gold);
    text-shadow: 0 0 25px var(--text-glow-gold);
}

/* --- SCENE 2: CONSTELLATION --- */
#scene-constellation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    padding: 0;
    pointer-events: none;
}

.constellation-guide {
    position: absolute;
    top: clamp(20px, 5vh, 48px);
    left: 0;
    width: 100%;
    padding: 0 20px;
    text-align: center;
    pointer-events: auto;
}

.guide-title {
    font-family: var(--font-heading);
    font-size: clamp(0.95rem, 3.6vw, 1.35rem);
    letter-spacing: 0.12em;
    color: rgba(248, 250, 252, 0.9);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.guide-subtitle {
    font-size: clamp(0.78rem, 2.8vw, 0.9rem);
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

.progress-container {
    position: absolute;
    bottom: clamp(20px, 5vh, 44px);
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 20px;
    pointer-events: auto;
}

.constellation-progress-track {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.2);
}

.prog-dot.active {
    color: var(--text-accent-gold);
    text-shadow: 0 0 10px var(--text-glow-gold);
    transform: scale(1.2);
    transition: all 0.3s ease;
}

.prog-line.active {
    color: var(--text-accent-cyan);
    text-shadow: 0 0 8px var(--text-glow-cyan);
}

/* --- SCENE 3: NAME REVEAL --- */
.hero-name {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 6.5vw, 4.5rem);
    font-weight: 700;
    letter-spacing: 0.22em;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(253, 224, 71, 0.4);
    margin: 24px 0;
    animation: subtleBreathe 4s ease-in-out infinite alternate;
}

@keyframes subtleBreathe {
    0% { filter: drop-shadow(0 0 15px rgba(253, 224, 71, 0.3)); }
    100% { filter: drop-shadow(0 0 35px rgba(253, 224, 71, 0.6)); }
}

/* --- SCENE 4: BIRTHDAY MILESTONE --- */
.bday-date-tag {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 2.5vw, 1.15rem);
    font-weight: 600;
    letter-spacing: 0.3em;
    color: var(--text-accent-cyan);
    text-shadow: 0 0 15px var(--text-glow-cyan);
    margin-bottom: 20px;
    text-transform: uppercase;
}

.age-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0 24px;
}

.age-halo {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(253, 224, 71, 0.2) 0%, transparent 70%);
    animation: pulseHalo 3s ease-in-out infinite;
}

@keyframes pulseHalo {
    0%, 100% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.9; }
}

.age-number {
    font-family: var(--font-heading);
    font-size: clamp(3.5rem, 10vw, 6rem);
    font-weight: 700;
    line-height: 1;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(253, 224, 71, 0.5));
}

.bday-heading {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-style: italic;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
    margin-top: 16px;
}

.stardust-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.stardust-mote {
    position: absolute;
    width: 3px;
    height: 3px;
    background-color: #fde047;
    border-radius: 50%;
    box-shadow: 0 0 8px #fde047;
    opacity: 0;
    animation: floatMote linear infinite;
}

@keyframes floatMote {
    0% { transform: translateY(20px) scale(0.5); opacity: 0; }
    50% { opacity: 0.8; }
    100% { transform: translateY(-80px) scale(1.2); opacity: 0; }
}

/* --- SCENE 5: PERSONAL MESSAGE ORB & LETTER --- */
.orb-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.star-orb {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffffff 0%, #fde047 40%, #eab308 100%);
    box-shadow: 0 0 40px rgba(253, 224, 71, 0.8), 0 0 80px rgba(253, 224, 71, 0.3);
    cursor: pointer;
    animation: floatOrb 4s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.star-orb:hover {
    transform: scale(1.15);
}

.orb-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1.5px solid rgba(253, 224, 71, 0.6);
    animation: orbPulseRipple 2s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

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

@keyframes orbPulseRipple {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

.letter-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: clamp(20px, 4vw, 40px);
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    margin: 0 auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(56, 189, 248, 0.1);
}

.letter-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    letter-spacing: 0.2em;
    color: var(--text-accent-gold);
    margin-bottom: 20px;
    text-transform: uppercase;
}

.letter-body {
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 2.8vw, 1.35rem);
    line-height: 1.8;
    color: rgba(248, 250, 252, 0.95);
    font-style: italic;
    text-align: justify;
    text-justify: inter-word;
    margin-bottom: 24px;
}

/* --- SCENE 6: FINAL HORIZON --- */
.final-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 6vw, 3.8rem);
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #ffffff;
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
    margin: 16px 0 8px;
}

.final-date {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.35em;
    color: var(--text-accent-gold);
    margin-bottom: 20px;
}

.final-dedication {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-style: italic;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.secret-puzzle-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 16px auto 12px;
    padding: 10px 22px;
    background: rgba(253, 224, 71, 0.08);
    border: 1px dashed rgba(253, 224, 71, 0.45);
    border-radius: 9999px;
    color: var(--text-accent-gold);
    font-size: clamp(0.78rem, 2.8vw, 0.9rem);
    font-family: var(--font-body);
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 20px rgba(253, 224, 71, 0.15);
    animation: secretGlowPulse 2.5s ease-in-out infinite alternate;
}

.secret-puzzle-badge:hover {
    background: rgba(253, 224, 71, 0.18);
    border-color: rgba(253, 224, 71, 0.9);
    border-style: solid;
    transform: scale(1.04) translateY(-1px);
    box-shadow: 0 0 30px rgba(253, 224, 71, 0.4);
}

.secret-sparkle {
    font-size: 1rem;
    animation: sparkleSpin 3s linear infinite;
}

@keyframes secretGlowPulse {
    0% { transform: scale(0.98); opacity: 0.85; }
    100% { transform: scale(1.02); opacity: 1; filter: drop-shadow(0 0 10px rgba(253, 224, 71, 0.4)); }
}

@keyframes sparkleSpin {
    0% { transform: rotate(0deg) scale(0.9); }
    50% { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(0.9); }
}

/* --- EASTER EGG MODAL --- */
.easter-egg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.easter-egg-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.easter-egg-box {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(253, 224, 71, 0.4);
    border-radius: 20px;
    padding: clamp(24px, 4vw, 36px) 24px;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(253, 224, 71, 0.25);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.easter-egg-modal.visible .easter-egg-box {
    transform: translateY(0) scale(1);
}

.egg-icon {
    font-size: 2rem;
    color: var(--text-accent-gold);
    margin-bottom: 12px;
}

.egg-text {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-style: italic;
    line-height: 1.7;
    color: #fffbeb;
    margin-bottom: 16px;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
    .audio-controller {
        top: 16px;
        right: 16px;
    }

    .audio-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .scene {
        padding: 16px;
    }

    .constellation-guide {
        top: 20px;
    }

    .progress-container {
        bottom: 24px;
    }

    .celestial-btn {
        padding: 12px 28px;
        font-size: 0.88rem;
    }

    .letter-card {
        padding: 20px;
    }

    .letter-body {
        font-size: 1.05rem;
        line-height: 1.65;
    }
}
