/* ============================================
   GameHub - Sidebar Layout Game Template
   Fully Localized - No External Dependencies
   ============================================ */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
a{
    text-decoration: none;
}

:root {
    /* Color Scheme - Green/Teal Theme */
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --secondary: #14b8a6;
    --accent: #22d3ee;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Background Colors */
    --bg-primary: #0a0e27;
    --bg-secondary: #151932;
    --bg-sidebar: #1a1f3a;
    --bg-card: #1e2442;
    --bg-hover: #252b4a;
    
    /* Text Colors */
    --text-primary: #f0fdf4;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    --gradient-hero: linear-gradient(135deg, #059669 0%, #14b8a6 50%, #22d3ee 100%);
    --gradient-card: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(20, 184, 166, 0.1) 100%);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.3);
    
    /* Transitions */
    --transition: all 0.3s ease;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-logo {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-icon {
    width: 25px;
    height: 25px;
    vertical-align: middle;
    margin-right: 10px;
}

.sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: var(--font-size-2xl);
    cursor: pointer;
    padding: var(--spacing-xs);
}

.sidebar-nav {
    padding: var(--spacing-md);
    flex: 1;
}

.nav-item {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-xs);
    transition: var(--transition);
    font-size: var(--font-size-base);
}

.nav-item:hover,
.nav-item.active {
    background: var(--gradient-primary);
    color: white;
    transform: translateX(4px);
}

.sidebar-categories {
    padding: var(--spacing-md);
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.sidebar-title {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.category-item {
    padding: var(--spacing-sm) var(--spacing-md);
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-size: var(--font-size-sm);
    font-family: var(--font-family);
    display: block;
    text-decoration: none;
}

.category-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--text-primary);
}

.category-item.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.sidebar-footer {
    padding: var(--spacing-md);
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--primary-light);
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    padding: 0;
    width: calc(100% - 280px);
}

/* ============================================
   Top Bar
   ============================================ */

.top-bar {
    position: sticky;
    top: 0;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    justify-content: space-between;
    z-index: 999;
    margin: 0;
}

.menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: var(--font-size-xl);
    cursor: pointer;
    padding: var(--spacing-xs);
    transition: var(--transition);
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.menu-btn:active {
    opacity: 0.7;
}

.top-bar-title {
    display: none;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    min-width: 0;
}

.top-bar-title img {
    display: block;
    flex-shrink: 0;
    margin-right: var(--spacing-xs);
}

.top-bar-back {
    display: none;
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    white-space: nowrap;
}

.search-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xs) var(--spacing-sm);
    transition: var(--transition);
    max-width: 500px;
}

.search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: var(--spacing-xs);
    outline: none;
    font-size: var(--font-size-base);
    line-height: 1.5;
    vertical-align: middle;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-xs);
    font-size: var(--font-size-lg);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.search-btn:hover {
    color: var(--primary);
}

