:root {
    --primary: #ff6b6b;
    --secondary: #4ecdc4;
    --bg: #f7fff7;
    --dark: #292f36;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg);
    color: var(--dark);
    margin: 0;
    text-align: center;
}

h1 { font-family: 'Pacifico', cursive; color: var(--primary); font-size: 3em; }

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 500px;
    margin: 20px auto;
    padding: 10px;
}

.game-btn {
    background: white;
    border: 2px solid var(--secondary);
    border-radius: 15px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    text-decoration: none;
    position: relative;
    transition: transform 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.game-btn:active { transform: scale(0.95); }
.game-btn.locked { background: #ccc; cursor: not-allowed; filter: grayscale(1); }
.game-btn.done { border-color: #2ecc71; background: #e8f8f5; }

.check { position: absolute; top: 5px; right: 5px; font-size: 0.5em; }
.lock { position: absolute; font-size: 1.5em; color: #555; }

/* Le bouton central (9) */
.game-9 { grid-column: 2; grid-row: 2; border: 4px solid gold; }
/* Réorganisation visuelle pour mettre le 9 au milieu */
.game-1 { grid-column: 1; grid-row: 1; }
.game-2 { grid-column: 2; grid-row: 1; }
.game-3 { grid-column: 3; grid-row: 1; }
.game-4 { grid-column: 1; grid-row: 2; }
.game-5 { grid-column: 3; grid-row: 2; } /* Le 5 est à droite du milieu */
.game-6 { grid-column: 1; grid-row: 3; }
.game-7 { grid-column: 2; grid-row: 3; }
.game-8 { grid-column: 3; grid-row: 3; }

canvas { background: #eee; max-width: 100%; border: 2px solid #333; margin: 0 auto; display: block; }

.modal {
    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: 1000;
}
.hidden { display: none; }
.modal-content { background: white; padding: 30px; border-radius: 10px; animation: pop 0.5s; }

@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

/* Responsive */
@media (max-width: 600px) {
    .grid-container { gap: 10px; }
    .game-btn { height: 80px; }
}
