* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'EB Garamond', 'Georgia', serif;
    background-color: #050505;
    background-image:
        radial-gradient(circle at 50% 50%, #111 0%, #050505 60%, #000 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #b0b0b0;
    overflow: hidden;
    position: relative;
}

/* Cinematic film grain & vignette */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 1000;
    mix-blend-mode: overlay;
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.9);
}

/* Ethereal Message Area */
.message-area {
    position: absolute;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.4rem;
    font-weight: 300;
    /* Lighter weight for elegance */
    color: #e0e0e0;
    max-width: 650px;
    z-index: 20;
    line-height: 1.6;
    text-align: center;
    letter-spacing: 0.06em;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);

    /* Blur-in animation for new texts */
    opacity: 1;
    filter: blur(0px);
    transition: opacity 0.5s ease, filter 0.5s ease;
}

.message-area.fade {
    opacity: 0;
    filter: blur(10px);
}

/* The Button - An Altar/Physical Object */
.main-button {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: none;
    background: radial-gradient(circle at 30% 30%, #1a1a1a, #080808);

    /* Physical depth shadows */
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        /* Tiny edge detail */
        inset 10px 10px 20px rgba(0, 0, 0, 0.8),
        /* Deep inner shadow */
        inset -5px -5px 15px rgba(255, 255, 255, 0.02),
        /* Subtle rim light reflection */
        15px 15px 30px rgba(0, 0, 0, 0.6),
        /* Drop shadow */
        -5px -5px 20px rgba(25, 25, 25, 0.05);
    /* Ambient light top-left */

    color: #4a4a4a;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'EB Garamond', serif;
    letter-spacing: 0.3em;
    text-transform: lowercase;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;

    /* Breathing Rim Light Effect */
    animation: breathingLight 6s ease-in-out infinite;
}

@keyframes breathingLight {

    0%,
    100% {
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 15px 15px 30px rgba(0, 0, 0, 0.6);
    }

    50% {
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), 15px 15px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(200, 200, 200, 0.02);
    }
}

.main-button::after {
    /* Inner concave feel */
    content: '';
    position: absolute;
    width: 70%;
    height: 70%;
    border-radius: 50%;
    background: radial-gradient(circle at 70% 70%, #0a0a0a, #141414);
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.5), inset -1px -1px 2px rgba(255, 255, 255, 0.05);
    z-index: 1;
}

.main-button span {
    z-index: 2;
    /* Text above inner circle */
    opacity: 0.6;
    transition: opacity 0.3s;
}

.main-button:hover {
    transform: scale(1.02);
    color: #777;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        20px 20px 40px rgba(0, 0, 0, 0.7);
}

.main-button:hover span {
    opacity: 0.9;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.main-button:active {
    transform: scale(0.96);
    background: #050505;
    box-shadow:
        inset 5px 5px 15px rgba(0, 0, 0, 0.9),
        inset -1px -1px 5px rgba(50, 50, 50, 0.1);
}

/* Subtle pulse - barely noticeable */
@keyframes subtlePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(80, 80, 80, 0);
    }

    50% {
        box-shadow: 0 0 40px 0 rgba(80, 80, 80, 0.08);
    }
}

.main-button.pulse {
    animation: subtlePulse 4s ease-in-out infinite;
}

/* Golden Ripple - Fibonacci Effect */
.ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid #C5A059;
    /* Golden */
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
    pointer-events: none;
    animation: expandRipple 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    z-index: -1;
}

@keyframes expandRipple {
    0% {
        width: 100%;
        height: 100%;
        opacity: 0.8;
        border-width: 2px;
    }

    100% {
        width: 180%;
        /* Expand well beyond button */
        height: 180%;
        opacity: 0;
        border-width: 0px;
    }
}

.main-button.golden-border {
    border-color: #C5A059 !important;
    box-shadow: 0 0 20px rgba(197, 160, 89, 0.3);
    transition: all 0.5s ease;
}

/* Counters - very understated */
.counters {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4rem;
    align-items: center;
}

.counter {
    text-align: center;
}

.counter-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 400;
    color: #666;
    letter-spacing: 0.05em;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.4rem;
}

.counter-label {
    font-size: 0.7rem;
    font-weight: 400;
    color: #444;
    letter-spacing: 0.15em;
    text-transform: lowercase;
}

