/* ========================================
   TheNumber.One - Main Stylesheet
   A free browser games portal
   ======================================== */

/* CSS Variables */
:root {
    /* Colors - Vibrant gaming theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252542;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    
    --accent-primary: #00d4ff;
    --accent-secondary: #7b2fff;
    --accent-tertiary: #ff2d95;
    --accent-success: #00ff88;
    --accent-warning: #ffaa00;
    
    --gradient-primary: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-tertiary) 100%);
    --gradient-glow: radial-gradient(circle at center, rgba(0, 212, 255, 0.15) 0%, transparent 70%);
    
    /* Typography */
    --font-display: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Borders */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.3);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    
    /* Z-index */
    --z-dropdown: 100;
    --z-modal: 1000;
    --z-tooltip: 1100;
}

/* RTL Support for Arabic */
[dir="rtl"] {
    direction: rtl;
}

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

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

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

/* Skip Link - Accessibility */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-radius: var(--radius-md);
    z-index: var(--z-tooltip);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--spacing-md);
}

/* Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ========================================
   Header
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-dropdown);
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-md) var(--spacing-lg);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

/* Navigation */
.nav {
    display: flex;
    align-items: center;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition-fast);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.nav-link {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--accent-primary);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box input {
    width: 200px;
    padding: var(--spacing-sm) var(--spacing-md);
    padding-right: 40px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

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

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
    width: 250px;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Language Selector */
.lang-selector {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition-fast);
}

.lang-btn:hover {
    border-color: var(--accent-primary);
}

.lang-btn svg {
    width: 16px;
    height: 16px;
    transition: var(--transition-fast);
}

.lang-btn[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + var(--spacing-xs));
    right: 0;
    min-width: 150px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-fast);
    overflow: hidden;
    z-index: var(--z-dropdown);
}

.lang-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown button {
    display: block;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    transition: var(--transition-fast);
}

[dir="rtl"] .lang-dropdown button {
    text-align: right;
}

.lang-dropdown button:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(80px + var(--spacing-3xl)) var(--spacing-lg) var(--spacing-3xl);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

.hero-glow {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: var(--gradient-glow);
    filter: blur(60px);
    opacity: 0.6;
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.6; transform: translateX(-50%) scale(1.1); }
}

.hero-content {
    text-align: center;
    max-width: 900px;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: var(--spacing-lg);
}

.hero-title span {
    display: block;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xl);
}

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    font-weight: 600;
    font-size: 1.125rem;
    border-radius: var(--radius-full);
    transition: var(--transition-base);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--bg-primary);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.5);
}

/* Hero Stats */
.hero-stats {
    display: flex;
    gap: var(--spacing-2xl);
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
}

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

/* Hero Devices (hidden on mobile) */
.hero-devices {
    display: none;
}

/* ========================================
   Sections
   ======================================== */
.section {
    padding: var(--spacing-3xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* ========================================
   Categories
   ======================================== */
.categories-section {
    background: var(--bg-secondary);
}

.categories-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-md);
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg) var(--spacing-xl);
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    transition: var(--transition-base);
    min-width: 120px;
}

.category-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.category-card.active {
    border-color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.1);
}

.category-icon {
    font-size: 2rem;
}

.category-card span {
    font-weight: 500;
    color: var(--text-secondary);
}

.category-card.active span {
    color: var(--text-primary);
}

/* ========================================
   Games Grid
   ======================================== */
.games-section {
    background: var(--bg-primary);
}

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

/* Game Card */
.game-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: var(--transition-base);
    cursor: pointer;
}

