/* ==========================================================================
   Base Styles & Variables
   ========================================================================== */
:root {
    /* Color Palette */
    --bg-color: #ffffff;
    --section-bg: #f7f8fa;
    --card-bg: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #5a5a7a;
    --text-muted: #9a9ab0;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border: #e5e7eb;
    
    /* Semantic Colors */
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;

    /* Typography */
    --font-body: 'Inter', system-ui, sans-serif;
    --font-brand: 'Orbitron', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

p {
    margin-bottom: 1.25rem;
}

ul, ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

blockquote {
    border-left: 4px solid var(--accent);
    background-color: var(--section-bg);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    font-style: italic;
    color: var(--text-secondary);
}

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    background-color: var(--bg-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.brand-logo {
    font-family: var(--font-brand);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.brand-logo:hover {
    text-decoration: none;
    color: var(--accent-hover);
}

/* Navigation */
.main-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--accent);
    background-color: var(--section-bg);
    text-decoration: none;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* ==========================================================================
   Game Specific
   ========================================================================== */
.game-section {
    padding: 3rem 0;
    text-align: center;
}

.page-title {
    margin-bottom: 0.5rem;
}

.game-description {
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 2rem;
}

.game-container {
    max-width: 800px;
    margin: 0 auto 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    overflow: hidden;
    background-color: #000; /* keep canvas bg dark for the game itself */
}

canvas {
    display: block;
    width: 100%;
    height: auto;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.game-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    color: #ffffff;
    transition: filter 0.2s ease;
    font-family: var(--font-body);
}

.game-btn:hover {
    filter: brightness(0.9);
}

.game-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: none;
}

.game-btn-play { background-color: var(--success); }
.game-btn-pause { background-color: var(--warning); }
.game-btn-restart { background-color: var(--accent); }

/* ==========================================================================
   Components
   ========================================================================== */
.btn {
    display: inline-block;
    background-color: var(--accent);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
    text-decoration: none;
}

.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Articles */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.article-card {
    display: flex;
    flex-direction: column;
}

.article-card h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.article-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex-grow: 1;
}

.article-card .read-more {
    margin-top: 1rem;
    font-weight: 600;
    color: var(--accent);
    display: inline-block;
}

.article-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.article-content {
    line-height: 1.8;
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
}

/* FAQ */
.faq-item {
    margin-bottom: 1.5rem;
}

.faq-item strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.faq-item p {
    color: var(--text-secondary);
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 1.5rem 0;
}

.breadcrumb a {
    color: var(--text-secondary);
}

/* Forms */
input, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--card-bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    margin-bottom: 1rem;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Focus Accessibility */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background-color: var(--card-bg);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    transition: bottom 0.4s ease;
    z-index: 1000;
}

.cookie-banner.show {
    bottom: 0;
}

.cookie-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
    gap: 2rem;
}

.cookie-text {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Ad Placeholder */
.ad-placeholder {
    display: none;
}

/* Footer */
.site-footer {
    background-color: var(--section-bg);
    padding: 3rem 0;
    text-align: center;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-link {
    color: var(--text-secondary);
    font-weight: 500;
}

.footer-link:hover {
    color: var(--accent);
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--bg-color);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 10px 15px rgba(0,0,0,0.05);
        gap: 0.5rem;
    }

    .main-nav.active {
        display: flex;
    }

    .nav-link {
        display: block;
        padding: 0.75rem 1rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
}

/* Print Styles */
@media print {
    .site-header, .site-footer, .game-container, .game-controls, .cookie-banner, .mobile-menu-btn {
        display: none !important;
    }
    
    body {
        background-color: #fff;
        color: #000;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}
