body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    text-align: center;
    max-width: 900px;
}

.game-area {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    color: var(--primary-color);
    margin: 0;
}

.status {
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: bold;
    color: #2c3e50;
    min-height: 1.5em;
}

/* Setup Phase */
.setup-phase {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 0 auto;
}

.setup-instructions {
    color: #666;
    margin-bottom: 15px;
}

/* Ship Selector */
.ship-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 15px;
}

.ship-btn {
    padding: 8px 14px;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.ship-btn:hover {
    border-color: #3498db;
    background: #ebf5fb;
}

.ship-btn.selected {
    border-color: #3498db;
    background: #3498db;
    color: white;
}

.ship-btn.placed {
    border-color: #27ae60;
    background: #eafaf1;
    color: #27ae60;
}

.ship-btn.placed.selected {
    background: #27ae60;
    color: white;
}

.setup-controls {
    margin-bottom: 15px;
}

/* Setup Grid */
.setup-grid, .battle-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    max-width: 340px;
    margin: 0 auto 15px;
}

.bs-cell {
    width: 32px;
    height: 32px;
    background: #3498db;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background-color 0.15s;
    position: relative;
}

.bs-cell:hover {
    background: #2980b9;
}

/* Ship placed on grid */
.bs-cell.ship {
    background: #7f8c8d;
}

/* Setup preview */
.bs-cell.preview-valid {
    background: #2ecc71 !important;
}

.bs-cell.preview-invalid {
    background: #e74c3c !important;
}

/* Battle states */
.bs-cell.hit {
    background: #e74c3c;
}

.bs-cell.hit::after {
    content: '💥';
    font-size: 16px;
}

.bs-cell.miss {
    background: #95a5a6;
}

.bs-cell.miss::after {
    content: '•';
    font-size: 20px;
    color: white;
}

.bs-cell.sunk {
    background: #8b0000;
}

.bs-cell.sunk::after {
    content: '💥';
    font-size: 16px;
}

/* My grid: show own ships */
.bs-cell.my-ship {
    background: #7f8c8d;
}

.bs-cell.my-ship.hit {
    background: #e74c3c;
}

/* Disabled attack cells */
.bs-cell.disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.setup-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

/* Battle Grids Layout */
.battle-grids {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.grid-section {
    text-align: center;
}

.grid-section h3 {
    margin: 0 0 10px;
    color: #2c3e50;
    font-size: 1rem;
}

/* Ship Status */
.ship-status {
    text-align: left;
    font-size: 0.8rem;
    margin-top: 8px;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
}

.ship-status-item {
    padding: 2px 0;
    color: #2c3e50;
}

.ship-status-item.sunk {
    color: #e74c3c;
    text-decoration: line-through;
}

/* Cover Screen */
.cover-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.cover-content {
    text-align: center;
    color: white;
}

.cover-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: white;
}

.cover-content p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: #bdc3c7;
}

/* Game buttons */
.game-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

#exit-game-btn {
    padding: 10px 20px;
    font-size: 1rem;
}

/* Online info */
.online-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.opponent-name {
    font-weight: 600;
    color: var(--text-muted, #666);
}

/* Responsive */
@media (max-width: 700px) {
    .battle-grids {
        flex-direction: column;
        align-items: center;
    }

    .bs-cell {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .bs-cell.hit::after, .bs-cell.sunk::after {
        font-size: 13px;
    }
}
