/* =========================================
   N-DRIVE: TRENAZHER PDD - MAIN STYLE
========================================= */

/* --- 1. ПЕРЕМЕННЫЕ (ЦВЕТОВАЯ ПАЛИТРА) --- */
:root {
    --neon-cyan: #00f3ff;
    --neon-purple: #bc13fe;
    --neon-red: #ff003c;
    --neon-green: #00ff66;
    --neon-gold: #ffb700;
    
    --text-main: #ffffff;
    --text-muted: #8ea1bd;
    
    --nav-height: 70px;
}

/* --- 2. БАЗОВЫЕ НАСТРОЙКИ --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-main);
    background: #030508 url('img/bg.webp') no-repeat center center fixed;
    background-size: cover;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(3, 5, 8, 0.7);
    z-index: -2;
}

/* --- 3. ДИНАМИЧЕСКИЙ ФОН "СКОРОСТЬ" --- */
.cyber-speed-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.speed-line {
    position: absolute;
    right: -450px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan));
    box-shadow: 0 0 8px var(--neon-cyan);
    border-radius: 2px;
    animation: flyLine linear forwards;
}

.speed-square {
    position: absolute;
    right: -50px;
    width: 5px;
    height: 5px;
    background: var(--neon-cyan);
    box-shadow: 0 0 6px var(--neon-cyan);
    animation: flySquare linear forwards;
    border-radius: 1px;
}

@keyframes flyLine {
    0% { transform: translateX(0); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateX(-140vw); opacity: 0; }
}

@keyframes flySquare {
    0% { transform: translateX(0) rotate(45deg); opacity: 0; }
    10% { opacity: 0.9; }
    90% { opacity: 0.9; }
    100% { transform: translateX(-140vw) rotate(45deg); opacity: 0; }
}

/* --- 4. УТИЛИТЫ И ГЛАССМОРФИЗМ --- */
.glass-panel {
    background: rgba(10, 15, 25, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 243, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* 
  ЗДЕСЬ МЫ ИЗБАВИЛИСЬ ОТ !important.
  Селектор `body .hidden` имеет вес (0,1,1), что естественно перекрывает 
  любой одиночный класс вроде `.cyber-modal-overlay` с весом (0,1,0).
*/
body .hidden {
    display: none;
}

/* --- 5. ВЕРХНИЙ HUD И ОПЫТ --- */
.cyber-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin: 8px 12px 6px;
    border-radius: 12px;
    gap: 12px;
    z-index: 10;
    border-top: 2px solid var(--neon-cyan);
    border-bottom: 2px solid var(--neon-cyan);
    animation: hudBreathe 2s ease-in-out infinite alternate;
}

@keyframes hudBreathe {
    0% { box-shadow: 0 -3px 10px rgba(0, 243, 255, 0.1), 0 3px 10px rgba(0, 243, 255, 0.1); border-color: rgba(0, 243, 255, 0.3); }
    100% { box-shadow: 0 -8px 20px rgba(0, 243, 255, 0.6), 0 8px 20px rgba(0, 243, 255, 0.6); border-color: rgba(0, 243, 255, 1); }
}

.hud-left { flex-shrink: 0; }
.hud-center { flex-grow: 1; display: flex; flex-direction: column; gap: 4px; }
.hud-right { flex-shrink: 0; display: flex; align-items: center; gap: 6px; }

.avatar-wrapper {
    position: relative;
    width: 45px;
    height: 45px;
}
.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    position: relative;
    z-index: 2; 
}
.level-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: var(--neon-purple);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 900;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #fff;
    z-index: 3;
}

.xp-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--neon-cyan);
    text-transform: uppercase;
    padding: 0 2px;
}
.xp-amount {
    color: var(--text-main);
    text-shadow: 0 0 3px #000;
}
.xp-bar {
    position: relative;
    width: 100%;
    height: 14px;
    display: flex;
    align-items: center;
}
.xp-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
    object-fit: fill;
}

.xp-fill-mask {
    position: absolute;
    top: 15%; left: 1%; 
    height: 70%; width: 98%; 
    z-index: 2;
    border-radius: 4px;
    overflow: hidden;
}

.xp-bar .xp-fill-active {
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.2) 0%, rgba(0, 243, 255, 0.8) 85%, #ffffff 100%);
    border-radius: 3px;
    box-shadow: 0 0 10px var(--neon-cyan);
    position: relative;
    transition: width 0.6s cubic-bezier(0.1, 1, 0.3, 1);
}
/* =========================================
   НАСТРОЙКИ (ШЕСТЕРЕНКА И ПЕРЕКЛЮЧАТЕЛИ)
========================================= */
.hud-settings-btn {
    background: transparent;
    border: none;
    color: var(--neon-cyan);
    font-size: 1.6rem;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), text-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: 8px; /* Поменяли right на left, чтобы отодвинуть от монет */
}

.hud-settings-btn:hover, .hud-settings-btn:active {
    transform: rotate(90deg); /* Крутится при нажатии */
    text-shadow: 0 0 15px var(--neon-cyan);
}

/* Кастомный Cyber-Toggle */
.cyber-toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 0;
    font-weight: 700;
}

