/* =========================
   GLOBAL
========================= */
.bataille-container,
.boards {
    display: flex;
    gap: 40px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

h3 {
    margin-bottom: 10px;
    text-align: center;
}

.info-session {
    margin-bottom: 15px;
    color: #ddd;
    font-weight: bold;
}

/* =========================
   GRILLES
========================= */
.grid,
.plateau {
    display: grid;
    grid-template-columns: repeat(10, 40px);
    grid-template-rows: repeat(10, 40px);
    gap: 2px;
}

.cell,
.case {
    width: 40px;
    height: 40px;
    background-color: #1F1F1F;
    border: 1px solid #444;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

/* =========================
   BATEAUX JOUEUR
========================= */
.ship-piece,
.case.ship {
    background-color: #6c6c6c;
}

.ship-piece::after {
    content: "🚢";
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

/* =========================
   ETATS DE JEU
========================= */
.hit,
.case.hit {
    background-color: #E53935 !important;
    animation: explosion 0.25s ease;
}

.miss,
.case.miss {
    background-color: #1E88E5 !important;
}

@keyframes explosion {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* =========================
   PREVIEW PLACEMENT
========================= */
.preview-ok {
    background-color: rgba(0, 200, 0, 0.6) !important;
}

.preview-no {
    background-color: rgba(255, 0, 0, 0.6) !important;
}

/* =========================
   BATEAUX A PLACER
========================= */
#ships,
#ships-container {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.ship {
    display: flex;
    gap: 3px;
    padding: 6px 8px;
    cursor: grab;
    background-color: #555;
    border-radius: 6px;
    user-select: none;
}

.ship.vertical {
    flex-direction: column; /* ← FAIT BASCULER LE BATEAU VERTICAL */
}

.ship::before {
    content: "🚢";
    font-size: 18px;
}

.ship[data-size="2"]::before { content: "🚢🚢"; }
.ship[data-size="3"]::before { content: "🚢🚢🚢"; }
.ship[data-size="4"]::before { content: "🚢🚢🚢🚢"; }
.ship[data-size="5"]::before { content: "🚢🚢🚢🚢🚢"; }

/* =========================
   DESACTIVATION
========================= */
.disabled .cell,
.disabled .case {
    pointer-events: none;
    opacity: 0.85;
}

/* =========================
   MESSAGES
========================= */

#player-board div.hit {
    background: red;
}
#player-board div.miss {
    background: #555;
}
#enemy-board div.hit {
    background: red;
}
#enemy-board div.miss {
    background: #555;
}

/* =========================
   BATEAUX COULÉS
========================= */
.coulé {
    background-color: #8B0000 !important; /* rouge foncé */
    position: relative;
}

.coulé::after {
    content: "💥";
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 18px;
}

/* =========================
   MESSAGES
========================= */
#message {
    margin: 15px auto 0 auto;
    display: flex;
    flex-direction: column-reverse; /* le dernier message en haut */
    gap: 5px;
	max-width: 600px;
	
}

#message div {
    transition: all 0.3s ease;
}

.bataille-result-ok, .bataille-result-no {
    margin:10px 0;
    padding:10px;
    border-radius:10px;
}
.bataille-result-ok { border: dashed lightgreen; color: white; max-width: 600px; margin: 10px auto 0 auto; }
.bataille-result-no { border: dashed lightcoral; color: white; max-width: 600px; margin: 10px auto 0 auto; }

.solde-result {
    padding:10px;
    border-radius:10px;
}

.level-result {
    margin:10px 0 0 0;
    padding:10px;
    border-radius:10px;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.touché-msg {
    background-color: rgba(255, 215, 0, 0.2); /* jaune pour touché */
    border-left: 4px solid #FFD700;
}

/* Animation bateau coulé */
.animate-sink {
    animation: sink 0.5s ease;
}

@keyframes sink {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) rotate(-5deg); }
    100% { transform: scale(1); }
}

/* Flash compteur bateau coulé */
.flash-counter {
    animation: flash 0.5s ease;
}

@keyframes flash {
    0% { transform: scale(1); color:#00c800; }
    50% { transform: scale(1.2); color:#FFD700; }
    100% { transform: scale(1); color:#00c800; }
}

/* Orientation affichage déjà existant */
#orientation-display {
    font-weight: bold;
    color: #f2af70;
    font-size: 16px;
    margin: 10px 0 6px 0;
}

#orientation-display span {
    color: lightgreen;
}

/* Touché et coulé restent */
.touché-msg {
    background-color: rgba(255, 215, 0, 0.2);
    border-left: 4px solid #FFD700;
}
.coulé::after { content: "💥"; font-size:18px; display:flex; justify-content:center; align-items:center; height:100%; }

.formulaire-input-cat-roulette {
    display: inline-flex;
    position: relative;
    width: fit-content;
	vertical-align: middle;
}

.formulaire-input-cat-roulette label {
    font-size: 1rem;
    line-height: 1.5rem;
    font-weight: bold;
    color: rgb(169, 169, 173);
    margin-top: 6px;
    background: none;
}

.formulaire-input-cat-roulette span {
    margin: 8px 0px 0px 10px;
}

.form-input-form-mbr-cat-roulette {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgb(255, 255, 255);
    font-size: 12px;
    padding: 10px 10px 10px 40px;
    width: fit-content;
    outline: none;
    background: rgb(26, 26, 26);
    border-radius: 8px;
    height: 38px;
	display: inline-block;
}

.level {
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 6px;
    color: #fff;
}

.level-easy {
    background: #2ecc71; /* vert */
}

.level-medium {
    background: #f1c40f; /* jaune */
    color: #000;
}

.level-hard {
    background: #e74c3c; /* rouge */
}

.level-expert {
    background: #8e44ad; /* violet */
}


/* Overlay WIN */
#bataille-win-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

#bataille-win-overlay.show {
    opacity: 1;
    pointer-events: all;
}

#bataille-win-overlay h1 {
    font-size: 5rem;
    color: gold;
    text-shadow: 0 0 20px #fff, 0 0 40px gold;
    animation: scalePulse 1s infinite alternate;
}

@keyframes scalePulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.3); }
}