body {
    background-image: url("../img/galaxie.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    
    font-family: "Space Mono", monospace;
    color: white;
    font-size: 18px;
    text-align: center;
    min-height: 100dvh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

h1 {
    font-family: "Stardos Stencil", cursive;
    font-size: 40px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(235, 26, 26, 0.8);
}

h2 {
    font-family: "Stardos Stencil", cursive;
    font-size: 30px;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(235, 26, 26, 0.8);
}

#loading {
    position: fixed;
    inset: 0;
    background-image: url("../img/espace.jpg");
    display: grid;
    justify-content: space-around;
    justify-items: center;
    align-items: end;
    align-content: center;
    z-index: 1000;
}

button {
    padding: 10px 25px;
    font-family: "Space Mono", monospace;
    font-size: 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background-color: #8E52BC;
    color: #0f172a;   
}

button:hover {
    background-color: rgb(43, 70, 226);
}
#loading.cache {
    pointer-events: none;
    transform: translateY(-100%);
    transition: fade-out 1s ease-in-out;
}

#message {
    font-size: 20px;
    margin-bottom: 30px;
    min-height: 25px; /* Keeps the layout from jumping */
}

#grille {
    width: 50vmin;
    height: 50vmin;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px; /* This creates the spaces between the boxes */
    margin: 0 auto;
}

#grille .cell {
    background: rgba(229,78,208); /* Subtle transparent box */
    border: 2px solid rgba(229, 78, 208,); /* Faint border instead of pink */
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Remove the harsh purple hover effect and replace with a soft glow */
#grille .cell:hover {
    background: blueviolet; /* Soft glow effect */
    box-shadow: 0 0 15px rgba(234, 233, 234, 0.5); 
}

#grille .cell img {
    max-width: 60%;
    max-height: 60%;
    object-fit: contain;
    pointer-events: none;
    animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
/* Highlights the winning row */
#grille .cell.gagnant {
    background: rgba(255, 215, 0, 0.4); /* Gold transparent background */
    border: 2px solid #ffd700; /* Solid gold border */
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); /* Neon glow effect */
    z-index: 10; /* Keeps the glow above other boxes */
    transition: all 0.3s ease-in-out;
}

.bottom-nav {
    margin-top: 40px;
}

#replay {
    padding: 10px 25px;
    font-family: "Space Mono", monospace;
    font-size: 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background-color: #e2e8f0;
    color: #0f172a;
    transition: background 0.2s;
}

#replay:hover {
    background-color: blueviolet;
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}