.cyber-toggle-label input {
    display: none; /* Прячем стандартный системный чекбокс */
}

.cyber-toggle-slider {
    position: relative;
    width: 44px;
    height: 22px;
    background: rgba(10, 15, 25, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    transition: 0.3s;
}

.cyber-toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    top: 2px;
    left: 3px;
    background: rgba(255, 255, 255, 0.5);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Состояние "ВКЛЮЧЕНО" */
.cyber-toggle-label input:checked + .cyber-toggle-slider {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--neon-cyan);
}

.cyber-toggle-label input:checked + .cyber-toggle-slider::before {
    transform: translateX(20px);
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
}
.coins-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: 900;
    color: var(--neon-gold);
    text-shadow: 0 0 5px rgba(255, 183, 0, 0.5);
    font-size: 0.9rem;
    line-height: 1;
}
.coin-icon {
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

/* --- 6. ОСНОВНОЙ КОНТЕНТ --- */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 6px 6px calc(var(--nav-height) + 20px); 
}

.view-section {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 7. ГЛАВНЫЙ ЭКРАН (ХАБ) И СЕТКА МЕНЮ --- */
.home-header {
    text-align: center;
    margin-bottom: 25px;
    padding-top: 10px;
}

/* Классический прозрачный логотип */
.home-logo {
    width: 80%;
    max-width: 320px;
    filter: drop-shadow(0 0 12px rgba(0, 243, 255, 0.4));
}

/* Новый прямоугольный баннер (режим v2) */
body.theme-v2 .home-logo {
    width: 100%;
    max-width: none;
    filter: none;
    display: block;
    border-radius: 12px;
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

.main-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 5px;
}

.cyber-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(10, 15, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    color: var(--text-main);
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cyber-tile:active { transform: scale(0.95); }

.tile-icon {
    font-size: 2.2rem; /* Это останется для старых иконок в нижнем меню */
    filter: drop-shadow(0 0 8px currentColor);
    display: flex; /* Чтобы картинка центрировалась */
    align-items: center;
    justify-content: center;
}


.tile-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
}

.tile-content h3 {
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
}

.tile-content p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Широкие плитки (на 2 колонки) */
.tile-train, .tile-exam {
    grid-column: 1 / -1;
    flex-direction: row;
    text-align: left;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Сбрасываем нижнюю рамку */
}

/* Тренировка (Зеленая) */
.tile-train {
    border-left: 4px solid var(--neon-green);
}
.tile-train h3, .tile-train .tile-icon { color: var(--neon-green); }

/* Экзамен (Красная) */
.tile-exam {
    border-left: 4px solid var(--neon-red);
}
.tile-exam h3, .tile-exam .tile-icon { color: var(--neon-red); }

/* --- ЦВЕТА КВАДРАТНЫХ ПЛИТОК --- */
.tile-list { border-bottom: 3px solid var(--neon-cyan); }
.tile-list h3, .tile-list .tile-icon { color: var(--neon-cyan); }

.tile-topics { border-bottom: 3px solid var(--neon-gold); }
.tile-topics h3, .tile-topics .tile-icon { color: var(--neon-gold); }

.tile-signs { border-bottom: 3px solid #ff007f; }
.tile-signs h3, .tile-signs .tile-icon { color: #ff007f; }

/* Штрафы теперь огненно-оранжевые */
.tile-penalties { border-bottom: 3px solid #ff4400; }
.tile-penalties h3, .tile-penalties .tile-icon { color: #ff4400; }

/* --- ЭФФЕКТЫ НАВЕДЕНИЯ И НАЖАТИЯ ДЛЯ cyber-tile --- */
.cyber-tile {
    position: relative;
    overflow: hidden; /* Важно: обрезает градиент по краям плитки */
    background: rgba(10, 15, 25, 0.6);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
}

/* Вытягиваем иконки и текст на передний план, чтобы перелив был ПОД ними */
.cyber-tile .tile-icon,
.cyber-tile .tile-content {
    position: relative;
    z-index: 2;
}

/* Тот самый перелив (теперь яркий!) */
.cyber-tile::before {
    content: '';
    position: absolute;
    top: 0; 
    left: -100%; /* Стартуем полностью за левым краем плитки */
    width: 100%; 
    height: 100%;
    /* Более концентрированный луч света */
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 243, 255, 0.15) 30%, 
        rgba(188, 19, 254, 0.4) 50%, 
        rgba(0, 243, 255, 0.15) 70%, 
        transparent 100%
    );
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Эффект при наведении мышкой */
.cyber-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(0, 243, 255, 0.25);
}

/* Включаем и анимируем перелив при наведении */
.cyber-tile:hover::before {
    opacity: 1;
    animation: cyberShimmer 1.5s linear infinite;
}

/* Математика движения слева направо */
@keyframes cyberShimmer {
    0% { transform: translateX(0); }
    100% { transform: translateX(200%); } /* Движение на 200% ширины */
}

/* Эффект при клике/тапе (нажатие) */
.cyber-tile:active {
    transform: scale(0.94);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
.cyber-tile:active::before {
    opacity: 0; /* Гасим перелив при клике */
}

/* Плавность для самой картинки */
.tile-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

/* Увеличение картинки при наведении на плитку */
.cyber-tile:hover .tile-img {
    transform: scale(1.15);
}
.section-title { text-align: center; margin-bottom: 20px; font-size: 1.2rem; }

.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    padding: 10px 0;
}

.ticket-num-btn {
    background: rgba(10, 15, 25, 0.5);
    border: 1px solid rgba(0, 243, 255, 0.3);
    color: var(--neon-cyan);
    border-radius: 8px;
    padding: 15px 0;
    font-family: inherit;
    font-weight: 900;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease; /* Плавность */
}

/* Эффект при наведении (для мышки) */
.ticket-num-btn:hover { 
    background: rgba(0, 243, 255, 0.15); 
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4); 
}

/* Эффект при нажатии (для пальца) */
.ticket-num-btn:active { 
    transform: scale(0.9); 
    background: rgba(0, 243, 255, 0.3); 
}

/* --- 8. ЗАГОЛОВОК ВОПРОСА, КНОПКА И ТАЙМЕР --- */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.question-meta h2 {
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--text-main);
    margin-bottom: 2px;
}

.neon-text {
    font-size: 0.8rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cyber-btn-small {
    background: rgba(255, 183, 0, 0.15);
    border: 1px solid var(--neon-gold);
    color: var(--neon-gold);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 183, 0, 0.25);
    animation: fadeIn 0.3s ease-out forwards;
}

.cyber-btn-small:active {
    transform: scale(0.95);
    background: rgba(255, 183, 0, 0.3);
}

.instrument-gauge {
    display: flex;
    justify-content: center;
    align-items: center;
}

.css-speedometer {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(16, 22, 37, 0.9) 30%, rgba(0, 243, 255, 0.15) 100%);
    border: 2px solid rgba(0, 243, 255, 0.4);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2), inset 0 0 8px rgba(0, 243, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.css-speed-ticks {
    position: absolute;
    top: 3px; left: 3px; right: 3px; bottom: 3px;
    border-radius: 50%;
    border: 2px dashed var(--neon-green);
    clip-path: polygon(0 0, 100% 0, 100% 70%, 0 70%);
    z-index: 1;
    transition: border-color 0.3s ease;
}

.timer-value {
    position: absolute;
    bottom: 6px; 
    font-size: 0.75rem; 
    font-weight: 900;
    z-index: 3;
    text-shadow: 0 1px 2px #000;
}

.css-needle {
    position: absolute;
    top: 50%; left: 50%;
    width: 2px;
    height: 18px;
    background: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
    border-radius: 2px;
    z-index: 2;
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(-135deg);
    transition: transform 1s linear, background-color 0.3s, box-shadow 0.3s;
}

.css-needle::after {
    content: '';
    position: absolute;
    bottom: -3px; left: -2px;
    width: 6px; height: 6px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 4px #000;
}

/* --- 9. МЕДИА И ТЕКСТ ВОПРОСА --- */
.cyber-image-frame {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
    padding: 4px;
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.25) 0%, rgba(10, 15, 25, 0.8) 50%, rgba(188, 19, 254, 0.25) 100%);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6);
}

