/* ========== ОСНОВНЫЕ СТИЛИ ========== */
/* === ЕДИНАЯ ТЁМНАЯ ТЕМА === */
:root {
    --theme-transition: none;
    --top-text: #e2e8f0;
    --top-text-muted: rgba(255,255,255,0.55);
    --top-switch-bg: rgba(255,255,255,0.08);
    --top-role-bg: rgba(99,102,241,0.18);
    --top-role-color: #a5b4fc;
}
body {
    --bg-body: #0f172a;
    --bg-surface: #1e293b;
    --bg-card: #1e293b;
    --bg-card-alt: #162032;
    --bg-muted: #2a3548;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --accent: #818cf8;
    --nav-bg: rgba(15,23,42,0.97);
    --top-bar-bg: rgba(15,23,42,0.97);
    --top-bar-border: rgba(255,255,255,0.08);
    min-height: 100vh;
    color-scheme: dark;
    background: var(--bg-body);
    color: var(--text-primary);
    transition: var(--theme-transition);
}
/* Глобальные сбросы для темы */
.container, #main-container, #classroom-screen, #diary-screen,
.rating-card, .card, .card-item, .tournament-card, .battle-card {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
    transition: var(--theme-transition);
}
.rating-card .rating-header, .card-header, .section-header {
    border-color: var(--border) !important;
}
.rating-stat-item, .stat-item, .info-row {
    color: var(--text-secondary) !important;
}
.rating-stat-value, .stat-value {
    color: var(--text-primary) !important;
}
.bottom-nav {
    background: var(--nav-bg) !important;
    border-top: 1px solid var(--border) !important;
    transition: var(--theme-transition);
}
.nav-item {
    color: var(--text-muted) !important;
    transition: var(--theme-transition);
}
.nav-item.active {
    color: var(--accent) !important;
    background: rgba(99,102,241,0.12);
    font-weight: 600;
}
#classroom-screen, #classroom-screen * {
    color: var(--text-primary) !important;
}
#classroom-screen .card, #classroom-screen .card-item {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
}
#diary-screen, #diary-screen .diary-card, #diary-screen .student-card {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}
#top-mode-bar {
    background: var(--top-bar-bg) !important;
    border-bottom: 1px solid var(--top-bar-border) !important;
    transition: var(--theme-transition);
}
/* top-bar кнопки */
#top-mode-bar button[data-mode] {
    border: none; padding: 6px 16px; border-radius: 10px; font-size: 13px;
    font-weight: 600; background: transparent; color: var(--top-text-muted);
    cursor: pointer; transition: all 0.2s;
}
#top-mode-bar button[data-mode].active {
    background: #6366f1; color: #fff;
}
/* role buttons managed by JS (selectMode + loadClassroomProfile) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Android Emoji', sans-serif;
}

body {
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}


/* ========== ХЕДЕР ========== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 12px 0;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: white;
    transform: rotate(10deg);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ========== РЕАЛЬНЫЙ БАЛАНС ========== */
