body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative; /* For positioning the dice */
}

.container {
    max-width: 1200px;
    width: 100%;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

h1 {
    color: #2c3e50;
    margin-bottom: 25px;
}

h2 {
    font-size: 1.5em;
    color: #34495e;
    margin-bottom: 15px;
}

.new-game-button {
    background-color: #e74c3c;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 30px;
}

.new-game-button:hover {
    background-color: #c0392b;
}

.category {
    margin-bottom: 30px;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 25px;
    justify-content: center;
}

.card {
    background-color: #fdfdfd;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    opacity: 0.6; /* Gris désactivé au départ */
    filter: grayscale(100%); /* Gris désactivé au départ */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* RÈGLE POUR LES ÉTATS ILLUMINÉ ET LOKI (NON GRISÉS) */
.card.active,
.card.loki,
.card.found {
    opacity: 1;
    filter: grayscale(0%);
}

/* Règle pour l'état actif (illuminé) */
.card.active {
    box-shadow: 0 6px 12px rgba(46, 204, 113, 0.3);
    border-color: #2ecc71;
}

/* Règle spécifique pour les cartes "Loki" */
.card.loki {
    box-shadow: 0 6px 12px rgba(231, 76, 60, 0.3);
    border-color: #e74c3c;
}

/* Règle spécifique pour les cartes "trouvées" (Items et Heures) */
.card.found {
    box-shadow: 0 6px 12px rgba(231, 76, 60, 0.3);
    border-color: #e74c3c; /* Une bordure rouge */
}

.card img {
    max-width: 100px;
    height: auto;
    margin-bottom: 10px;
}

.card p {
    font-weight: bold;
    color: #555;
    margin: 0;
}

/* Style de la section de réponse finale */
#answer-section {
    margin-top: 50px;
    border-top: 2px dashed #ccc;
    padding-top: 30px;
}

.final-answer-grid {
    display: flex;
    justify-content: center;
    gap: 25px;
}

.answer-card {
    width: 200px;
    padding: 20px;
    border-radius: 10px;
    background-color: #f9f9f9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Style spécifique pour les cartes de réponse */
.answer-card.loki, .answer-card.found {
    border: 2px solid #e74c3c;
}

.answer-card p {
    font-size: 1.2em;
}

/* Styles pour le dé virtuel */
#dice-container {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

#dice {
    width: 100px;
    height: 100px;
    background-color: #fdfdfd;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 2px solid #ddd;
}

#dice:hover {
    transform: scale(1.05);
}

.dice-inner {
    width: 90%;
    height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    color: #6a1b9a; /* Indigo */
    margin: 0;
}

#dice img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none; /* Hidden by default */
}

/* Dice rolling animation */
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.dice-rolling {
    animation: shake 0.5s infinite;
}
