:root {
    --bg-deep: #0f0c29;
    --bg-purple: #302b63;
    --bg-gold: #24243e;
    --text-color: #ffffff;
    --accent-gold: #FFD700;
    --accent-purple: #9D50BB;
    /* Premium Glass Variables */
    --glass-bg: rgba(16, 12, 30, 0.75); /* Slightly more opaque for readability */
    --glass-border: rgba(255, 215, 0, 0.25);
    --glass-shine: rgba(255, 255, 255, 0.05);
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-deep);
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #2c2005 100%);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* Critical for preventing horizontal scroll */
    min-height: 100vh;
}

/* Typography & Global */
h1, h2, h3 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Premium Buttons */
.btn {
    display: inline-block;
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    z-index: 10;
    white-space: nowrap; /* Prevents text wrap on small buttons */
}

.btn-primary {
    background: linear-gradient(90deg, #FFD700 0%, #FDB931 50%, #FFD700 100%);
    background-size: 200% auto;
    color: #1a0b2e;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

    .btn-primary:hover {
        background-position: right center;
        transform: translateY(-3px);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    }

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    /* Initialize the variable to 0 (top of page) */
    --scroll-prog: 0;
    /* Smoothly reduce padding as we scroll */
    /* Starts at 25px, ends at 10px */
    padding: calc(25px - (var(--scroll-prog) * 15px)) 0;
    /* Background Fade: Transparent -> Dark Tint */
    background: rgba(0, 0, 0, calc(var(--scroll-prog) * 0.5));
    /* Blur Fade: 0px -> 20px */
    backdrop-filter: blur(calc(var(--scroll-prog) * 20px));
    -webkit-backdrop-filter: blur(calc(var(--scroll-prog) * 20px));
    /* Border Fade: Invisible -> Subtle Gold */
    border-bottom: 1px solid rgba(255, 215, 0, calc(var(--scroll-prog) * 0.15));
    /* We remove the 'transition' here so it locks instantly to your scroll finger */
}

.nav-content {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 50px;
}

.logo {
    /* ... keep your existing fonts/colors ... */
    font-weight: 800;
    background: linear-gradient(to right, #FFD700, #FDB931, #fffacd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 3px;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.2));
    position: absolute;
    white-space: nowrap;
    /* CRITICAL FIX: Disable CSS transitions so JS has full control */
    transition: none !important;
    /* Hardware acceleration to prevent text-shaking */
    will-change: transform, left, font-size;
    transform: translateZ(0);
    /* --- MATH FOR STRICT LEFT MOVEMENT --- */
    /* 1. SIZING: 2rem -> 1.2rem */
    font-size: calc(2rem - (var(--scroll-prog) * 0.8rem));
    /* 2. LEFT POSITION: 50% -> 20px */
    left: calc(50% - (var(--scroll-prog) * (50% - 20px)));
    /* 3. TRANSFORM: -50% (Centered) -> 0% (Left Aligned) */
    transform: translateX(calc(-50% + (var(--scroll-prog) * 50%)));
}

/* SCROLLED STATE: Move Left & Resize */
header.scrolled .logo {
    left: 20px; /* Moves to the left alignment */
    transform: translateX(0); /* Removes the centering offset */
    font-size: 1rem; /* Resizes the logo down */
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    background: transparent;
    padding-bottom: 80px;
    padding-top: 80px; /* Added top padding for mobile spacing */
}

    .hero::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: url('Images/Hero.jpg') no-repeat center top;
        background-size: cover;
        z-index: -1;
        opacity: 0.6;
        mix-blend-mode: overlay;
        -webkit-mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 90%);
        mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 90%);
    }

    .hero::after {
        content: '';
        position: absolute;
        inset: 0;
        z-index: -1;
        background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.5) 100%);
        pointer-events: none;
        -webkit-mask-image: linear-gradient(to bottom, black 0%, black 60%, transparent 95%);
        mask-image: linear-gradient(to bottom, black 0%, black 60%, transparent 95%);
    }

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 0 20px;
    margin-top: 50px;
}

.hero h1 {
    font-size: 5.5rem;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #ffffff 40%, #c77dff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

.hero p {
    font-size: 1.4rem;
    color: #e2e8f0;
    margin-bottom: 50px;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.features {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-bottom: 60px;
    flex-wrap: wrap; /* Allows items to wrap on small screens */
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    color: #FFD700;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* Games Section */
.games-section {
    padding: 50px 0 100px 0;
    position: relative;
    z-index: 2;
}

.section-title {
    text-align: center;
    font-size: 4rem;
    margin-bottom: 120px;
    background: linear-gradient(to bottom, #fff, #b8b8b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

    .section-title::after {
        content: '';
        display: block;
        width: 100px;
        height: 4px;
        background: #FFD700;
        margin: 20px auto 0;
        border-radius: 2px;
        box-shadow: 0 0 15px #FFD700;
    }

/* Card Layout */
.game-card {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 50px;
    margin-bottom: 150px;
    padding: 60px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5), inset 0 1px 0 var(--glass-shine), 0 20px 50px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
    align-items: center;
}

    .game-card::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle, rgba(255,215,0,0.1) 0%, transparent 70%);
        z-index: 0;
        pointer-events: none;
    }

/* Info Side */
.game-info-side {
    position: relative;
    z-index: 2;
    text-align: left;
    min-width: 0; /* Prevents flex/grid overflow issues */
}

.game-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
}

.game-icon {
    width: 100px;
    height: 100px;
    border-radius: 22px;
    object-fit: cover;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,215,0,0.3);
}

.game-title {
    font-size: 2.5rem;
    line-height: 1.1;
    background: linear-gradient(to right, #fff, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-desc {
    color: #ccc;
    font-size: 1.1rem;
    margin-bottom: 30px;
    font-weight: 300;
}

/* Visual Side */
.game-visual-side {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    background: rgba(0,0,0,0.3);
    padding: 20px 0;
    z-index: 1;
}

.carousel-container {
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.carousel-track {
    display: flex;
    gap: 20px;
    width: max-content;
    animation: scroll 35s linear infinite;
}

    .carousel-track:hover {
        animation-play-state: paused;
    }

.screenshot {
    height: 350px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

footer {
    padding: 80px 0;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    color: #94a3b8;
    background: rgba(10, 5, 20, 0.8);
    backdrop-filter: blur(10px);
}

/* =========================================
   MOBILE & TABLET RESPONSIVENESS
   ========================================= */

/* Tablet (Landscape/Portrait) */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 4rem;
    }

    .game-card {
        grid-template-columns: 1fr; /* Stack vertically */
        padding: 40px;
        text-align: center;
        gap: 30px;
    }

    .game-info-side {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .game-header {
        align-items: center;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    /* Adjust Fonts */
    .hero h1 {
        font-size: 2.8rem;
        margin-bottom: 15px;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2.5rem;
        margin-bottom: 50px;
    }

    .game-title {
        font-size: 2rem;
    }

    /* Stack Features */
    .features {
        flex-direction: column;
        gap: 25px;
    }

    /* Adjust Card for Mobile */
    .game-card {
        padding: 25px 20px; /* Much smaller padding */
        border-radius: 20px;
        margin-bottom: 80px;
        gap: 30px;
    }

    .game-icon {
        width: 80px;
        height: 80px;
    }

    /* Adjust Carousel for Mobile */
    .screenshot {
        height: 200px; /* Smaller images */
    }

    .game-visual-side {
        border-radius: 12px;
    }

    /* Adjust Buttons */
    .btn {
        padding: 14px 25px;
        font-size: 0.8rem;
        width: 100%; /* Full width buttons on mobile */
        text-align: center;
    }
}
