/* ============================================
   COLOR SCHEME - ТЕМНАЯ ТЕМА
   ============================================ */
:root {
    color-scheme: dark;  /* Подсказывает браузеру использовать тёмную тему */
}

/* Сброс отступов у всех элементов */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;  /* Учитываем padding и border в ширине/высоте */
}

/* ============================================
   RESET & GLOBAL
   ============================================ */

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #121212;  /* Тёмный фон */
    color: #e0e0e0;             /* Светлый текст */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.main-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 20px;
    background-color: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
    width: 100%;
}

/* ============================================
   CHESS CONTAINER
   ============================================ */
.chess-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

/* ============================================
   CHESS BOARD WRAPPER
   ============================================ */
.chess-board-wrapper {
    background-color: #1e1e1e;
    padding: 20px;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 320px;
    flex: 1;
    max-width: 560px;
}

/* ============================================
   CHESS BOARD
   ============================================ */
.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);  /* 8 колонок равной ширины */
    gap: 0;
    width: 100%;
    aspect-ratio: 1;  /* Доска всегда квадратная */
    border: 2px solid #2a2a4a;
    border-radius: 8px;
    overflow: hidden;
    background-color: #1e1e1e;
    user-select: none;  /* Запрещаем выделение текста */
}

/* ============================================
   CHESS CELLS
   ============================================ */
.chess-cell {
    aspect-ratio: 1;  /* Каждая клетка квадратная */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(28px, 6vw, 48px);  /* Адаптивный размер шрифта */
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

/* Светлые клетки */
.chess-cell.white {
    background: #f0d9b5;
}

/* Тёмные клетки */
.chess-cell.black {
    background: #b58863;
}

/* Эффект при наведении */
.chess-cell:hover {
    filter: brightness(1.08);
}

/* Эффект при клике */
.chess-cell:active {
    transform: scale(0.92);
}

/* Выбранная клетка (зелёная подсветка) */
.chess-cell.selected {
    background: #7fc97f !important;
    box-shadow: inset 0 0 24px rgba(46, 204, 113, 0.5);
}

/* Подсветка возможных ходов (кружок с анимацией) */
.chess-cell.highlight::after {
    content: '';
    position: absolute;
    width: 30%;
    height: 30%;
    background: rgba(46, 204, 113, 0.5);
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

/* Анимация пульсации для подсветки возможных ходов */
@keyframes pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* ============================================
   ПОДСВЕТКА ПОСЛЕДНЕГО ХОДА (тёмный оливковый)
   ============================================ */

/* Стили для клеток, с которых был сделан ход (last-move-from) 
   и на которые был сделан ход (last-move-to) */
.chess-cell.last-move-from,
.chess-cell.last-move-to {
    
    /* 
       box-shadow: inset - создаёт внутреннюю тень (контур внутри клетки)
       0 0 0 - смещение по X, смещение по Y, размытие (0 = чёткий контур)
       3px - толщина контура
       rgba(60, 80, 20, 0.7) - цвет контура:
         60 - красный компонент
         80 - зелёный компонент 
         20 - синий компонент
         0.7 - непрозрачность (70% видимости, 30% прозрачности)
       !important - принудительно применяет стиль поверх других
    */
    box-shadow: inset 0 0 0 3px rgba(60, 80, 20, 0.7) !important;
    
    /* 
       animation - анимация появления контура
       move-highlight-lichess - имя анимации (описана ниже)
       0.4s - длительность анимации (400 миллисекунд)
       ease-out - плавное замедление в конце анимации
    */
    animation: move-highlight-lichess 0.4s ease-out;
    
    /* 
       z-index: 1 - поднимает элемент выше остальных,
       чтобы контур был виден поверх соседних клеток
    */
    z-index: 1;
}

/* 
   Анимация появления контура 
   (в начале толще и ярче, к концу становится тоньше и бледнее)
*/
@keyframes move-highlight-lichess {
    
    /* 
       0% - начало анимации (сразу после хода)
       box-shadow: inset 0 0 0 4.5px - контур толще (4.5px)
       rgba(60, 80, 20, 0.9) - цвет с непрозрачностью 90% (ярче)
    */
    0% {
        box-shadow: inset 0 0 0 4.5px rgba(60, 80, 20, 0.9);
    }
    
    /* 
       100% - конец анимации (через 0.4 секунды)
       box-shadow: inset 0 0 0 3px - контур тоньше (3px)
       rgba(60, 80, 20, 0.7) - цвет с непрозрачностью 70% (бледнее)
       Контур остаётся в таком состоянии до следующего хода
    */
    100% {
        box-shadow: inset 0 0 0 3px rgba(60, 80, 20, 0.7);
    }
}

/* ============================================
   КНОПКА "ВЕРНУТЬ ХОД" (приглушённая)
   ============================================ */
.chess-controls button.undo {
    background: rgba(255, 165, 0, 0.25);  /* Полупрозрачный оранжевый */
    color: #e0a040;                        /* Приглушённый оранжевый текст */
    border: 1px solid rgba(255, 165, 0, 0.3);
    backdrop-filter: blur(4px);            /* Лёгкое размытие фона */
    transition: all 0.25s ease;
}

/* Активная кнопка при наведении */
.chess-controls button.undo:hover:not(:disabled) {
    background: rgba(255, 165, 0, 0.4);
    border-color: rgba(255, 165, 0, 0.5);
    color: #f0b850;
    box-shadow: 0 0 16px rgba(255, 165, 0, 0.15);
    transform: scale(1.02);
}

/* Отключённая кнопка (нет ходов для отмены) */
.chess-controls button.undo:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    transform: none !important;
    border-color: rgba(255, 255, 255, 0.05);
    color: #666;
    background: rgba(255, 255, 255, 0.03);
}

/* Отключённая кнопка при наведении (без эффектов) */
.chess-controls button.undo:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}


