/* Общие стили */
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* background: url('assets/menu/background.png') no-repeat center center fixed; */
    background-size: 101%;
}

canvas {
    width: 100%;
    height: 100vh;
    display: none;
    z-index: 0; /* Канвас ниже интерфейса */
}

/* style.css */
#fps-counter {
    position: absolute;
    top: 10px; /* Остаётся вверху */
    left: 50%; /* Центрируем по горизонтали */
    transform: translateX(-50%); /* Сдвигаем влево на половину ширины элемента */
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    z-index: 1000;
    border-radius: 3px;
}

#target-health-bar {
    position: absolute;
    top: 70px; /* Оставляем позицию, чтобы не пересекаться с другими шкалами */
    left: 10px;
    width: 200px;
    height: 12px; /* Уменьшаем высоту до 12px, как у ship-health-bar */
    background: rgba(0, 0, 0, 0.5); /* Полупрозрачный черный фон, как у корабля */
    border: 1px solid #00D4FF; /* Голубая граница, как у корабля */
    border-radius: 3px; /* Скругленные углы */
    overflow: hidden; /* Скрываем переполнение для fill */
    display: none;
}
#target-health-fill {
    height: 100%;
    background: #00B7EB; /* Синий цвет вместо зеленого (#00CC00) */
    transition: width 0.3s ease; /* Плавный переход, как у ship-health-fill */
}
#target-health-bar::before {
    content: attr(data-label);
    color: #fff;
    font-family: 'Orbitron', sans-serif; /* Заменяем Arial на Orbitron */
    font-size: 10px; /* Размер шрифта, как у ship-health-bar */
    position: absolute;
    top: -16px; /* Позиция над шкалой, как у корабля */
    left: 0; /* Выравнивание по левому краю, как у корабля */
    text-shadow: 0 0 3px rgba(0, 212, 255, 0.6); /* Тень текста, как у корабля */
}

#reloadButton {
    position: fixed;
    top: 50px;
    right: 40px;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 2000 !important;
    pointer-events: auto !important;
    transition: transform 0.3s ease;
}

#reloadButton::before,
#reloadButton::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 3px;
    background: #00D4FF;
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
    transition: transform 0.3s ease, background 0.3s ease;
}

#reloadButton::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

#reloadButton::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

#reloadButton:hover::before,
#reloadButton:hover::after {
    background: #ffffff;
}

#reloadButton:hover {
    transform: scale(1.2);
}

#reloadButton:hover::after {
    content: 'Reload';
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: white;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
    width: auto;
    height: auto;
    background: none;
    box-shadow: none;
    transform: translate(-50%, 100%);
    top: 100%;
    left: 50%;
}

/* Стили для чата */
#chat-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 300px;
    font-family: 'Orbitron', sans-serif;
    color: white;
    z-index: 1001; /* Выше других элементов */
}

#chat-log {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 212, 255, 0.5);
    border-radius: 5px;
    height: 200px;
    overflow-y: auto;
    padding: 10px;
    font-size: 14px;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

#chat-log p {
    margin: 5px 0;
}

#chat-input-container {
    display: flex;
    margin-top: 5px;
}

#chat-input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 212, 255, 0.5);
    border-radius: 5px;
    padding: 5px;
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    outline: none;
}

#chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
}

#chat-send-button {
    background: rgba(0, 212, 255, 0.8);
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    margin-left: 5px;
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    cursor: pointer;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

#chat-send-button:hover {
    background: rgba(0, 212, 255, 1);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

#reloadButton:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

#mainMenuOverlay:not([style*="display: none"]) ~ #reloadButton,
#settingsOverlay:not([style*="display: none"]) ~ #reloadButton {
    display: none !important;
}

#mainMenuOverlay[style*="display: none"] ~ #reloadButton {
    display: block !important;
}

#application-canvas {
    z-index: 0 !important;
}

#network-status {
    z-index: 500 !important;
}



/* Стили для всплывающего окна с маркерами */
#marker-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border: 1px solid #00D4FF;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    max-height: 80vh;
    overflow-y: auto;
    display: none;
    z-index: 1000; /* Выше всех элементов */
    pointer-events: auto; /* Перехват кликов */
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

#marker-window h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

#marker-window div {
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#marker-window button {
    padding: 2px 5px;
    font-size: 12px;
    background: linear-gradient(45deg, #0D1B2A, #00D4FF);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
    font-family: 'Orbitron', sans-serif;
    transition: transform 0.3s, border 0.3s; /* Добавлен переход для границы */
}

#marker-window button:hover {
    transform: scale(1.05);
}

#marker-window button:focus {
    outline: none; /* Убираем стандартный outline */
    border: 2px solid #00D4FF; /* Голубой контур при фокусе */
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.8); /* Свечение */
}

#marker-window button.active-button {
    background: linear-gradient(45deg, #00D4FF, #0D1B2A); /* Инвертированный градиент */
    border: 2px solid #fff; /* Белый контур для активной кнопки */
    transform: scale(1.05); /* Увеличение */
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8); /* Свечение */
}