.q-img {
    width: 100%;
    display: block;
    border-radius: 4px;
    position: relative;
    z-index: 1;
    filter: contrast(1.25) brightness(0.75) saturate(0.85); 
}

.hologram-overlay {
    position: absolute;
    top: 4px; left: 4px; right: 4px; bottom: 4px; 
    background: linear-gradient(rgba(0, 243, 255, 0.04) 50%, transparent 50%);
    background-size: 100% 4px; 
    box-shadow: inset 0 0 25px 12px rgba(10, 15, 25, 1);
    pointer-events: none; 
    z-index: 2;
    border-radius: 4px;
    animation: scanlineMove 10s linear infinite;
}

.cyber-image-frame::before,
.cyber-image-frame::after {
    content: '';
    position: absolute;
    width: 35px; height: 35px;
    z-index: 3;
    pointer-events: none;
}
.cyber-image-frame::before {
    top: -1px; left: -1px;
    border-top: 3px solid var(--neon-cyan);
    border-left: 3px solid var(--neon-cyan);
    border-radius: 8px 0 0 0;
    box-shadow: -2px -2px 10px rgba(0, 243, 255, 0.5);
}
.cyber-image-frame::after {
    bottom: -1px; right: -1px;
    border-bottom: 3px solid var(--neon-purple);
    border-right: 3px solid var(--neon-purple);
    border-radius: 0 0 8px 0;
    box-shadow: 2px 2px 10px rgba(188, 19, 254, 0.5);
}

@keyframes scanlineMove {
    0% { background-position: 0 0; }
    100% { background-position: 0 200px; }
}

@keyframes monitorTurnOn {
    0% { transform: scale(1, 0.02); filter: brightness(4) sepia(1) hue-rotate(180deg); opacity: 0; }
    20% { transform: scale(1, 0.02); filter: brightness(3); opacity: 1; }
    50% { transform: scale(1, 1); filter: brightness(1.5); opacity: 1; }
    80% { filter: brightness(0.8); }
    100% { transform: scale(1, 1); filter: brightness(1); opacity: 1; }
}