/* ============================================
   КНОПКА ПРАВИЛ С ИНДИКАТОРОМ
   ============================================ */

#rulesToggle {
    transition: all 0.3s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

#rulesToggle .rules-indicator {
    transition: all 0.3s ease;
}

/* Анимация при смене состояния */
#rulesToggle .rules-indicator {
    animation: rulesIndicatorPop 0.3s ease;
}

@keyframes rulesIndicatorPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* При наведении */
#rulesToggle:hover {
    transform: scale(1.02);
}

#rulesToggle:active {
    transform: scale(0.95);
}


/* ============================================
   ПРЕДУПРЕЖДЕНИЕ "НЕТ ХОДОВ ДЛЯ ОТМЕНЫ" (приглушённое)
   ============================================ */
.chess-status .no-undo {
    color: #666;               /* Тёмно-серый, почти незаметный */
    font-style: italic;
    font-size: 14px;
    opacity: 0.7;
}

/* Иконка перед текстом */
.chess-status .no-undo::before {
    content: '⏳ ';
    opacity: 0.5;
}

/* ============================================
   CHESS INFO
   ============================================ */
.chess-info {
    background-color: #2a2a2a;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* ID комнаты (кликабельный для копирования) */
.chess-info .room-id {
    color: #e0e0e0;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    user-select: all;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

/* Эффект при наведении на ID комнаты */
.chess-info .room-id:hover {
    background: rgba(255, 215, 0, 0.1);
    text-decoration: underline;
}

/* Метки (например, "🏠 Комната:") */
.chess-info .label {
    color: #888;
    font-size: 14px;
}

/* Значения (например, ID комнаты) */
.chess-info .value {
    color: #e0e0e0;
    font-weight: 500;
}

/* ============================================
   CHESS STATUS
   ============================================ */
.chess-status {
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 15px;
    min-height: 44px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    border: 1px solid #2a2a2a;
}

/* Успешное сообщение (зелёное) */
.chess-status .success {
    color: #2ecc71;
}

/* Сообщение об ошибке (серое) */
.chess-status .error {
    color: #e0e0e0;
    background: transparent;
}

/* Информационное сообщение (голубое) */
.chess-status .info-msg {
    color: #87ceeb;
}

/* Предупреждение (жёлтое) */
.chess-status .warning {
    color: #f1c40f;
}

/* ============================================
   CHESS CONTROLS
   ============================================ */
.chess-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 4px;
}

/* Поля ввода */
.chess-controls input {
    flex: 1;
    min-width: 100px;
    padding: 8px 14px;
    border: 2px solid #444;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #e0e0e0;
    font-size: 14px;
    transition: border-color 0.3s, background 0.3s;
}

/* Поле ввода в фокусе */
.chess-controls input:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 255, 255, 0.08);
}

/* Placeholder в полях ввода */
.chess-controls input::placeholder {
    color: #666;
}

/* Кнопки */
.chess-controls button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
    font-size: 13px;
    white-space: nowrap;
}

/* Эффект при наведении на кнопку */
.chess-controls button:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Эффект при клике на кнопку */
.chess-controls button:active {
    transform: scale(0.94);
}

/* --- ЦВЕТА КНОПОК --- */

/* Синяя кнопка (Войти) */
.chess-controls button.primary {
    background: #007bff;
}
.chess-controls button.primary:hover {
    background: #0056b3;
}

/* Зелёная кнопка (Создать) */
.chess-controls button.success {
    background: #28a745;
}
.chess-controls button.success:hover {
    background: #1e7e34;
}

/* Серая кнопка (Очистить) */
.chess-controls button.danger {
    background: #6c757d;
    color: #fff;
}
.chess-controls button.danger:hover {
    background: #5a6268;
}