/* Стили для всплывающего окна склада */
#storage-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border: 1px solid #00D4FF;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    max-height: 80vh;
    overflow-y: auto;
    display: none; /* По умолчанию скрыто */
    z-index: 1000;
    pointer-events: auto; /* Меню кликабельно */
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

#storage-window h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
    text-align: center;
}

/* Контейнеры для групп ресурсов */
.resource-group {
    margin: 15px 0;
}

.resource-group h4 {
    font-size: 16px;
    color: #00D4FF;
    margin: 5px 0;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

/* Стили для списка ресурсов */
.resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 5px 0;
}

/* Текст ресурса и количества */
.resource-name {
    font-size: 14px;
    color: white;
}

.resource-amount {
    font-size: 14px;
}

/* Недостаток ресурсов (красный) */
.resource-amount.insufficient {
    color: #FF3333;
    text-shadow: 0 0 5px rgba(255, 51, 51, 0.8);
}

/* Достаточно ресурсов (зелёный) */
.resource-amount.sufficient {
    color: #00CC00;
    text-shadow: 0 0 5px rgba(0, 204, 0, 0.8);
}

/* Кнопки создания топлива и патронов */
#make-fuel, #make-ammo {
    padding: 5px 10px;
    font-size: 14px;
    background: linear-gradient(45deg, #0D1B2A, #00D4FF);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
    font-family: 'Orbitron', sans-serif;
    transition: transform 0.3s, border 0.3s, background 0.3s, box-shadow 0.3s;
    margin: 5px 0;
    width: 100%;
    text-align: center;
    pointer-events: auto; /* Кнопки кликабельны */
}

/* Эффект при наведении */
#make-fuel:hover, #make-ammo:hover {
    transform: scale(1.05);
    background: linear-gradient(45deg, #00D4FF, #0D1B2A); /* Инверсия градиента */
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

/* Состояние фокуса (для клавиатурной навигации) */
#make-fuel:focus, #make-ammo:focus {
    outline: none;
    border: 2px solid #00D4FF;
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

/* Некликабельное состояние */
#make-fuel:disabled, #make-ammo:disabled {
    background: linear-gradient(45deg, #0D1B2A, #666);
    color: #888;
    cursor: not-allowed;
    text-shadow: none;
    transform: none;
    box-shadow: none;
}

/* Активная кнопка (выделение при навигации стрелками) */
#make-fuel.active-button, #make-ammo.active-button {
    background: linear-gradient(45deg, #00D4FF, #0D1B2A);
    border: 2px solid #fff;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

/* Убираем pointer-events: none с body и оставляем остальным меню */
#marker-window, #orbit-window, #asteroid-submenu {
    pointer-events: auto; /* Эти меню тоже кликабельны */
}

/* По умолчанию всё кликабельно */
body {
    pointer-events: auto;
}

/* Экран "Game Over" */
.game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
    font-family: 'Orbitron', sans-serif;
    color: white;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
}

.game-over-title {
    font-size: 48px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
    margin-bottom: 30px;
}

.restart-button {
    padding: 10px 20px;
    font-size: 20px;
    background: linear-gradient(45deg, #0D1B2A, #00D4FF);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
    font-family: 'Orbitron', sans-serif;
    transition: transform 0.3s, box-shadow 0.3s;
}

.restart-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

.restart-button:focus {
    outline: none;
    border: 2px solid #00D4FF;
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

.restart-button.active-button {
    background: linear-gradient(45deg, #00D4FF, #0D1B2A);
    border: 2px solid #fff;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* Групповой экран с подсказками в начале игры */
#controls-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 20px;
    border: 2px solid #00D4FF;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
    animation: pulse 2s infinite;
}

#controls-hint h3 {
    font-size: 24px;
    text-align: center;
    margin: 0 0 15px 0;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

#controls-hint .category {
    margin: 10px 0;
}

#controls-hint .category h4 {
    font-size: 18px;
    color: #00D4FF;
    margin: 5px 0;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

#controls-hint .category p {
    margin: 5px 0;
    font-size: 14px;
}

#controls-hint .key {
    color: #00D4FF;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

#controls-hint button {
    display: block;
    margin: 15px auto 0;
    padding: 10px 20px;
    font-size: 16px;
    background: linear-gradient(45deg, #0D1B2A, #00D4FF);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
    font-family: 'Orbitron', sans-serif;
    transition: transform 0.3s;
}

#controls-hint button:hover {
    transform: scale(1.05);
}

/* Контекстная подсказка для переключения камер */
#camera-hint {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 10px 20px;
    border: 2px solid #00D4FF;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    display: none;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
    animation: pulse 2s infinite;
    pointer-events: none;
}

#camera-hint .key {
    color: #00D4FF;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

/* Контекстная подсказка для стрельбы */
#shoot-hint {
    position: absolute;
    bottom: 40px;
    right: 10px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 10px 15px;
    border: 2px solid #00D4FF;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    display: none;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
    animation: pulse 2s infinite;
    pointer-events: none;
}

