/* 1. Глобальные переменные для тем */
:root {
    --bg-color: #0f111a;
    --card-bg: #161925;
    --text-color: #e1e1e6;
    --accent-color: #7289da; /* Discord Blue */
    --accent-hover: #5b73c7;
    --border-color: #2f334d;
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f1c40f;
    --admin-purple: #9b59b6;
    --header-height: 70px;
    --sidebar-width: 160px;
}

[data-theme="light"] {
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #1c1e21;
    --border-color: #dddfe2;
    --accent-color: #405de6;
}

/* 2. Базовые настройки */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 3. Рекламные блоки (ТЗ: Рекламные баннеры по бокам) */
.side-ad {
    position: fixed;
    top: calc(var(--header-height) + 40px);
    width: var(--sidebar-width);
    height: 600px;
    background: rgba(0,0,0,0.05);
    border: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.left-ad { left: 20px; }
.right-ad { right: 20px; }

/* 4. Верхний баннер Discord */
.top-promo-banner {
    background: #5865F2;
    text-align: center;
    padding: 8px 0;
}
.top-promo-banner a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
}

/* 5. Header */
.main-header {
    height: var(--header-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-color);
}
.logo-text span { color: var(--accent-color); }

.main-nav { display: flex; gap: 20px; }
.nav-item {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
}
.nav-item:hover { color: var(--accent-color); }

/* 6. Кнопки */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}
.btn-primary { background: var(--accent-color); color: white; }
.btn-primary:hover { background: var(--accent-hover); }

.google-login-btn {
    background: #df4b37;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
}

/* 7. Сетка выбора игры (ТЗ: Мейн страница) */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 40px 0;
}

.game-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    text-decoration: none;
    color: white;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
    background-size: cover;
    background-position: center;
}

.game-card:hover { transform: translateY(-5px); }

.game-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.game-card span {
    position: relative;
    z-index: 2;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
}

.any-card {
    background: linear-gradient(45deg, #2c3e50, #000000);
}

/* 8. Настройки и переключатели */
.user-controls { display: flex; align-items: center; gap: 20px; }
.nav-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
}

.lang-switcher { position: relative; }
.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
.lang-switcher:hover .lang-dropdown { display: block; }
.lang-dropdown a {
    display: block;
    padding: 8px 15px;
    color: var(--text-color);
    text-decoration: none;
}

/* Скрытие сайдбаров на мобилках */
@media (max-width: 1400px) {
    .side-ad { display: none; }
}