.hidden {
    display: none !important;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95); 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.overlay-content {
    background-color: rgba(20, 20, 20, 0.9);
    border: 2px solid #2fff00;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    color: white; 
}

.overlay-content h2 {
    color: #2fff00;
    margin-bottom: 20px;
}

.btn-box {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 32px 40px;
    background-color: rgba(0, 0, 0, 0.65);
    border: 2px solid #2fff00;
    border-radius: 8px;
    width: 300px;
    margin: 0 auto;
}

.btn-primary {
    padding: 16px 20px;
    background-color: #2fff00;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5);
}
.btn-box .btn-primary,
.form-box .btn-primary {
    width: 100%;
}
.btn-primary:hover {
    background-color: #1dd900;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.7);
    transform: translateY(-1px);
}

.form-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px 32px;
    background-color: rgba(0, 0, 0, 0.65);
    border: 2px solid #2fff00;
    border-radius: 8px;
    width: fit-content;
    margin: 20px auto;
    color: #2fff00; 
}
.form-box label {
    font-weight: bold;
    color: #2fff00;
}

.board-game-player,
.board-game-opponent {
    display: grid;
    border: 1px solid black;
}
.board-game-player {
    gap: 2px;
    padding: 2px;
}
.board-game-opponent {
    gap: 1px;
    padding: 1px;
}

.box {
    width: 40px;
    height: 40px;
    background-color: #2fff00;
    border: 1px solid black;
    box-sizing: border-box;
}
.board-game-opponent .box {
    width: 20px;
    height: 20px;
}

.box.hit {
    background-color: #ff0000 !important;
}
.box.miss {
    background-color: #2200ff !important;
}


.sidebar {
    width: 200px;
    background-color: rgba(0, 0, 0, 0.65);
    border-right: 2px solid #2fff00;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: white;
    text-align: center;
}

.sidebar .btn-primary {
    width: 100%;
}

.game-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 20px 0;
}

.box:hover {
    background-color: #1aaa00;
    cursor: pointer;
}

.box.ship {
    background-color: #555555;
}

.box.ghost {
    background-color: rgba(85, 85, 85, 0.6);
}

#placement-controls {
    color: white;
    text-align: center;
}
#placement-controls h3 {
    color: #2fff00;
}



.mode-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-mode {
    padding: 12px 20px;
    background-color: #555555;
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5);
    transition: background-color 0.2s, transform 0.1s;
}

.btn-mode:hover {
    transform: translateY(-1px);
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.7);
}

.btn-mode.active {
    background-color: #1aaa00; 
}