#shoot-hint .key {
    color: #00D4FF;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

/* Контекстная подсказка для меню маркеров */
#marker-hint {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -100%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 10px 20px;
    border: 2px solid #00D4FF;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    display: none;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
    animation: pulse 2s infinite;
    pointer-events: none;
}

#marker-hint .key {
    color: #00D4FF;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

/* Контекстная подсказка для урона */
#damage-hint {
    position: absolute;
    top: 60px;
    left: 10px;
    background: rgba(255, 0, 0, 0.3);
    color: #f00;
    padding: 10px 20px;
    border: 2px solid #f00;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    display: none;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
    animation: blink 1s infinite;
    pointer-events: none;
}

/* Контекстная подсказка для способностей */
#ability-hint {
    position: absolute;
    top: 30px;
    left: 10px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 10px 20px;
    border: 2px solid #00D4FF;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    display: none;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
    animation: pulse 2s infinite;
    pointer-events: none;
}

#ability-hint.shield {
    color: #00f;
    border-color: #00f;
    box-shadow: 0 0 15px rgba(0, 0, 255, 0.6);
}

#ability-hint.cloak {
    color: #888;
    border-color: #888;
    box-shadow: 0 0 15px rgba(136, 136, 136, 0.6);
}

#ability-hint.turrets {
    color: #f80;
    border-color: #f80;
    box-shadow: 0 0 15px rgba(255, 136, 0, 0.6);
}

#ability-hint .key {
    color: #00D4FF;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

/* Общая анимация пульсации */
@keyframes pulse {
    0% { opacity: 0.9; }
    50% { opacity: 1; }
    100% { opacity: 0.9; }
}

/* Общая анимация мигания */
@keyframes blink {
    50% { opacity: 0.5; }
}

/* Оповещение о спавне астероидов */
#asteroid-spawn-alert {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 15px 25px;
    border: 2px solid #00D4FF;
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    text-align: center;
    display: none;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
    cursor: pointer;
    transition: transform 0.3s, opacity 0.5s;
    animation: pulse 2s infinite;
}

#asteroid-spawn-alert:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 0 20px rgba(0, 212, 255, 1);
}

#asteroid-spawn-alert span {
    font-size: 14px;
    color: #00D4FF;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

/* Прицел */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: top 0.1s, left 0.1s;
    z-index: 200;
    display: none; 
}

#crosshair::before,
#crosshair::after {
    content: '';
    position: absolute;
    background: #ff0000;
    box-shadow: 0 0 5px #ff0000;
}

#crosshair::before {
    width: 2px;
    height: 10px;
    left: 4px;
    top: 0;
}

#crosshair::after {
    width: 10px;
    height: 2px;
    left: 0;
    top: 4px;
}

#crosshair.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

#crosshair:not(.active) {
    opacity: 0.7;
}

/* Главное меню */
#mainMenuOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    z-index: 100;
}

/* Скрываем все элементы здоровья и надпись, когда главное меню видно */
#mainMenuOverlay:not([style*="display: none"]) ~ #ship-health-bar,
#mainMenuOverlay:not([style*="display: none"]) ~ #ship-health-fill,
#mainMenuOverlay:not([style*="display: none"]) ~ #base-health-bar,
#mainMenuOverlay:not([style*="display: none"]) ~ #base-health-fill,
#mainMenuOverlay:not([style*="display: none"]) ~ #cosmic-base-label {
    display: none;
}

#mainMenuOverlay button {
    position: relative; /* Убедимся, что кнопки не перекрываются */
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 500;
    color: transparent;
    background: linear-gradient(45deg, #0D1B2A, #00D4FF);
    background-clip: text;
    -webkit-background-clip: text;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8),
                 1px 1px 1px rgba(255, 255, 255, 0.3),
                 -1px -1px 1px rgba(255, 255, 255, 0.3);
    padding: 15px 25px;
    margin: 20px 0 20px 20px;
    border: none;
    background-color: transparent;
    cursor: pointer !important;
    pointer-events: auto !important;
    outline: none;
}

#mainMenuOverlay button:hover {
    transform: scale(1.05);
    text-shadow: 0 0 10px rgba(0, 212, 255, 1),
                 1px 1px 1px rgba(255, 255, 255, 0.5),
                 -1px -1px 1px rgba(255, 255, 255, 0.5);
}

#mainMenuOverlay button:focus {
    outline: 2px solid #00D4FF;
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

@keyframes sparkle {
    0% { text-shadow: 0 0 5px rgba(0, 212, 255, 0.8), 1px 1px 1px rgba(255, 255, 255, 0.3), -1px -1px 1px rgba(255, 255, 255, 0.3); }
    50% { text-shadow: 0 0 5px rgba(0, 212, 255, 0.8), 2px 2px 2px rgba(255, 255, 255, 0.5), -2px -2px 2px rgba(255, 255, 255, 0.5); }
    100% { text-shadow: 0 0 5px rgba(0, 212, 255, 0.8), 1px 1px 1px rgba(255, 255, 255, 0.3), -1px -1px 1px rgba(255, 255, 255, 0.3); }
}

