/*
    Ce fichier de styl eest utilisé pour toute la parti jeu avec les différents bateaux
*/


/* === RESET & BASE === */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-align: center;
}

/* === HEADER & FOOTER === */
header {
    background-color: #147297;
    color: antiquewhite;
    padding: 10px 0;
    height: 60px;
}

footer {
    background-color: rgb(36, 37, 41);
    color: antiquewhite;
    width: 100%;
    height: 50px;
    padding: 10px 0;
}

/* === MAIN CONTENT === */
main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 110px);
    padding: 0 20px;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 50px;
}

/* === CHARGEMENT (LOADER) === */
.loading-circle {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-top: 5px solid #3498db;
    border-radius: 50%;
    margin-bottom: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#wait p {
    font-size: 23px;
}

/* === GESTION DES BATEAUX === */
#ship-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 200px;
}

#selectBoat {
    display: flex;
    justify-content: center;
    align-items: center;
}

.ship {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 150px;
    height: 40px;
    background-color: lightblue;
    border: 2px solid navy;
    cursor: pointer;
    transition: 0.2s;
    border-radius: 8px;
}

.ship[boat="posed"] {
    background-color: rgba(255, 0, 0, 0.5);
    border: 2px solid rgb(255, 0, 0);
}

.ship:hover {
    transform: scale(1.1);
}

/* === GRILLES DE JEU === */
.game {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
}

.bataille-navale {
    border-collapse: collapse;
}

.bataille-navale td,
.bataille-navale th {
    border: 1px solid black;
    width: 40px;
    height: 40px;
    text-align: center;
}

.bataille-navale .header {
    background-color: #f0f0f0;
    font-weight: bold;
}

.bataille-navale td {
    background-color: #fff;
}

/* === BOUTONS POUR LE JEU === */
button[fonction="jeu"], button[fonction="adv"] {
    display: block;
    width: 100%;
    height: 100%;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    line-height: 1;
    font-size: 0;
    box-sizing: border-box;
}

/* === STATUT DES CASES === */
button[boat="preview"] { background-color: rgba(0, 123, 255, 0.5); }
button[boat="error"] { background-color: rgba(255, 0, 0, 0.5); }
button[boat="validate"] { background-color: rgba(0, 255, 179, 0.6); }
button[boat="missed"] { background-color: rgba(22, 27, 33, 0.2); }
button[boat="touched"] { background-color: rgba(146, 41, 15, 0.5); }

/* === BOUTON DE VALIDATION === */
#submit-btn {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 16px;
    background-color: #0078d7;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.2s;
}

#submit-btn:hover {
    background-color: #005ea2;
    transform: scale(0.98);
}

/* === AUTRES === */
td {
    margin: 0;
    padding: 0;
    border-spacing: 0;
}

.turn {
    font-size: 30px;
    padding: 20px;
}

[hidden] {
    display: none !important;
}
