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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    text-align: center;
    width: 100%;
    max-width: 1200px;
}

.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

h1 {
    color: white;
    font-size: 2.5em;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    flex: 1;
}

.game-boards {
    display: flex;
    justify-content: space-around;
    gap: 40px;
    flex-wrap: wrap;
}

.board-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.board-section h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5em;
}

/* Информация о кораблях противника */
.enemy-ships-info {
    margin-top: 10px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.enemy-ships-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.enemy-ship-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: transparent;
    border-radius: 0;
    border: none;
    font-size: 0.9em;
    color: #333;
}

.enemy-ship-info-item .ship-size {
    font-weight: 600;
    color: #1e40af;
}

.enemy-ship-info-item .ship-count {
    display: inline-block;
    font-weight: 700;
    color: #dc2626;
    padding: 2px 8px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 4px;
}

/* Блок-заглушка для поля противника до начала игры */
.enemy-board-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 440px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px dashed rgba(102, 126, 234, 0.3);
    border-radius: 10px;
    margin-top: 15px;
}

.placeholder-content {
    text-align: center;
    padding: 40px;
}

.placeholder-content h3 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.placeholder-content p {
    color: #666;
    font-size: 1.1em;
    line-height: 1.6;
}


.board {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    grid-template-rows: repeat(11, 1fr);
    gap: 2px;
    background-color: #1e3a8a;
    padding: 5px;
    border-radius: 5px;
    width: 440px;
    height: 440px;
}

.cell {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1e40af 100%);
    border: 1px solid rgba(30, 58, 138, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #333;
    position: relative;
    overflow: hidden;
}

/* Эффект воды/волн на клетках */
.cell::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
    animation: waterFlow 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes waterFlow {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(10px, 10px) rotate(180deg);
    }
}

/* Текстура воды */
.cell::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.03) 2px,
            rgba(255, 255, 255, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.03) 2px,
            rgba(255, 255, 255, 0.03) 4px
        );
    pointer-events: none;
}

/* Вариации оттенков для эффекта глубины */
.cell-shade-1 {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 50%, #1e3a8a 100%) !important;
}

.cell-shade-2 {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1e40af 100%) !important;
}

.cell:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%) !important;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
    border-color: rgba(96, 165, 250, 0.8);
    z-index: 1;
}

.cell:hover::before {
    animation-duration: 1.5s;
}

.cell.coordinate {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    font-weight: bold;
    cursor: default;
    border: 1px solid #a5b4fc;
}

.cell.coordinate::before,
.cell.coordinate::after {
    display: none;
}

.cell.coordinate:hover {
    transform: none;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    box-shadow: none;
}

/* Стили для координат */
.cell.row-label {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    font-weight: bold;
    border: 1px solid #a5b4fc;
}

.cell.row-label::before,
.cell.row-label::after {
    display: none;
}

.cell.col-label {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    font-weight: bold;
    border: 1px solid #a5b4fc;
}

.cell.col-label::before,
.cell.col-label::after {
    display: none;
}

.cell.corner {
    background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
    border: 1px solid #818cf8;
}

.cell.corner::before,
.cell.corner::after {
    display: none;
}

/* Стили для статуса игры */
#game-status {
    color: white;
    font-size: 1.2em;
    margin-bottom: 20px;
    padding: 10px 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
}

#game-status.your-turn {
    background: rgba(34, 197, 94, 0.3);
    animation: pulse 2s infinite;
}

#game-status.enemy-turn {
    background: rgba(239, 68, 68, 0.3);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Стили для сообщений */
#game-message {
    color: white;
    font-size: 1em;
    margin-bottom: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.message-success {
    background: rgba(34, 197, 94, 0.8);
}

.message-error {
    background: rgba(239, 68, 68, 0.8);
}

.message-info {
    background: rgba(59, 130, 246, 0.8);
}

