/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --bg-dark: #050810;
    --bg-deep: #020408;
    --bg-card: rgba(19, 27, 46, 0.7); /* Glass Effect Base */
    --primary-blue: #00baff;
    --primary-glow: rgba(0, 186, 255, 0.6);
    --accent-orange: #ff5e00;
    --text-gold: #ffd700;
    --text-white: #ffffff;
    --text-gray: #b0b3b8;
    --success-green: #00ff88;
    --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
    
    /* Layout Variables */
    --header-height: 60px;
    --container-max-width: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font-main); }

body { 
    background-color: var(--bg-dark); 
    color: var(--text-white); 
    overflow-x: hidden; 
    padding-bottom: 80px; /* Space for sticky footer */
    -webkit-font-smoothing: antialiased; /* Smoother fonts on Mobile */
}

a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul { list-style: none; }
img { max-width: 100%; display: block; } /* Prevent image overflow */

/* =========================================
   2. HEADER & RESPONSIVE NAV
   ========================================= */
.header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 20px; /* Reduced padding for mobile */
    height: var(--header-height);
    background: rgba(5, 8, 16, 0.9); /* Slightly more opaque */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
}

.logo { 
    font-size: 22px; /* Adjusted for mobile */
    font-weight: 900; 
    font-style: italic; 
    letter-spacing: -0.5px; 
    display: flex; align-items: center; 
    white-space: nowrap;
}
.logo span { color: var(--primary-blue); text-shadow: 0 0 10px var(--primary-glow); }

/* Desktop Navigation */
.nav-menu { display: flex; gap: 25px; align-items: center; }

.nav-link { 
    font-size: 15px; 
    font-weight: 500; 
    color: var(--text-gray); 
    position: relative; 
    padding: 5px 0;
}
.nav-link:hover, .nav-link.active { color: var(--text-white); }
.nav-link::after {
    content: ''; position: absolute; width: 0; height: 2px; bottom: 0; left: 0;
    background: var(--primary-blue); transition: width 0.3s;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.login-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    transition: 0.3s;
}
.login-btn:hover { background: var(--primary-blue); border-color: var(--primary-blue); color: #000; }


/* Hamburger Menu */
.hamburger { display: none; cursor: pointer; flex-direction: column; gap: 5px; z-index: 1001; }
.bar { width: 25px; height: 3px; background: white; border-radius: 2px; transition: 0.3s; }

/* Mobile View Adjustments */
@media (max-width: 768px) {
    .header { padding: 10px 15px; } /* Tighter padding */

    .nav-menu {
        position: fixed; 
        top: 0; 
        right: -100%; 
        width: 80%; /* Wider drawer for better touch targets */
        height: 100vh;
        background: rgba(10, 15, 25, 0.98); 
        backdrop-filter: blur(20px);
        flex-direction: column; 
        align-items: center; 
        justify-content: center; 
        gap: 25px;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
        border-left: 1px solid rgba(255,255,255,0.1);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
        padding-top: 60px; /* clear space for close button area if needed */
        z-index: 999;
    }
    .nav-menu.active { right: 0; }
    
    .nav-link { font-size: 18px; padding: 10px; width: 100%; text-align: center; } /* Larger touch targets */

    .hamburger { display: flex; }
    
    /* Hamburger Animation */
    .hamburger.active .bar:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }
}

/* =========================================
   3. HERO & ANIMATIONS
   ========================================= */
.hero {
    position: relative; 
    padding: 80px 20px 50px; /* Increased top padding */
    text-align: center;
    background: radial-gradient(circle at 50% 20%, #1a253a 0%, var(--bg-dark) 80%);
    overflow: hidden;
    min-height: auto; /* Let content dictate height on mobile */
}

/* Background Animated Grid */
.hero::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px; opacity: 0.5; z-index: 0;
    pointer-events: none; /* Fix for clicking issues */
}

.hero-content { position: relative; z-index: 2; width: 100%; max-width: 800px; margin: 0 auto; }

.hero h1 { 
    font-size: clamp(32px, 8vw, 56px); /* Responsive Typography: Scales with viewport */
    line-height: 1.1; 
    margin-bottom: 15px; 
    font-weight: 800; 
    text-transform: uppercase; 
}
.hero h1 span {
    background: linear-gradient(90deg, #00baff, #00ff88);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(0, 186, 255, 0.3));
}
.hero p { 
    color: var(--text-gray); 
    font-size: clamp(14px, 4vw, 18px); /* Responsive Font Size */
    margin-bottom: 30px; 
    line-height: 1.6;
}

/* Pulsing Button */
.cta-button {
    background: linear-gradient(45deg, #ff5e00, #ff8800);
    color: white; 
    padding: 16px 40px; /* Slightly smaller for mobile optimization */
    border-radius: 50px;
    font-size: 16px; 
    font-weight: bold; 
    text-transform: uppercase;
    box-shadow: 0 0 20px rgba(255, 94, 0, 0.5);
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    animation: pulse 2s infinite; position: relative; overflow: hidden;
    text-align: center;
    width: auto;
    min-width: 200px;
}
.cta-button::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 3s infinite;
}

@keyframes pulse { 0% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 94, 0, 0.5); } 50% { transform: scale(1.05); box-shadow: 0 0 30px rgba(255, 94, 0, 0.8); } 100% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 94, 0, 0.5); } }
@keyframes shimmer { 0% { left: -100%; } 100% { left: 100%; } }