.question-body {
    padding: 12px 10px;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700; 
    line-height: 1.35;
    margin-bottom: 12px;
    border-left: 4px solid var(--neon-purple); 
    background: linear-gradient(90deg, rgba(188, 19, 254, 0.15) 0%, rgba(10, 15, 25, 0.45) 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* --- 10. КНОПКИ ОТВЕТОВ --- */
.answers-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.cyber-answer-btn {
    width: 100%;
    background: rgba(10, 15, 25, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.92rem;
    text-align: left;
    padding: 12px 14px;
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.cyber-answer-btn:active {
    transform: scale(0.98);
}

.cyber-answer-btn:not(:disabled):hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.answers-container .cyber-answer-btn:disabled:not(.correct):not(.wrong) {
    opacity: 0.55; 
    filter: blur(1px) grayscale(70%); 
    border-color: rgba(0, 243, 255, 0.1); 
    background: rgba(10, 15, 25, 0.3); 
    box-shadow: none; 
    transform: scale(0.98); 
    transition: all 0.4s ease-out;
}

.cyber-answer-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -150%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transform: skewX(-25deg);
    z-index: 5;
    pointer-events: none;
}

.cyber-answer-btn.correct {
    background: rgba(0, 255, 102, 0.15);
    border-color: var(--neon-green);
    box-shadow: inset 0 0 15px rgba(0, 255, 102, 0.2), 0 0 10px rgba(0, 255, 102, 0.4);
    color: var(--neon-green);
}

.cyber-answer-btn.correct::before {
    animation: glareSweep 0.7s ease-out forwards;
}

.cyber-answer-btn.wrong {
    border-color: var(--neon-red);
    animation: errorFlashAndShake 0.6s ease-in-out forwards; 
}

.cyber-answer-btn.wrong::before {
    display: none; 
}

@keyframes errorFlashAndShake {
    0% { transform: translateX(0); background: rgba(255, 0, 60, 0.9); color: #ffffff; box-shadow: 0 0 25px var(--neon-red); }
    20% { transform: translateX(-6px); background: rgba(255, 0, 60, 0.15); color: var(--neon-red); box-shadow: none; }
    40% { transform: translateX(6px); background: rgba(255, 0, 60, 0.9); color: #ffffff; box-shadow: 0 0 25px var(--neon-red); }
    60% { transform: translateX(-3px); background: rgba(255, 0, 60, 0.15); color: var(--neon-red); box-shadow: none; }
    80% { transform: translateX(3px); background: rgba(255, 0, 60, 0.4); }
    100% { transform: translateX(0); background: rgba(255, 0, 60, 0.15); color: var(--neon-red); box-shadow: inset 0 0 15px rgba(255, 0, 60, 0.2), 0 0 10px rgba(255, 0, 60, 0.4); }
}

@keyframes glareSweep {
    0% { left: -150%; }
    100% { left: 200%; }
}

.cyber-btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(90deg, rgba(0,243,255,0.1) 0%, rgba(188,19,254,0.3) 100%);
    border: 1px solid var(--neon-purple);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(188, 19, 254, 0.4);
}

.cyber-btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 0 5px rgba(188, 19, 254, 0.4);
}

/* --- 11. НИЖНЯЯ НАВИГАЦИЯ --- */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--nav-height);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(0, 243, 255, 0.15);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px;
    transition: all 0.3s;
    cursor: pointer;
}

.nav-btn .icon { font-size: 1.4rem; filter: grayscale(1); }
.nav-btn .label { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; }

.nav-btn.active { color: var(--neon-cyan); }
.nav-btn.active .icon { filter: drop-shadow(0 0 5px var(--neon-cyan)) grayscale(0); transform: scale(1.1); }
.nav-btn.active .label { text-shadow: 0 0 5px var(--neon-cyan); }

/* Плавность для самой иконки */
.nav-btn .icon { 
    font-size: 1.4rem; 
    filter: grayscale(1); 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

/* Эффект при наведении (для тех, кто с мышкой) */
.nav-btn:hover {
    background: rgba(0, 243, 255, 0.05);
    border-radius: 12px;
    color: var(--text-main);
}
.nav-btn:hover .icon {
    transform: translateY(-2px) scale(1.05);
    filter: grayscale(0.3) drop-shadow(0 0 5px rgba(0, 243, 255, 0.3));
}

/* Эффект при клике/тапе (Главная фишка для телефона!) */
.nav-btn:active {
    transform: scale(0.9);
    background: rgba(0, 243, 255, 0.15);
    border-radius: 12px;
}
.nav-btn:active .icon {
    transform: scale(0.95);
}

body.on-home-screen .bottom-nav {
    display: none;
}

body.on-home-screen .app-content {
    padding-bottom: 20px; 
}

/* --- 12. МОДАЛЬНОЕ ОКНО "РАЗБОР" (КИБЕР-СКАНЕР) --- */
.cyber-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(3, 5, 8, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    animation: fadeIn 0.25s ease-out forwards;
}

.cyber-modal-content {
    width: 100%;
    max-width: 500px;
    max-height: 80dvh;
    overflow-y: auto;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--neon-gold);
    box-shadow: 0 0 25px rgba(255, 183, 0, 0.2);
    background: rgba(12, 18, 30, 0.95);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 183, 0, 0.2);
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.modal-header .explanation-header {
    color: var(--neon-gold);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0;
}

.cyber-close-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    width: 28px; height: 28px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cyber-close-btn:active {
    color: var(--neon-red);
    border-color: var(--neon-red);
}

#explanation-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.cyber-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--neon-cyan);
    text-decoration: none;
    font-size: 0.85rem;
    border-bottom: 1px dashed var(--neon-cyan);
}