/* Стили для кораблей */
.cell.ship {
    background: 
        /* Текстура дерева - вертикальные волокна */
        repeating-linear-gradient(
            0deg,
            rgba(139, 69, 19, 0.15) 0px,
            rgba(139, 69, 19, 0.15) 1px,
            transparent 1px,
            transparent 3px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(101, 67, 33, 0.1) 0px,
            rgba(101, 67, 33, 0.1) 2px,
            transparent 2px,
            transparent 5px
        ),
        /* Базовый цвет корпуса с эффектом дерева */
        linear-gradient(135deg, 
            rgba(101, 67, 33, 0.4) 0%, 
            rgba(139, 69, 19, 0.5) 20%,
            rgba(101, 67, 33, 0.45) 40%,
            rgba(139, 69, 19, 0.5) 60%,
            rgba(101, 67, 33, 0.4) 80%,
            rgba(139, 69, 19, 0.45) 100%
        ),
        /* Коричневый цвет корабля */
        linear-gradient(135deg, rgba(101, 67, 33, 0.95) 0%, rgba(139, 69, 19, 0.9) 30%, rgba(160, 82, 45, 0.85) 50%, rgba(139, 69, 19, 0.9) 70%, rgba(101, 67, 33, 0.95) 100%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px
        ) !important;
    border: 2px solid rgba(101, 67, 33, 0.8);
    border-top: 1px solid rgba(160, 82, 45, 0.6);
    border-bottom: 3px solid rgba(69, 39, 19, 0.9);
    position: relative;
    overflow: hidden;
    animation: shipPlacement 0.3s ease-out;
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes shipPlacement {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.cell.ship::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0px;
    box-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 1px 1px rgba(139, 69, 19, 0.2);
    /* Отключаем анимацию воды для клеток с кораблями */
    animation: none;
}

/* Иллюминаторы (окна) для кораблей */
.cell.ship::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9) 0%, rgba(251, 191, 36, 0.8) 30%, rgba(245, 158, 11, 0.9) 60%, rgba(217, 119, 6, 1) 100%);
    border: 1px solid rgba(217, 119, 6, 0.8);
    border-radius: 2px;
    box-shadow: 
        0 0 6px rgba(251, 191, 36, 0.9),
        inset 0 0 3px rgba(255, 255, 255, 0.6),
        inset -1px -1px 2px rgba(0, 0, 0, 0.3);
    animation: windowGlow 3s ease-in-out infinite;
}

@keyframes windowGlow {
    0%, 100% {
        opacity: 1;
        box-shadow: 
            0 0 6px rgba(251, 191, 36, 0.9),
            inset 0 0 3px rgba(255, 255, 255, 0.6),
            inset -1px -1px 2px rgba(0, 0, 0, 0.3);
    }
    50% {
        opacity: 0.85;
        box-shadow: 
            0 0 8px rgba(251, 191, 36, 1),
            inset 0 0 4px rgba(255, 255, 255, 0.8),
            inset -1px -1px 2px rgba(0, 0, 0, 0.3);
    }
}

/* Позиционирование иллюминаторов для горизонтальных кораблей */
.cell.ship.ship-horizontal::after {
    left: 25%;
    top: 50%;
    transform: translateY(-50%);
}

/* Позиционирование иллюминаторов для вертикальных кораблей */
.cell.ship.ship-vertical::after {
    left: 50%;
    top: 25%;
    transform: translateX(-50%);
}

/* Дополнительные иллюминаторы для больших кораблей через псевдоэлементы */
.cell.ship.ship-size-4.ship-horizontal,
.cell.ship.ship-size-3.ship-horizontal {
    background-image: 
        radial-gradient(circle at 25% 50%, rgba(251, 191, 36, 0.4) 3px, transparent 3px),
        radial-gradient(circle at 75% 50%, rgba(251, 191, 36, 0.4) 3px, transparent 3px),
        linear-gradient(135deg, rgba(101, 67, 33, 0.95) 0%, rgba(139, 69, 19, 0.9) 30%, rgba(160, 82, 45, 0.85) 50%, rgba(139, 69, 19, 0.9) 70%, rgba(101, 67, 33, 0.95) 100%);
}

