:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --success: #10b981;
    --error: #ef4444;
    --bg: #fafbfc;
    --surface: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.bg-grid {
    display: none;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    transform: none;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 4rem;
    padding: 2rem 0;
}

h1 {
    font-size: clamp(3rem, 7vw, 5rem);
    font-weight: 900;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 25%, #3b82f6 50%, #06b6d4 75%, #0891b2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: shimmer 4s ease-in-out infinite;
    position: relative;
    display: inline-block;
}

@keyframes shimmer {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    letter-spacing: normal;
    text-transform: none;
    font-weight: 500;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: none;
    box-shadow: var(--shadow);
}

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

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

.game-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    animation: none;
}

.game-card h2 {
    font-size: 1.375rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: -0.015em;
}

.game-card p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.play-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    text-transform: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: normal;
}

.play-btn::before {
    display: none;
}

.play-btn:hover {
    background: var(--primary-dark);
    transform: none;
    box-shadow: 0 4px 12px rgb(37 99 235 / 0.3);
}

.play-btn:active {
    transform: scale(0.98);
}

/* Game Area */
.game-area {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    animation: none;
    box-shadow: var(--shadow);
}

.game-area.active {
    display: block;
}

.game-title {
    font-size: 1.875rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: -0.025em;
}

.score-display {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.instruction {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.game-canvas {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
}

/* Reaction Game */
.reaction-zone {
    width: 100%;
    height: 400px;
    background: #fef3f2;
    border: 2px solid #fecaca;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-weight: 600;
}

.reaction-zone.ready {
    background: #f0fdf4;
    border-color: #86efac;
    animation: none;
    box-shadow: 0 0 0 4px rgb(134 239 172 / 0.2);
}

/* Memory Game */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.memory-cell {
    aspect-ratio: 1;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.memory-cell:hover {
    transform: scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgb(37 99 235 / 0.1);
}

.memory-cell.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgb(37 99 235 / 0.2);
}

.memory-cell.error {
    background: var(--error);
    border-color: var(--error);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Focus Game */
#focus-canvas {
    background: var(--bg) !important;
    border: 2px solid var(--border) !important;
    border-radius: 12px !important;
}

#focus-timer {
    font-family: inherit !important;
    font-size: 1.5rem !important;
    color: var(--text-primary) !important;
    font-weight: 700 !important;
}

.focus-target {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    position: absolute;
    cursor: pointer;
    box-shadow: 0 4px 12px rgb(37 99 235 / 0.3);
    animation: none;
    transition: all 0.2s ease;
}

.focus-target:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* BLOCKS Game */
#blocks-canvas-wrapper {
    background: var(--bg);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

#blocks-canvas {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.blocks-counter {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    background: var(--primary);
    color: white;
    font-size: 48px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgb(37 99 235 / 0.3);
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.blocks-counter:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgb(37 99 235 / 0.4);
}

.blocks-counter:active {
    transform: scale(0.95);
}

/* Back Button */
.back-btn {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    text-transform: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 2rem;
    font-family: inherit;
}

.back-btn:hover {
    background: var(--bg);
    color: var(--text-primary);
    border-color: var(--text-secondary);
    transform: none;
}

/* Stats */
.stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.stat-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.75rem;
    text-align: center;
    min-width: 140px;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.875rem;
    color: var(--text-primary);
    font-weight: 700;
    font-family: inherit;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }

    header {
        margin-bottom: 2.5rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .game-card {
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    #blocks-canvas {
        height: 300px;
    }

    .blocks-counter {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }

    .game-area {
        padding: 1.5rem;
    }

    .stats {
        gap: 1rem;
    }

    .stat-item {
        padding: 1rem 1.25rem;
        min-width: 120px;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}