.cyber-references {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-top: 1px dashed rgba(0, 243, 255, 0.3);
    padding-top: 15px;
}

.cyber-ref-card {
    display: flex;
    gap: 15px;
    background: rgba(10, 15, 25, 0.6);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    animation: slideInRight 0.5s ease-out forwards;
}

.cyber-ref-card img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.cyber-ref-info { flex: 1; }
.cyber-ref-info h4 {
    color: var(--neon-cyan);
    font-size: 0.95rem;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.cyber-ref-penalty {
    margin-top: 8px;
    padding: 8px;
    background: rgba(255, 0, 60, 0.15);
    border-left: 3px solid var(--neon-red);
    color: #ffb3b3;
    font-size: 0.85rem;
    line-height: 1.3;
    border-radius: 0 4px 4px 0;
}
.cyber-ref-penalty b { color: var(--neon-red); }

/* --- 13. АНИМАЦИИ ИНТЕРФЕЙСА И ЧАСТИЦЫ --- */
@keyframes slideInLeft {
    0% { transform: translateX(-120%); opacity: 0; }
    80% { transform: translateX(5%); opacity: 1; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    0% { transform: translateX(120%); opacity: 0; }
    80% { transform: translateX(-5%); opacity: 1; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes unfoldBottom {
    0% { transform: translateY(-40px) scale(0.9); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes flyUp {
    0% { transform: translateY(8px) scale(0.7); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.cyber-particle {
    position: absolute; 
    pointer-events: none;
    border-radius: 50%;
}

.particle-spark {
    background: #ffffff;
    box-shadow: 0 0 8px var(--neon-gold), 0 0 15px var(--neon-gold);
    z-index: 5;
    animation: sparkFly 1.2s cubic-bezier(0.1, 1, 0.3, 1) forwards;
}

.particle-smoke {
    background: rgba(100, 100, 110, 0.7);
    filter: blur(4px);
    z-index: 1;
    animation: smokeRise 0.9s ease-out forwards;
}

.flying-spark {
    position: fixed;
    width: 10px; height: 10px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 10px #ffffff, -8px 4px 10px var(--neon-gold), -16px 8px 20px var(--neon-gold), -24px 12px 25px rgba(255, 183, 0, 0.6);
    z-index: 9999;
    animation: flyToXP 1.85s ease-in-out forwards;
}

.leading-spark {
    position: absolute;
    right: 0; top: 50%;
    width: 12px; height: 12px;
    background: #ffffff;
    border-radius: 50%;
    transform: translate(50%, -50%);
    z-index: 5;
    animation: pulseLeadingSpark 1s infinite alternate;
}

@keyframes sparkFly {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    70% { opacity: 1; transform: translate(calc(-50% + var(--tx)*0.8), calc(-50% + var(--ty)*0.8)) scale(0.6); }
    100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0); opacity: 0; }
}

@keyframes smokeRise {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
    100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(4); opacity: 0; }
}

@keyframes flyToXP {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--endX)), calc(-50% + var(--endY))) scale(1.3); opacity: 1; }
}

@keyframes pulseLeadingSpark {
    0% { box-shadow: 0 0 8px var(--neon-gold), 0 0 15px var(--neon-gold); transform: translate(50%, -50%) scale(1); }
    100% { box-shadow: 0 0 15px var(--neon-gold), 0 0 30px #fff; transform: translate(50%, -50%) scale(1.4); }
}

/* --- ПЛАШКА РЕЖИМА НАД ВОПРОСОМ --- */
.active-mode-banner {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(10, 15, 25, 0.5);
    backdrop-filter: blur(5px);
}

.active-mode-banner.train-mode {
    color: var(--neon-green);
    border: 1px dashed rgba(0, 255, 102, 0.4);
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.1);
}

.active-mode-banner.exam-mode {
    color: var(--neon-red);
    border: 1px dashed rgba(255, 0, 60, 0.4);
    box-shadow: 0 0 10px rgba(255, 0, 60, 0.1);
}

@keyframes slideDownFade {
    0% { transform: translateY(-15px); opacity: 0; filter: blur(4px); }
    100% { transform: translateY(0); opacity: 1; filter: blur(0); }
}

/* =========================================
   СПИСОК ОШИБОК ПОСЛЕ ЭКЗАМЕНА
========================================= */
.exam-mistakes-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.exam-mistakes-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--neon-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.mistake-review-btn {
    width: 100%;
    background: rgba(255, 0, 60, 0.12);
    border: 1px solid rgba(255, 0, 60, 0.4);
    border-left: 4px solid var(--neon-red);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text-main);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s, background 0.2s;
}