/* Фиолетовая кнопка (Сброс, Перевернуть) */
.chess-controls button.secondary {
    background: #4a4a6a;
}
.chess-controls button.secondary:hover {
    background: #5a5a7a;
}

/* Жёлтая кнопка (предупреждение) */
.chess-controls button.warning {
    background: #ffc107;
    color: #1a1a2e;
}
.chess-controls button.warning:hover {
    background: #e0a800;
}

/* ============================================
   CHESS SIDEBAR
   ============================================ */
.chess-sidebar {
    max-width: 280px;
    min-width: 200px;
    padding: 20px;
    background-color: #1e1e1e;
    border-radius: 12px;
    border: 1px solid #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    flex: 1;
}

/* Заголовок сайдбара */
.chess-sidebar h3 {
    color: #007bff;
    font-size: 1.2rem;
    margin-bottom: 16px;
    text-align: center;
    letter-spacing: 1px;
}

/* Каждый пункт в сайдбаре */
.chess-sidebar .info-item {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid #2a2a2a;
    font-size: 13px;
    gap: 8px;
}

/* Метка в сайдбаре */
.chess-sidebar .info-item .label {
    color: #888;
    flex-shrink: 0;
}

/* Значение в сайдбаре (кликабельное для копирования) */
.chess-sidebar .info-item .value {
    color: #e0e0e0;
    cursor: pointer;
    text-align: right;
    word-break: break-all;
    transition: color 0.2s;
}

/* Эффект при наведении на значение в сайдбаре */
.chess-sidebar .info-item .value:hover {
    color: #ffd700;
}

/* Разделительная линия в сайдбаре */
.chess-sidebar hr {
    border: none;
    border-top: 1px solid #2a2a2a;
    margin: 12px 0;
}

/* Подсказка внизу сайдбара */
.chess-sidebar .footer-note {
    text-align: center;
    font-size: 11px;
    color: #555;
    margin-top: 8px;
}

/* ============================================
   TOAST NOTIFICATIONS (всплывающие уведомления)
   ============================================ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transform: translateY(80px);    /* Скрыт за экраном */
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    z-index: 1000;
    max-width: 380px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

/* Показанное уведомление */
.toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* --- ЦВЕТА TOAST --- */

/* Успех (зелёный) */
.toast.success {
    background: #28a745;
    color: #fff;
}

/* Ошибка (тёмный фон с оранжевым текстом) */
.toast.error {
    background: #2a2a2a;
    color: #ffa94d;
    border: 1px solid #ffa94d;
}

/* Информация (синий) */
.toast.info {
    background: #17a2b8;
    color: #fff;
}

/* Предупреждение (жёлтый) */
.toast.warning {
    background: #ffc107;
    color: #1a1a2e;
}


/* ============================================
   ПОДСВЕТКА КОРОЛЯ ПРИ ШАХЕ
   ============================================ */

.chess-cell.king-in-check {
    position: relative;
    z-index: 2;
}

/* Внешнее свечение вокруг короля */
.chess-cell.king-in-check::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 50, 50, 0.25) 0%, rgba(255, 50, 50, 0) 70%);
    animation: kingCheckGlow 1.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* Сама клетка с королём - лёгкий красноватый оттенок */
.chess-cell.king-in-check {
    background: rgba(255, 50, 50, 0.08) !important;
}

/* Для тёмных клеток чуть ярче */
.chess-cell.black.king-in-check {
    background: rgba(255, 50, 50, 0.15) !important;
}

@keyframes kingCheckGlow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}


/* ============================================
   SCROLLBAR (полоса прокрутки)
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================
   АДАПТИВ ДЛЯ РАЗНЫХ ЭКРАНОВ (RESPONSIVE)
   ============================================ */

/* ============================================
   ПЛАНШЕТЫ И МАЛЕНЬКИЕ НОУТБУКИ (до 900px)
   ============================================ */
@media (max-width: 900px) {
    .main-container {
        padding: 16px;
        border-radius: 8px;
    }

    .chess-container {
        flex-direction: column;    /* Вертикальное расположение */
        align-items: center;
    }

    .chess-sidebar {
        max-width: 100%;
        min-width: auto;
        width: 100%;
    }

    .chess-board-wrapper {
        max-width: 100%;
        min-width: auto;
        padding: 16px;
    }
}

/* ============================================
   ТЕЛЕФОНЫ (до 600px)
   ============================================ */
