/* =========================================
   GREAT MINDS — CEREBRAL V2 (No Gold)
   ========================================= */

body.greatminds {
    --bg-deep: #05070a;
    --neural-cyan: #22d3ee;
    --neural-purple: #818cf8;
    --neural-pink: #f472b6;
    --admin-neon: #a855f7; /* Synapse Purple replaces Gold */
    --glass: rgba(15, 23, 42, 0.7);
    --text-main: #f1f5f9;

    background-color: var(--bg-deep);
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(129, 140, 248, 0.08) 0%, transparent 80%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    color: var(--text-main);
}

/* 1. EXPANDED HUB LAYOUT */
.hub-main-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5rem; /* Massive vertical space between nodes */
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* 2. DYNAMIC BRAIN NODES */
.brain-node {
    background: var(--glass);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5rem; /* High internal space */
    width: 100%;
    /* Organic Blob Shape */
    border-radius: 60% 40% 70% 30% / 40% 50% 60% 50%;
    box-shadow: 0 0 50px rgba(34, 211, 238, 0.05);
    transition: all 0.8s ease-in-out;
    animation: brain-morph 12s infinite alternate ease-in-out;
}

@keyframes brain-morph {
    0%   { border-radius: 60% 40% 70% 30% / 40% 50% 60% 50%; }
    100% { border-radius: 40% 60% 30% 70% / 50% 60% 40% 60%; }
}

/* 3. ADMIN CONSOLE (Neon Purple Link) */
.btn-admin-console {
    display: inline-block;
    border: 2px solid var(--admin-neon);
    color: var(--admin-neon);
    background: transparent;
    padding: 1.2rem 4rem;
    border-radius: 50px;
    text-transform: uppercase;
    font-weight: 900;
    text-decoration: none;
    letter-spacing: 2px;
    transition: 0.3s;
}

.btn-admin-console:hover {
    background: var(--admin-neon);
    color: #fff;
    box-shadow: 0 0 40px var(--admin-neon);
}

/* 4. CLOUD BUTTONS (Resume/Join) */
.btn-brain-link, .btn-brain {
    display: inline-block;
    background: linear-gradient(135deg, var(--neural-cyan), var(--neural-purple));
    color: #000;
    padding: 1.2rem 4rem;
    border-radius: 50px 50px 50px 50px / 80% 80% 40% 40%;
    font-weight: 900;
    text-decoration: none;
    text-transform: uppercase;
    box-shadow: 0 10px 30px rgba(34, 211, 238, 0.3);
    cursor: pointer;
}

.btn-brain-link:hover, .btn-brain:hover {
    transform: scale(1.05) translateY(-5px);
    filter: brightness(1.2);
}

/* Floating Success Pulse */
.success-pulse {
    position: fixed;
    top: 5rem;
    left: 50%;
    transform: translateX(-50%);
    width: auto !important;
    min-width: 300px;
    padding: 2rem 4rem !important;
    z-index: 9999;
    border-color: var(--neural-cyan);
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.2);
    pointer-events: none; /* Allows clicking through the message */
}

.pulse-text {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--neural-cyan);
    margin: 0;
}

/* Faster, reactive morphing on hover */
.brain-node:hover {
    transform: scale(1.02);
    animation-duration: 4s; /* Speeds up the morphing when you "touch" it */
    box-shadow: 0 0 60px rgba(34, 211, 238, 0.15);
    filter: brightness(1.1);
}

/* Scroll-based movement trigger (using standard CSS) */
@media (prefers-reduced-motion: no-preference) {
    .hub-main-flow .brain-node {
        view-timeline-name: --node-scroll;
        view-timeline-axis: block;
        
        /* This makes the blob "wiggle" or shift slightly as it enters the viewport */
        animation-name: brain-morph, scroll-wiggle;
        animation-timeline: auto, --node-scroll;
        animation-range: entry 10% cover 50%;
    }
}

/* --- NEURAL BREATHING PULSE --- */

@keyframes brain-breathe {
    0% {
        transform: scale(1);
        box-shadow: 0 0 40px rgba(34, 211, 238, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    50% {
        transform: scale(1.02); /* Expands slightly outward */
        box-shadow: 0 0 60px rgba(129, 140, 248, 0.15); /* Pulse of purple/cyan glow */
        border-color: rgba(34, 211, 238, 0.3); /* Lines become more vivid */
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 40px rgba(34, 211, 238, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

.brain-node {
    /* Layering the breathing pulse on top of the existing morphing */
    animation: 
        brain-morph 12s infinite alternate ease-in-out, 
        brain-breathe 8s infinite ease-in-out;
    transition: all 0.8s ease-in-out; /* Smooths out the "inhale/exhale" */
}

/* Speed up the breathing when the user is active on the node */
.brain-node:hover {
    animation-duration: 4s, 3s; /* Morphs faster, breathes faster */
    filter: brightness(1.1);
}

/* --- NEURAL SYNAPSE NAVIGATION --- */

.synapse-navigation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* Allows clicking the game box in the middle */
    z-index: 100;
}

.synapse-link {
    pointer-events: auto; /* Re-enables clicking for the bubbles */
    position: absolute;
    width: 80px;
    height: 80px;
    background: var(--glass);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: brain-morph 8s infinite alternate ease-in-out; /* Uses your existing morph */
}

/* Individual Drift Positions */
.link-rules { top: 15%; left: 10%; animation-delay: 0s; }
.link-lobby { top: 10%; right: 15%; animation-delay: 2s; }
.link-stats { bottom: 20%; left: 15%; animation-delay: 4s; }

/* The 'Focus' Effect */
.synapse-link:hover {
    width: 140px;
    height: 140px;
    background: rgba(34, 211, 238, 0.1);
    border-color: var(--neural-cyan);
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.2);
    z-index: 1000;
}

.synapse-label {
    font-size: 0.6rem;
    color: var(--neural-cyan);
    font-weight: 800;
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.synapse-link:hover .synapse-label {
    opacity: 1;
}