/* --- competitions/style.css --- */
/* Дизайн в стиле "Призрачные Гонщики" (Dark Mode + Neon) */

/* !!!ИИ!!! Рекомендация: Добавить CSS переменные для всех цветов и размеров для лучшей поддерживаемости и темизации.
/* !!!ИИ!!! Рекомендация: Реализовать мобильную версию мониторинга (showWordsReport):
   - На мобильных: правая панель (текущая гонка) становится основной
   - Левая панель (все слова) скрывается в выдвижной панели справа
   - Кнопка закрытия должна быть крестиком в правом верхнем углу
   - Добавить CSS media queries для max-width: 768px
*/

:root {
    --bg-dark: #121214;
    --card-bg: rgba(30, 30, 38, 0.75);
    --accent-neon: #00f2fe;
    /* Неоновый голубой */
    --accent-glow: rgba(0, 242, 254, 0.3);
    --text-light: #f5f5f7;
    --text-muted: #8a8a93;
    --border-color: rgba(255, 255, 255, 0.1);

    /* Цвета времени суток */
    --morning-gradient: linear-gradient(135deg, #ff9e7d 0%, #ffbee5 100%);
    --day-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --evening-gradient: linear-gradient(135deg, #fb8c00 0%, #8e24aa 100%);
    --night-gradient: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: background 1s ease;
}

/* --- Стили времени суток --- */
body.morning {
    background: var(--morning-gradient);
    color: #333;
}

body.day {
    background: var(--day-gradient);
    color: #333;
}

body.evening {
    background: var(--evening-gradient);
}

body.night {
    background: var(--night-gradient);
}

/* Если фон светлый, меняем цвет текста */
body.morning .glow-text,
body.day .glow-text {
    color: #1a1a1a;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body.morning .subtitle,
body.day .subtitle {
    color: #555;
}

body.morning .setup-card h3,
body.day .setup-card h3 {
    color: #333;
}

body.morning .stat-label,
body.day .stat-label {
    color: #555;
}

/* --- Контейнер --- */
.game-container {
    width: 100%;
    max-width: 900px;
    /* Немного расширил для сайдбара */
    min-height: 600px;
    height: auto;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    padding: 30px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Светлая тема для карточек если фон светлый */
body.morning .game-container,
body.day .game-container {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

/* --- Экраны --- */
.screen {
    display: none;
    flex-direction: column;
    height: 100%;
    animation: fadeIn 0.3s ease-out;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Лобби --- */
.glow-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 5px;
    color: #fff;
    text-shadow: 0 0 10px var(--accent-glow), 0 0 20px var(--accent-glow);
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 1rem;
}

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

.setup-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.morning .setup-card,
body.day .setup-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}

.setup-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: var(--accent-neon);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.options-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    color: var(--text-light);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

body.morning .option-btn,
body.day .option-btn {
    background: rgba(0, 0, 0, 0.05);
    color: #000;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.option-btn.active {
    background: rgba(0, 242, 254, 0.15);
    border-color: var(--accent-neon);
    color: var(--accent-neon);
    box-shadow: 0 0 15px var(--accent-glow);
}

body.morning .option-btn.active,
body.day .option-btn.active {
    background: rgba(0, 242, 254, 0.2);
    color: #0088cc;
}

/* Статистика */
.player-stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.player-stats-card {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex: 1;
}

.rating-button-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.secondary-btn {
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid var(--accent-neon);
    color: #fff;
    padding: 15px 30px;
    border-radius: 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.secondary-btn:hover {
    background: var(--accent-neon);
    color: #000;
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-2px);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

body.morning .stat-value,
body.day .stat-value {
    color: #1a1a1a;
}

.action-btn {
    background: linear-gradient(90deg, #00f2fe 0%, #4facfe 100%);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 242, 254, 0.3);
}

.glow-btn {
    box-shadow: 0 0 20px var(--accent-glow);
}

.back-link {
    text-align: center;
    margin-top: 15px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: #fff;
}

body.morning .back-link:hover,
body.day .back-link:hover {
    color: #1a1a1a;
}

/* --- Игровой экран --- */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 20px;
    border-radius: 12px;
}

.game-timer {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #ff4a4a;
    text-shadow: 0 0 10px rgba(255, 74, 74, 0.3);
}

.exit-btn {
    background: rgba(255, 74, 74, 0.2);
    border: 1px solid #ff4a4a;
    color: #ff4a4a;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.exit-btn:hover {
    background: #ff4a4a;
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 74, 74, 0.3);
}

.game-stats-top {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.word-progress {
    font-family: 'Orbitron', sans-serif;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.score-display {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: var(--accent-neon);
}

/* Компоновка игры с сайдбаром */
.main-game-layout {
    display: flex;
    flex: 1;
    gap: 20px;
    overflow: hidden;
}

.game-area-left {
    flex: 3;
    display: flex;
    flex-direction: column;
}

.sidebar-right {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.sidebar-right h3 {
    font-size: 0.9rem;
    color: var(--accent-neon);
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    text-align: center;
}

#passed-words-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
}

#passed-words-list li {
    font-size: 0.85rem;
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
}

#passed-words-list li .word {
    color: #fff;
    font-weight: 600;
}

body.day #passed-words-list li .word,
body.morning #passed-words-list li .word {
    color: #111;
}

#passed-words-list li .trans {
    color: var(--text-muted);
}

body.day #passed-words-list li .trans,
body.morning #passed-words-list li .trans {
    color: #444;
}

.phantom-help {
    color: #d8d8d8;
    margin-bottom: 14px;
    line-height: 1.4;
}

.phantom-tree {
    max-height: 60vh;
    overflow-y: auto;
    text-align: left;
}

.phantom-month,
.phantom-day {
    margin-bottom: 10px;
}

.phantom-month > summary,
.phantom-day > summary {
    color: #f5f5f7;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 700;
}

.phantom-day > summary {
    margin: 8px 0 8px 14px;
    color: #00f2fe;
}

.phantom-day > summary span {
    color: #f5f5f7;
    font-size: 0.85rem;
    margin-left: 8px;
}

.phantom-day-sessions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-left: 24px;
}