.cell.ship.ship-size-4.ship-vertical,
.cell.ship.ship-size-3.ship-vertical {
    background-image: 
        radial-gradient(circle at 50% 25%, rgba(251, 191, 36, 0.4) 3px, transparent 3px),
        radial-gradient(circle at 50% 75%, rgba(251, 191, 36, 0.4) 3px, transparent 3px),
        linear-gradient(135deg, rgba(101, 67, 33, 0.95) 0%, rgba(139, 69, 19, 0.9) 30%, rgba(160, 82, 45, 0.85) 50%, rgba(139, 69, 19, 0.9) 70%, rgba(101, 67, 33, 0.95) 100%);
}

/* Нос корабля (первая клетка) */
.cell.ship.ship-nose-horizontal {
    border-left: 4px solid #0f172a;
    border-radius: 6px 0 0 4px;
    position: relative;
}

.cell.ship.ship-nose-horizontal::before {
    border-radius: 6px 0 0 0;
}

.cell.ship.ship-nose-horizontal::after {
    /* Иллюминатор на носу */
    left: 25%;
    top: 50%;
    transform: translateY(-50%);
}

.cell.ship.ship-nose-vertical {
    border-top: 4px solid #0f172a;
    border-radius: 6px 6px 0 0;
    position: relative;
}

.cell.ship.ship-nose-vertical::before {
    border-radius: 6px 6px 0 0;
}

.cell.ship.ship-nose-vertical::after {
    /* Иллюминатор на носу */
    left: 50%;
    top: 25%;
    transform: translateX(-50%);
}

/* Корма корабля (последняя клетка) */
.cell.ship.ship-stern-horizontal {
    border-right: 4px solid #0f172a;
    border-radius: 0 6px 4px 0;
    position: relative;
}

.cell.ship.ship-stern-horizontal::before {
    border-radius: 0 6px 0 0;
}

/* Рулевое колесо на корме горизонтального корабля */
.cell.ship.ship-stern-horizontal::after {
    right: 4px;
    top: 50%;
    width: 7px;
    height: 7px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.7) 0%, rgba(79, 70, 229, 0.85) 40%, rgba(55, 48, 163, 1) 70%);
    border: 1px solid rgba(55, 48, 163, 0.9);
    border-radius: 50%;
    box-shadow: 
        inset 0 0 2px rgba(255, 255, 255, 0.4),
        0 0 4px rgba(79, 70, 229, 0.6),
        inset -1px -1px 1px rgba(0, 0, 0, 0.3);
    transform: translateY(-50%);
    left: auto;
}

.cell.ship.ship-stern-vertical {
    border-bottom: 4px solid #0f172a;
    border-radius: 0 0 6px 6px;
    position: relative;
}

.cell.ship.ship-stern-vertical::before {
    border-radius: 0 0 0 0;
}

/* Рулевое колесо на корме вертикального корабля */
.cell.ship.ship-stern-vertical::after {
    left: 50%;
    bottom: 4px;
    top: auto;
    width: 7px;
    height: 7px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.7) 0%, rgba(79, 70, 229, 0.85) 40%, rgba(55, 48, 163, 1) 70%);
    border: 1px solid rgba(55, 48, 163, 0.9);
    border-radius: 50%;
    box-shadow: 
        inset 0 0 2px rgba(255, 255, 255, 0.4),
        0 0 4px rgba(79, 70, 229, 0.6),
        inset -1px -1px 1px rgba(0, 0, 0, 0.3);
    transform: translateX(-50%);
}

/* Средние части корабля */
.cell.ship.ship-middle-horizontal {
    border-left: 1px solid rgba(15, 23, 42, 0.3);
    border-right: 1px solid rgba(15, 23, 42, 0.3);
}

.cell.ship.ship-middle-vertical {
    border-top: 1px solid rgba(15, 23, 42, 0.3);
    border-bottom: 1px solid rgba(15, 23, 42, 0.3);
}