/* Copy button - almost invisible */
/* Share button - minimal */
.share-button {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: 1px solid #333;
    /* Slightly darker border */
    color: #555;
    /* Slightly darker icon */
    border-radius: 50%;
    /* Circular */
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.share-button svg {
    pointer-events: none;
}


.share-button:hover {
    border-color: #333;
    color: #666;
}

.share-button.generating {
    animation: pulse 1.5s infinite;
}

/* Record label - minimal */
/* Mute button - minimal */
.mute-button {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(100, 100, 100, 0.2);
    /* Subtle border for visibility */
    padding: 8px 16px;
    border-radius: 20px;
    color: #777;
    /* Higher contrast */
    font-size: 0.7rem;
    font-family: 'EB Garamond', 'Georgia', serif;
    letter-spacing: 0.1em;
    text-transform: lowercase;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.8;
    /* More visible default */
}

.mute-button:hover {
    color: #666;
    opacity: 1;
}

/* Record label - minimal */
.record-label {
    position: fixed;
    top: 2rem;
    right: 2rem;
    right: 2rem;
    font-size: 0.85rem;
    /* Slightly larger */
    color: #666;
    /* More visible */
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: lowercase;
    transition: all 0.5s ease;
}

.record-label span {
    color: #444;
    font-variant-numeric: tabular-nums;
}

.record-label.beaten {
    color: #555;
}

.record-label.beaten span {
    color: #666;
}

/* Hide unnecessary elements */
.bg-gradient,
.ambient-orb,
.scanlines,
.stats-divider {
    display: none;
}

/* Responsive Design - Mobile Optimized */
@media (max-width: 600px) {
    .main-button {
        width: 170px;
        /* Slightly smaller to prevent overlap */
        height: 170px;
        font-size: 1.3rem;
        /* Larger text */
        box-shadow:
            -3px -3px 8px rgba(255, 255, 255, 0.03),
            3px 3px 8px rgba(0, 0, 0, 0.5),
            inset 1px 1px 2px rgba(255, 255, 255, 0.05);
    }

    .message-area {
        top: 12%;
        /* Move higher up */
        font-size: 1.15rem;
        /* Slightly smaller font for better fit */
        max-width: 85%;
        /* Use full width */
        line-height: 1.5;
    }

    .counters {
        bottom: 20%;
        /* Move down slightly */
        gap: 3rem;
    }

    .counter-value {
        font-size: 1.6rem;
    }

    .record-label {
        font-size: 0.8rem;
        top: 1.5rem;
        right: 1.5rem;
    }

    .mute-button {
        bottom: 1.5rem;
        left: 1.5rem;
    }

    .share-button {
        bottom: 1.5rem;
    }
}

/* =========================================
   UI EVOLUTION SYSTEM (Fibonacci Progressive)
   ========================================= */

/* Stage 1: Fib 5 - The Awakening (Border) */
.evo-border {
    border: 1px solid #C5A059 !important;
    box-shadow: 0 0 20px rgba(197, 160, 89, 0.3);
}

/* Stage 2: Fib 8 - The Aura (Glow) */
.evo-glow {
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.2);
    animation: evoPulse 3s infinite ease-in-out;
}

@keyframes evoPulse {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(197, 160, 89, 0.2);
    }

    50% {
        box-shadow: 0 0 25px rgba(197, 160, 89, 0.4);
    }
}

/* Stage 3: Fib 13 - The Expansion (Title) */
.evo-title {
    letter-spacing: 0.3em !important;
    transition: letter-spacing 1s ease;
}

/* Stage 4: Fib 21 - The Atmosphere (Spotlight) */
.evo-spotlight::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    /* Fix for mobile overflow: Use viewport relative units or smaller fixed size */
    width: 600px;
    /* Fallback (redundant if checking bottom) or reference */
    /* Use simple vw/vh or clamp */
    width: 80vmin;
    /* 80% of smaller dimension */
    height: 80vmin;
    max-width: 600px;
    max-height: 600px;
    background: radial-gradient(circle, rgba(197, 160, 89, 0.03) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: -2;
    pointer-events: none;
    animation: spotlightBreath 8s infinite ease-in-out;
}

@keyframes spotlightBreath {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Stage 5: Fib 34 - The Ether (Particles) */
.evo-particles::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(rgba(197, 160, 89, 0.1) 1px, transparent 1px),
        radial-gradient(rgba(197, 160, 89, 0.1) 1px, transparent 1px);
    background-size: 50px 50px, 100px 100px;
    background-position: 0 0, 25px 25px;
    animation: particleDrift 20s linear infinite;
    z-index: -5;
    pointer-events: none;
}

@keyframes particleDrift {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-100px);
    }
}

