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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding: 20px;
    background-color: #f0f8ff;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

.game-info {
    margin-bottom: 20px;
}

.game-info ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.controls {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

.game-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#grid-container {
    display: grid;
    grid-template-columns: repeat(11, 40px); /* 1 column for hint + 10 columns for grid */
    grid-template-rows: repeat(11, 40px); /* 1 row for hint + 10 rows for grid */
    gap: 2px;
    margin: 20px auto;
    justify-content: center; /* Center grid horizontally */
}

.cell {
    width: 40px;
    height: 40px;
    border: 1px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f8ff; /* Light blue background for cells */
    cursor: pointer;
    font-weight: bold;
}

.cell:hover:not(.hint) {
    background-color: #d6eaf8;
}

.cell.ship {
    background-color: #555;
    border: none; /* Remove default cell border for ships */
}

.cell.water {
    background-color: #add8e6;
    color: #0077be;
    border-radius: 0 !important; /* Ensure water cells are always square */
    width: 40px !important;      /* Restore standard size */
    height: 40px !important;
    margin: 0 !important;        /* Remove any margin */
}

.hint {
    background-color: #d0d0d0;
    font-weight: bold;
}

/* Ship orientation and part styling - Enhanced to be more visible */
.ship.horizontal, .ship.vertical {
    background-color: #555;
}

/* Rounded ends for ships - Increased border radius for more pronounced rounding */
.ship.bow.horizontal {
    border-radius: 20px 0 0 20px;
    border-left: 2px solid #555; /* Add border to enhance rounded effect */
}

.ship.stern.horizontal {
    border-radius: 0 20px 20px 0;
    border-right: 2px solid #555;
}

.ship.bow.vertical {
    border-radius: 20px 20px 0 0;
    border-top: 2px solid #555;
}

.ship.stern.vertical {
    border-radius: 0 0 20px 20px;
    border-bottom: 2px solid #555;
}

/* Submarine styling - Enhanced to ensure it's clearly a circle */
.ship.submarine {
    border-radius: 50% !important; /* Force circular shape */
    width: 32px !important;  /* Make slightly smaller to ensure roundness is visible */
    height: 32px !important;
    margin: 4px;
    background-color: #444;
}

/* Status message styling */
#status-message {
    text-align: center;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.success-message {
    background-color: #d4edda;
    color: green;
    font-weight: bold;
}

.error-message {
    background-color: #f8d7da;
    color: red;
    font-weight: bold;
}

.fleet-status {
    margin: 20px auto;
    text-align: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.fleet-status p {
    margin: 5px 0;
}

.ship-status {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
}

.ship {
    display: inline-block;
    padding-left: 5px;
}