/* Эффект при наведении */
.cell.ship:hover {
    background: 
        /* Текстура дерева при наведении */
        repeating-linear-gradient(
            0deg,
            rgba(139, 69, 19, 0.2) 0px,
            rgba(139, 69, 19, 0.2) 1px,
            transparent 1px,
            transparent 3px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(101, 67, 33, 0.15) 0px,
            rgba(101, 67, 33, 0.15) 2px,
            transparent 2px,
            transparent 5px
        ),
        /* Более светлый деревянный градиент */
        linear-gradient(135deg, 
            rgba(139, 69, 19, 0.5) 0%, 
            rgba(160, 82, 45, 0.6) 20%,
            rgba(139, 69, 19, 0.55) 40%,
            rgba(160, 82, 45, 0.6) 60%,
            rgba(139, 69, 19, 0.5) 80%,
            rgba(160, 82, 45, 0.55) 100%
        ),
        /* Коричневый цвет корабля */
        linear-gradient(135deg, rgba(139, 69, 19, 0.95) 0%, rgba(160, 82, 45, 0.9) 30%, rgba(184, 134, 11, 0.85) 50%, rgba(160, 82, 45, 0.9) 70%, rgba(139, 69, 19, 0.95) 100%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px
        ) !important;
    box-shadow: 
        0 0 12px rgba(139, 69, 19, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.cell.ship:hover::after {
    box-shadow: 
        0 0 8px rgba(251, 191, 36, 1),
        inset 0 0 4px rgba(255, 255, 255, 0.8),
        inset -1px -1px 2px rgba(0, 0, 0, 0.3);
}

/* Эффект бликов на воде вокруг кораблей */
.cell.ship {
    filter: drop-shadow(0 0 3px rgba(139, 69, 19, 0.3));
}

.cell.ship::before {
    z-index: 1;
}

/* Рельсы/перила на палубе больших кораблей */
.cell.ship.ship-size-4 .deck-rails,
.cell.ship.ship-size-3 .deck-rails {
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        rgba(139, 92, 246, 0.6) 0px,
        rgba(139, 92, 246, 0.6) 2px,
        transparent 2px,
        transparent 4px
    );
    border-top: 1px solid rgba(79, 70, 229, 0.5);
    z-index: 2;
}

/* Трубы для больших кораблей (4-палубных) - используем дополнительный элемент через JavaScript */
.cell.ship.ship-size-4.ship-middle-horizontal,
.cell.ship.ship-size-4.ship-middle-vertical {
    position: relative;
}

/* Дым из труб для больших кораблей через box-shadow на палубе */
.cell.ship.ship-size-4.ship-middle-horizontal::before,
.cell.ship.ship-size-4.ship-middle-vertical::before {
    background: 
        linear-gradient(to bottom, rgba(241, 245, 249, 0.5) 0%, rgba(226, 232, 240, 0.4) 50%, transparent 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(255, 255, 255, 0.1) 3px,
            rgba(255, 255, 255, 0.1) 6px
        ),
        radial-gradient(ellipse at 50% 0%, rgba(107, 114, 128, 0.3) 0%, transparent 60%);
    animation: smokePuff 3s ease-out infinite;
}

@keyframes smokePuff {
    0% {
        background: 
            linear-gradient(to bottom, rgba(241, 245, 249, 0.5) 0%, rgba(226, 232, 240, 0.4) 50%, transparent 100%),
            repeating-linear-gradient(
                0deg,
                transparent,
                transparent 3px,
                rgba(255, 255, 255, 0.1) 3px,
                rgba(255, 255, 255, 0.1) 6px
            ),
            radial-gradient(ellipse at 50% -5px, rgba(107, 114, 128, 0.2) 0%, transparent 50%);
    }
    50% {
        background: 
            linear-gradient(to bottom, rgba(241, 245, 249, 0.5) 0%, rgba(226, 232, 240, 0.4) 50%, transparent 100%),
            repeating-linear-gradient(
                0deg,
                transparent,
                transparent 3px,
                rgba(255, 255, 255, 0.1) 3px,
                rgba(255, 255, 255, 0.1) 6px
            ),
            radial-gradient(ellipse at 50% -8px, rgba(107, 114, 128, 0.4) 0%, transparent 60%);
    }
    100% {
        background: 
            linear-gradient(to bottom, rgba(241, 245, 249, 0.5) 0%, rgba(226, 232, 240, 0.4) 50%, transparent 100%),
            repeating-linear-gradient(
                0deg,
                transparent,
                transparent 3px,
                rgba(255, 255, 255, 0.1) 3px,
                rgba(255, 255, 255, 0.1) 6px
            ),
            radial-gradient(ellipse at 50% -12px, rgba(107, 114, 128, 0.1) 0%, transparent 70%);
    }
}

/* Размеры иллюминаторов для разных кораблей */
.cell.ship.ship-size-4::after {
    width: 12px;
    height: 12px;
}

.cell.ship.ship-size-3::after {
    width: 10px;
    height: 10px;
}

.cell.ship.ship-size-2::after {
    width: 9px;
    height: 9px;
}

.cell.ship.ship-size-1::after {
    width: 8px;
    height: 8px;
}

/* Якорь на корме для больших кораблей */
.cell.ship.ship-size-4.ship-stern-horizontal {
    background-image: 
        radial-gradient(circle at 75% 75%, rgba(55, 65, 81, 0.7) 1px, rgba(55, 65, 81, 0.5) 2px, transparent 3px),
        linear-gradient(135deg, rgba(101, 67, 33, 0.95) 0%, rgba(139, 69, 19, 0.9) 30%, rgba(160, 82, 45, 0.85) 50%, rgba(139, 69, 19, 0.9) 70%, rgba(101, 67, 33, 0.95) 100%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px
        );
}

.cell.ship.ship-size-4.ship-stern-vertical {
    background-image: 
        radial-gradient(circle at 75% 75%, rgba(55, 65, 81, 0.7) 1px, rgba(55, 65, 81, 0.5) 2px, transparent 3px),
        linear-gradient(135deg, rgba(101, 67, 33, 0.95) 0%, rgba(139, 69, 19, 0.9) 30%, rgba(160, 82, 45, 0.85) 50%, rgba(139, 69, 19, 0.9) 70%, rgba(101, 67, 33, 0.95) 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px
        );
}

/* Стили для выстрелов */
.cell.shot {
    pointer-events: none;
    cursor: not-allowed;
}

.cell.shot:hover {
    transform: none;
    background-color: inherit;
}

.cell.shot-miss {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    color: #6b7280;
    font-size: 20px;
    font-weight: bold;
    border: 2px solid #9ca3af;
    position: relative;
}

/* Убираем эффект воды для промахов */
.cell.shot-miss::after {
    display: none;
}

/* Эффект кругов на воде при промахе */
.cell.shot-miss::before {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 60%;
    border: 2px solid rgba(107, 114, 128, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 100%;
        height: 100%;
        opacity: 0;
    }
}

.cell.shot-hit {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid #f87171;
    position: relative;
}

.cell.shot-hit::after {
    display: none;
}

/* Эффект взрыва при попадании */
.cell.shot-hit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: explosion 0.4s ease-out;
    pointer-events: none;
}