/* Stage 6: Fib 55 - The Cycle (Rotation) */
.evo-rotate {
    animation: slowRotate 60s linear infinite;
}

@keyframes slowRotate {
    0% {
        transform: rotate(0deg);
    }

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

/* Stage 7: Fib 89 - The Pulse (Color Shift) */
.evo-color-shift {
    animation: colorShiftAnim 10s infinite alternate;
}

@keyframes colorShiftAnim {
    0% {
        border-color: rgba(197, 160, 89, 0.4);
        box-shadow: 0 0 20px rgba(197, 160, 89, 0.3);
    }

    100% {
        border-color: rgba(75, 0, 130, 0.5);
        box-shadow: 0 0 30px rgba(75, 0, 130, 0.4);
    }
}

/* Stage 8: Fib 144 - The Orbit (Dual Ring) */
.evo-dual-ring::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border: 1px dashed rgba(197, 160, 89, 0.2);
    border-radius: 50%;
    animation: reverseRotate 30s linear infinite;
    pointer-events: none;
}

@keyframes reverseRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}

/* Stage 9: Fib 233 - The Glitch */
.evo-glitch {
    animation: glitchAnim 5s infinite;
}

@keyframes glitchAnim {

    0%,
    95%,
    100% {
        transform: translate(0, 0);
        opacity: 1;
    }

    96% {
        transform: translate(-2px, 2px);
        opacity: 0.8;
    }

    97% {
        transform: translate(2px, -2px);
        opacity: 0.9;
    }

    98% {
        transform: translate(-1px, 1px);
        opacity: 1;
    }

    99% {
        transform: translate(1px, -1px);
        opacity: 0.7;
    }
}

/* Stage 9: Tremble (The Unease) */
.evo-tremble {
    animation: trembleAnim 0.1s infinite;
}

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

    25% {
        transform: translate(1px, 1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, -1px) rotate(-1deg);
    }

    75% {
        transform: translate(1px, -1px) rotate(0deg);
    }

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

/* Fix: If Rotate + Tremble are active, we need a combined animation or wrapper.
   For simplicity, Tremble overrides slightly or we use 'filter' for tremble? 
   Actually, let's use a subtle filter displacement or just accept jittery rotation. 
   Better: Tremble uses 'margin' or 'padding' hack? No.
   Let's let Tremble be a separate small animation. 
   Wait, 'animation' property overrides. We can't have both 'slowRotate' and 'trembleAnim' unless we list both.
*/
.evo-rotate.evo-tremble {
    animation: slowRotate 60s linear infinite, trembleAnim 0.1s infinite;
    /* Multi-animation support */
}

/* Stage 10: Hollow (The Void) */
.evo-hollow {
    background-color: transparent !important;
    border-width: 3px !important;
    /* Main color is inherited or set by border */
}

/* Stage 11: Echo (The Shadow) */
.evo-echo {
    box-shadow:
        0 0 0 10px rgba(197, 160, 89, 0.1),
        0 0 0 20px rgba(197, 160, 89, 0.05),
        0 0 20px rgba(197, 160, 89, 0.3) !important;
}

/* Stage 12: Vignette ( The Close-In) - Applied to Body */
.evo-vignette::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
    z-index: 100;
    /* Above most things, below clickable UI if needed. Share button is z-100. */
    opacity: 0;
    animation: fadeInVignette 3s forwards;
}

@keyframes fadeInVignette {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Stage 13: Dimension (The Shift) */
/* Requires changing rotation to 3D */
.evo-rotate.evo-3d {
    animation: slowRotate3d 60s linear infinite, trembleAnim 0.1s infinite;
}

@keyframes slowRotate3d {
    0% {
        transform: perspective(500px) rotate3d(1, 1, 1, 0deg);
    }

    100% {
        transform: perspective(500px) rotate3d(1, 1, 1, 360deg);
    }
}

/* Stage 14: Ascend (The Climax) */
.evo-ascend {
    background-color: #fff !important;
    border-color: #fff !important;
    color: #000 !important;
    box-shadow:
        0 0 50px rgba(255, 255, 255, 0.8),
        0 0 100px rgba(255, 255, 255, 0.4) !important;
    mix-blend-mode: screen;
}


/* Share Modal Styles */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    animation: fadeInOverlay 0.3s forwards;
}

@keyframes fadeInOverlay {
    to {
        opacity: 1;
    }
}

.share-modal {
    background: #111;
    border: 1px solid #333;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    animation: popInModal 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popInModal {
    to {
        transform: scale(1);
    }
}