.phantom-session-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: #d8d8d8;
    margin-bottom: 8px;
}

.phantom-word-count {
    border: 1px solid rgba(0, 242, 254, 0.45);
    color: #00f2fe;
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 700;
}

.ghost-session-words.collapsed {
    display: none;
}

.ghost-session-words.visible {
    display: flex;
}

/* Трасса */
.race-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    padding: 20px 0;
    margin-bottom: 30px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.lane {
    height: 60px;
    position: relative;
    display: flex;
    align-items: center;
}

.lane:first-child {
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.track-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
}

.racer {
    position: absolute;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: left 0.5s cubic-bezier(0.1, 0.7, 0.1, 1);
}

.racer-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

.racer-name {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Специфический стиль для призрака */
#opponent-lane .racer.ghost .racer-icon {
    filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.5)) opacity(0.7);
}

/* Игровая зона */
.game-play-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    justify-content: center;
}

.word-to-type {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #fff;
}

body.morning .word-to-type,
body.day .word-to-type {
    color: #1a1a1a;
}

.translation {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.input-container {
    width: 100%;
    max-width: 400px;
    position: relative;
    display: flex;
    gap: 10px;
}

#game-input {
    flex: 1;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 1.2rem;
    text-align: center;
    transition: all 0.3s ease;
    font-family: inherit;
}

body.morning #game-input,
body.day #game-input {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

#game-input:focus {
    outline: none;
    border-color: var(--accent-neon);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px var(--accent-glow);
}

