/* Variabili per personalizzare il gioco */
:root {
    --bg-color: #f0f0f0;
    --font-color: #333;
    --button-bg: #4CAF50;
    --button-font: 'Arial', sans-serif;
    --grid-size: 400px;
    --frame-color: #6c5b7b;
    --frame-shadow: 5px 5px 15px rgba(0, 0, 0, 0.3);
    --tile-animation-duration: 0.3s;
}

/* Immagine di sfondo */
body {
    background-image: url('background.jpg'); /* Inserisci il percorso della tua immagine */
    background-size: cover;
    background-position: center;
    color: var(--font-color);
    font-family: var(--button-font);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.game-container {
    text-align: center;
    background-color: rgba(255, 255, 255, 0.8); /* Sfondo semi-trasparente per il contenuto */
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--frame-shadow);
}

.game-frame {
    border: 15px solid var(--frame-color);
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5), var(--frame-shadow);
    padding: 5px;
    display: inline-block;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    width: var(--grid-size);
    height: var(--grid-size);
}

.tile {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border: 1px solid #ccc;
    transition: transform var(--tile-animation-duration) ease;
}

.tile.moving {
    transform: scale(1.1);
}

#victory-image {
    width: var(--grid-size);
    height: var(--grid-size);
    border-radius: 10px;
    display: none; /* Inizialmente nascosta */
}

#victory-image.visible {
    display: block; /* Mostrata quando il giocatore vince */
}

#shuffle-btn {
    background-color: var(--button-bg);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
}

#shuffle-btn:hover {
    background-color: #45a049;
}

#help-btn {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

#help-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.hidden {
    display: none;
}

#win-message {
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
    margin-top: 20px;
}

.stats {
    margin-top: 10px;
    font-size: 18px;
    display: flex;
    justify-content: space-around;
}

/* Animazione per l'aiuto */
@keyframes highlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.tile.highlight {
    animation: highlight 1s ease-in-out;
}