.mistake-review-btn:active {
    transform: scale(0.98);
    background: rgba(255, 0, 60, 0.25);
}

.mistake-info {
    flex: 1;
    overflow: hidden;
}

.mistake-q-num {
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--neon-red);
    text-transform: uppercase;
    margin-bottom: 3px;
}

.mistake-q-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mistake-arrow {
    color: var(--neon-gold);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}
/* --- СТИЛИ ФУТЕРА ГЛАВНОГО ЭКРАНА --- */
.main-footer {
    margin-top: 0px;
    padding: 12px 0;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    border-top: 1px dashed rgba(0, 243, 255, 0.15);
    width: 100%;
}

.main-footer a {
    color: var(--neon-cyan);
    text-decoration: none;
    transition: color 0.2s;
}

.main-footer a:hover {
    color: var(--neon-gold);
    text-shadow: 0 0 5px rgba(255, 183, 0, 0.5);
}

.footer-warning {
    margin-top: 6px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35); /* Спокойный благородный серый */
    letter-spacing: 0.2px;
}
/* Жестко прячем футер, если мы не на главном экране */
body:not(.on-home-screen) .main-footer {
    display: none;
}
/* =========================================
   РАЗДЕЛ: ТЕМЫ
========================================= */
.topics-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 5px;
}

.topic-btn {
    background: rgba(10, 15, 25, 0.6);
    border: 1px solid rgba(255, 183, 0, 0.3);
    border-left: 4px solid var(--neon-gold);
    color: var(--text-main);
    padding: 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topic-btn:hover {
    background: rgba(255, 183, 0, 0.15);
    box-shadow: 0 0 15px rgba(255, 183, 0, 0.2);
}

.topic-btn:active {
    transform: scale(0.96);
    background: rgba(255, 183, 0, 0.25);
}

.topic-btn-icon {
    color: var(--neon-gold);
    font-size: 1.2rem;
    text-shadow: 0 0 5px rgba(255, 183, 0, 0.5);
}

/* --- ПРАЗДНИЧНОЕ ОПОВЕЩЕНИЕ О НОВОМ УРОВНЕ (РУЛЬ + ФАНФАРЫ) --- */
.levelup-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    overflow: hidden;
    font-family: 'Exo 2', sans-serif;
}

.levelup-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    will-change: transform, opacity;
    animation: lvlUpFlyOut 0.65s cubic-bezier(0.2, 0.95, 0.3, 1.12) forwards;
}

.levelup-overlay.is-returning .levelup-stage {
    animation: lvlUpFlyBack 0.65s cubic-bezier(0.55, 0.05, 0.85, 0.35) forwards;
}

/* Вращающиеся праздничные лучи за рулём */
.levelup-sunburst {
    position: absolute;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: repeating-conic-gradient(
        from 0deg,
        rgba(255, 215, 0, 0.24) 0deg 10deg,
        transparent 10deg 20deg,
        rgba(0, 243, 255, 0.18) 20deg 30deg,
        transparent 30deg 40deg
    );
    mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 18%, rgba(0, 0, 0, 0) 68%);
    -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 18%, rgba(0, 0, 0, 0) 68%);
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.35s ease, transform 0.45s ease;
}

.levelup-overlay.is-burst .levelup-sunburst {
    opacity: 1;
    transform: scale(1);
    animation: lvlUpRaysSpin 9s linear infinite;
}

.levelup-overlay.is-returning .levelup-sunburst {
    opacity: 0;
    transform: scale(0.3);
}

/* Двойная неоновая волна в момент раскрытия */
.levelup-ring {
    position: absolute;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    border: 3px solid var(--neon-gold);
    box-shadow: 0 0 28px var(--neon-gold), inset 0 0 18px var(--neon-cyan);
    opacity: 0;
}

.levelup-ring-2 {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 32px var(--neon-cyan);
}

.levelup-overlay.is-burst .levelup-ring-1 {
    animation: lvlUpRingExpand 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.levelup-overlay.is-burst .levelup-ring-2 {
    animation: lvlUpRingExpand 1.05s cubic-bezier(0.16, 1, 0.3, 1) 0.12s forwards;
}

/* Контейнер фанфар (искры и конфетти) */
.levelup-particles-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.levelup-spark {
    position: absolute;
    border-radius: 50%;
    animation: lvlUpSparkBurst var(--dur, 1.1s) cubic-bezier(0.12, 0.85, 0.25, 1) forwards;
}

.levelup-confetti {
    position: absolute;
    border-radius: 2px;
    animation: lvlUpConfettiBurst var(--dur, 1.35s) cubic-bezier(0.12, 0.8, 0.25, 1) forwards;
}

/* Внутренняя композиция с лёгким парением */
.levelup-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.levelup-overlay.is-burst .levelup-content {
    animation: lvlUpFloat 2.2s ease-in-out infinite;
}

.levelup-kicker {
    padding: 5px 16px;
    margin-bottom: 10px;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: #fff8d6;
    background: linear-gradient(90deg, rgba(255, 183, 0, 0.25), rgba(0, 243, 255, 0.25));
    border: 1px solid rgba(255, 215, 0, 0.65);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 18px rgba(255, 183, 0, 0.45);
    text-shadow: 0 0 10px rgba(255, 183, 0, 0.85);
}

/* Круг-руль */
.levelup-wheel-wrap {
    position: relative;
    width: 196px;
    height: 196px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(16, 22, 38, 0.92) 42%, rgba(8, 12, 22, 0.72) 100%);
    box-shadow:
        0 0 36px rgba(0, 243, 255, 0.45),
        0 0 64px rgba(255, 183, 0, 0.28);
}

