:root {
    /* Brand Colors */
    --primary: #2563eb;       /* Royal Blue */
    --primary-dark: #1e40af;
    --accent: #f59e0b;        /* Amber for highlights */
    
    /* Backgrounds */
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.9); /* Прозрачность для хедера */
    
    /* Text */
    --text-main: #111827;
    --text-muted: #6b7280;
    
    /* UI Elements */
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding-top: 80px; /* Отступ под фиксированную шапку */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Navigation Bar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--bg-nav);
    backdrop-filter: blur(10px); /* Эффект матового стекла */
    border-bottom: 1px solid #e5e7eb;
    z-index: 1000;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-container {
    width: 100%;
    max-width: 1200px; /* Широкий контейнер */
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    margin-left: 20px;
    font-size: 0.95rem;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--primary); }
.nav-btn {
    background: var(--primary);
    color: white !important;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.nav-btn:hover { background: var(--primary-dark); }

/* --- Layout Wrappers --- */
.wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1; /* Прижимает футер вниз */
}

/* Для страницы игры (узкая колонка) */
.wrapper-narrow {
    max-width: 680px;
}

/* --- Components --- */
.hero {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 40px;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 10px; color: #1e293b; }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* Сетка карточек */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Адаптивная магия */
    gap: 24px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.card-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 10px 0; }
.card-meta { display: flex; gap: 10px; margin-bottom: 20px; }
.tag { background: #eff6ff; color: var(--primary); padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; }

/* Buttons & Inputs */
.btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
    width: 100%;
}
.btn:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 2px solid #e5e7eb; color: var(--text-main); }
.btn-outline:hover { border-color: var(--text-main); }

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
    font-size: 1rem;
    box-sizing: border-box;
}

/* Game Styles */
.question-block { margin-top: 20px; }
.question-text { font-size: 1.35rem; font-weight: 700; line-height: 1.4; margin-bottom: 25px; color: #334155; }
.options-list { display: flex; flex-direction: column; gap: 12px; }

.option-btn {
    padding: 18px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    text-align: left;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    color: var(--text-main);
}
.option-btn:hover:not(:disabled) { border-color: var(--primary); background: #eff6ff; }
.option-btn.correct { background: #dcfce7 !important; border-color: #22c55e !important; color: #14532d; }
.option-btn.wrong { background: #fee2e2 !important; border-color: #ef4444 !important; color: #7f1d1d; }

.footer {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
    border-top: 1px solid #e5e7eb;
    background: white;
}
.hidden { display: none !important; }