@keyframes explosion {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 120%;
        height: 120%;
        opacity: 0;
    }
}

.cell.shot-hit.ship {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #dc2626 100%) !important;
    border-color: #dc2626;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.6);
}

.cell.shot-hit.ship::before {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.cell.shot-hit.ship::after {
    background: radial-gradient(circle, #fbbf24 0%, #dc2626 50%, #991b1b 100%);
    box-shadow: 0 0 6px rgba(220, 38, 38, 0.8), inset 0 0 2px rgba(0, 0, 0, 0.5);
}

/* Панель размещения кораблей */
.ship-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 250, 251, 0.98) 100%);
    padding: 12px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    width: 440px;
    height: 440px;
    margin-top: 8px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "title title"
        "ships controls";
    gap: 12px;
    border: 2px solid rgba(59, 130, 246, 0.2);
    position: relative;
    overflow: hidden;
}

.ship-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.ship-panel h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1.15em;
    text-align: center;
    font-weight: 700;
    grid-area: title;
}

.ship-panel .ships-list {
    grid-area: ships;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-content: start;
    justify-items: center;
    overflow: visible;
    margin-bottom: 12px;
}

.ship-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    width: 120px;
    justify-content: center;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(239, 246, 255, 0.9) 100%);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.ship-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.ship-item:hover::before {
    left: 100%;
}