.levelup-wheel-svg,
.levelup-wheel-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.45));
}

.levelup-overlay.is-burst .levelup-wheel-svg,
.levelup-overlay.is-burst .levelup-wheel-img {
    animation: lvlUpWheelWiggle 1.8s ease-in-out infinite;
}

.levelup-number {
    position: absolute;
    font-size: 3.4rem;
    font-weight: 900;
    line-height: 1;
    color: #ffffff;
    text-shadow:
        0 0 14px var(--neon-gold),
        0 0 28px var(--neon-cyan),
        0 2px 6px rgba(0, 0, 0, 0.9);
}

/* Подписи под рулём */
.levelup-meta {
    margin-top: 12px;
    padding: 10px 18px;
    background: rgba(10, 14, 24, 0.86);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 243, 255, 0.45);
    border-radius: 16px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.65);
}

.levelup-rank {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ffffff;
    margin-bottom: 6px;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.levelup-coins {
    display: inline-block;
    padding: 4px 14px;
    font-size: 1rem;
    font-weight: 900;
    color: var(--neon-gold);
    background: rgba(255, 183, 0, 0.16);
    border: 1px solid rgba(255, 183, 0, 0.55);
    border-radius: 999px;
    text-shadow: 0 0 10px rgba(255, 183, 0, 0.6);
}

.levelup-unlock {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(0, 255, 102, 0.35);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--neon-green);
    text-shadow: 0 0 8px rgba(0, 255, 102, 0.45);
}

/* --- КЛЮЧЕВЫЕ КАДРЫ --- */
@keyframes lvlUpFlyOut {
    0% {
        opacity: 0;
        transform: translate(var(--start-x, 0px), var(--start-y, -240px)) scale(0.14) rotate(-200deg);
    }
    70% {
        opacity: 1;
        transform: translate(0, 0) scale(1.08) rotate(12deg);
    }
    100% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
}

@keyframes lvlUpFlyBack {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        opacity: 1;
        transform: translate(0, 0) scale(1.08) rotate(-14deg);
    }
    100% {
        opacity: 0;
        transform: translate(var(--start-x, 0px), var(--start-y, -240px)) scale(0.12) rotate(200deg);
    }
}

@keyframes lvlUpFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

@keyframes lvlUpWheelWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-7deg); }
    75% { transform: rotate(7deg); }
}

@keyframes lvlUpRaysSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes lvlUpRingExpand {
    0% {
        opacity: 0.95;
        transform: scale(0.85);
    }
    100% {
        opacity: 0;
        transform: scale(2.6);
    }
}

@keyframes lvlUpSparkBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0.4);
    }
    20% {
        opacity: 1;
        transform: translate(calc(var(--tx) * 0.45), calc(var(--ty) * 0.45)) scale(1.15);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0.15);
    }
}

@keyframes lvlUpConfettiBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(0.5);
    }
    70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), calc(var(--ty) + 45px)) rotate(var(--rot, 240deg)) scale(0.8);
    }
}

/* =========================================
   ВЫБОР И ПОКУПКА ТЕМ В НАСТРОЙКАХ
========================================= */
.theme-selector-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.theme-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.theme-coins-badge {
    color: var(--neon-gold);
    font-weight: 900;
    font-size: 0.82rem;
}

.theme-cards-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.theme-card-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-main);
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.theme-card-btn:hover:not(:disabled) {
    border-color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.08);
}

.theme-card-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.theme-card-btn.active {
    border-color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.14);
}

.theme-card-btn.soon {
    opacity: 0.55;
    cursor: default;
}

.theme-card-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

.theme-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.theme-card-name {
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
}

.theme-card-desc {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.theme-card-status {
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.theme-status-active { color: var(--neon-green); }
.theme-status-free { color: var(--neon-cyan); }
.theme-status-price { color: var(--neon-gold); }
.theme-status-soon { color: var(--text-muted); }

.theme-shop-msg {
    font-size: 0.76rem;
    font-weight: 700;
    min-height: 16px;
    text-align: center;
}
.cyber-btn-back-link {
    background: rgba(10, 15, 25, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    padding: 8px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
/* --- УМНАЯ ПАНЕЛЬ ПОДСКАЗОК (БАЗА ДЛЯ ТЁМНЫХ ТЕМ) --- */
.hint-toggle-btn {
    padding: 6px 10px;
    font-size: 1.3rem;
    background: rgba(0, 243, 255, 0.05);
    border: 1px dashed rgba(0, 243, 255, 0.4);
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
    transition: all 0.3s;
}

.hint-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    border-color: var(--neon-cyan);
    padding: 10px;
    flex-direction: column;
    gap: 8px;
    z-index: 999999;
    min-width: 220px;
    background: rgba(10, 12, 16, 0.98);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 1);
    text-align: left;
    border-radius: 10px;
    font-family: 'Exo 2', sans-serif;
}

.hint-header-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.12);
    padding: 7px 10px;
    transition: 0.2s;
    cursor: pointer;
}