.game-card.hidden {
    display: none;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.game-card:hover .game-overlay {
    opacity: 1;
}

.game-card:hover .play-btn {
    transform: scale(1);
}

/* Game Preview */
.game-preview {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.game-thumbnail {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-base);
}

.play-btn {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    border-radius: 50%;
    color: var(--bg-primary);
    transform: scale(0.8);
    transition: var(--transition-base);
}

.play-btn svg {
    width: 28px;
    height: 28px;
    margin-left: 4px;
}

.play-btn:hover {
    background: var(--text-primary);
    box-shadow: var(--shadow-glow);
}

/* Game Info */
.game-info {
    padding: var(--spacing-lg);
}

.game-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.game-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

.game-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.game-tag {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-primary);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.game-rating {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ========================================
   Game Thumbnails - Visual Previews
   ======================================== */

/* 2048 */
.game-thumb-2048 {
    background: linear-gradient(135deg, #faf8ef 0%, #eee4da 100%);
}

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
}

.tile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1.25rem;
    animation: tileAppear 0.3s ease backwards;
}

.tile:nth-child(1) { animation-delay: 0.1s; }
.tile:nth-child(2) { animation-delay: 0.2s; }
.tile:nth-child(3) { animation-delay: 0.3s; }
.tile:nth-child(4) { animation-delay: 0.4s; }

@keyframes tileAppear {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.t2 { background: #eee4da; color: #776e65; }
.t4 { background: #ede0c8; color: #776e65; }
.t8 { background: #f2b179; color: #f9f6f2; }
.t16 { background: #f59563; color: #f9f6f2; }

/* Tetris */
.game-thumb-tetris {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
}

.tetris-blocks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px;
    justify-content: center;
    align-items: center;
}

.block {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    animation: tetrisFall 2s ease-in-out infinite;
}

.block-i {
    background: #00f0f0;
    box-shadow: 0 0 10px #00f0f0;
    width: 80px;
    height: 20px;
}

.block-l {
    background: #f0a000;
    box-shadow: 0 0 10px #f0a000;
    animation-delay: 0.3s;
}

.block-t {
    background: #a000f0;
    box-shadow: 0 0 10px #a000f0;
    animation-delay: 0.6s;
}

.block-s {
    background: #00f000;
    box-shadow: 0 0 10px #00f000;
    animation-delay: 0.9s;
}

@keyframes tetrisFall {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* Snake */
.game-thumb-snake {
    background: linear-gradient(135deg, #1a472a 0%, #0d2818 100%);
    position: relative;
}

.snake-body {
    display: flex;
    gap: 4px;
    padding: 20px;
}

.snake-body span {
    width: 20px;
    height: 20px;
    background: #4ade80;
    border-radius: 4px;
    animation: snakeMove 1s ease-in-out infinite;
}

.snake-body span:first-child {
    background: #22c55e;
    border-radius: 6px;
}

.snake-body span:nth-child(2) { animation-delay: 0.1s; }
.snake-body span:nth-child(3) { animation-delay: 0.2s; }
.snake-body span:nth-child(4) { animation-delay: 0.3s; }
.snake-body span:nth-child(5) { animation-delay: 0.4s; }

@keyframes snakeMove {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.snake-food {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    animation: foodPulse 1s ease-in-out infinite;
}

@keyframes foodPulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); }
}

/* Flappy Bird */
.game-thumb-flappy {
    background: linear-gradient(180deg, #87CEEB 0%, #70c5ce 100%);
    position: relative;
    overflow: hidden;
}

.flappy-scene {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 30px;
}

.pipe {
    width: 40px;
    background: linear-gradient(90deg, #73c127 0%, #5ea31b 50%, #73c127 100%);
    border-radius: 4px;
}

.pipe-top {
    height: 60px;
    align-self: flex-start;
    margin-top: -10px;
}

.pipe-bottom {
    height: 50px;
    align-self: flex-end;
    margin-bottom: -10px;
}

.bird {
    font-size: 2rem;
    animation: birdFlap 0.5s ease-in-out infinite;
}

@keyframes birdFlap {
    0%, 100% { transform: translateY(0) rotate(-10deg); }
    50% { transform: translateY(-15px) rotate(10deg); }
}

/* Breakout */
.game-thumb-breakout {
    background: linear-gradient(180deg, #0f0f23 0%, #1a1a3e 100%);
}

.breakout-scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    height: 100%;
}

.bricks {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: auto;
}

.bricks span {
    width: 28px;
    height: 12px;
    border-radius: 2px;
}

.bricks span:nth-child(1), .bricks span:nth-child(2) { background: #ff4444; }
.bricks span:nth-child(3), .bricks span:nth-child(4) { background: #ff8844; }
.bricks span:nth-child(5), .bricks span:nth-child(6) { background: #ffff44; }
.bricks span:nth-child(7), .bricks span:nth-child(8) { background: #44ff44; }

.ball {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    margin: 20px 0;
    animation: ballBounce 1s ease-in-out infinite;
}

@keyframes ballBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.paddle {
    width: 50px;
    height: 10px;
    background: var(--accent-primary);
    border-radius: 4px;
    margin-top: auto;
}

/* Memory */
.game-thumb-memory {
    background: linear-gradient(135deg, #4a1d6a 0%, #2d1240 100%);
}

.memory-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 20px;
}

.mem-card {
    width: 45px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 8px;
    font-size: 1.5rem;
    transition: var(--transition-base);
}

.mem-card.flip {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
}

/* Minesweeper */
.game-thumb-mines {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
}

.mines-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 20px;
}

.cell {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    border: 2px outset #fff;
    font-weight: 700;
    font-size: 0.875rem;
}

.cell.hidden {
    background: #c0c0c0;
}

.cell.flag {
    font-size: 1rem;
}

.cell:nth-child(1) { color: #0000ff; }
.cell:nth-child(2) { color: #008000; }
.cell:nth-child(6) { color: #ff0000; }
.cell:nth-child(7) { color: #0000ff; }
.cell:nth-child(9) { color: #0000ff; }

/* Pong */
.game-thumb-pong {
    background: #000;
    position: relative;
}

.pong-scene {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 20px;
    position: relative;
}

.pong-paddle {
    width: 8px;
    height: 40px;
    background: #fff;
}

.pong-ball {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    animation: pongMove 2s ease-in-out infinite;
}

@keyframes pongMove {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(20px, -15px); }
    50% { transform: translate(0, 0); }
    75% { transform: translate(-20px, 15px); }
}

.pong-line {
    position: absolute;
    left: 50%;
    top: 10%;
    bottom: 10%;
    width: 4px;
    background: repeating-linear-gradient(
        to bottom,
        #fff 0px,
        #fff 10px,
        transparent 10px,
        transparent 20px
    );
    transform: translateX(-50%);
}

/* ========================================
   Features Section
   ======================================== */
.features-section {
    background: var(--bg-secondary);
}

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

.feature-card {
    text-align: center;
    padding: var(--spacing-xl);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    transition: var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ========================================
   Game Modal
   ======================================== */
.game-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-base);
}

.game-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transform: scale(0.9);
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
}

.game-modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-card);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-controls {
    display: flex;
    gap: var(--spacing-sm);
}

.modal-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.modal-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-btn svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    flex: 1;
    min-height: 400px;
    background: #000;
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: none;
}

.modal-footer {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--bg-card);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.game-controls-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

/* Fullscreen mode */
.game-modal.fullscreen .modal-content {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
}

.game-modal.fullscreen .modal-body {
    height: calc(100vh - 120px);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: var(--spacing-3xl) 0 var(--spacing-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-2xl);
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 2fr 3fr;
    }
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: var(--spacing-md);
    max-width: 300px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-xl);
}

.footer-col h4 {
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.footer-col a {
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

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

.footer-bottom {
    padding-top: var(--spacing-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.seo-text {
    margin-top: var(--spacing-sm);
    font-size: 0.75rem !important;
    opacity: 0.5;
}

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

/* Tablet */
@media (max-width: 992px) {
    .search-box {
        display: none;
    }
    
    .hero-stats {
        gap: var(--spacing-xl);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .header-container {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: var(--spacing-lg);
        gap: var(--spacing-sm);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition-base);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-menu.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        width: 100%;
        text-align: center;
        padding: var(--spacing-md);
    }
    
    .hero {
        padding-top: calc(60px + var(--spacing-2xl));
        min-height: auto;
        padding-bottom: var(--spacing-2xl);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .stat {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .categories-grid {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding-bottom: var(--spacing-md);
        -webkit-overflow-scrolling: touch;
    }
    
    .category-card {
        flex-shrink: 0;
        min-width: 100px;
        padding: var(--spacing-md);
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: var(--spacing-md);
    }
    
    .section {
        padding: var(--spacing-2xl) 0;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .modal-body iframe {
        min-height: 300px;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .logo-icon {
        display: none;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
}

/* Touch devices */
@media (hover: none) {
    .game-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.3);
    }
    
    .play-btn {
        transform: scale(1);
        width: 60px;
        height: 60px;
    }
}

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

/* Print styles */
@media print {
    .header,
    .hero-bg,
    .game-modal,
    .footer {
        display: none;
    }
    
    body {
        background: #fff;
        color: #000;
    }
    
    .game-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