#mainMenuOverlay button {
    animation: sparkle 2s infinite;
}

/* Вступительные экраны и оверлеи */
#introOverlay, #mission2IntroOverlay, #defeatOverlay, #victoryOverlay, #missionStubOverlay, #settingsOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
    font-family: 'Orbitron', sans-serif;
    z-index: 100;
    text-align: center;
}

#introOverlay div, #mission2IntroOverlay div {
    font-size: 18px;
    white-space: pre-wrap;
    margin-bottom: 20px;
}

#introOverlay div:first-child, #mission2IntroOverlay div:first-child {
    font-size: 32px;
    margin-bottom: 20px;
}

#introOverlay button, #mission2IntroOverlay button, #defeatOverlay button, #victoryOverlay button, #missionStubOverlay button, #settingsOverlay button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background: linear-gradient(45deg, #0D1B2A, #00D4FF);
    color: white;
    border: none;
    border-radius: 5px;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
    font-family: 'Orbitron', sans-serif;
    transition: transform 0.3s;
}

#introOverlay button:hover, #mission2IntroOverlay button:hover, #defeatOverlay button:hover, #victoryOverlay button:hover, #missionStubOverlay button:hover, #settingsOverlay button:hover {
    transform: scale(1.05);
}

#victoryOverlay button {
    margin-bottom: 10px;
}

/* Динамические элементы из app.js */
#damage-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 0, 0, 0);
    pointer-events: none;
    transition: opacity 0.5s;
}

#cosmic-base-label {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 16px;
}

/* Общий контейнер для здоровья */

/* Здоровье корабля */
/* Здоровье корабля (предыдущие стили) */
#ship-health-bar {
    position: absolute;
    top: 50px;
    left: 10px;
    width: 200px;
    height: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00D4FF;
    border-radius: 3px;
    overflow: hidden;
}

#ship-health-fill {
    width: 100%;
    height: 100%;
    background: #00CC00;
    transition: width 0.3s ease;
}





/* Спидометр (только цифры) */
#speed-display {
    position: absolute;
    top: 90px;
    left: 10px;
    color: #00D4FF; /* Голубой цвет текста */
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5); /* Полупрозрачный фон */
    padding: 4px 8px;
    border: 1px solid #00D4FF;
    border-radius: 3px;
    text-shadow: 0 0 3px rgba(0, 212, 255, 0.6);
}

/* Метки для здоровья */
#ship-health-bar::before,
#base-health-bar::before {
    content: attr(data-label);
    position: absolute;
    top: -16px;
    left: 0;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    text-shadow: 0 0 3px rgba(0, 212, 255, 0.6);
}

/* Спидометр использует data-label как содержимое */
#speed-display::before {
    content: attr(data-label);
}

/* Главное меню */
#mainMenuOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    z-index: 1000 !important;
    background: rgba(0, 0, 0, 0.8);
    pointer-events: auto !important;
}

/* Скрытие индикаторов в меню */
#mainMenuOverlay:not([style*="display: none"]) ~ #ship-health-bar,
#mainMenuOverlay:not([style*="display: none"]) ~ #ship-health-fill,
#mainMenuOverlay:not([style*="display: none"]) ~ #base-health-bar,
#mainMenuOverlay:not([style*="display: none"]) ~ #base-health-fill,
#mainMenuOverlay:not([style*="display: none"]) ~ #speed-display {
    visibility: hidden;
}

/* Показ индикаторов в игре */
#mainMenuOverlay[style*="display: none"] ~ #ship-health-bar,
#mainMenuOverlay[style*="display: none"] ~ #ship-health-fill,
#mainMenuOverlay[style*="display: none"] ~ #speed-display {
    visibility: visible;
}

/* Канвас */
#application-canvas {
    z-index: 0;
}

#cooldown-label {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    font-family: Arial, sans-serif;
    font-size: 16px;
}

/* Справа внизу над строкой статуса: слева внизу стоит чат, он перекрывал радар */
#radar {
    position: absolute;
    bottom: 50px;
    right: 10px;
    width: 160px;
    height: 160px;
    z-index: 1002;
    pointer-events: none;
}

/* Радар виден только во время игры (когда показан игровой канвас) */
#application-canvas[style*="display: block"] ~ #radar {
    display: block;
}

#orbit-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border: 1px solid white;
    font-family: Arial, sans-serif;
    font-size: 16px;
    display: none;
    z-index: 100;
}

#asteroid-submenu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border: 1px solid white;
    font-family: Arial, sans-serif;
    font-size: 14px;
    max-height: 80vh;
    overflow-y: auto;
    display: none;
    z-index: 1001; /* Выше #marker-window */
    pointer-events: auto; /* Перехват кликов */
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Стили для кнопок в #asteroid-submenu */
#asteroid-submenu button {
    padding: 2px 5px;
    font-size: 12px;
    background: linear-gradient(45deg, #0D1B2A, #00D4FF);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
    font-family: 'Orbitron', sans-serif;
    transition: transform 0.3s, border 0.3s;
}