.sort-select {
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.sort-select:hover,
.sort-select:focus {
    border-color: var(--primary);
}

/* ============================================
   Hero Banner
   ============================================ */

.hero-banner {
    background: var(--gradient-hero);
    padding: var(--spacing-2xl) var(--spacing-lg);
    margin: 0 0 var(--spacing-xl) 0;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(16, 185, 129, 0.2), transparent 60%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-text {
    font-size: var(--font-size-xl);
    color: rgba(240, 253, 244, 0.9);
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
}

.hero-cta {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-xl);
    background: var(--text-primary);
    color: var(--primary-dark);
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

/* ============================================
   Games Section
   ============================================ */

.games-section {
    padding: 0 var(--spacing-lg) var(--spacing-2xl);
    margin: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-count {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    align-items: start;
}

.game-box {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(148, 163, 184, 0.1);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.game-box:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    border-color: var(--primary);
}

.game-image {
    width: 100%;
    height: 200px;
    background: var(--gradient-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    position: relative;
    transition: var(--transition);
    overflow: hidden;
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.game-box:hover .game-image {
    transform: scale(1.05);
}

.game-badge {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-badge.new {
    background: var(--primary);
    color: white;
}

.game-badge.trending {
    background: var(--warning);
    color: white;
}

.game-info {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-desc {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-xs);
    margin-top: auto;
    gap: var(--spacing-sm);
}

.game-rating {
    color: var(--warning);
    font-weight: 600;
}

.game-cat {
    background: var(--bg-hover);
    padding: 4px var(--spacing-sm);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-transform: capitalize;
}

.load-more {
    text-align: center;
    margin-top: var(--spacing-xl);
}

.load-btn {
    padding: var(--spacing-sm) var(--spacing-xl);
    background: transparent;
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
}

.load-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   Overlay
   ============================================ */

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        box-shadow: var(--shadow-xl);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .overlay.active {
        display: block;
        opacity: 1;
    }

    .sidebar-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .menu-btn {
        display: flex;
    }

    .top-bar-title {
        display: flex;
    }

    .top-bar-back {
        display: block;
    }

    .top-bar {
        padding: var(--spacing-sm) var(--spacing-md);
        display: flex;
        align-items: center;
        gap: var(--spacing-xs);
        flex-wrap: wrap;
    }

    .menu-btn {
        flex-shrink: 0;
        margin-right: 0;
    }

    .top-bar-title {
        flex: 1;
        font-size: var(--font-size-lg);
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 0;
        display: flex;
        align-items: center;
        gap: 0;
        min-width: 0;
    }

    .top-bar-title img {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        margin-right: var(--spacing-xs);
    }

    .search-wrapper {
        flex: 1 1 100%;
        max-width: none;
        width: 100%;
        margin-top: var(--spacing-xs);
        order: 3;
    }

    .top-actions {
        display: none;
    }

    .search-input {
        font-size: var(--font-size-sm);
        padding: var(--spacing-xs);
    }

    .sort-select {
        font-size: var(--font-size-xs);
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .hero-title {
        font-size: var(--font-size-3xl);
    }

    .hero-text {
        font-size: var(--font-size-lg);
    }

    .hero-banner {
        padding: var(--spacing-xl) var(--spacing-md);
        margin: 0;
    }

    .hero-content {
        max-width: 100%;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--spacing-md);
    }

    .games-section {
        padding: 0 var(--spacing-md) var(--spacing-xl);
        margin: 0;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .game-count {
        font-size: var(--font-size-xs);
    }

    .game-box {
        border-radius: var(--radius-lg);
    }

    .game-image {
        height: 150px;
        font-size: 3rem;
    }

    .game-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .game-info {
        padding: var(--spacing-sm);
    }

    .game-title {
        font-size: var(--font-size-base);
    }

    .game-desc {
        font-size: var(--font-size-xs);
        -webkit-line-clamp: 2;
    }

    .load-btn {
        width: 100%;
        padding: var(--spacing-sm) var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .sidebar {
        width: 85%;
        max-width: 300px;
    }

    .sidebar-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .sidebar-logo {
        font-size: var(--font-size-xl);
    }

    .sidebar-nav,
    .sidebar-categories,
    .sidebar-footer {
        padding: var(--spacing-md);
    }

    .nav-item {
        padding: var(--spacing-sm);
        font-size: var(--font-size-sm);
    }

    .category-item {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-xs);
    }

    .top-bar {
        padding: var(--spacing-xs) var(--spacing-sm);
        display: flex;
        align-items: center;
        gap: var(--spacing-xs);
    }

    .menu-btn {
        flex-shrink: 0;
        margin-right: 0;
    }

    .top-bar-title {
        flex: 1;
        font-size: var(--font-size-base);
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 0;
        line-height: 1.2;
        display: flex;
        align-items: center;
        gap: 0;
        min-width: 0;
    }

    .top-bar-title img {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        margin-right: var(--spacing-xs);
    }

    .top-bar-back {
        flex-shrink: 0;
        font-size: var(--font-size-xs);
        padding: var(--spacing-xs);
        margin-left: auto;
    }

    .menu-btn {
        flex-shrink: 0;
    }

    .search-wrapper {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        margin-top: var(--spacing-xs);
        max-width: none;
    }

    /* Hide search on detail page mobile */
    .top-bar .search-wrapper[style*="display: none"] {
        display: none !important;
    }

    .hero-title {
        font-size: var(--font-size-2xl);
        line-height: 1.2;
    }

    .hero-text {
        font-size: var(--font-size-base);
    }

    .hero-cta {
        width: 100%;
        text-align: center;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .hero-banner {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .section-title {
        font-size: var(--font-size-xl);
    }

    .game-box {
        border-radius: var(--radius-md);
    }

    .game-image {
        height: 180px;
        font-size: 4rem;
    }

    .game-info {
        padding: var(--spacing-md);
    }

    .game-title {
        font-size: var(--font-size-lg);
        margin-bottom: var(--spacing-xs);
    }

    .game-desc {
        font-size: var(--font-size-sm);
        margin-bottom: var(--spacing-sm);
        -webkit-line-clamp: 3;
    }

    .game-meta {
        font-size: var(--font-size-xs);
    }

    .section-header {
        margin-bottom: var(--spacing-md);
    }

    /* Detail page mobile styles */
    .game-detail-header {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-md) !important;
    }

    .game-detail-image-wrapper .game-detail-image {
        height: 250px !important;
        font-size: 5rem !important;
    }

    .play-btn-large {
        padding: var(--spacing-sm) var(--spacing-md) !important;
        font-size: var(--font-size-base) !important;
    }

    .game-detail-title {
        font-size: var(--font-size-2xl) !important;
    }

    .game-detail-meta {
        /* flex-direction: column; */
        align-items: flex-start;
        gap: var(--spacing-sm) !important;
    }

    .game-features {
        grid-template-columns: 1fr !important;
    }

    .breadcrumb-nav {
        padding: var(--spacing-sm) var(--spacing-md) !important;
        font-size: var(--font-size-xs) !important;
    }

    .game-detail-container {
        margin: 0 var(--spacing-sm) !important;
        padding: var(--spacing-md) !important;
        border-radius: var(--radius-lg) !important;
    }
    
    .game-detail-header {
        gap: var(--spacing-md) !important;
    }
    
    .game-detail-meta {
        padding: var(--spacing-sm) !important;
    }
    
    .game-features {
        padding: var(--spacing-md) !important;
        gap: var(--spacing-sm) !important;
    }

    .game-detail-description p {
        font-size: var(--font-size-sm) !important;
        line-height: 1.6 !important;
    }

    .related-games .games-grid {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-md) !important;
    }
    
    .related-games .game-image {
        height: 150px !important;
    }
    
    .game-back-icon {
        top: 10px !important;
        left: 10px !important;
        width: 44px !important;
        height: 44px !important;
    }
    
    .game-back-icon img {
        width: 32px !important;
        height: 32px !important;
    }

    /* Category and search pages */
    .games-section {
        padding: 0 var(--spacing-sm) var(--spacing-lg) !important;
    }

    /* Top bar spacing */
    .top-bar {
        gap: var(--spacing-xs) !important;
    }

    .search-wrapper {
        flex: 1 1 100% !important;
        width: 100% !important;
        margin-top: var(--spacing-xs) !important;
        order: 3 !important;
    }

    /* Contact and other content pages */
    article {
        margin: 0 var(--spacing-sm) !important;
        padding: var(--spacing-md) !important;
    }

    article h1,
    article h2 {
        font-size: var(--font-size-xl) !important;
    }

    article h2 {
        font-size: var(--font-size-lg) !important;
    }

    /* Form elements */
    input[type="text"],
    input[type="email"],
    textarea,
    select {
        font-size: var(--font-size-base) !important;
        padding: var(--spacing-sm) !important;
    }

    /* Top bar back link */
    .top-bar a {
        font-size: var(--font-size-xs) !important;
        white-space: nowrap;
    }

    /* Breadcrumb mobile */
    .breadcrumb-nav {
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }

    .breadcrumb-nav a,
    .breadcrumb-nav span {
        font-size: var(--font-size-xs) !important;
    }

    /* Related games mobile */
    .related-games h2 {
        font-size: var(--font-size-lg) !important;
        margin-bottom: var(--spacing-md) !important;
    }
}

/* ============================================
   Mobile Touch Optimizations
   ============================================ */

@media (max-width: 768px) {
    /* Larger touch targets */
    .nav-item,
    .category-item,
    .game-box,
    .load-btn,
    .play-btn-large {
        min-height: 44px;
    }

    /* Touch feedback */
    .nav-item:active,
    .category-item:active,
    .game-box:active,
    .load-btn:active {
        opacity: 0.7;
        transform: scale(0.98);
    }

    /* Prevent text selection on buttons */
    .menu-btn,
    .nav-item,
    .category-item,
    button {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        user-select: none;
    }

    /* Smooth scrolling */
    html {
        -webkit-overflow-scrolling: touch;
    }

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        width: 100%;
    }
}

/* ============================================
   Detail Page Styles
   ============================================ */

.breadcrumb-nav {
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumb-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: var(--transition);
}

.breadcrumb-nav a:hover {
    color: var(--primary-light);
}

.breadcrumb-nav span {
    color: var(--text-muted);
    margin: 0 var(--spacing-xs);
    font-size: var(--font-size-sm);
}

.breadcrumb-nav span:last-of-type {
    color: var(--text-primary);
}

.game-detail-container {
    background: var(--bg-card);
    margin: 0 var(--spacing-lg);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.game-detail-header {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    align-items: start;
}

@media (max-width: 1024px) {
    .game-detail-header {
        grid-template-columns: 1fr 1.5fr;
        gap: var(--spacing-lg);
    }
}

.game-detail-image-wrapper {
    display: flex;
    flex-direction: column;
}

.game-detail-image {
    width: 100%;
    height: 400px;
    background: var(--gradient-card);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.game-detail-image:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.game-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.play-btn-large {
    width: 100%;
    margin-top: var(--spacing-md);
    padding: var(--spacing-lg) var(--spacing-md);
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-lg);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    box-shadow: var(--shadow-md);
    min-height: 56px;
}

.play-btn-large:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.play-btn-large:active {
    transform: translateY(0);
}

.game-detail-title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    word-wrap: break-word;
}

@media (max-width: 768px) {
    .game-detail-title {
        font-size: var(--font-size-2xl);
    }
}

.game-detail-meta {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--bg-hover);
    border-radius: var(--radius-lg);
}

.game-detail-meta > div {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.game-detail-meta .rating {
    color: var(--warning);
    font-size: var(--font-size-lg);
}

.game-detail-meta .rating-value {
    color: var(--text-primary);
    font-weight: 600;
}

.game-detail-meta .category-badge {
    background: var(--gradient-primary);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-md);
    color: white;
    text-transform: capitalize;
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.game-detail-meta .free-badge {
    color: var(--text-secondary);
}

.game-detail-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-base);
}

.game-detail-description h1,
.game-detail-description h2,
.game-detail-description h3 {
    color: var(--text-primary);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.game-detail-description h1:first-child,
.game-detail-description h2:first-child,
.game-detail-description h3:first-child {
    margin-top: 0;
}

.game-detail-description p {
    margin-bottom: var(--spacing-md);
}

.game-detail-description p:last-child {
    margin-bottom: 0;
}

.game-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.game-feature-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.game-feature-item .feature-icon {
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

.related-games {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 2px solid rgba(16, 185, 129, 0.2);
}

.related-games h2 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.related-games h2::before {
    content: '🎮';
    font-size: var(--font-size-xl);
}

.related-games .games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.related-games .game-image {
    height: 180px;
    transition: var(--transition);
}

.related-games .game-box:hover .game-image {
    transform: scale(1.05);
}

.related-games .game-info {
    padding: var(--spacing-md);
}

.related-games .game-title {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-xs);
}

/* Game back icon (for iframe overlay) */
.game-back-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    border-radius: 50%;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: var(--gradient-primary);
    width: 50px;
    height: 50px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.game-back-icon:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

.game-back-icon img {
    width: 38px;
    height: 38px;
    vertical-align: middle;
}

/* ============================================
   Utilities
   ============================================ */

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}