@media (max-width: 600px) {
    body {
        padding: 8px;
        min-height: 100vh;
        height: 100%;
        overflow-x: hidden;  /* Убираем горизонтальную прокрутку */
    }

    .main-container {
        padding: 10px;
        border-radius: 6px;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
    }

    .chess-container {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 12px;
    }

    .chess-board-wrapper {
        padding: 10px;
        min-width: unset;      /* Убираем минимальную ширину */
        max-width: 100%;
        width: 100%;
        flex: none;
    }

    /* Доска занимает всю ширину и остаётся квадратной */
    .chess-board {
        width: 100%;
        aspect-ratio: 1;
        max-width: 100%;
        border-width: 1px;
    }

    /* Размер фигур на доске */
    .chess-cell {
        font-size: clamp(20px, 5vw, 32px);
    }

    /* Информация над доской */
    .chess-info {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 4px;
        font-size: 13px;
        padding: 10px;
    }

    .chess-info .room-id {
        font-size: 16px;
        word-break: break-all;  /* Перенос длинных ID */
    }

    /* Статус игры */
    .chess-status {
        font-size: 13px;
        min-height: 36px;
        padding: 8px 12px;
        margin: 10px 0;
    }

    /* Панель управления */
    .chess-controls {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .chess-controls input {
        min-width: 60px;
        font-size: 12px;
        padding: 6px 10px;
        flex: 1 1 80px;
    }

    .chess-controls button {
        font-size: 11px;
        padding: 6px 10px;
        flex: 1 1 auto;
        min-width: 50px;
    }

    /* Сайдбар на всю ширину */
    .chess-sidebar {
        max-width: 100%;
        min-width: unset;
        width: 100%;
        padding: 14px;
        margin-top: 0;
    }

    .chess-sidebar h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .chess-sidebar .info-item {
        font-size: 12px;
        padding: 5px 0;
    }

    /* Toast на всю ширину экрана */
    .toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
        font-size: 12px;
        padding: 10px 14px;
    }
}

/* ============================================
   ОЧЕНЬ МАЛЕНЬКИЕ ТЕЛЕФОНЫ (до 400px)
   ============================================ */
@media (max-width: 400px) {
    .chess-board-wrapper {
        padding: 6px;
    }

    .chess-controls input {
        min-width: 50px;
        font-size: 11px;
        padding: 4px 8px;
    }

    .chess-controls button {
        font-size: 10px;
        padding: 4px 8px;
        min-width: 40px;
    }

    .chess-sidebar {
        padding: 10px;
    }

    .chess-sidebar .info-item {
        font-size: 11px;
    }

    .chess-info {
        font-size: 11px;
        padding: 8px;
    }
}


/* ============================================
   КНОПКИ РЕЖИМОВ ИГРЫ (RADIOBUTTON)
   ============================================ */

.mode-btn {
    position: relative;
    padding: 8px 14px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: #aaa;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 80px;
    justify-content: center;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
    transform: translateY(-1px);
}

.mode-btn:active {
    transform: scale(0.95);
}

/* Активная кнопка */
.mode-btn.active {
    background: rgba(40, 167, 69, 0.12);
    border-color: #28a745;
    color: #28a745;
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.1);
}

/* Индикатор (зелёный кружок) */
.mode-btn .mode-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

/* Активный индикатор - зелёный с пульсацией */
.mode-btn.active .mode-indicator {
    background: #28a745;
    border-color: #28a745;
    box-shadow: 0 0 12px rgba(40, 167, 69, 0.4);
    animation: modeIndicatorPulse 2s ease-in-out infinite;
}

@keyframes modeIndicatorPulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(40, 167, 69, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(40, 167, 69, 0.6);
    }
}

/* Текст подсказки для режимов */
.mode-hint {
    font-size: 12px;
    color: #666;
    text-align: center;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    margin-top: 4px;
    min-height: 20px;
    transition: all 0.3s ease;
}

.mode-hint.active {
    color: #aaa;
    background: rgba(255, 255, 255, 0.04);
}

/* Адаптив для мобильных */
@media (max-width: 600px) {
    .mode-btn {
        font-size: 11px;
        padding: 6px 10px;
        min-width: 60px;
        gap: 4px;
    }
    
    .mode-btn .mode-indicator {
        width: 8px;
        height: 8px;
    }
}

/* ============================================
   ОТОБРАЖЕНИЕ РЕЖИМА В САЙДБАРЕ
   ============================================ */

#modeDisplay {
    transition: all 0.3s ease;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Разные цвета для разных режимов в сайдбаре */
#modeDisplay.mode-classic {
    color: #28a745;
}

#modeDisplay.mode-marseille {
    color: #17a2b8;
}

#modeDisplay.mode-no_turn {
    color: #ffc107;
}

#modeDisplay.mode-no_rules {
    color: #dc3545;
}

/* Анимация при смене режима в сайдбаре */
@keyframes modeDisplayChange {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    30% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    60% {
        transform: scale(0.9);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#modeDisplay.changing {
    animation: modeDisplayChange 0.4s ease-out;
}