#asteroid-submenu button:hover {
    transform: scale(1.05);
}

#asteroid-submenu button:focus {
    outline: none;
    border: 2px solid #00D4FF;
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

#asteroid-submenu button.active-button {
    background: linear-gradient(45deg, #00D4FF, #0D1B2A);
    border: 2px solid #fff;
    transform: scale(1.05);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

/* Кнопки управления (сенсорные) */
#btnW, #btnA, #btnS, #btnD, #btnQ, #btnE, #btnSpace, #btnEnter, #btnShift, #btnH, #btnZ, #btnX, #btnT, #btnG {
    position: absolute;
    padding: 10px;
    background: #444;
    color: #fff;
    border: 1px solid #666;
    border-radius: 5px;
    display: none;
}

#btnW { bottom: 100px; left: 50%; transform: translateX(-50%); }
#btnA { bottom: 50px; left: 20px; }
#btnS { bottom: 50px; left: 50%; transform: translateX(-50%); }
#btnD { bottom: 50px; right: 20px; }
#btnQ { bottom: 100px; left: 100px; }
#btnE { bottom: 100px; right: 100px; }
#btnSpace { bottom: 150px; left: 50%; transform: translateX(-50%); }
#btnEnter { bottom: 200px; right: 20px; }
#btnShift { bottom: 150px; left: 20px; }
#btnH { top: 50px; right: 20px; }
#btnZ { bottom: 100px; left: 150px; }
#btnX { bottom: 100px; right: 150px; }
#btnT { bottom: 150px; left: 100px; }
#btnG { bottom: 150px; right: 100px; }

/* Скорость */
#speed-panel {
    position: absolute;
    top: 70px;
    left: 10px;
    width: 200px;
    color: #fff;
    font-family: Arial, sans-serif;
}

#speed-panel span {
    display: block;
    margin-bottom: 5px;
}

#speed-fill {
    width: 100%;
    height: 10px;
    background: #00f;
}

/* Превышение скорости */
#speed-warning {
    position: absolute;
    top: 70px;
    left: 220px;
    color: #f00;
    font-family: Arial, sans-serif;
    padding: 5px;
    display: none;
    animation: blink 1s infinite;
}

/* Варп */
#warp-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00f;
    font-family: Arial, sans-serif;
    font-size: 24px;
    text-shadow: 0 0 10px #00f;
    background: linear-gradient(to bottom, #00f, #000);
    padding: 10px 20px;
    border-radius: 5px;
    display: none;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* Попадание */
#hit-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #f00;
    font-family: Arial, sans-serif;
    background: rgba(255, 0, 0, 0.3);
    padding: 5px;
    display: none;
    animation: shake 0.2s infinite;
}

@keyframes shake {
    0% { transform: translate(0, 0); }
    25% { transform: translate(2px, 0); }
    75% { transform: translate(-2px, 0); }
    100% { transform: translate(0, 0); }
}

/* Энергия */
#energy-panel {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 200px;
    color: #fff;
    font-family: Arial, sans-serif;
}

#energy-panel span {
    display: block;
    margin-bottom: 5px;
}

#energy-fill {
    width: 100%;
    height: 10px;
    background: #0f0;
}

/* Щит */
#shield-panel {
    position: absolute;
    top: 10px;
    left: 220px;
    color: #00f;
    font-family: Arial, sans-serif;
    display: none;
}

/* Маскировка */
#cloak-panel {
    position: absolute;
    top: 30px;
    left: 220px;
    color: #888;
    font-family: Arial, sans-serif;
    display: none;
}

/* Турели */
#turret-panel {
    position: absolute;
    bottom: 40px;
    right: 10px;
    color: #f80;
    font-family: Arial, sans-serif;
    display: none;
}

/* Перегрев оружия */
#weapon-heat-panel {
    position: absolute;
    bottom: 60px;
    right: 10px;
    width: 150px;
    color: #fff;
    font-family: Arial, sans-serif;
    display: none;
}

#weapon-heat-panel span {
    display: block;
    margin-bottom: 5px;
}

#weapon-heat-fill {
    width: 0%;
    height: 10px;
    background: #f00;
}

/* Уровень повреждений */
#hull-panel {
    position: absolute;
    top: 10px;
    left: 300px;
    color: #f00;
    font-family: Arial, sans-serif;
    display: none;
    animation: blink 1s infinite;
}

/* Автопилот */
#autopilot-panel {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: #0f0;
    font-family: Arial, sans-serif;
    display: none;
}

/* Аномалии */
#hazard-panel {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #ff0;
    font-family: Arial, sans-serif;
    padding: 5px;
    display: none;
    animation: blink 1s infinite;
}

/* Астероиды */
#asteroid-panel {
    position: absolute;
    bottom: 120px;
    left: 10px;
    color: #fff;
    font-family: Arial, sans-serif;
    display: none;
}