.hint-header-btn.is-open {
    background: rgba(0, 243, 255, 0.06);
}

.hint-header-btn.is-used-header {
    color: var(--neon-green);
}

.hint-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.hint-content-box {
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.hint-desc {
    font-size: 0.75rem;
    color: #ccc;
    line-height: 1.4;
    text-shadow: none;
}

.hint-lock-note {
    color: var(--neon-red);
    font-weight: 700;
    margin-top: 6px;
    display: inline-block;
}

.hint-cost {
    color: var(--neon-gold);
    font-weight: 700;
}

.hint-free {
    color: var(--neon-green);
    font-weight: 700;
}

.hint-use-btn.is-locked {
    opacity: 0.45;
    border-color: var(--text-muted);
}

.hint-use-btn.is-no-coins {
    opacity: 0.5;
    border-color: var(--neon-red);
    color: var(--neon-red);
}

.hint-use-btn.is-ready {
    border-color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.15);
    cursor: pointer;
}

.hint-use-btn.is-reusable {
    border-color: var(--neon-green);
    color: var(--neon-green);
    background: rgba(0, 255, 102, 0.06);
}

.hint-use-btn.is-used {
    opacity: 0.6;
    border-color: var(--neon-green);
    color: var(--neon-green);
    background: transparent;
    cursor: default;
}
/* --- ИТОГИ БИЛЕТА И ЧЕК НАГРАД (БАЗА ДЛЯ ТЁМНЫХ ТЕМ) --- */
.ticket-result-wrap {
    text-align: center;
    padding: 12px 0;
}

.ticket-result-badge {
    display: inline-block;
    padding: 4px 12px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.08);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 20px;
}

.ticket-result-title {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.ticket-result-title.is-passed {
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
}

.ticket-result-title.is-failed {
    color: var(--neon-red);
    text-shadow: 0 0 10px var(--neon-red);
}

.ticket-result-desc {
    font-size: 1.05rem;
    margin-bottom: 12px;
}

.ticket-result-totals {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-bottom: 14px;
}

.ticket-total-xp {
    color: var(--neon-cyan);
    font-size: 1.3rem;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

.ticket-total-coins {
    color: var(--neon-gold);
    font-size: 1.3rem;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(255, 183, 0, 0.4);
}

.ticket-receipt {
    max-width: 340px;
    margin: 0 auto 18px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 10px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
}

.receipt-row:last-child {
    border-bottom: none;
}

.receipt-label {
    color: #ccc;
    text-align: left;
}

.receipt-val {
    white-space: nowrap;
}

.receipt-xp {
    color: var(--neon-cyan);
    font-weight: 700;
}

.receipt-coins {
    color: var(--neon-gold);
    font-weight: 700;
}

.ticket-result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
    margin: 0 auto;
}

.ticket-retry-btn {
    width: 100%;
    padding: 12px 16px;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.12);
    border: 1px solid var(--neon-cyan);
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.2);
}

.ticket-home-btn {
    width: 100%;
    padding: 11px 16px;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
}

/* --- РАЗБОР ОШИБОК ЭКЗАМЕНА В МОДАЛКЕ --- */
.mistake-modal-question {
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.35;
}

.mistake-answer-box {
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.mistake-answer-box.is-wrong {
    background: rgba(255, 0, 60, 0.15);
    border-left: 3px solid var(--neon-red);
    color: #ffb3b3;
}

.mistake-answer-box.is-correct {
    background: rgba(0, 255, 102, 0.12);
    border-left: 3px solid var(--neon-green);
    color: var(--neon-green);
    margin-bottom: 12px;
}

.mistake-modal-tip {
    border-top: 1px dashed rgba(255, 183, 0, 0.25);
    padding-top: 10px;
}
/* Десктопный сайдбар и виджеты скрыты на мобильных экранах */
.desktop-only {
    display: none;
}
/* =========================================
   СВЯЗКА УСТРОЙСТВ (ТЕЛЕФОН <-> ПК)
========================================= */
.cloud-sync-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cloud-sync-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-main);
}

.cloud-sync-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--neon-cyan);
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(128, 128, 128, 0.14);
}

.cloud-sync-my {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-code-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px dashed var(--neon-cyan);
    background: rgba(128, 128, 128, 0.1);
}

.sync-code-display.hidden {
    display: none;
}

.sync-code-display strong {
    font-size: 1rem;
    letter-spacing: 2px;
    color: var(--neon-cyan);
}

.cloud-sync-enter {
    display: flex;
    gap: 8px;
}

.cloud-sync-enter input {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(128, 128, 128, 0.3);
    background: rgba(128, 128, 128, 0.1);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.82rem;
    text-transform: uppercase;
    outline: none;
}

.cloud-sync-enter input:focus {
    border-color: var(--neon-cyan);
}