* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    background: #020205;
    color: #00ffcc;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 1920px;
    height: 1080px;
    max-width: 100vw;
    max-height: 90vh;
    aspect-ratio: 16/9;
    border: 3px solid #ff0055;
    box-shadow: 0 0 35px rgba(255, 0, 85, 0.5);
}

canvas {
    width: 100%;
    height: 100%;
}

#ui-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 38%;
    /* Légèrement agrandi pour accueillir les textes plus gros */
    background: rgba(5, 7, 18, 0.98);
    /* Fond plus opaque pour un meilleur contraste */
    border-top: 4px solid #00ffcc;
    display: grid;
    grid-template-columns: 1.2fr 1.3fr 1.1fr;
    /* Ajustement des proportions */
    padding: 25px;
    gap: 25px;
}

/* --- LOG DE COMBAT PLUS LISIBLE --- */
#action-log {
    border: 2px solid #ff0055;
    background: rgba(10, 2, 5, 0.85);
    padding: 20px;
    overflow-y: auto;
    font-size: 22px;
    /* Plus gros (anciennement 18px) */
    font-weight: bold;
    line-height: 1.6;
    color: #ffffff;
    /* Changé en blanc pour une lisibilité parfaite */
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

#control-panel {
    border: 2px solid #00ffcc;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(0, 40, 40, 0.15);
}

/* --- INDICATEUR DE TOUR --- */
#character-turn-indicator {
    font-size: 26px;
    /* Plus gros (anciennement 22px) */
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 12px #00ffcc;
    margin-bottom: 10px;
}

.hidden {
    display: none !important;
}

/* --- ANCIEN BLOC #menu-actions, #menu-targets, #menu-skills MODIFIÉ --- */
#menu-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

/* Les menus de Magies et de Cibles passent en 2 colonnes pour éviter le débordement */
#menu-skills, #menu-targets {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 8px;
}

/* Le bouton RETOUR prendra toute la largeur sur la première ligne */
#menu-skills .btn:first-child, #menu-targets .btn:first-child {
    grid-column: span 2;
}

/* --- BOUTONS AJUSTÉS --- */
.btn {
    background: #0d111d;
    color: #00ffcc;
    border: 2px solid #00ffcc;
    padding: 10px 14px; /* Réduit légèrement de 14px à 10px pour gagner de la place */
    font-size: 20px; /* Légèrement ajusté de 22px à 20px pour un alignement parfait */
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    cursor: pointer;
    text-align: left;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn:hover {
    background: #00ffcc;
    color: #000;
    box-shadow: 0 0 20px #00ffcc;
}

/* --- BOUTONS PLUS GRANDS --- */
.btn {
    background: #0d111d;
    color: #00ffcc;
    border: 2px solid #00ffcc;
    padding: 14px;
    /* Plus d'espace interne */
    font-size: 22px;
    /* Plus gros (anciennement 18px) */
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    cursor: pointer;
    text-align: left;
    border-radius: 4px;
}

.btn:hover {
    background: #00ffcc;
    color: #000;
    box-shadow: 0 0 20px #00ffcc;
}

/* --- PANNEAU DES STATUTS DES PERSONNAGES --- */
#party-status {
    border: 2px solid #00ffcc;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 22px;
    /* Plus gros (anciennement 16px) */
    color: #ffffff;
    /* Texte par défaut en blanc */
}

.status-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid rgba(0, 255, 204, 0.2);
    padding-bottom: 6px;
    font-weight: bold;
}

#save-panel {
    position: absolute;
    top: -60px;
    right: 20px;
    display: flex;
    gap: 15px;
}

.btn-save {
    background: #020205;
    color: #ff0055;
    border: 2px solid #ff0055;
    padding: 10px 20px;
    font-size: 18px;
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    cursor: pointer;
    border-radius: 4px;
}

.btn-save:hover {
    background: #ff0055;
    color: #fff;
}