/* =========================================
   4. GAME CARDS & GRID
   ========================================= */
.section-title { 
    text-align: center; 
    font-size: 24px; /* Default for mobile */
    margin: 40px 0 25px; 
    position: relative; 
}
@media (min-width: 768px) { .section-title { font-size: 32px; } }

.section-title::after { content: ''; display: block; width: 60px; height: 3px; background: var(--primary-blue); margin: 10px auto 0; border-radius: 2px; }

.game-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive columns */
    gap: 20px; 
    padding: 0 20px; 
    max-width: var(--container-max-width); 
    margin: 0 auto;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px; 
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; flex-direction: column; /* Ensure footer stays at bottom */
}

/* Mobile specific hover removal: Keeps styling but removes transform to prevent sticky hover states */
@media (hover: hover) {
    .game-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        border-color: var(--primary-blue);
    }
}

.card-image-box { 
    height: 180px; 
    width: 100%;
    overflow: hidden; 
    position: relative; 
    background: #000; /* Fallback */
}
.card-image-box img { 
    width: 100%; height: 100%; object-fit: cover; 
    transition: transform 0.5s ease; 
}
.game-card:hover .card-image-box img { transform: scale(1.1); }

.card-details { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.card-details h3 { font-size: 20px; margin-bottom: 8px; color: var(--text-white); }
.card-details p { font-size: 14px; color: var(--text-gray); margin-bottom: 15px; line-height: 1.5; flex-grow: 1; }

.play-link {
    color: var(--primary-blue); font-weight: bold; font-size: 14px;
    display: inline-flex; align-items: center; gap: 5px;
    margin-top: auto; /* Push to bottom */
    padding: 10px 0; /* Increase touch area */
}
.play-link:hover { gap: 8px; text-decoration: underline; } 

/* =========================================
   5. REVIEWS & SCROLLERS
   ========================================= */
.review-scroller {
    display: flex; 
    gap: 15px; 
    overflow-x: auto; 
    padding: 20px;
    scroll-behavior: smooth; 
    -webkit-overflow-scrolling: touch; /* Momentum scrolling on iOS */
    scroll-snap-type: x mandatory; /* Snap effect */
}
.review-scroller::-webkit-scrollbar { display: none; } 

.review-card {
    min-width: 280px; 
    max-width: 300px;
    background: #0f1420; 
    padding: 20px;
    border-radius: 12px; 
    border-left: 3px solid var(--success-green);
    scroll-snap-align: center; /* Center align on snap */
    flex-shrink: 0;
}

/* =========================================
   6. FOOTER STYLES
   ========================================= */
/* =========================================
   STICKY FOOTER (FULLY RESPONSIVE)
   ========================================= */
.sticky-footer {
    position: fixed; 
    bottom: 0; 
    left: 0;
    width: 100%;
    background: rgba(5, 8, 16, 0.95); 
    
    /* Blur effect for both Chrome and Safari */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); 
    
    display: flex; 
    justify-content: center; 
    align-items: center;
    z-index: 999;
    border-top: 1px solid var(--primary-blue);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    
    /* 🔴 CRITICAL: Prevents width issues */
    box-sizing: border-box; 
    
    /* 🔴 SAFE AREA SUPPORT: Prevents button overlapping iPhone Home Bar */
    padding: 12px 20px; 
    padding-bottom: calc(12px + env(safe-area-inset-bottom)); 
}

.sticky-btn {
    width: 100%; 
    max-width: 400px; /* Limits width on Tablets/PC so it doesn't look huge */
    padding: 14px; 
    background: var(--primary-blue); 
    color: white;
    text-align: center; 
    border-radius: 8px; 
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 186, 255, 0.3);
    
    /* Smooth interaction */
    transition: transform 0.1s ease, background 0.3s ease;
    border: none;
    display: block;
    cursor: pointer;
    line-height: 1.2;
}

.sticky-btn:active { transform: scale(0.96); } /* Click press effect */
.sticky-btn:hover { background: #0099d1; } /* Slight hover darken */

/* =========================================
   RESPONSIVE TWEAKS
   ========================================= */

/* 1. Small Mobile Screens (Old Androids / iPhone SE / Galaxy Fold) */
@media (max-width: 360px) {
    .sticky-footer {
        padding: 10px 15px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
    .sticky-btn {
        padding: 12px; /* Smaller button height */
        font-size: 14px; /* Smaller text */
    }
}

/* 2. Landscape Mode (When phone is rotated) - Saves vertical space */
@media (max-height: 500px) and (orientation: landscape) {
    .sticky-footer {
        padding: 8px 20px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
    .sticky-btn {
        padding: 8px; /* Compact button */
        font-size: 14px;
        max-width: 300px; /* Don't stretch too wide in landscape */
    }
}