/* ═══════════════════════════════════════════════════════════════
   OnlineFreeGames.org - Premium Dark Theme
   100% W3C Valid · Mobile-First · PageSpeed Optimized
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties (Design Tokens) ────────────────── */
:root {
    --bg-primary: #080b14;
    --bg-secondary: #0d1117;
    --bg-card: rgba(15, 20, 35, 0.85);
    --bg-card-hover: rgba(20, 28, 50, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --bg-input: rgba(255, 255, 255, 0.06);

    --text-primary: #e8ecf4;
    --text-secondary: #8b95a8;
    --text-muted: #5a6377;
    --text-heading: #ffffff;

    --accent-primary: #00c8ff;
    --accent-secondary: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #00c8ff 0%, #7c3aed 100%);
    --accent-glow: 0 0 20px rgba(0, 200, 255, 0.3);
    --accent-glow-strong: 0 0 30px rgba(0, 200, 255, 0.5), 0 0 60px rgba(124, 58, 237, 0.2);

    --border-color: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(0, 200, 255, 0.3);

    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-card-hover: 0 8px 40px rgba(0, 0, 0, 0.6);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    --container-max: 1320px;
    --header-height: 72px;

    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-heading: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --cat-action: #ef4444;
    --cat-puzzle: #8b5cf6;
    --cat-sports: #22c55e;
    --cat-racing: #f59e0b;
    --cat-adventure: #06b6d4;
    --cat-board: #a78bfa;
    --cat-arcade: #ec4899;
    --cat-kids: #f472b6;
}

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(0, 200, 255, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(124, 58, 237, 0.03) 0%, transparent 50%);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: #5ce1ff;
}

ul, ol {
    list-style: none;
}

/* ─── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-heading);
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.375rem, 3vw, 1.75rem); margin-top: 2rem; margin-bottom: 0.75rem; }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.375rem); margin-top: 1.5rem; margin-bottom: 0.5rem; }

/* ─── Layout ───────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    min-height: calc(100vh - var(--header-height) - 200px);
    padding: 2rem 0;
}

/* ─── Header ───────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    background: rgba(8, 11, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 1rem;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.site-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.site-logo .logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.02em;
}

.site-logo .logo-text span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Search Bar ───────────────────────────────────────────── */
.search-bar {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.search-bar input {
    width: 100%;
    height: 44px;
    padding: 0 44px 0 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-body);
    transition: all var(--transition-fast);
    outline: none;
}

.search-bar input:focus {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.1);
}

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

.search-bar button {
    position: absolute;
    right: 4px;
    top: 4px;
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.search-bar button:hover {
    transform: scale(1.05);
}

/* ─── Navigation ───────────────────────────────────────────── */
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.main-nav a {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--text-heading);
    background: var(--bg-glass-hover);
}

.mobile-toggle {
    display: none;
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.25rem;
    align-items: center;
    justify-content: center;
}

/* ─── Hero Section ─────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 3rem 0;
    position: relative;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.hero h1 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
}

.hero-stat .stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ─── Section Titles ───────────────────────────────────────── */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.section-title h2 {
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title h2::before {
    content: '';
    width: 4px;
    height: 1.5em;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.section-title a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.section-title a:hover {
    color: var(--accent-primary);
}

/* ─── Category Bar ─────────────────────────────────────────── */
.category-bar {
    display: flex;
    gap: 0.5rem;
    padding: 1.5rem 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-bar::-webkit-scrollbar {
    display: none;
}

.category-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.category-chip:hover, .category-chip.active {
    background: var(--bg-glass-hover);
    color: var(--text-heading);
    border-color: var(--border-glow);
    box-shadow: var(--accent-glow);
}

.category-chip .chip-icon {
    font-size: 1.1rem;
}

.category-chip .chip-count {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}

/* ─── Game Cards Grid ──────────────────────────────────────── */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.game-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
    text-decoration: none;
    display: block;
}

.game-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--border-glow);
}

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

.card-image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

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

.card-image .card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(8, 11, 20, 0.95) 100%);
    pointer-events: none;
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    z-index: 2;
}

.card-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 2;
    box-shadow: 0 4px 20px rgba(0, 200, 255, 0.4);
}

.game-card:hover .card-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.card-play-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
    margin-left: 3px;
}

.card-info {
    padding: 1rem 1.125rem;
}

.card-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-heading);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-info .card-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ─── Game Page ─────────────────────────────────────────────── */
.game-page-header {
    margin-bottom: 1.5rem;
}

.game-page-header h1 {
    margin-bottom: 0.5rem;
}

.game-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.game-meta a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.game-meta a:hover {
    background: var(--bg-glass-hover);
    color: var(--text-heading);
}

.game-frame-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.game-frame-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.game-frame-wrapper .fullscreen-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 10;
    font-size: 1.125rem;
}