.ship-item:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.95) 0%, rgba(219, 234, 254, 0.95) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.ship-item.selected {
    border-color: #1e3a8a;
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.95) 0%, rgba(191, 219, 254, 0.95) 100%);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.6), inset 0 0 10px rgba(59, 130, 246, 0.1);
    transform: scale(1.02);
}

.ship-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #9ca3af;
    background: linear-gradient(135deg, rgba(243, 244, 246, 0.9) 0%, rgba(229, 231, 235, 0.9) 100%);
}

.ship-preview {
    display: flex;
    gap: 2px;
    height: 22px;
    cursor: grab;
    user-select: none;
    transition: opacity 0.2s ease;
    align-items: stretch;
}

.ship-preview:hover {
    opacity: 0.8;
}

.ship-preview:active {
    cursor: grabbing;
}

.ship-preview-4 {
    width: 120px;
}

.ship-preview-3 {
    width: 90px;
}

.ship-preview-2 {
    width: 60px;
}

.ship-preview-1 {
    width: 30px;
}

.ship-preview > div {
    background: 
        /* Текстура дерева - вертикальные волокна */
        repeating-linear-gradient(
            0deg,
            rgba(139, 69, 19, 0.15) 0px,
            rgba(139, 69, 19, 0.15) 1px,
            transparent 1px,
            transparent 3px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(101, 67, 33, 0.1) 0px,
            rgba(101, 67, 33, 0.1) 1px,
            transparent 1px,
            transparent 2px
        ),
        linear-gradient(135deg, rgba(101, 67, 33, 0.95) 0%, rgba(139, 69, 19, 0.9) 30%, rgba(160, 82, 45, 0.85) 50%, rgba(139, 69, 19, 0.9) 70%, rgba(101, 67, 33, 0.95) 100%);
    border: 1px solid rgba(101, 67, 33, 0.8);
    flex: 1;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    min-width: 14px;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.2);
}

.ship-preview > div::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 35%;
    background: linear-gradient(to bottom, rgba(229, 231, 235, 0.4), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.ship-preview > div::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9) 0%, rgba(251, 191, 36, 0.8) 30%, rgba(245, 158, 11, 0.9) 60%, rgba(217, 119, 6, 1) 100%);
    border: 1px solid rgba(217, 119, 6, 0.8);
    border-radius: 2px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 
        0 0 2px rgba(251, 191, 36, 0.8),
        inset 0 0 1px rgba(255, 255, 255, 0.6);
}

.ship-label {
    display: none;
}

.ship-count {
    display: none;
}

.placement-controls {
    grid-area: controls;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-content: start;
    padding-left: 8px;
    border-left: 1px solid rgba(59, 130, 246, 0.2);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
}

.btn-rotate {
    background-color: #3b82f6;
    color: white;
    transition: all 0.3s ease;
}

.btn-rotate:hover {
    background-color: #2563eb;
}

.btn-rotate.active {
    background-color: #22c55e;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
    animation: pulse-button 2s infinite;
}

@keyframes pulse-button {
    0%, 100% { 
        box-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
    }
    50% { 
        box-shadow: 0 0 25px rgba(34, 197, 94, 0.9);
    }
}

.btn-clear {
    background-color: #f59e0b;
    color: white;
}

.btn-clear:hover {
    background-color: #d97706;
}

.btn-auto {
    background-color: #8b5cf6;
    color: white;
}

.btn-auto:hover {
    background-color: #7c3aed;
}

.btn-exit {
    background-color: #ef4444;
    color: white;
    padding: 10px 25px;
}

.btn-exit:hover {
    background-color: #dc2626;
}

.btn-ready {
    background-color: #22c55e;
    color: white;
}

.btn-ready:hover:not(:disabled) {
    background-color: #16a34a;
}