/* Счётчик врагов */
#kill-count-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #fff;
    font-family: Arial, sans-serif;
}
/* Окно входа */
#loginWindow {
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid #00D4FF;
    border-radius: 5px;
    padding: 20px;
    font-family: 'Orbitron', sans-serif;
    color: white;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
    z-index: 10000;
    width: min(340px, calc(100vw - 32px));
    box-sizing: border-box;
    text-align: center;
}

#loginWindow input,
#loginWindow button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 8px 0;
    padding: 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: white;
    background: rgba(13, 27, 42, 0.9);
    border: 1px solid #00D4FF;
    border-radius: 4px;
}

#loginWindow button {
    cursor: pointer;
}

#loginWindow button:hover:not(:disabled),
#loginWindow button:focus {
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.8);
    outline: none;
}

#loginWindow button:disabled {
    opacity: 0.5;
    cursor: wait;
}

#loginWindow #guestButton {
    margin-top: 16px;
    border-style: dashed;
}

#guestHint {
    font-size: 11px;
    opacity: 0.7;
    margin: 0;
}

#loginError {
    white-space: pre-line;
    font-size: 12px;
}

/* Экран настроек */
#settingsOverlay {
    overflow-y: auto;
    justify-content: flex-start;
    padding: 24px 16px;
    box-sizing: border-box;
}

#settingsOverlay h2 {
    margin: 0 0 12px;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

#settingsForm {
    width: min(460px, 100%);
    text-align: left;
}

#settingsForm fieldset {
    border: 1px solid rgba(0, 212, 255, 0.5);
    border-radius: 5px;
    margin: 0 0 12px;
    padding: 8px 14px 12px;
}

#settingsForm legend {
    padding: 0 6px;
    color: #00D4FF;
}

#settingsForm label {
    display: grid;
    grid-template-columns: 1fr 140px 52px;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    font-size: 13px;
}

#settingsForm label.checkbox {
    display: flex;
    gap: 8px;
    cursor: pointer;
}

#settingsForm label select {
    grid-column: 2 / 4;
}

#settingsForm input[type="range"] {
    width: 100%;
    accent-color: #00D4FF;
}

#settingsForm input[type="checkbox"] {
    accent-color: #00D4FF;
    width: 16px;
    height: 16px;
}

#settingsForm output {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

#settingsForm select {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    color: white;
    background: rgba(13, 27, 42, 0.9);
    border: 1px solid #00D4FF;
    border-radius: 4px;
    padding: 5px;
}

#settingsForm .hint {
    font-size: 11px;
    opacity: 0.6;
    margin: 0 0 4px;
}

#settingsOverlay .settings-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

@media (max-width: 480px) {
    #settingsForm label {
        grid-template-columns: 1fr 44px;
    }
    #settingsForm label input[type="range"] {
        grid-column: 1 / 3;
        grid-row: 2;
    }
    #settingsForm label select {
        grid-column: 1 / 3;
    }
}

/* Лента убийств */
#kill-feed {
    position: absolute;
    top: 95px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    z-index: 500;
    pointer-events: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
}

.kill-entry {
    background: rgba(0, 0, 0, 0.6);
    border-left: 3px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 4px 10px;
    border-radius: 3px;
    transition: opacity 1s;
    max-width: 60vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kill-entry.mine {
    border-left-color: #00D4FF;
    background: rgba(0, 60, 90, 0.7);
}

.kill-entry .killer { color: #FF9A1F; }
.kill-entry .victim { color: #FF5A5A; }
.kill-entry .icon { color: rgba(255, 255, 255, 0.7); }
.kill-entry.fading { opacity: 0; }

/* Лобби */
#lobbyOverlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-family: 'Orbitron', sans-serif;
    z-index: 100;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding: 24px 16px;
    box-sizing: border-box;
    gap: 10px;
}

#lobbyOverlay h2 {
    margin: 0;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

#lobbyOverlay h3 {
    margin: 0 0 8px;
    font-size: 15px;
    color: #00D4FF;
}

.lobby-status {
    margin: 0;
    font-size: 12px;
    opacity: 0.75;
    min-height: 1em;
}

.lobby-section {
    width: min(480px, 100%);
    border: 1px solid rgba(0, 212, 255, 0.5);
    border-radius: 5px;
    padding: 12px 14px;
    box-sizing: border-box;
}

.lobby-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#roomList {
    max-height: 220px;
    overflow-y: auto;
}

.room-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 12px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
}

.room-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-count {
    font-variant-numeric: tabular-nums;
    opacity: 0.8;
}

.room-empty {
    font-size: 12px;
    opacity: 0.6;
    margin: 4px 0;
}

#lobbyOverlay button,
#menuRoomInfo button {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    color: white;
    background: rgba(13, 27, 42, 0.9);
    border: 1px solid #00D4FF;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
}

#lobbyOverlay button:disabled {
    opacity: 0.4;
    cursor: default;
}

#lobbyOverlay button:hover:not(:disabled),
#menuRoomInfo button:hover {
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.8);
}