.game-frame-wrapper .fullscreen-btn:hover {
    background: rgba(0, 200, 255, 0.3);
    border-color: var(--accent-primary);
}

.game-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

/* ─── Article Content ──────────────────────────────────────── */
.game-article {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.game-article h2 {
    font-size: 1.375rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-top: 2rem;
}

.game-article h2:first-child {
    margin-top: 0;
}

.game-article p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.game-article ul, .game-article ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.game-article ul {
    list-style: disc;
}

.game-article ol {
    list-style: decimal;
}

.game-article li {
    color: var(--text-secondary);
    padding: 0.25rem 0;
    line-height: 1.7;
}

/* ─── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.sidebar-card h3 {
    font-size: 1rem;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.related-item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.related-item:hover {
    background: var(--bg-glass-hover);
}

.related-item img {
    width: 60px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.related-item .related-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0;
}

.related-item .related-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ─── Share Buttons ────────────────────────────────────────── */
.share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.share-btn:hover {
    opacity: 0.85;
    color: white;
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.telegram { background: #0088cc; }

/* ─── Breadcrumbs ──────────────────────────────────────────── */
.breadcrumbs {
    padding: 1rem 0;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumbs li:not(:last-child)::after {
    content: '›';
    margin-left: 0.5rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-secondary);
}

.breadcrumbs a:hover {
    color: var(--accent-primary);
}

/* ─── Categories Page ──────────────────────────────────────── */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-decoration: none;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-card-hover);
}

.category-card:hover::before {
    opacity: 1;
}

.category-card .cat-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.category-card h3 {
    font-size: 1.125rem;
    color: var(--text-heading);
    margin: 0 0 0.5rem;
}

.category-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex: 1;
}

.category-card .cat-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ─── Pagination ───────────────────────────────────────────── */
.pagination {
    text-align: center;
    padding: 2rem 0;
}

.pagination ul {
    display: flex;
    justify-content: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.pagination a {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.pagination a:hover {
    background: var(--bg-glass-hover);
    color: var(--text-heading);
    border-color: var(--border-glow);
}

.pagination .pagination-current {
    background: var(--accent-gradient);
    color: white;
    font-weight: 700;
}

.pagination .disabled {
    opacity: 0.35;
    cursor: default;
    color: var(--text-muted);
}

.pagination .pagination-dots {
    color: var(--text-muted);
    border: none;
}

.pagination-info {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ─── 404 Page ─────────────────────────────────────────────── */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-page .error-code {
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.error-page p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 1rem 0 2rem;
}

.error-page .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: var(--accent-gradient);
    color: white;
    font-weight: 600;
    border-radius: var(--radius-full);
    font-size: 1rem;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.error-page .btn:hover {
    box-shadow: var(--accent-glow-strong);
    transform: translateY(-2px);
    color: white;
}

/* ─── Footer ───────────────────────────────────────────────── */
.site-footer {
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    padding: 3rem 0 2rem;
}

.footer-about {
    padding-right: 2rem;
}

.footer-about .logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 1rem;
    display: block;
}

.footer-about .logo-text span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-about p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.footer-col h4 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-heading);
    margin-bottom: 1rem;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul a {
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-col ul a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ─── Search Results ───────────────────────────────────────── */
.search-header {
    margin-bottom: 2rem;
}

.search-header h1 span {
    color: var(--accent-primary);
}

.no-results {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}

.no-results .no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ─── Lazy Load Animations ─────────────────────────────────── */
.lazy-img {
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.lazy-img.loaded {
    opacity: 1;
}

/* ─── Reduced Motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}

/* ─── Responsive: Tablet ───────────────────────────────────── */
@media (max-width: 1024px) {
    .game-layout {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }

    .main-nav {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .main-nav.open {
        display: flex;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(8, 11, 20, 0.97);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
        gap: 0;
    }

    .main-nav.open a {
        padding: 0.75rem 1rem;
    }
}

/* ─── Responsive: Mobile ───────────────────────────────────── */
@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }

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

    .card-info {
        padding: 0.75rem;
    }

    .card-info h3 {
        font-size: 0.85rem;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .game-article {
        padding: 1.25rem;
    }

    .game-frame-wrapper {
        aspect-ratio: 4 / 3;
        border-radius: var(--radius-md);
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }

    .search-bar {
        display: none;
    }

    .category-card {
        padding: 1.125rem;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Print ────────────────────────────────────────────────── */
@media print {
    .site-header, .site-footer, .sidebar,
    .game-frame-wrapper, .share-buttons,
    .category-bar, .pagination, .search-bar {
        display: none !important;
    }
    body {
        background: white;
        color: black;
    }
    .game-article {
        border: none;
        padding: 0;
        background: none;
    }
}