.share-title {
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.1em;
}

.share-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #333;
    padding: 1rem;
    width: 100%;
    margin-bottom: 0.8rem;
    color: #ccc;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    border-radius: 8px;
    text-decoration: none;
    /* For the link */
}

.share-option-btn:hover {
    background: #1a1a1a;
    border-color: #555;
    transform: translateY(-2px);
}

.share-option-btn span {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.share-option-btn small {
    font-size: 0.7rem;
    color: #666;
}

.support-btn {
    border-color: #C5A059;
    color: #e0c080;
}

.support-btn:hover {
    background: rgba(197, 160, 89, 0.1);
    border-color: #e0c080;
}

.support-btn small {
    color: #a88a55;
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: #555;
    margin-top: 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

/* Corruption Effects - FIXED */
.blur-out {
    filter: blur(8px) !important;
    opacity: 0.3 !important;
    transition: all 1s ease;
}

body.glitch-active::before {
    opacity: 0.3 !important;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E") !important;
    animation: noiseAnim 0.2s infinite;
}

@keyframes noiseAnim {
    0% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-5%, -5%);
    }

    20% {
        transform: translate(-10%, 5%);
    }

    30% {
        transform: translate(5%, -10%);
    }

    40% {
        transform: translate(-5%, 15%);
    }

    50% {
        transform: translate(-10%, 5%);
    }

    60% {
        transform: translate(15%, 0);
    }

    70% {
        transform: translate(0, 10%);
    }

    80% {
        transform: translate(-15%, 0);
    }

    90% {
        transform: translate(10%, 5%);
    }

    100% {
        transform: translate(5%, 0);
    }
}

.button-resisting {
    transition: transform 0.8s cubic-bezier(0.5, 0, 0, 1) !important;
    /* Sluggish */
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.9) !important;
    filter: grayscale(100%) contrast(150%);
}

.button-resisting:active {
    transform: scale(0.99) !important;
    /* Barely moves */
}



.close-modal-btn:hover {
    color: #999;
}

/* =========================================
   ATMOSPHERIC MOODS (Narrative Resonance)
   ========================================= */

/* Base transition for smooth matching of narrative tone */
body {
    transition: background 2s ease, filter 2s ease;
}

#mainButton {
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1),
        box-shadow 2s ease,
        border-color 2s ease,
        filter 2s ease;
}

/* MOOD: TENSION (Fast/Agitated) 
   Used for: Chaos, Pain
*/
body.mood-tension {
    background: radial-gradient(circle at center, #1a0505 0%, #000000 100%);
}

body.mood-tension #mainButton {
    box-shadow: 0 0 30px rgba(255, 50, 50, 0.15), inset 0 0 20px rgba(0, 0, 0, 0.8);
    border-color: #522;
    filter: contrast(1.2) sepia(0.2);
}

body.mood-tension #message {
    color: #e6b3b3;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
}

/* MOOD: ETHEREAL (Slow/Contemplative)
   Used for: Silence, Dream, Existence
*/
body.mood-ethereal {
    background: radial-gradient(circle at center, #0a1015 0%, #000000 100%);
    filter: contrast(0.9) brightness(1.1);
}

body.mood-ethereal #mainButton {
    box-shadow: 0 0 40px rgba(100, 200, 255, 0.1), inset 0 0 10px rgba(255, 255, 255, 0.02);
    border-color: #234;
}

body.mood-ethereal #message {
    color: #cceeff;
    text-shadow: 0 0 10px rgba(100, 200, 255, 0.2);
    font-weight: 300;
}

/* MOOD: COLD (Rational/Ego)
   Used for: Ego, Control, Purpose, Simulation
*/
body.mood-cold {
    background: #020202;
}

body.mood-cold #mainButton {
    border: 1px solid #333;
    box-shadow: none;
    background: #050505;
}

body.mood-cold #message {
    font-family: 'Courier New', monospace;
    /* Fallback safe font */
    letter-spacing: 2px;
}

/* MOOD: INTENSE (Compulsion/Deep Focus)
   Used for: Compulsion
*/
body.mood-intense {
    background: #000;
}

body.mood-intense #mainButton {
    box-shadow: 0 0 0 2px #333, 0 0 50px rgba(255, 100, 0, 0.1);
    animation: intense-pulse 4s infinite ease-in-out;
}

@keyframes intense-pulse {

    0%,
    100% {
        border-color: #333;
    }

    50% {
        border-color: #632;
    }
}