.real-balance {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.real-balance .rub { color: #60a5fa; }
.real-balance .stars { color: #fbbf24; }
.real-balance .separator { color: #475569; }


/* ========== КАРТОЧКИ ДЛЯ ВАЛЮТ ========== */
.real-balance-card,
.game-balance-card,
.stats-card,
.referral-card,
.exchange-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Реальный баланс */
.real-balance-row {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.balance-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
}

.balance-item .stars { color: #fbbf24; }
.balance-item .rub { color: #60a5fa; }
.balance-value { font-weight: 700; color: white; }
.balance-label { 
    font-size: 12px; 
    color: #94a3b8;
    margin-left: 4px;
}

/* Игровой баланс */
.game-balance-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.game-balance-row .zlt-icon { 
    font-size: 32px; 
    color: #34d399;
}

.game-balance-row .big-number {
    font-size: 48px;
    font-weight: 800;
    color: #34d399;
}

.game-balance-row .zlt-label {
    font-size: 16px;
    color: #94a3b8;
}

.game-balance-hint {
    text-align: center;
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 11px;
    color: #94a3b8;
}

.stats-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.stat-secondary {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.stat-secondary-value {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.stat-secondary-label {
    font-size: 11px;
    color: #94a3b8;
}

/* Реферальная программа */
.referral-code {
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 12px;
    font-family: monospace;
    font-size: 16px;
}

.referral-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.referral-value {
    color: #34d399;
    font-weight: 700;
}

/* Правовая информация */
.legal-section {
    background: rgba(30,41,59,0.5);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.legal-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: #94a3b8;
}

.legal-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legal-link {
    color: #818cf8;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.legal-link:hover {
    color: #a5b4fc;
}

/* Кнопки действий */
.profile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 20px 0;
}

.action-button.exchange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.action-button.shop {
    background: linear-gradient(135deg, #10b981, #059669);
}

.action-button.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Обмен валют */
.exchange-balances {
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.balance-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: white;
}

.balance-row:last-child {
    border-bottom: none;
}

.balance-row-value {
    font-weight: 700;
    color: #fbbf24;
}

.rates-card {
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    color: white;
}

.rate-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.rate-value {
    color: #34d399;
    font-weight: 700;
}

.exchange-form {
    margin-top: 16px;
}

.exchange-select,
.exchange-input {
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    color: white;
    font-size: 16px;
}

.exchange-select option {
    background: #1e293b;
}

.exchange-result {
    background: rgba(99,102,241,0.2);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin: 16px 0;
    color: white;
}

.exchange-result span {
    color: #fbbf24;
    font-size: 24px;
}

/* Быстрый старт */
.quick-start-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.quick-start-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-start-card:hover {
    transform: translateY(-2px);
    background: rgba(30, 41, 59, 0.9);
}

.quick-start-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.quick-start-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.quick-start-badge {
    font-size: 12px;
    color: #34d399;
}

/* Сетка предметов */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

/* Настройки тренировки */
.setup-section {
    margin-bottom: 24px;
}

.setup-label {
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setup-button {
    flex: 1;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.setup-button.active {
    background: rgba(99, 102, 241, 0.3);
    border-color: #6366f1;
}

.setup-button:hover {
    background: rgba(30, 41, 59, 0.8);
}

/* Результаты тренировки */
.results-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.result-stat {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    padding: 12px 4px;
    text-align: center;
}

.result-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
}

.result-stat-label {
    font-size: 10px;
    color: #94a3b8;
}

.results-percent {
    font-size: 18px;
    color: #fbbf24;
    margin-top: 8px;
}

.mistakes-card {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}

.mistakes-title {
    font-size: 16px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 12px;
}

.results-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Ожидание турнира */
.waiting-emoji {
    font-size: 48px;
    margin-bottom: 16px;
}

.waiting-info {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 20px;
    padding: 16px;
    margin-top: 20px;
}

.waiting-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.waiting-info-row:last-child {
    border-bottom: none;
}

.waiting-info-value {
    font-weight: 700;
}

.waiting-info-value.prize {
    color: #fbbf24;
}

/* Профиль */
.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.profile-id {
    color: #64748b;
    font-size: 14px;
}

/* Промо-карточки */
.promo-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.promo-card:hover {
    transform: translateY(-2px);
    background: rgba(30, 41, 59, 0.9);
}

.promo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.promo-content {
    flex: 1;
}

.promo-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: white;
}

.promo-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #94a3b8;
}

.promo-prize {
    color: #fbbf24;
    font-weight: 600;
}

/* ========== СУЩЕСТВУЮЩИЕ СТИЛИ ========== */
/* Здесь оставляем все остальные стили из твоего main.css */
/* ... */
/* ========== ОСНОВНЫЕ СТИЛИ ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Android Emoji', sans-serif;
}

body {
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* Градиентный фон */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15), transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* ========== ХЕДЕР ========== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 12px 0;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: white;
    transform: rotate(10deg);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ========== БАЛАНС ========== */
.balance-block {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.balance-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
}

.balance-item.stars { color: #fbbf24; }
.balance-item.zlt { color: #34d399; }
.balance-item.rub { color: #60a5fa; }

.zlt-badge {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 2px;
}

/* ========== ПРИВЕТСТВИЕ ========== */
.welcome-section {
    margin-bottom: 24px;
}

.welcome-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-subtitle {
    font-size: 14px;
    color: #64748b;
}
.play-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 14px 28px; border-radius: 14px;
    background: linear-gradient(135deg, #818cf8, #7c3aed);
    color: white; font-size: 16px; font-weight: 800;
    cursor: pointer; white-space: nowrap; flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 16px rgba(99,102,241,0.5);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.play-btn:active { transform: scale(0.93); }

/* ========== КАРТОЧКА РЕЙТИНГА ========== */
.rating-card {
    background: linear-gradient(135deg, #1e293b, var(--bg-body,#0f172a));
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
}

.rating-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99,102,241,0.2), transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rating-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.rating-title {
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rating-value {
    font-size: 32px;
    font-weight: 800;
    color: #6366f1;
}

.rating-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    position: relative;
    z-index: 1;
}

.rating-stat-item {
    text-align: center;
}

.rating-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
}

.rating-stat-label {
    font-size: 11px;
    color: #94a3b8;
}


/* ========== СЕКЦИИ ========== */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title h2 {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.section-title a {
    color: #818cf8;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

/* ========== КАРТОЧКИ ОБЪЯВЛЕНИЙ ========== */
.announcement-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
    cursor: pointer;
    color: white;
}

.announcement-card:hover {
    transform: translateY(-2px);
    background: rgba(30, 41, 59, 0.9);
}

.announcement-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.announcement-content {
    flex: 1;
}

.announcement-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: white;
}

.announcement-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #94a3b8;
}

.announcement-prize {
    color: #fbbf24;
    font-weight: 600;
}

/* ========== КАРТОЧКИ ПРЕДМЕТОВ ========== */
.placeholder-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.subject-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px 12px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.subject-card:hover {
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-2px);
}

.subject-card.active {
    background: rgba(99, 102, 241, 0.3);
    border-color: #6366f1;
}

.subject-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.subject-title {
    font-size: 14px;
    font-weight: 500;
    color: white;
    margin-bottom: 4px;
}

.subject-badge {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 30px;
    display: inline-block;
}

/* ========== КАРТОЧКИ ТУРНИРОВ ========== */
.tournament-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.tournament-card:hover {
    transform: translateY(-2px);
    background: rgba(30, 41, 59, 0.9);
}

.tournament-card.selected {
    border: 2px solid #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.subject-tag {
    background: rgba(255,255,255,0.1);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
}

.time-tag {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: white;
}

.card-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.stat-item {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 10px 0;
    text-align: center;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 11px;
    color: #94a3b8;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.prize-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prize-label {
    font-size: 13px;
    color: #94a3b8;
}

.prize-value {
    font-size: 18px;
    font-weight: 700;
    color: #fbbf24;
}

/* ========== КНОПКИ ========== */
.action-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 20px;
    position: relative;
    z-index: 1000;
}

.action-button:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(99,102,241,0.5);
}

.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.back-button {
    background: none;
    border: none;
    font-size: 16px;
    color: #818cf8;
    cursor: pointer;
    padding: 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== СЕЛЕКТЫ И ИНПУТЫ ========== */
select.subject-card, input.subject-card {
    width: 100%;
    background: rgba(30, 41, 59, 0.8);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 14px;
    border-radius: 16px;
    font-size: 16px;
    cursor: pointer;
    appearance: none;
}

select.subject-card option {
    background: #1e293b;
    color: white;
}

input.subject-card::placeholder {
    color: #94a3b8;
}

/* ========== ТЕМЫ (ЧИПЫ) ========== */
.topics-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.topic-chip {
    background: rgba(30, 41, 59, 0.5);
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s;
}

.topic-chip:hover {
    background: rgba(30, 41, 59, 0.8);
}

.topic-chip.active {
    background: rgba(99, 102, 241, 0.3);
    border-color: #6366f1;
    color: white;
}

/* ========== ГРУППЫ КНОПОК ========== */
.button-group {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.button-group .subject-card {
    flex: 1;
}

/* ========== ЭКРАН ОЖИДАНИЯ ========== */
.waiting-screen {
    text-align: center;
    padding: 40px 0;
}

.loader {
    width: 50px;
    height: 50px;
    margin: 30px auto;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== ЭКРАН ИГРЫ ========== */
.game-header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-stats {
    background: rgba(99,102,241,0.2);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    color: #818cf8;
    display: flex;
    gap: 8px;
}

.question-counter {
    background: rgba(99,102,241,0.2);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    color: #818cf8;
}

.timer {
    font-size: 32px;
    font-weight: 700;
    color: white;
}

.timer.warning {
    color: #ef4444;
}

.question-box {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 20px;
    font-size: 18px;
    line-height: 1.5;
    font-weight: 500;
    color: white;
}

/* ========== ОПЦИИ ОТВЕТОВ (С НОМЕРАМИ) ========== */
.options-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.option-button {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 16px 20px;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    width: 100%;
}

.option-button:hover {
    border-color: #6366f1;
    background: rgba(99,102,241,0.1);
}

.option-button.selected {
    background: #6366f1;
    color: white;
}

.option-button.correct {
    background: #34d399;
    color: white;
}

.option-button.correct .option-number {
    background: rgba(255,255,255,0.3);
    color: white;
}

.option-button.incorrect {
    background: #ef4444;
    color: white;
}

.option-button.incorrect .option-number {
    background: rgba(255,255,255,0.3);
    color: white;
}

.option-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.option-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    font-weight: 700;
    font-size: 16px;
    color: #818cf8;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    line-height: 1.4;
}

.stats-bar {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #94a3b8;
}

/* ========== ЭКРАН РЕЗУЛЬТАТОВ ========== */
.results-screen {
    padding: 20px 0;
}

.result-header {
    text-align: center;
    margin-bottom: 24px;
}

.result-emoji {
    font-size: 64px;
    margin-bottom: 8px;
}

.place-card {
    background: linear-gradient(135deg, #1e293b, var(--bg-body,#0f172a));
    border-radius: 30px;
    padding: 30px;
    margin-bottom: 24px;
    text-align: center;
    color: white;
}

.place-value {
    font-size: 72px;
    font-weight: 800;
    color: #6366f1;
}

/* ========== ЛИДЕРБОРД ========== */
.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: white;
}

.leaderboard-item.current-user {
    background: rgba(99,102,241,0.1);
    border-radius: 12px;
}

.leaderboard-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 12px;
    color: white;
}

.leaderboard-rank.top1 { background: #fbbf24; color: white; }
.leaderboard-rank.top2 { background: #94a3b8; color: white; }
.leaderboard-rank.top3 { background: #b45309; color: white; }

/* ========== РАЗБОР ОШИБОК ========== */
.mistake-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: white;
}

.mistake-question {
    font-weight: 500;
    margin-bottom: 8px;
    color: white;
}

.mistake-answer-wrong {
    color: #ef4444;
    font-size: 14px;
}

.mistake-answer-correct {
    color: #34d399;
    font-size: 14px;
}

.mistake-explanation {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 4px;
}

/* ===== ПЕРЕКЛЮЧАТЕЛЬ РЕЖИМОВ ===== */
.nav-mode-toggle {
    display: flex;
    background: #1e293b;
    border-radius: 20px;
    padding: 4px;
    margin: 8px 12px;
    border: 1px solid #334155;
}

.mode-option {
    flex: 1;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.3s;
    user-select: none;
}

.mode-option.active {
    background: #6366f1;
    color: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.mode-option:not(.active):hover {
    color: #e2e8f0;
}

body.mode-play .mode-option[data-mode="play"] { background: #6366f1; color: #fff; }

/* ========== БОТТОМ-НАВИГАЦИЯ ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 12, 16, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 8px 0;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: none;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 2px;
    align-items: center;
    z-index: 2147483647;
    justify-content: flex-start;
}
@media (min-width: 768px) {
    .bottom-nav {
        justify-content: center;
    }
}
.bottom-nav::-webkit-scrollbar { display: none; }
.bottom-nav { touch-action: pan-x; }

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #94a3b8;
    font-size: 12px;
    transition: all 0.2s;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 30px;
    position: relative;
    z-index: 10000;
    scroll-snap-align: center;
    flex-shrink: 0;
}

.nav-item.active {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.12);
    font-weight: 600;
}

.nav-icon {
    font-size: 24px;
}

/* ========== УТИЛИТЫ ========== */
.hidden {
    display: none !important;
}

/* ========== ФИКС ДЛЯ КЛИКАБЕЛЬНОСТИ ========== */
button, .subject-card, .nav-item, .action-button, .tournament-card, .back-button, .topic-chip {
    cursor: pointer;
    position: relative;
    z-index: 1000;
}

.rating-card::before, .gradient-bg {
    pointer-events: none;
}

/* ========== РАЗДЕЛЕНИЕ ВАЛЮТ ========== */

/* Реальный баланс в хедере */
.real-balance {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.real-balance .rub { color: #60a5fa; }
.real-balance .stars { color: #fbbf24; }
.real-balance .separator { color: #475569; }

/* Карточки в профиле */
.real-balance-card,
.game-balance-card,
.stats-card,
.referral-card,
.exchange-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Реальный баланс в профиле */
.real-balance-row {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.balance-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
}

.balance-item .stars { color: #fbbf24; }
.balance-item .rub { color: #60a5fa; }
.balance-item .value { font-weight: 700; }
.balance-item .label { 
    font-size: 12px; 
    color: #94a3b8;
    margin-left: 4px;
}

/* Игровой баланс в профиле */
.game-balance-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.game-balance-row .zlt { 
    font-size: 32px; 
    color: #34d399;
}

.game-balance-row .big-number {
    font-size: 48px;
    font-weight: 800;
    color: #34d399;
}

.game-balance-row .label {
    font-size: 16px;
    color: #94a3b8;
}

.game-balance-hint {
    text-align: center;
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
}

/* Игровой баланс в тренировках */
.game-balance-card.small {
    padding: 12px;
    margin-bottom: 16px;
}

.game-balance-card.small .game-balance-row .zlt {
    font-size: 24px;
}

.game-balance-card.small .game-balance-row .big-number {
    font-size: 32px;
}

/* Кнопки действий */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 20px 0;
}

.action-button.exchange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.action-button.shop {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* Обмен валют */
.exchange-balances {
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.balance-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.balance-row:last-child {
    border-bottom: none;
}

.rates-card {
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.rate-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.exchange-form {
    margin-top: 16px;
}

.exchange-form select,
.exchange-form input {
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    color: white;
    font-size: 16px;
}

.exchange-result {
    background: rgba(99,102,241,0.2);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin: 16px 0;
}

.exchange-result span {
    color: #fbbf24;
    font-size: 24px;
}
/* Экран покупки ZLT */
.buy-zlt-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}

.current-balance {
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
}

.current-balance .zlt-amount {
    font-size: 24px;
    font-weight: 700;
    color: #34d399;
}

.packages-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.package-card {
    background: rgba(0,0,0,0.2);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.package-card:hover {
    transform: translateY(-2px);
    background: rgba(0,0,0,0.3);
}

.package-card.popular {
    border: 2px solid #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.package-card.vip {
    border: 2px solid #a855f7;
    background: rgba(168, 85, 247, 0.1);
}

.popular-badge, .vip-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 30px;
    font-weight: 600;
}

.popular-badge {
    background: #fbbf24;
    color: #000;
}

.vip-badge {
    background: #a855f7;
    color: white;
}

.package-info {
    flex: 1;
}

.package-amount {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.package-price {
    font-size: 18px;
    font-weight: 600;
    color: #fbbf24;
}

.package-stars {
    font-size: 14px;
    color: #94a3b8;
}

.package-bonus {
    font-size: 12px;
    color: #34d399;
    margin-top: 4px;
}

.package-button {
    background: linear-gradient(135deg, #34d399, #10b981);
    border: none;
    border-radius: 30px;
    padding: 8px 16px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.package-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(52, 211, 153, 0.5);
}

.selected-package {
    background: rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 16px;
    margin-top: 16px;
}

.selected-info {
    text-align: center;
    font-size: 18px;
    margin-bottom: 16px;
}

.selected-info span {
    font-weight: 700;
    color: #fbbf24;
}

.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.payment-button {
    padding: 14px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-button:first-child {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.payment-button:last-child {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: black;
}

.payment-button:hover {
    transform: scale(1.02);
}

.status-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
}
.status-badge.upcoming {
    background: #3b82f6;
    color: white;
}
.status-badge.active {
    background: #34d399;
    color: white;
}
.status-badge.results {
    background: #fbbf24;
    color: black;
}
.status-badge.ended {
    background: #ef4444;
    color: white;
}
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.countdown-number {
    font-size: 120px;
    font-weight: bold;
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251,191,36,0.5);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}
.game-status {
    font-size: 12px;
    font-weight: bold;
    background: rgba(0,0,0,0.3);
    padding: 4px 8px;
    border-radius: 20px;
}
.announcement-type {
    background: rgba(99,102,241,0.2);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}
.tournament-card .time-tag.countdown {
    background: #fbbf24;
    color: #000;
    font-weight: bold;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}
.subject-badge {
    background: rgba(99,102,241,0.2);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    color: #818cf8;
}

/* ========== ПОДПИСКИ ========== */
.subscriptions-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.subscription-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.05);
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.subscription-card:hover {
    transform: translateY(-2px);
    background: rgba(30, 41, 59, 0.9);
}

.subscription-card.vip {
    border: 2px solid #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.subscription-card.premium {
    border: 2px solid #a855f7;
    background: rgba(168, 85, 247, 0.1);
}

.subscription-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 24px;
}

.subscription-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subscription-price {
    font-size: 28px;
    font-weight: 800;
    color: #fbbf24;
    margin-bottom: 16px;
}

.subscription-price span {
    font-size: 14px;
    color: #94a3b8;
}

.subscription-bonuses {
    margin: 16px 0;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
}

.subscription-bonus {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.subscription-bonus-value {
    color: #34d399;
    font-weight: 600;
}

.subscription-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
}

.subscription-status-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}

.subscription-expires {
    color: #94a3b8;
    font-size: 14px;
    margin: 8px 0;
}

.subscription-cancel {
    background: #ef4444;
    border: none;
    border-radius: 30px;
    padding: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    width: 100%;
}
.subscription-info {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.subscription-header span {
    font-weight: 600;
    color: #fbbf24;
}

.subscription-header a {
    color: #818cf8;
    font-size: 12px;
    cursor: pointer;
}

.subscription-details {
    font-size: 14px;
}

.subscription-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.subscription-bonus {
    color: #34d399;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.exam-switch {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 2px;
}
.exam-btn {
    background: transparent;
    border: none;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: #aaa;
    cursor: pointer;
}
.exam-btn.active {
    background: #fbbf24;
    color: #0f172a;
}


.bottom-nav {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    border-top: 2px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 300px;
    z-index: -2; /* ниже всего */
}

body {
    background: transparent;
    margin: 0;
    padding: 0;
}

#tournaments-container {
    padding-bottom: 80px; /* чтобы кнопка не перекрывалась меню */
}

.floating-join-btn-header {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #0f172a;
    padding: 8px 16px;
    border-radius: 40px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.floating-join-btn-header:active {
    transform: scale(0.96);
}

.floating-join-btn-header.hidden {
    display: none;
}

/* Для всех контейнеров, где есть прокрутка */
.container {
    padding-bottom: 70px; /* высота твоего меню (подбери значение) */
}

/* ===== ТЕМЫ (data-theme) ===== */
/* Тёмная тема — Арена */
body {
    background: var(--bg-body,#0f172a);
    color: var(--text-primary,#e2e8f0);
}

body.oge-mode {
    background: #1a2e1a;
    color: var(--text-primary,#e2e8f0);
}
body.oge-mode .gradient-bg {
    background: radial-gradient(circle at 50% 0%, rgba(52, 211, 153, 0.12), transparent 70%);
}

.game-header {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 20px;
    padding: 10px 14px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary,#e2e8f0);
}
.game-header #game-subject {
    margin-right: auto;
}
.game-header .stats-center {
    display: flex;
    gap: 10px;
    align-items: center;
}
.game-header #timer {
    font-size: 22px;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(0,0,0,0.4);
    padding: 4px 10px;
    border-radius: 16px;
    margin-left: auto;
}
.game-header #correct-count-top { color: #34d399; }
.game-header #wrong-count-top { color: #f87171; }
.game-header #score-top { color: #fbbf24; }
.game-header #total-time-top { color: #94a3b8; }
.game-header #current-q, .game-header #total-q { color: white; }

/* ===== ГЛОБАЛЬНЫЙ ЧАТ ===== */
.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid #1e293b; margin-bottom: 12px;
}
.chat-header .back-button { font-size: 14px; padding: 8px 0; flex-shrink: 0; }
.chat-title { flex: 1; font-size: 16px; font-weight: 600; }
.chat-counter {
  background: #6366f1; color: white;
  font-size: 12px; padding: 2px 10px; border-radius: 12px; font-weight: 600;
}
.chat-messages {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column;
  gap: 6px; padding: 4px 0; min-height: 200px; max-height: 60vh;
}
.chat-message {
  background: #1e293b; border-radius: 12px; padding: 10px 14px;
  max-width: 85%; align-self: flex-start;
}
.chat-message.own {
  background: #6366f122; align-self: flex-end;
  border: 1px solid #6366f144;
}
.chat-msg-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px;
}
.chat-msg-user { font-size: 12px; font-weight: 600; color: #6366f1; }
.chat-msg-time { font-size: 10px; color: #64748b; }
.chat-msg-text { font-size: 14px; line-height: 1.4; word-break: break-word; }
.chat-system {
  text-align: center; font-size: 12px; color: #64748b;
  padding: 8px 0; font-style: italic;
}
.chat-loading { text-align: center; color: #64748b; padding: 40px 0; font-size: 14px; }
.chat-input-bar {
  display: flex; gap: 8px; padding: 12px 0;
  border-top: 1px solid #1e293b; margin-top: 12px;
}
.chat-input {
  flex: 1; padding: 10px 16px; border-radius: 24px; border: 1px solid #334155;
  background: #1e293b; color: #e2e8f0; font-size: 14px; outline: none;
}
.chat-input:focus { border-color: #6366f1; }
.chat-send-btn {
  width: 42px; height: 42px; border-radius: 50%; border: none;
  background: #6366f1; color: white; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.chat-send-btn:hover { background: #4f46e5; }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-float-timer {
  position: fixed; bottom: 80px; right: 16px;
  background: #6366f1; color: white; padding: 8px 16px;
  border-radius: 20px; font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(99,102,241,0.4); z-index: 100;
}
.chat-unread {
  position: absolute; top: -4px; right: -4px;
  background: #ef4444; color: white; font-size: 10px;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

/* ========== ЛИДЕРБОРД ========== */
.rating-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.rating-tab {
  flex: 1;
  padding: 10px 0;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.rating-tab.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1e293b;
  border-radius: 12px;
  padding: 10px 14px;
}
.leaderboard-item.current-user {
  border: 1px solid rgba(99,102,241,0.3);
  background: linear-gradient(135deg, #1e293b, #1e1b4b);
  box-shadow: 0 0 12px rgba(99,102,241,0.08);
}
.leaderboard-rank {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-body,#0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
  flex-shrink: 0;
}
.leaderboard-rank.top1 { background: #fbbf24; color: #000; font-size: 18px; }
.leaderboard-rank.top2 { background: #94a3b8; color: #000; font-size: 16px; }
.leaderboard-rank.top3 { background: #d97706; color: #000; font-size: 15px; }
.leaderboard-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.leaderboard-name {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leaderboard-stats {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}
.leaderboard-rp {
  font-size: 15px;
  font-weight: 800;
  color: #a855f7;
  flex-shrink: 0;
  background: rgba(168,85,247,0.1);
  padding: 6px 12px;
  border-radius: 10px;
  text-align: center;
  min-width: 48px;
}
.leaderboard-my-rank {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(99,102,241,0.3);
}
.my-rank-pos {
  min-width: 40px;
  height: 36px;
  border-radius: 18px;
  background: rgba(99,102,241,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #6366f1;
  flex-shrink: 0;
}
.my-rank-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.my-rank-name {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}
.my-rank-rp {
  font-size: 12px;
  color: #a855f7;
  font-weight: 700;
  margin-top: 2px;
  background: rgba(168,85,247,0.1);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
}

/* ========== ДОСТИЖЕНИЯ ========== */
.achievements-section {
  margin-top: 20px;
}
.achievements-section .section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.achievements-section .section-title {
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
}
.achievements-section .section-badge {
  background: #6366f1;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
}
.achievement-card {
  background: #1e293b;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  transition: all 0.2s;
}
.achievement-card.unlocked {
  border: 1px solid rgba(99,102,241,0.3);
  background: linear-gradient(135deg, #1e293b, #1e1b4b);
}
.achievement-card.claimed-ach {
  opacity: 0.6;
  border: 1px solid rgba(34,197,94,0.2);
}
.achievement-icon {
  font-size: 28px;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}
.achievement-info {
  flex: 1;
  min-width: 0;
}
.achievement-title {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}
.achievement-desc {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}
.achievement-progress-text {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}
.achievement-progress-bar {
  height: 4px;
  background: #334155;
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.achievement-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  border-radius: 2px;
  transition: width 0.3s;
}
.achievement-progress-fill.complete {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}
.achievement-reward {
  font-size: 12px;
  font-weight: 600;
  color: #fbbf24;
  white-space: nowrap;
}
.achievement-claim-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: #22c55e;
  color: white;
  flex-shrink: 0;
}
.achievement-claim-btn:disabled {
  background: #334155;
  color: #64748b;
  cursor: not-allowed;
}
.achievement-claimed-label {
  font-size: 11px;
  color: #22c55e;
  font-weight: 600;
  white-space: nowrap;
}

/* ========== ЭКРАН ДОСТИЖЕНИЙ ========== */
.ach-full-header {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.ach-full-stat {
  flex: 1;
  background: #1e293b;
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  border: 1px solid #334155;
}
.ach-full-stat-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: #6366f1;
  line-height: 1.2;
}
.ach-full-stat-label {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

/* ========== ВОПРОС ДНЯ ========== */
.qod-section {
  margin-bottom: 24px;
}
.qod-card {
  background: linear-gradient(135deg, #1e293b, var(--bg-body,#0f172a));
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 16px;
}
.qod-text {
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 12px;
  line-height: 1.4;
}
.qod-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qod-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  font-size: 14px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s;
}
.qod-option:hover {
  border-color: #6366f1;
  background: #2a2a3e;
}
.qod-option.selected {
  border-color: #6366f1;
  background: #6366f122;
}
.qod-option.correct {
  border-color: #22c55e;
  background: #22c55e22;
  color: #22c55e;
}
.qod-option.wrong {
  border-color: #ef4444;
  background: #ef444422;
  color: #ef4444;
}
.qod-option.disabled {
  cursor: default;
  opacity: 0.7;
}
.qod-option-letter {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  flex-shrink: 0;
}
.qod-option.correct .qod-option-letter {
  background: #22c55e;
  color: white;
}
.qod-option.wrong .qod-option-letter {
  background: #ef4444;
  color: white;
}
.qod-reward {
  font-size: 12px;
  color: #fbbf24;
  font-weight: 600;
  margin-top: 12px;
  text-align: center;
}
.qod-loader {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #94a3b8;
  z-index: 10;
  backdrop-filter: blur(4px);
}
@keyframes qodFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.qod-loader::after {
  content: 'Отправка...';
}
.qod-result {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.qod-result.correct {
  background: #22c55e22;
  color: #22c55e;
  border: 1px solid #22c55e44;
}
.qod-result.wrong {
  background: #ef444422;
  color: #ef4444;
  border: 1px solid #ef444444;
}
.qod-answered {
  margin-top: 0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  line-height: 1.5;
}
.qod-answered.correct {
  background: #22c55e22;
  color: #22c55e;
  border: 1px solid #22c55e44;
}
.qod-answered.wrong {
  background: #ef444422;
  color: #ef4444;
  border: 1px solid #ef444444;
}

/* ========== ЕГЭ-КЛУБ ========== */
.club-tabs {
  display: flex;
  gap: 4px;
  background: #1e293b;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
}
.club-tab {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}
.club-tab.active {
  background: #6366f1;
  color: white;
}
.club-tab-content { display: none; }
.club-tab-content.active { display: block; }
.club-form-card {
  background: #1e293b;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.club-field { margin-bottom: 12px; }
.club-field label {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 4px;
  font-weight: 600;
}
.club-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: var(--bg-body,#0f172a);
  color: #e2e8f0;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
.club-input:focus { border-color: #6366f1; }
.club-textarea { resize: vertical; min-height: 60px; }
.club-questions-editor { font-family: monospace; font-size: 13px; line-height: 1.5; }
.club-field-row { display: flex; gap: 8px; }
.club-cost-badge {
  text-align: center;
  font-size: 14px;
  color: #fbbf24;
  font-weight: 600;
  padding: 8px;
  background: #fbbf2411;
  border-radius: 8px;
  margin-top: 8px;
}
.club-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}
.club-result.success { background: #22c55e22; color: #22c55e; border: 1px solid #22c55e44; }
.club-result.error { background: #ef444422; color: #ef4444; border: 1px solid #ef444444; }
.club-result.info { background: #6366f122; color: #818cf8; border: 1px solid #6366f144; }
.club-result.hidden { display: none; }
.club-preview {
  background: var(--bg-body,#0f172a);
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #94a3b8;
}
.club-preview .highlight { color: #22c55e; font-weight: 600; }
.club-code-input { font-family: monospace; }
.ct-my-card {
  background: var(--bg-body,#0f172a);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid #1e293b;
}
.ct-my-card .ct-title { font-size: 14px; font-weight: 600; color: #e2e8f0; }
.ct-my-card .ct-meta { font-size: 12px; color: #64748b; margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; }
.ct-my-card .ct-code { color: #fbbf24; font-weight: 700; letter-spacing: 2px; }

/* Переключатель режима вопросов */
.club-mode-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-body,#0f172a);
  border-radius: 10px;
  padding: 3px;
}
.club-mode-btn {
  flex: 1;
  text-align: center;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}
.club-mode-btn.active {
  background: #6366f1;
  color: white;
}
.club-mode-section { margin-top: 12px; }
.club-mode-section.hidden { display: none; }

/* Range slider */
.club-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #334155;
  outline: none;
  margin: 8px 0;
}
.club-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  border: 2px solid #4f46e5;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.club-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  border: 2px solid #4f46e5;
}

/* Select styling */
.club-input select, .club-input[type="number"] {
  width: 100%;
}

/* Кнопки на карточках турниров */
.ct-start-btn, .ct-play-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;
}
.ct-start-btn {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
}
.ct-start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== ЛЕНТА НОВОСТЕЙ ===== */
.feed-card {
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

.feed-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.feed-type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.feed-type-announcement {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}
.feed-type-results {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}
.feed-type-news {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}
.feed-type-manual {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

.feed-time {
  font-size: 11px;
  color: #64748b;
}

.feed-text {
  font-size: 14px;
  line-height: 1.5;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.feed-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 8px 0;
}

.feed-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feed-reactions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.feed-reaction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
  transition: all 0.2s;
  user-select: none;
  border: 1px solid transparent;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Android Emoji', 'EmojiSymbols', sans-serif;
}
.feed-reaction:hover {
  background: rgba(255,255,255,0.1);
}
.feed-reaction.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: #6366f1;
}
/* Colored active reactions — order is always ❤️, 🔥, 👍 */
.feed-reactions > .feed-reaction.active:nth-child(1) {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}
.feed-reactions > .feed-reaction.active:nth-child(2) {
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.15);
}
.feed-reactions > .feed-reaction.active:nth-child(3) {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.15);
}

.feed-empty {
  text-align: center;
  color: #64748b;
  padding: 40px 20px;
  font-size: 14px;
}

.feed-more-btn {
  text-align: center;
  color: #818cf8;
  padding: 12px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.1);
  margin-top: 8px;
  transition: all 0.2s;
}
.feed-more-btn:hover {
  background: rgba(99, 102, 241, 0.2);
}
.ct-play-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
}

/* ===== КЛАСС (учебный блок) ===== */
.nav-item[data-section="class"] .nav-icon {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-item[data-section="class"].active {
  border-top-color: #f59e0b;
}
.nav-item[data-section="class"].active .nav-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-item[data-section="class"].active .nav-label {
  color: #d97706;
}

/* ===== КЛАСС-ЭКРАН (внутренние стили) ===== */
#classroom-screen {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  padding: 20px;
  min-height: 100vh;
}
#classroom-screen .container { max-width: 1200px; margin: 0 auto; }
#classroom-screen h1 { font-size: 28px; margin-bottom: 24px; color: var(--text-primary); display: flex; align-items: center; gap: 12px; }
#classroom-screen h1 small { font-size: 14px; font-weight: 400; color: var(--text-muted); }
#classroom-screen .back-link { color: #f59e0b; text-decoration: none; font-size: 14px; display: inline-block; margin-bottom: 16px; }
#classroom-screen .back-link:hover { text-decoration: underline; }
#classroom-screen .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
#classroom-screen .stat-card { background: var(--bg-card); border-radius: 12px; padding: 16px 20px; border: 1px solid var(--border); }
#classroom-screen .stat-card .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
#classroom-screen .stat-card .value { font-size: 28px; font-weight: 700; color: var(--text-primary); margin-top: 4px; }
#classroom-screen .section { background: var(--bg-card); border-radius: 16px; padding: 24px; margin-bottom: 24px; border: 1px solid var(--border); }
#classroom-screen .section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
#classroom-screen .section-title { font-size: 18px; font-weight: 600; color: var(--text-primary); }
#classroom-screen .btn { padding: 8px 20px; border-radius: 8px; border: none; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; background: #6366f1; color: white; }
#classroom-screen .btn:hover { background: #818cf8; transform: translateY(-1px); }
#classroom-screen .btn-secondary { background: #334155; color: #e2e8f0; }
#classroom-screen .btn-secondary:hover { background: #475569; }
#classroom-screen .btn-danger { background: #dc2626; color: white; }
#classroom-screen .btn-danger:hover { background: #ef4444; }
#classroom-screen .btn-success { background: #16a34a; color: white; }
#classroom-screen .btn-success:hover { background: #22c55e; }
#classroom-screen .test-list { display: flex; flex-direction: column; gap: 12px; }
#classroom-screen .test-item { background: var(--bg-muted); border-radius: 10px; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; border-left: 4px solid #6366f1; transition: background 0.2s; }
#classroom-screen .test-item:hover { background: var(--bg-card-alt); }
#classroom-screen .test-info { flex: 1; min-width: 200px; }
#classroom-screen .test-title { font-weight: 600; color: var(--text-primary); font-size: 16px; }
#classroom-screen .test-meta { font-size: 13px; color: var(--text-secondary); margin-top: 4px; display: flex; gap: 16px; flex-wrap: wrap; }
#classroom-screen .test-meta span { display: flex; align-items: center; gap: 4px; }
#classroom-screen .test-status { font-size: 12px; padding: 2px 12px; border-radius: 20px; font-weight: 500; }
#classroom-screen .test-status.published { background: #064e3b; color: #a7f3d0; }
#classroom-screen .test-status.draft { background: #78350f; color: #fde68a; }
#classroom-screen .test-status.archived { background: #1e293b; color: #94a3b8; }
#classroom-screen .test-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#classroom-screen .modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 1000; align-items: center; justify-content: center; }
#classroom-screen .modal-overlay.active { display: flex; }
#classroom-screen .modal { background: var(--bg-card); border-radius: 16px; padding: 32px; max-width: 560px; width: 90%; max-height: 90vh; overflow-y: auto; border: 1px solid var(--border); }
#classroom-screen .modal h2 { color: var(--text-primary); margin-bottom: 20px; font-size: 22px; }
#classroom-screen .modal label { display: block; font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
#classroom-screen .modal input, #classroom-screen .modal select, #classroom-screen .modal textarea { width: 100%; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-muted); color: var(--text-primary); font-size: 14px; margin-bottom: 16px; transition: border-color 0.2s; }
#classroom-screen .modal input:focus, #classroom-screen .modal select:focus, #classroom-screen .modal textarea:focus { outline: none; border-color: #6366f1; }
#classroom-screen .modal textarea { min-height: 80px; resize: vertical; }
#classroom-screen .modal .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
#classroom-screen .modal .modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }
#classroom-screen .empty-state { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
#classroom-screen .empty-state .icon { font-size: 48px; margin-bottom: 12px; }
#classroom-screen .empty-state h3 { color: var(--text-primary); margin-bottom: 8px; }
#classroom-screen .loading { text-align: center; padding: 40px; color: var(--text-muted); }
#classroom-screen .toast { position: fixed; bottom: 24px; right: 24px; background: var(--bg-card); color: var(--text-primary); padding: 12px 24px; border-radius: 10px; border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 2000; transform: translateY(100px); opacity: 0; transition: all 0.3s; }
#classroom-screen .toast.show { transform: translateY(0); opacity: 1; }
#classroom-screen .toast.error { border-color: #dc2626; }
#classroom-screen .toast.success { border-color: #16a34a; }
@media (max-width: 640px) {
  #classroom-screen .modal .form-row { grid-template-columns: 1fr; }
  #classroom-screen .test-item { flex-direction: column; align-items: stretch; }
  #classroom-screen .test-actions { justify-content: flex-start; }
  #classroom-screen .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Inline styles moved from index.html ===== */
/* ===== ГЛОБАЛЬНЫЙ ЧАТ (inline для Telegram WebView) ===== */
.chat-header { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #1e293b; margin-bottom: 12px; }
.chat-header .back-button { font-size: 14px; padding: 8px 0; flex-shrink: 0; }
.chat-title { flex: 1; font-size: 16px; font-weight: 600; }
.chat-counter { background: #6366f1; color: white; font-size: 12px; padding: 2px 10px; border-radius: 12px; font-weight: 600; }
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 0; min-height: 200px; max-height: 60vh; }
.chat-message { background: #1e293b; border-radius: 12px; padding: 10px 14px; max-width: 85%; align-self: flex-start; }
.chat-message.own { background: #6366f122; align-self: flex-end; border: 1px solid #6366f144; }
.chat-msg-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.chat-msg-user { font-size: 12px; font-weight: 600; color: #6366f1; }
.chat-msg-time { font-size: 10px; color: #64748b; }
.chat-msg-text { font-size: 14px; line-height: 1.4; word-break: break-word; }
.chat-system { text-align: center; font-size: 12px; color: #64748b; padding: 8px 0; font-style: italic; }
.chat-loading { text-align: center; color: #64748b; padding: 40px 0; font-size: 14px; }
.chat-input-bar { display: flex; gap: 8px; padding: 12px 0; border-top: 1px solid #1e293b; margin-top: 12px; }
.chat-input { flex: 1; padding: 10px 16px; border-radius: 24px; border: 1px solid #334155; background: #1e293b; color: #e2e8f0; font-size: 14px; outline: none; }
.chat-input:focus { border-color: #6366f1; }
.chat-send-btn { width: 42px; height: 42px; border-radius: 50%; border: none; background: #6366f1; color: white; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-float-timer { position: fixed; bottom: 80px; right: 16px; background: #6366f1; color: white; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 12px rgba(99,102,241,0.4); z-index: 100; }
.chat-unread { position: absolute; top: -4px; right: -4px; background: #ef4444; color: white; font-size: 10px; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700; }

/* ===== ЕЖЕДНЕВНЫЕ ЗАДАНИЯ ===== */
.daily-quests-container { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.quest-loading { text-align: center; color: #64748b; padding: 16px; font-size: 13px; }
.quest-card { background: #1e293b; border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.quest-card.completed { opacity: 0.7; }
.quest-card.claimed { opacity: 0.5; }
.quest-icon { font-size: 24px; width: 36px; text-align: center; flex-shrink: 0; }
.quest-info { flex: 1; min-width: 0; }
.quest-title { font-size: 13px; font-weight: 600; color: #e2e8f0; }
.quest-desc { font-size: 11px; color: #64748b; margin-top: 2px; }
.quest-progress { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.quest-progress-bar { height: 4px; background: #334155; border-radius: 2px; margin-top: 4px; overflow: hidden; }
.quest-progress-fill { height: 100%; background: linear-gradient(90deg, #6366f1, #a855f7); border-radius: 2px; transition: width 0.3s; }
.quest-reward { font-size: 12px; font-weight: 600; color: #fbbf24; white-space: nowrap; }
.quest-claim-btn { padding: 6px 14px; border-radius: 8px; border: none; font-size: 12px; font-weight: 600; cursor: pointer; background: #6366f1; color: white; flex-shrink: 0; }
.quest-claim-btn:disabled { background: #334155; color: #64748b; cursor: not-allowed; }
.quest-claim-btn.claimed { background: #22c55e; color: white; }

/* ===== НОМЕР РЕЛИЗА ===== */
.version-label { position: absolute; top: 4px; right: 4px; font-size: 10px; color: #94a3b8; font-family: monospace; pointer-events: none; user-select: none; }

/* ===== ОНБОРДИНГ ===== */
#onboarding-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10,12,16,0.92);
    backdrop-filter: blur(8px);
    z-index: 2147483647;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    transition: opacity 0.3s;
}
#onboarding-overlay.hidden { display: none !important; }
#onboarding-slides {
    position: relative;
    width: 100%;
    max-width: 360px;
    min-height: 340px;
}
.onboarding-slide {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}
.onboarding-slide.active { display: flex; }
.onboarding-emoji { font-size: 64px; line-height: 1; margin-bottom: 8px; }
.onboarding-title { font-size: 22px; font-weight: 700; color: #fff; }
.onboarding-text { font-size: 15px; color: #94a3b8; line-height: 1.5; max-width: 300px; }
.onboarding-dots {
    display: flex;
    gap: 8px;
    margin: 24px 0;
}
.onboarding-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #334155;
    transition: all 0.3s;
}
.onboarding-dot.active { background: #818cf8; width: 24px; border-radius: 4px; }
.onboarding-btn {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    border: none;
    padding: 14px 48px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}
.onboarding-btn:active { transform: scale(0.96); }
.chat-counter { background: #6366f1; color: white; font-size: 12px; padding: 2px 10px; border-radius: 12px; font-weight: 600; }
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 0; min-height: 200px; max-height: 60vh; }
.chat-message { background: #1e293b; border-radius: 12px; padding: 10px 14px; max-width: 85%; align-self: flex-start; }
.chat-message.own { background: #6366f122; align-self: flex-end; border: 1px solid #6366f144; }
.chat-msg-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.chat-msg-user { font-size: 12px; font-weight: 600; color: #6366f1; }
.chat-msg-time { font-size: 10px; color: #64748b; }
.chat-msg-text { font-size: 14px; line-height: 1.4; word-break: break-word; }
.chat-system { text-align: center; font-size: 12px; color: #64748b; padding: 8px 0; font-style: italic; }
.chat-loading { text-align: center; color: #64748b; padding: 40px 0; font-size: 14px; }
.chat-input-bar { display: flex; gap: 8px; padding: 12px 0; border-top: 1px solid #1e293b; margin-top: 12px; }
.chat-input { flex: 1; padding: 10px 16px; border-radius: 24px; border: 1px solid #334155; background: #1e293b; color: #e2e8f0; font-size: 14px; outline: none; }
.chat-input:focus { border-color: #6366f1; }
.chat-send-btn { width: 42px; height: 42px; border-radius: 50%; border: none; background: #6366f1; color: white; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-float-timer { position: fixed; bottom: 80px; right: 16px; background: #6366f1; color: white; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 12px rgba(99,102,241,0.4); z-index: 100; }
.chat-unread { position: absolute; top: -4px; right: -4px; background: #ef4444; color: white; font-size: 10px; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
    /* Лента новостей */
    .feed-container { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
    .feed-card {
        background: linear-gradient(135deg, #1e293b 0%, #1a2235 100%);
        border-radius: 16px; padding: 18px;
        border: 1px solid #2a3448;
        transition: border-color 0.2s;
        position: relative;
        overflow: hidden;
    }
    .feed-card::before {
        content: '';
        position: absolute; top: 0; left: 0; right: 0; height: 3px;
        background: linear-gradient(90deg, #6366f1, #a855f7);
        opacity: 0.6;
    }
    .feed-card:first-child { border-color: #6366f155; }
    .feed-card:first-child::before { opacity: 1; }
    .feed-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
    .feed-type-badge {
        display: inline-flex; align-items: center; gap: 4px;
        font-size: 11px; padding: 3px 12px; border-radius: 20px;
        font-weight: 600; letter-spacing: 0.3px;
    }
    .feed-type-announcement { background: #6366f120; color: #a5b4fc; border: 1px solid #6366f130; }
    .feed-type-results { background: #fbbf2415; color: #fde68a; border: 1px solid #fbbf2420; }
    .feed-type-manual { background: #22c55e15; color: #86efac; border: 1px solid #22c55e20; }
    .feed-type-news { background: #38bdf815; color: #7dd3fc; border: 1px solid #38bdf820; }
    .feed-time { font-size: 11px; color: #64748b; margin-left: auto; white-space: nowrap; }
    .feed-text { font-size: 14px; line-height: 1.7; color: #e2e8f0; white-space: pre-wrap; margin-bottom: 14px; }
    .feed-join-btn { display: inline-block; padding: 10px 24px; border-radius: 12px;
      background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white;
      font-size: 14px; font-weight: 600; cursor: pointer; text-align: center;
      margin-bottom: 12px; transition: transform 0.15s, box-shadow 0.15s;
      box-shadow: 0 4px 12px rgba(99,102,241,0.3); }
    .feed-join-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(99,102,241,0.4); }
    .feed-join-btn:active { transform: scale(0.97); }
    .feed-divider { height: 1px; background: linear-gradient(90deg, #2a3448, transparent); margin-bottom: 12px; }
    .feed-footer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: #64748b; }
    .feed-reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
    .feed-reaction { background: #2a3448; padding: 3px 12px; border-radius: 16px; cursor: pointer; font-size: 13px; transition: all 0.15s; }
    .feed-reaction:hover { background: #3a4460; transform: scale(1.05); }
    .feed-empty { text-align: center; padding: 40px 20px; color: #64748b; }
    .feed-more-btn { text-align: center; padding: 14px; background: #1e293b; border: 1px solid #2a3448; border-radius: 14px; cursor: pointer; font-size: 14px; color: #818cf8; font-weight: 500; transition: all 0.15s; }
    .feed-more-btn:hover { background: #2a3448; border-color: #6366f144; }

    /* ===== ВОПРОС ДНЯ ===== */
    .qod-card { background: #1e293b; border-radius: 12px; padding: 14px; }
    .qod-text { font-size: 15px; line-height: 1.5; margin-bottom: 12px; font-weight: 500; }
    .qod-options { display: flex; flex-direction: column; gap: 6px; }
    .qod-option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #334155; border-radius: 10px; cursor: pointer; transition: background 0.15s; }
    .qod-option:active { background: #475569; }
    .qod-option.disabled { cursor: default; opacity: 0.8; }
    .qod-option.disabled:active { background: #334155; }
    .qod-option.correct { background: #22c55e22; border: 1px solid #22c55e55; }
    .qod-option.wrong { background: #ef444422; border: 1px solid #ef444455; }
    .qod-option-letter { width: 24px; height: 24px; border-radius: 50%; background: #475569; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
    .qod-option.correct .qod-option-letter { background: #22c55e; color: #fff; }
    .qod-option.wrong .qod-option-letter { background: #ef4444; color: #fff; }
    .qod-result { margin-top: 10px; padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; }
    .qod-result.correct { background: #22c55e15; color: #4ade80; }
    .qod-result.wrong { background: #ef444415; color: #f87171; }
    .qod-reward { font-size: 12px; color: #fbbf24; margin-top: 8px; text-align: center; }
    /* ===== РАСКРЫВАЮЩИЙСЯ ВОПРОС ДНЯ ===== */
    .collapsible-section { margin-bottom: 8px; }
    .collapsible-header { cursor: pointer; user-select: none; }
    .collapsible-header:active { opacity: 0.7; }
    .collapsible-body { overflow: hidden; transition: max-height 0.3s ease; }
    /* ===== БЛОК ВОПРОСА ДНЯ И ЗАДАНИЙ ===== */
    .qod-header { display: flex; align-items: center; justify-content: space-between; background: #1e293b; border: 1px solid #6366f144; border-radius: 12px; padding: 12px 16px; cursor: pointer; user-select: none; }
    .qod-header:active { background: #334155; }
    .qod-header-left { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; color: #e2e8f0; }
    .qod-header-link { font-size: 13px; color: #818cf8; text-decoration: none; flex-shrink: 0; }
    .qod-header + .collapsible-body { margin-top: 8px; }
    /* ===== СВЁРНУТЫЕ СЕКЦИИ ===== */
    .compact-section { margin-bottom: 8px; }
    .compact-section .section-title { margin-bottom: 4px; }
    .compact-section .section-title h2 { font-size: 14px; }
    .compact-section .section-title a { font-size: 12px; }
    .compact-grid { display: flex; gap: 6px; flex-wrap: wrap; }
    .compact-grid .subject-card { padding: 8px 10px; min-width: 0; flex: 1 1 auto; }
    .compact-grid .subject-icon { font-size: 18px; }
    .compact-grid .subject-title { font-size: 12px; }
    .compact-grid .subject-badge { display: none; }
    .compact-card { background: #1e293b; border-radius: 8px; padding: 8px 12px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
    .compact-card .announcement-icon { font-size: 16px; }
    .compact-card .announcement-title { font-size: 13px; }
    .compact-card .announcement-meta { font-size: 11px; gap: 6px; }
    .compact-card .announcement-meta span { white-space: nowrap; }
    .compact-section .announcement-card { padding: 8px 12px; }
    .compact-section .announcement-icon { font-size: 16px; }
    .compact-section .announcement-title { font-size: 13px; }
    .compact-section .announcement-meta { font-size: 11px; gap: 4px; }
    .compact-section .announcement-meta span { white-space: nowrap; }
    .compact-section .announcement-type { display: none; }
    .compact-promo-grid { display: flex; gap: 6px; flex-direction: column; }
    .compact-promo-grid .announcement-card { padding: 8px 12px; }
    .compact-promo-grid .announcement-icon { font-size: 16px; }
    .compact-promo-grid .announcement-title { font-size: 13px; }
    .compact-promo-grid .announcement-meta { font-size: 11px; gap: 6px; }
    .compact-promo { background: #1e293b; border-radius: 8px; padding: 8px 12px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
    .compact-promo .compact-promo-icon { font-size: 16px; }
    .compact-promo .compact-promo-title { font-size: 13px; font-weight: 500; }
    .compact-promo .compact-promo-meta { font-size: 11px; color: #64748b; }
    /* ===== ЭКРАН ЗАДАНИЙ ===== */
    .quests-full { display: flex; flex-direction: column; gap: 10px; padding-bottom: 80px; }
    .quests-full .quest-card { background: #1e293b; border-radius: 12px; padding: 14px; display: flex; align-items: center; gap: 12px; }
    .quests-full .quest-card.completed { opacity: 0.7; }
    .quests-full .quest-card.claimed { opacity: 0.5; }


/* ===== ТЁМНАЯ ТЕМА (data-theme="dark") ===== */
body[data-theme="dark"] .container,
body[data-theme="dark"] #classroom-screen,
body[data-theme="dark"] #classroom-screen .container {
    background: var(--bg-body,#0f172a) !important;
    color: #e2e8f0 !important;
}
body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] .section-title,
body[data-theme="dark"] .welcome-title,
body[data-theme="dark"] .logo-text,
body[data-theme="dark"] .stat-value,
body[data-theme="dark"] .label {
    color: #f1f5f9 !important;
}
body[data-theme="dark"] small,
body[data-theme="dark"] .welcome-subtitle,
body[data-theme="dark"] .label {
    color: #94a3b8 !important;
}
body[data-theme="dark"] .stat-card,
body[data-theme="dark"] .section,
body[data-theme="dark"] .test-list,
body[data-theme="dark"] .rating-card,
body[data-theme="dark"] .subject-card,
body[data-theme="dark"] .game-header {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}
body[data-theme="dark"] .back-link {
    color: #f59e0b !important;
}
body[data-theme="dark"] .btn {
    background: #334155 !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}
body[data-theme="dark"] .btn-secondary {
    background: #1e293b !important;
    border-color: #475569 !important;
}
body[data-theme="dark"] .bottom-nav {
    background: #1e293b !important;
    border-color: #334155 !important;
}
body[data-theme="dark"] .bottom-nav .nav-item,
body[data-theme="dark"] .bottom-nav .nav-label {
    color: #94a3b8 !important;
}
body[data-theme="dark"] .bottom-nav .nav-item.active {
    color: #a5b4fc !important;
    background: rgba(99, 102, 241, 0.25) !important;
    border-top: 2px solid #818cf8 !important;
}
body[data-theme="dark"] .modal,
body[data-theme="dark"] .modal-overlay {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}
body[data-theme="dark"] input,
body[data-theme="dark"] textarea,
body[data-theme="dark"] select {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}
body[data-theme="dark"] label {
    color: #94a3b8 !important;
}
/* MaxFix: inline-стили с белым фоном в класс-руме */
body[data-theme="dark"] [style*="background:#ffffff"],
body[data-theme="dark"] [style*="background: #ffffff"] {
    background: #1e293b !important;
}
body[data-theme="dark"] [style*="color:#1e293b"],
body[data-theme="dark"] [style*="color: #1e293b"] {
    color: #f1f5f9 !important;
}
body[data-theme="dark"] [style*="color:#475569"],
body[data-theme="dark"] [style*="color: #475569"] {
    color: #94a3b8 !important;
}
body[data-theme="dark"] [style*="color:#64748b"],
body[data-theme="dark"] [style*="color: #64748b"] {
    color: #94a3b8 !important;
}
body[data-theme="dark"] [style*="border:1px solid #e2e8f0"],
body[data-theme="dark"] [style*="border: 1px solid #e2e8f0"] {
    border-color: #334155 !important;
}

/* ===== APP SHELL: topbar / content / bottom-nav не пересекаются ===== */
body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    padding-bottom: 0;
}
#top-mode-bar {
    flex-shrink: 0;
}
#content-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
#content-scroll .container {
    padding-bottom: 24px;
}
.bottom-nav {
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    flex-shrink: 0;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    -webkit-overflow-scrolling: touch;
}
.bottom-nav .nav-item {
    flex-shrink: 0 !important;
    white-space: nowrap;
}

/* ===== БРАУЗЕР (десктоп): центрировать нижнее меню ===== */
@media (min-width: 768px) {
    .bottom-nav {
        justify-content: center !important;
    }
}
