:root {
    /* Theme: Dark (Default/Glitch) */
    --bg-color: #050505;
    --text-color: #eeeeee;
    --accent-color: #ff3b30;
    --font-system: 'Inter', sans-serif;
    --font-warm: 'Playfair Display', serif;

    /* Dynamic Theme Variables (Will be updated by JS) */
    --reveal-bg: #fffcf2;
    /* Morning Cream */
    --reveal-text: #2c2c2c;
    --reveal-accent: #d62828;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    /* No selecting text */
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-system);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    /* Disable scrolling */
    display: flex;
    justify-content: center;
    align-items: center;
}

#app-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* --- PHASES --- */
.phase {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.phase.active {
    opacity: 1;
    pointer-events: all;
    z-index: 10;
}

.phase.hidden {
    display: none;
}

/* --- PHASE 0: START --- */
#phase-0 {
    background: var(--bg-color);
}

.ghost-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
}

.fade-in-text {
    animation: fadeInPulse 3s infinite;
    font-size: 0.9rem;
    letter-spacing: 2px;
    opacity: 0.7;
    text-transform: uppercase;
}

/* --- PHASE 1: LOCKED --- */
#gate-message {
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.subtext {
    font-size: 1rem;
    opacity: 0.6;
}

/* --- PHASE 2: GLITCH --- */
#phase-2 {
    background: #000;
    font-family: 'Courier New', monospace;
    align-items: flex-start;
    padding: 2rem;
}

.status-line {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.dim {
    opacity: 0.5;
}

.typing-cursor::after {
    content: '█';
    display: inline-block;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    color: var(--accent-color);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Glitch Shake Animation Class (JS triggers this) */
.shake-screen {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both infinite;
}

/* --- PHASE 3: REVEAL --- */
#phase-3 {
    background-color: var(--reveal-bg);
    color: var(--reveal-text);
    font-family: var(--font-warm);
    transition: background-color 1.5s ease;
}

.content-layer {
    text-align: center;
    padding: 2rem;
    z-index: 5;
    transform: translateZ(20px);
    /* 3D effect prep */
}

#reveal-title {
    font-size: 2.5rem;
    color: var(--reveal-accent);
    margin-bottom: 1.5rem;
    font-style: italic;
}

#reveal-body {
    font-size: 1.2rem;
    line-height: 1.6;
    min-height: 3rem;
    /* Prevent layout jump during typing */
}

.sms-link {
    margin-top: 3rem;
    display: inline-block;
    text-decoration: none;
    border-bottom: 1px solid var(--reveal-accent);
    color: var(--reveal-accent);
    font-family: var(--font-system);
    font-size: 0.9rem;
    padding-bottom: 4px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}



.sms-link:hover {
    opacity: 1;
}

/* --- NEW FOOTER ACTIONS --- */
.footer-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3rem;
    pointer-events: all;
    width: 100%;
}

.meta-links {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-end;
    /* Align baselines */
    gap: 1.5rem;
    flex-wrap: wrap;
    /* Safe wrapping for mobile */
}

/* Text Links in Footer */
.footer-link {
    text-decoration: none;
    color: var(--reveal-accent);
    font-family: var(--font-system);
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    border-bottom: 1px solid transparent;
    white-space: nowrap;
}

.footer-link:hover {
    opacity: 1;
    border-bottom: 1px solid var(--reveal-accent);
}

.sms-link {
    /* Main CTA - make it stand out a bit more than meta links */
    display: inline-block;
    text-decoration: none;
    border-bottom: 1px solid var(--reveal-accent);
    color: var(--reveal-accent);
    font-family: var(--font-system);
    font-size: 1rem;
    padding-bottom: 4px;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.sms-link:hover {
    opacity: 1;
    transform: scale(1.02);
}


/* --- MUSIC CONTROLS (Bottom of Phase 3) --- */
.music-controls {
    position: absolute;
    bottom: 1rem;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    z-index: 10;
    pointer-events: all;
}

.song-pick {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--reveal-text);
    font-family: var(--font-system);
    font-size: 0.6rem;
    font-style: italic;
    opacity: 0.3;
    transition: opacity 0.3s ease;
    padding: 0.2rem 0;
    pointer-events: all;
    white-space: nowrap;
    border-bottom: 1px solid transparent;
}

.song-pick:hover {
    opacity: 0.7;
}

.song-pick.active-song {
    opacity: 0.5;
    cursor: default;
    border-bottom: 1px solid var(--reveal-accent);
}

.song-divider {
    color: var(--reveal-text);
    font-size: 0.6rem;
    opacity: 0.2;
    pointer-events: none;
}

/* --- ANIMATIONS --- */
@keyframes fadeInPulse {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0.3;
    }
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

}


/* --- FLOATING HEARTS (Background) --- */
.heart-layer {
    position: absolute;
    top: -10%;
    /* Oversize to prevent edges showing */
    left: -10%;
    width: 120%;
    height: 120%;
    overflow: hidden;
    z-index: 1;
    /* Behind content text */
    pointer-events: none;

    /* Parallax Movement */
    transform: translate3d(var(--bg-x, 0), var(--bg-y, 0), 0);
    transition: transform 0.1s ease-out;
    /* Smooth out jitter */
}

.bg-heart {
    position: absolute;
    bottom: -10vh;
    /* Start below screen */
    color: var(--reveal-accent);
    opacity: 0.2;
    font-size: 2rem;
    animation: floatUp linear forwards;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(-120vh) rotate(360deg);
        opacity: 0;
    }
}