/* Base Reset */
:root {
    --primary-color: #e8f046;
    --primary-hover: #d9e12e;
    --background-color: #181A20;
    --card-background: #2a2a2a;
    --text-color: #fff;
    --transition-speed: 0.3s;
    --nav-bg: rgba(32, 34, 42, 0.95);
    --nav-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --btn-font: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Oswald', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    line-height: 1.5;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

/* Navigation Header */
.nav-container {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--background-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 100%;
}

.nav-wrapper {
    position: relative;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 20px;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    padding: 1.25rem 2rem;
    position: relative;
    width: 100%;
    background-color: var(--nav-bg);
    border-radius: 0 0 16px 16px;
    box-shadow: var(--nav-shadow);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.nav-indicator {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.7;
}

.left-section {
    flex: 1;
    min-width: 80px; /* Ensure logo has minimum space */
}

.center-section {
    flex: 2;
    display: flex;
    justify-content: center;
    gap: clamp(0.5rem, 2vw, 1rem); /* Responsive gap */
    font-family: Oswald, sans-serif;
}

.right-section {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    min-width: 30px; /* Ensure hamburger has minimum space */
}

/* Logo Styling */
.logo {
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 2;
}

.logo h1 {
    font-weight: 700;
    letter-spacing: 2px;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(to right, #fff, #f0f0f0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
    font-size: clamp(1.2rem, 4vw, 2rem); /* Responsive font size */
    white-space: nowrap; /* Prevent line break */
}

.logo .highlight {
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    transform: scale(1.2);
    transition: all var(--transition-speed) ease;
    -webkit-text-fill-color: var(--primary-color);
    text-shadow: 0 0 10px rgba(232, 240, 70, 0.5);
}

.highlight:hover {
    transform: scale(1.4) rotate(5deg);
    text-shadow: 0 0 15px rgba(232, 240, 70, 0.7);
}

/* Nav Buttons */
.nav-btn {
    background-color: var(--primary-color);
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 10px 0;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    width: clamp(85px, 15vw, 160px); /* Responsive width */
    font-size: clamp(12px, 2.5vw, 16px); /* Responsive font size */
    outline: none;
    position: relative;
    overflow: hidden;
    font-family: Oswald, sans-serif;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.nav-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.7s ease;
}

.nav-btn:hover:before {
    left: 100%;
}

.nav-btn.active {
    background-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(232, 240, 70, 0.4);
}

.nav-btn:not(.active) {
    background-color: rgba(232, 240, 70, 0.85);
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(232, 240, 70, 0.3);
}

.nav-btn:focus {
    box-shadow: 0 0 0 3px rgba(232, 240, 70, 0.4);
}

.nav-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(232, 240, 70, 0.2);
}

/* Hamburger Menu */
.hamburger {
    position: relative;
    width: clamp(25px, 5vw, 30px); /* Responsive width */
    height: clamp(20px, 4vw, 25px); /* Responsive height */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1001;
}

.hamburger span {
    width: 100%;
    height: clamp(2px, 0.5vw, 3px); /* Responsive height */
    background-color: var(--primary-color);
    transition: all var(--transition-speed) ease;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.hamburger.active span:nth-child(1) {
    transform: translateY(calc(clamp(9px, 45%, 11px))) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(calc(-1 * clamp(9px, 45%, 11px))) rotate(-45deg);
}

/* Fullscreen Menu */
.fullscreen-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(24, 26, 32, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.fullscreen-menu.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.fullscreen-menu nav ul {
    list-style: none;
    text-align: center;
    padding: 0; /* Remove default padding */
    width: 100%; /* Ensure full width */
}

.fullscreen-menu nav ul li {
    margin: clamp(15px, 5vh, 30px) 0; /* Responsive margin */
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease;
}

.fullscreen-menu.active nav ul li {
    transform: translateY(0);
    opacity: 1;
}

.fullscreen-menu.active nav ul li:nth-child(1) {
    transition-delay: 0.1s;
}

.fullscreen-menu.active nav ul li:nth-child(2) {
    transition-delay: 0.2s;
}

.fullscreen-menu nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: clamp(1.5rem, 5vw, 2rem); /* Responsive font size */
    font-weight: 500;
    transition: color var(--transition-speed) ease;
    position: relative;
    padding: 5px 10px;
    display: inline-block; /* Better tap targets on mobile */
}

.fullscreen-menu nav ul li a:before {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width var(--transition-speed) ease;
}

.fullscreen-menu nav ul li a:hover {
    color: var(--primary-color);
}

.fullscreen-menu nav ul li a:hover:before,
.fullscreen-menu nav ul li a:focus:before {
    width: 100%;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
    gap: clamp(15px, 3vw, 30px);
    margin-top: clamp(40px, 6vh, 60px);
    margin-bottom: clamp(20px, 3vh, 30px);
}

.game-card {
    aspect-ratio: 1/1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background-color: var(--card-background);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(232, 240, 70, 0.15);
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed) ease;
}

.game-card:hover img {
    transform: scale(1.05);
}

/* Responsive Design - Simplified and optimized */
@media (max-width: 992px) {
    .container {
        padding: 15px;
    }
    
    .nav-buttons {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
    }
    
    .nav-wrapper {
        margin-bottom: 15px;
    }
    
    .nav-buttons {
        border-radius: 0 0 12px 12px;
    }
    
    .nav-indicator {
        width: 70%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    .nav-buttons {
        padding: 0.7rem 0.5rem;
        gap: 10px;
    }
    
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .nav-btn:hover {
        transform: none;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }
    
    .highlight:hover {
        transform: scale(1.2);
        text-shadow: 0 0 10px rgba(232, 240, 70, 0.5);
    }
    
    .game-card:hover {
        transform: none;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
    
    .game-card:hover img {
        transform: none;
    }
    
    /* Add active states for touch devices */
    .nav-btn:active {
        transform: translateY(1px);
    }
    
    .game-card:active {
        transform: translateY(-3px);
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}