.boost-btn {
    background: rgba(255, 255, 0, 0.1);
    border: 1px solid #ffcc00;
    color: #ffcc00;
    width: 55px;
    height: 55px;
    border-radius: 12px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.boost-btn:hover {
    background: #ffcc00;
    color: #000;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.4);
}

.feedback-message {
    margin-top: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    height: 20px;
}

.feedback-message.error {
    color: #ff4a4a;
}

.feedback-message.success {
    color: #00f2fe;
}

/* Адаптивность */
@media (max-width: 768px) {
    .main-game-layout {
        flex-direction: column;
    }

    .sidebar-right {
        max-height: 150px;
    }

    .game-container {
        height: auto;
        min-height: 600px;
    }

    /* Мобильная версия лобби - изменение порядка элементов через HTML перестановку */
    /* Верхняя панель (Назад и Прохождение) */
    .lobby-top-bar {
        position: relative;
        top: 0;
        margin-bottom: 15px;
    }

    /* Заголовок */
    .glow-text {
        font-size: 1.8rem;
        margin-top: 10px;
    }

    /* Субтитр - под названием игры */
    .subtitle {
        margin-bottom: 10px;
        font-size: 0.9rem;
    }

    /* Статистика и Чемпионы - после субтитра */
    .player-stats-container {
        margin-bottom: 15px;
    }

    .player-stats-card {
        padding: 10px;
        font-size: 0.85rem;
    }

    .stat-item {
        padding: 5px 0;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .stat-value {
        font-size: 0.9rem;
    }

    .rating-button-container {
        margin-top: 10px;
    }

    .rating-button-container button {
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    /* Сетка настроек (Язык и Противник) */
    .setup-grid {
        gap: 15px;
    }

    /* Кнопки Запуска и Фантома - почти вплотную к Противнику */
    .lobby-actions {
        margin-top: 5px;
        margin-bottom: 10px;
    }

    /* Модальное окно Чемпионы - уменьшить на мобильной */
    .rating-popup {
        font-size: 0.75rem;
    }

    .rating-popup .swal2-title {
        font-size: 1rem;
    }

    .rating-popup table {
        font-size: 0.75rem;
    }

    .rating-popup th,
    .rating-popup td {
        padding: 6px 3px;
    }

    .rating-popup h3 {
        font-size: 0.9rem;
    }

    /* Кнопка настройки - самый верх */
    #admin-settings-btn {
        order: -1;
        position: relative;
        bottom: auto;
        right: auto;
        margin-bottom: 10px;
        align-self: flex-start;
    }

    .setup-card {
        padding: 15px;
    }

    .action-btn {
        font-size: 0.9rem;
        padding: 12px;
    }
}

/* Скрыть мобильные элементы на десктопе */
.words-report-toggle-btn {
    display: none;
}

/* Оверлей для модального окна */
.words-report-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
}

.words-report-modal-overlay.open {
    display: block;
}

/* Скрыть правую панель по умолчанию */
.words-report-right {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    background: #1e1e26 !important;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    overflow-y: auto;
}

.words-report-right.modal-open {
    display: block;
}

/* Кнопка закрытия модального окна */
.words-report-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 74, 74, 0.2);
    border: 1px solid #ff4a4a;
    color: #ff4a4a;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.words-report-close-btn:hover {
    background: #ff4a4a;
    color: #fff;
}

/* Заголовок SweetAlert2 для мониторинга слов */
.swal2-popup .swal2-title {
    color: #fff !important;
}

/* Кнопка гонки в правом верхнем углу */
.words-report-race-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(90deg, #00f2fe 0%, #4facfe 100%);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 242, 254, 0.3);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.words-report-race-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.5);
}

/* Улучшение дизайна для текущих слов (жёлтых) */
.words-report-left div[style*="background: #ffeb3b"] {
    border-left: 3px solid #ffeb3b !important;
    padding-left: 8px !important;
    font-weight: 600 !important;
}

/* Мобильная версия мониторинга слов */
@media (max-width: 768px) {
    .words-report-container {
        position: relative;
        width: 100%;
        height: 70vh;
        overflow: hidden;
    }

    .words-report-race-btn {
        display: flex;
    }

    .words-report-left {
        width: 100%;
        height: 100%;
        overflow-y: auto;
        background: rgba(0, 0, 0, 0.3);
        padding: 10px;
        border-radius: 5px;
    }

    .words-report-right {
        width: 95%;
        max-width: 350px;
    }

    .words-report-toggle-btn {
        display: none;
    }
}

/* Прогресс-бар для кнопки мониторинга */
.monitoring-progress-bar {
    width: 180px;
    height: 6px;
    background: #fff;
    border: 1px solid #000;
    border-radius: 3px;
    overflow: hidden;
}

.monitoring-progress-fill {
    height: 100%;
    background: #4caf50;
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

body.morning .monitoring-progress-bar,
body.day .monitoring-progress-bar {
    background: #fff;
    border: 1px solid #000;
}

body.morning #monitoring-progress-cz span,
body.morning #monitoring-progress-en span,
body.morning #monitoring-progress-both span,
body.day #monitoring-progress-cz span,
body.day #monitoring-progress-en span,
body.day #monitoring-progress-both span {
    color: #000 !important;
}

/* Общее количество очков в игре */
.total-score-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: #f5f5f7;
    margin-left: 15px;
    font-weight: bold;
}

@media (max-width: 600px) {
    .setup-grid {
        grid-template-columns: 1fr;
    }

    .word-to-type {
        font-size: 2rem;
    }
}

