:root {
    --bg-color: #ffffff; /* Fond blanc */
    --surface-color: rgba(255, 255, 255, 0.95); /* Semi-transparent pour l'overlay */
    --primary-color: #000000; /* Noir pour boutons principaux */
    --secondary-color: #666666;
    --accent-color: #333333;
    --success-color: #2e7d32; /* Vert foncé plus lisible sur blanc */
    --danger-color: #c62828;
    --warning-color: #f9a825;
    --text-color: #000000; /* Texte noir */
    --grid-line: #e0e0e0; /* Gris très clair pour la grille */
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Canvas Fullscreen */
.canvas-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-color: white;
}

canvas {
    display: block;
}

/* UI Overlay */
.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Laisse passer les clics vers le canvas si pas sur un élément */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Bouton Toggle (Hamburger) */
.btn-icon {
    pointer-events: auto;
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--surface-color);
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.1);
}

/* Conteneur principal de l'interface */
.ui-container {
    pointer-events: auto; /* Réactive les clics sur l'interface */
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    max-width: 500px;
    width: 90%;
    text-align: center;
    transition: opacity 0.3s, transform 0.3s;
    border: 1px solid #eee;
    
    /* Centrage */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ui-container.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* Menus */
.screen {
    display: none;
    width: 100%;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s;
}

.menu-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Game HUD specific style inside overlay */
.game-hud {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stats-panel {
    font-weight: bold;
    display: flex;
    justify-content: space-around;
    background: #f5f5f5;
    padding: 10px;
    border-radius: 8px;
}

.controls-panel {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Boutons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.primary { background-color: var(--primary-color); color: white; }
.secondary { background-color: var(--secondary-color); color: white; }
.accent { background-color: var(--accent-color); color: white; }
.success { background-color: var(--success-color); color: white; }
.danger { background-color: var(--danger-color); color: white; }
.warning { background-color: var(--warning-color); color: white; }

/* Inputs */
.input-group {
    text-align: left;
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.input-group input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.hint {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

footer {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #888;
}