#lobbyOverlay .lobby-primary {
    width: min(480px, 100%);
    padding: 12px;
    font-size: 16px;
    background: linear-gradient(45deg, #0D1B2A, #00708a);
}

.lobby-section .lobby-primary {
    width: 100%;
    margin-top: 10px;
}

#roomNameInput,
#roomMaxPlayers {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    color: white;
    background: rgba(13, 27, 42, 0.9);
    border: 1px solid #00D4FF;
    border-radius: 4px;
    padding: 8px;
    box-sizing: border-box;
}

#roomNameInput {
    width: 100%;
}

.lobby-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: center;
    margin-top: 10px;
    font-size: 13px;
}

.lobby-row label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lobby-row input[type="checkbox"] {
    accent-color: #00D4FF;
}

#menuRoomInfo button {
    background-clip: border-box;
    -webkit-background-clip: border-box;
    text-shadow: none;
    animation: none;
}

#menuRoomInfo {
    margin: 20px 0 0 45px;
    gap: 12px;
    align-items: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    color: white;
}

.room-mode {
    font-size: 11px;
    color: #00D4FF;
    opacity: 0.85;
}

/* Режим матча */
#match-hud,
#wave-hud {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.5);
    border-radius: 4px;
    padding: 4px 14px;
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    white-space: nowrap;
    z-index: 500;
    pointer-events: none;
}

#match-results {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, calc(100vw - 32px));
    max-height: 80vh;
    overflow-y: auto;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 8, 16, 0.9);
    border: 1px solid #00D4FF;
    border-radius: 6px;
    padding: 18px;
    color: white;
    font-family: 'Orbitron', sans-serif;
    z-index: 2500;
    pointer-events: none;
}

#match-results h2 {
    margin: 0 0 6px;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

#matchWinner {
    color: #FFD34D;
    margin: 0 0 12px;
    text-align: center;
}

#match-results table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#match-results th,
#match-results td {
    padding: 5px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    text-align: left;
}

#match-results td:last-child,
#match-results th:last-child {
    text-align: right;
}

#match-results tr.me td {
    color: #00D4FF;
}

#matchNext {
    margin: 12px 0 0;
    font-size: 12px;
    opacity: 0.8;
}

#wave-banner {
    position: absolute;
    top: 22%;
    left: 50%;
    transform: translateX(-50%);
    color: #FFD34D;
    font-family: 'Orbitron', sans-serif;
    font-size: 34px;
    text-align: center;
    text-shadow: 0 0 12px rgba(255, 150, 0, 0.9);
    z-index: 2400;
    pointer-events: none;
    white-space: nowrap;
}

#lobbyOverlay select:disabled {
    opacity: 0.4;
}

@media (max-width: 480px) {
    #wave-banner {
        font-size: 22px;
        white-space: normal;
        width: calc(100vw - 32px);
    }
}

/* Ангар */
#hangarOverlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-family: 'Orbitron', sans-serif;
    z-index: 100;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding: 24px 16px;
    box-sizing: border-box;
    gap: 12px;
}

#hangarOverlay h2 {
    margin: 0;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

#hangarResources {
    margin: 0;
    font-size: 13px;
    color: #00D4FF;
    text-align: center;
    white-space: pre-wrap;
}

#hangarList {
    width: min(520px, 100%);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hangar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(0, 212, 255, 0.5);
    border-radius: 5px;
    padding: 12px 14px;
}

.hangar-name {
    font-size: 16px;
}

.hangar-pips {
    display: flex;
    gap: 4px;
    margin: 6px 0;
}

.hangar-pips span {
    width: 18px;
    height: 6px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.15);
}

.hangar-pips span.on {
    background: #00D4FF;
}

.hangar-effect,
.hangar-cost {
    font-size: 11px;
    opacity: 0.75;
}

.hangar-buy {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

#hangarOverlay button {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    color: white;
    background: rgba(13, 27, 42, 0.9);
    border: 1px solid #00D4FF;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
}

#hangarOverlay button:disabled {
    opacity: 0.4;
    cursor: default;
}

#hangarOverlay button:hover:not(:disabled) {
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.8);
}

.hangar-hint {
    font-size: 11px;
    opacity: 0.6;
    max-width: 520px;
    text-align: center;
    margin: 0;
}

@media (max-width: 480px) {
    .hangar-row {
        flex-direction: column;
        align-items: stretch;
    }
    .hangar-buy {
        align-items: stretch;
        text-align: left;
    }
}

/* Не заезжать под счётчик FPS вверху по центру */
#hangarOverlay,
#lobbyOverlay,
#settingsOverlay,
#seasonOverlay {
    padding-top: 48px;
}

/* Таблица лидеров по неделям */
#seasonOverlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-family: 'Orbitron', sans-serif;
    z-index: 100;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding: 48px 16px 24px;
    box-sizing: border-box;
    gap: 10px;
}

#seasonOverlay h2 {
    margin: 0;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
}

.season-tabs {
    display: flex;
    gap: 8px;
}