/* Небесные светила (Солнце / Луна) - НАД ОКНОМ */
body::before {
    content: '';
    position: fixed;
    top: -40px; /* Частично скрыто за окном по умолчанию */
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    transition: all 1s ease;
    z-index: 0; /* Чтобы быть над фоном, но под окном (у окна z-index должен быть выше) */
    opacity: 0;
}

body.day::before {
    opacity: 1;
    background: #ffea00;
    box-shadow: 0 0 50px #ffea00, 0 0 100px #ffea00;
    top: -60px; /* Видно полностью над окном */
}

body.night::before {
    opacity: 1;
    background: #e0e0e0;
    box-shadow: 0 0 20px #fff, 0 0 40px rgba(255,255,255,0.5);
    left: auto;
    right: 50px;
    transform: none;
    top: 30px; /* Справа сбоку */
}

body.morning::before {
    opacity: 1;
    background: #ff9100;
    box-shadow: 0 0 40px #ff9100;
    top: -20px; /* Наполовину скрыто */
}

body.evening::before {
    opacity: 1;
    background: #ff3d00;
    box-shadow: 0 0 40px #ff3d00;
    top: -20px; /* Наполовину скрыто */
}

/* Улучшение читаемости в светлых темах */
body.day, body.morning {
    color: #1a1a1a;
}

body.day .glow-text, body.morning .glow-text {
    color: #000;
    text-shadow: none;
}

body.day .subtitle, body.morning .subtitle {
    color: #333;
}

body.day .setup-card, body.morning .setup-card,
body.day .player-stats-card, body.morning .player-stats-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
    color: #000;
}

body.day .stat-label, body.morning .stat-label {
    color: #555;
}

body.day .stat-value, body.morning .stat-value {
    color: #000;
}

body.day .option-btn, body.morning .option-btn {
    background: rgba(0, 0, 0, 0.05);
    color: #000;
    border-color: rgba(0, 0, 0, 0.1);
}

body.day .option-btn.active, body.morning .option-btn.active {
    background: var(--accent-neon);
    color: #000;
}

body.day .word-to-type, body.morning .word-to-type {
    color: #000;
    text-shadow: none;
}

body.day .translation, body.morning .translation {
    color: #333;
}

body.day .sidebar-right,
body.morning .sidebar-right,
body.day .game-header,
body.morning .game-header,
body.day .race-track,
body.morning .race-track {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(0, 0, 0, 0.12);
}

body.day .word-progress,
body.morning .word-progress,
body.day .racer-name,
body.morning .racer-name {
    color: #333;
}

/* Кнопка "Назад" сверху */
.top-back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    z-index: 10;
}

.top-back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

body.day .top-back-btn, body.morning .top-back-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #000;
}

body.day .top-back-btn:hover, body.morning .top-back-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Фикс для кнопки Чемпионы в светлой теме */
body.day .secondary-btn, body.morning .secondary-btn {
    color: #000 !important;
    border-color: rgba(0, 0, 0, 0.2);
}

/* Подсветка имени */
.player-name-highlight {
    font-weight: bold;
    color: #ffee00;
    text-shadow: 0 0 10px rgba(255, 238, 0, 0.5);
}

body.day .player-name-highlight, body.morning .player-name-highlight {
    color: #ff0055;
    text-shadow: 0 0 10px rgba(255, 0, 85, 0.3);
}

/* Видимость счета в светлой теме */
body.day #game-score, body.morning #game-score {
    color: #000 !important;
}

/* Плашка для пройденных слов */
.game-area-right {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.day .game-area-right, body.morning .game-area-right {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    color: #000;
}

.ghost-session-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 6px;
}

.ghost-session-card {
    width: 100%;
    border: 1px solid rgba(0, 242, 254, 0.35);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: #f5f5f7;
    padding: 14px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.ghost-session-card:hover {
    background: rgba(0, 242, 254, 0.12);
    transform: translateY(-1px);
}

.ghost-session-main {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 10px;
}

.ghost-session-main strong {
    color: #fff;
    font-size: 1rem;
}

.ghost-session-main small {
    color: #00f2fe;
    font-weight: 600;
}

.ghost-session-words {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ghost-word {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #f5f5f7;
    font-size: 0.82rem;
}

.ghost-word.completed b {
    color: #3cff88;
}

.ghost-word.missed {
    color: #ffb3b3;
}

.ghost-word.missed b {
    color: #ff4a4a;
}