.btn-ready:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Визуальная обратная связь для режима поворота */
.cell.ship.rotate-mode {
    cursor: pointer;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.8), inset 0 0 10px rgba(34, 197, 94, 0.3);
    animation: rotate-highlight 1.5s infinite;
}

@keyframes rotate-highlight {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(34, 197, 94, 0.8), inset 0 0 10px rgba(34, 197, 94, 0.3);
    }
    50% { 
        box-shadow: 0 0 20px rgba(34, 197, 94, 1), inset 0 0 15px rgba(34, 197, 94, 0.5);
    }
}

/* Визуальная обратная связь для drag & drop */
.cell.ship[draggable="true"] {
    cursor: move;
}

.cell.ship.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.cell.drag-over {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.5) 0%, rgba(59, 130, 246, 0.5) 50%, rgba(34, 197, 94, 0.5) 100%) !important;
    border: 2px dashed #22c55e;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.8);
}

/* Предпросмотр размещения */
.cell.preview {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.7) 0%, rgba(59, 130, 246, 0.7) 50%, rgba(34, 197, 94, 0.7) 100%) !important;
    border: 2px dashed #22c55e;
    position: relative;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
    z-index: 2;
}

.cell.preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.4);
    animation: previewPulse 1s ease-in-out infinite;
}

@keyframes previewPulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

.cell.preview-invalid {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.6) 0%, rgba(220, 38, 38, 0.6) 100%) !important;
    border: 2px dashed #dc2626;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    z-index: 2;
}

.cell.preview-invalid::before {
    display: none;
}

@media (max-width: 900px) {
    .header-controls {
        flex-direction: column;
        align-items: center;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .btn-exit {
        width: 100%;
        max-width: 200px;
    }
    
    .game-boards {
        flex-direction: column;
        align-items: center;
    }
    
    .board {
        width: 350px;
        height: 350px;
    }
    
    .ship-panel {
        width: 350px;
        height: 350px;
        padding: 20px;
    }
    
    .ship-panel h3 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .ships-list {
        gap: 12px;
        margin-bottom: 15px;
    }
    
    .ship-item {
        padding: 12px;
        gap: 8px;
    }
    
    .placement-controls {
        gap: 8px;
        padding-top: 12px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9em;
    }
}

@media (max-width: 400px) {
    .board {
        width: 300px;
        height: 300px;
    }
    
    .ship-panel {
        width: 300px;
        height: 300px;
        padding: 15px;
    }
    
    .ship-panel h3 {
        font-size: 1.1em;
        margin-bottom: 12px;
    }
    
    .ships-list {
        gap: 10px;
        margin-bottom: 12px;
    }
    
    .ship-item {
        padding: 10px;
        gap: 6px;
    }
    
    .ship-label {
        font-size: 0.8em;
    }
    
    .ship-count {
        font-size: 0.7em;
        padding: 2px 6px;
    }
    
    .placement-controls {
        gap: 6px;
        padding-top: 10px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}

/* Панель результатов игры */
.game-end-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.game-end-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 90%;
    text-align: center;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.game-end-title {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-end-title.winner {
    color: #22c55e;
    animation: pulse 1s infinite;
}

.game-end-title.loser {
    color: #ef4444;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 25px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.stat-label {
    display: block;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.remaining-ships {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.ships-info {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 10px;
    flex: 1;
    min-width: 200px;
    backdrop-filter: blur(10px);
}

.ships-info h3 {
    color: white;
    font-size: 1.2em;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.ships-info .ships-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ship-info-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 5px;
    color: white;
    font-size: 1em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-new-game {
    background-color: #22c55e;
    color: white;
    padding: 15px 40px;
    font-size: 1.2em;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.btn-new-game:hover {
    background-color: #16a34a;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(34, 197, 94, 0.4);
}

@media (max-width: 768px) {
    .game-end-content {
        padding: 30px 20px;
    }
    
    .game-end-title {
        font-size: 2em;
    }
    
    .game-stats {
        gap: 20px;
    }
    
    .remaining-ships {
        flex-direction: column;
        gap: 20px;
    }
    
    .ships-info {
        min-width: 100%;
    }
}