#seasonOverlay button {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    color: white;
    background: rgba(13, 27, 42, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.5);
    border-radius: 4px;
    padding: 6px 14px;
    cursor: pointer;
}

#seasonOverlay .season-tab.active {
    border-color: #00D4FF;
    background: #00708a;
}

#seasonReset,
#seasonMine {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
    text-align: center;
}

#seasonMine {
    color: #00D4FF;
    opacity: 1;
}

#seasonTable {
    width: min(460px, 100%);
    border-collapse: collapse;
    font-size: 13px;
}

#seasonTable th,
#seasonTable td {
    padding: 7px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    text-align: left;
}

#seasonTable td:last-child,
#seasonTable th:last-child {
    text-align: right;
}

#seasonTable tr.me td {
    color: #00D4FF;
}

/* ---------- Сенсорное управление (телефон) ---------- */
#touch-controls,
#rotate-hint {
    display: none;
}

/* Только на сенсорных устройствах и только во время игры */
body.touch #application-canvas[style*="display: block"] ~ #touch-controls {
    display: block;
}

#touch-controls {
    position: fixed;
    inset: 0;
    z-index: 900;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

#touch-joystick,
.touch-btn {
    position: absolute;
    pointer-events: auto;
    touch-action: none;
}

#touch-joystick {
    left: 24px;
    bottom: 24px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.08);
    border: 2px solid rgba(0, 212, 255, 0.45);
}

#touch-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 60px;
    height: 60px;
    margin: -30px 0 0 -30px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.45);
    border: 2px solid #00D4FF;
    pointer-events: none;
}

.touch-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid rgba(0, 212, 255, 0.6);
    background: rgba(0, 20, 35, 0.55);
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.touch-btn.big {
    width: 90px;
    height: 90px;
    font-size: 14px;
    border-color: rgba(255, 90, 90, 0.8);
    background: rgba(60, 0, 0, 0.5);
}

.touch-btn.small {
    width: 52px;
    height: 52px;
    font-size: 11px;
}

#touch-roll-left,
#touch-roll-right,
#touch-up,
#touch-down {
    font-size: 22px;
}

.touch-btn.pressed {
    background: rgba(0, 212, 255, 0.5);
}

.touch-btn.big.pressed {
    background: rgba(255, 70, 70, 0.6);
}

#touch-roll-left { left: 24px; bottom: 190px; }
#touch-roll-right { left: 122px; bottom: 190px; }
#touch-fire { right: 24px; bottom: 24px; }
#touch-torpedo { right: 128px; bottom: 30px; }
#touch-thrust { right: 38px; bottom: 128px; }
#touch-back { right: 128px; bottom: 112px; }
#touch-up { right: 212px; bottom: 76px; }
#touch-down { right: 212px; bottom: 16px; }
#touch-target { right: 38px; bottom: 206px; }
#touch-camera { right: 104px; bottom: 190px; }

/* Раскладка интерфейса на телефоне: кнопки занимают нижние углы */
body.touch #chat-container {
    display: none !important;
}

/* Вверху, правее полоски корпуса: внизу слева джойстик и кнопки крена */
body.touch #radar {
    right: auto;
    bottom: auto;
    left: 230px;
    top: 8px;
    width: 90px;
    height: 90px;
}

body.touch #cooldown-label {
    right: auto;
    bottom: auto;
    top: 104px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    white-space: nowrap;
    max-width: 70vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Кнопка меню (✕) повыше, чтобы не задевать кнопку «Цель» на маленьких экранах */
body.touch #reloadButton {
    top: 32px !important;
}

/* В портретной ориентации играть неудобно: просим повернуть телефон */
@media (orientation: portrait) {
    body.touch #application-canvas[style*="display: block"] ~ #rotate-hint {
        display: flex;
    }
}

#rotate-hint {
    position: fixed;
    inset: 0;
    z-index: 3000;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
}

/* Маркер попадания: четыре штриха вокруг центра экрана */
#hit-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 34px;
    transform: translate(-50%, -50%) rotate(45deg);
    pointer-events: none;
    z-index: 210;
    opacity: 0;
    background:
        linear-gradient(#fff, #fff) top center / 2px 10px no-repeat,
        linear-gradient(#fff, #fff) bottom center / 2px 10px no-repeat,
        linear-gradient(#fff, #fff) center left / 10px 2px no-repeat,
        linear-gradient(#fff, #fff) center right / 10px 2px no-repeat;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.9));
}

#hit-marker.show {
    animation: hitMarker 0.35s ease-out;
}

#hit-marker.kill {
    filter: drop-shadow(0 0 4px rgba(255, 60, 60, 1)) hue-rotate(0deg);
}

@keyframes hitMarker {
    0% { opacity: 1; transform: translate(-50%, -50%) rotate(45deg) scale(0.7); }
    60% { opacity: 1; transform: translate(-50%, -50%) rotate(45deg) scale(1.05); }
    100% { opacity: 0; transform: translate(-50%, -50%) rotate(45deg) scale(1.2); }
}
