.seabattle-wrapper {
    max-width: 1120px; /* Accommodate two boards */
    margin: 20px auto;
    position: relative;
}

.seabattle-boards {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
}

.seabattle-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    transition: opacity 0.3s ease;
}

.seabattle-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.seabattle-container {
    max-width: 550px;
    width: 100%;
    background: #fff;
    padding: 0 10px 10px 0;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    transition: opacity 0.5s ease;
}

.seabattle-container.opponent-board{
    pointer-events: none;
}

.seabattle-container.loaded {
    opacity: 1 !important;
}

.seabattle-header,
.seabattle-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.seabattle-cell {
    width: 10%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}

.grid-cell {
    background-image: url('images/grid.png');
    background-size: cover;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: scale(1);
}
.grid-cell:hover {
    transform: scale(0.85);
}

/* Ship styles */
.grid-cell.ship {
    background-size: 100% 100%, 100% 100%;
    background-repeat: no-repeat, no-repeat;
}

/* 4-grid ship */
.ship4-1 { background-image: url('images/ship4-1.png'), url('images/grid.png'); }
.ship4-2 { background-image: url('images/ship4-2.png'), url('images/grid.png'); }
.ship4-3 { background-image: url('images/ship4-3.png'), url('images/grid.png'); }
.ship4-4 { background-image: url('images/ship4-4.png'), url('images/grid.png'); }

/* 3-grid ships */
.ship3-1 { background-image: url('images/ship3-1.png'), url('images/grid.png'); }
.ship3-2 { background-image: url('images/ship3-2.png'), url('images/grid.png'); }
.ship3-3 { background-image: url('images/ship3-3.png'), url('images/grid.png'); }

/* 2-grid ships */
.ship2-1 { background-image: url('images/ship2-1.png'), url('images/grid.png'); }
.ship2-2 { background-image: url('images/ship2-2.png'), url('images/grid.png'); }

/* 1-grid ships */
.ship1{ background-image: url('images/ship1.png'), url('images/grid.png'); }

/* Vertical ships */
.grid-cell.ship.vertical {
    transition: none;
    transform: rotate(90deg);
}

.grid-cell.clicked {
    cursor: not-allowed;
    background-image: url('images/shot.png');
    background-size: 100% 100%, 100% 100%;
    background-repeat: no-repeat, no-repeat;
    opacity: 1;
}

.grid-cell.hit {
    background-image: url('images/hit.png') !important;
    background-size: 100% 100%, 100% 100%;
    background-repeat: no-repeat, no-repeat;
    opacity: 1 !important;
}

.grid-cell.clicked.yesterday {
    opacity: 0.5;
}

.empty {
    border: none;
}

.grid-cell.not-clickable {
    cursor: not-allowed;
}

.letter-cell,
.number-cell {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    font-size: 0; /* Hide any text content */
}

.seabattle-cell.letter-cell {
    padding-bottom: 5px; /* Adjust spacing for letters */
    background-size: auto 48%;
}

.seabattle-cell.number-cell {
    padding-right: 5px; /* Adjust spacing for numbers */
    background-size: auto 48%;
}

/* Mobile layout */
@media (max-width: 800px) {
    .seabattle-boards {
        flex-direction: column;
    }

    .seabattle-container {
        margin: 0 auto;
    }

    /* Player board on top for mobile */
    .player-board {
        order: -1;
    }
}

