[x-cloak] {
    display: none !important;
}

body {
    padding: 1rem;
}

.quiz-card {
    width: 100%;
    max-width: 780px;
    border-radius: 1rem;
    margin: auto;
}

.quiz-title {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 1rem;
    padding: 1rem;
}

.name-avatar {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.name-avatar minidenticon-svg svg {
    width: 24px;
    height: 24px;
}

.card-body {
    padding: 1rem;
}

@media (min-width: 500px) {
    .quiz-title {
        padding: 2rem;
    }

    .card-body {
        padding: 2rem;
    }
}

/* Shake animation for wrong answers */
@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-8px);
    }
    40% {
        transform: translateX(8px);
    }
    60% {
        transform: translateX(-5px);
    }
    80% {
        transform: translateX(5px);
    }
}
.shake {
    animation: shake 0.4s ease;
}

/* <details> hint styling */
details > summary::-webkit-details-marker {
    display: none;
}

details.hint > summary.btn::before {
    content: "💡 Afficher l'indice";
}

details[open].hint > summary.btn::before {
    content: "▲ Masquer l'indice";
}

details .hint-box {
    background: #f8f9ff;
    border-radius: 0.5rem 0.5rem;
}
details .hint-box img {
    cursor: zoom-in;
}

/* <details> solution styling */
details.solution {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

details.solution > summary.btn::before {
    content: "Afficher la ";
}

details[open].solution > summary.btn::before {
    content: "Masquer la ";
}

/* Progress bar */
.progress {
    height: 8px;
    border-radius: 4px;
}

/* Done screen star */
.star-emoji {
    font-size: 4rem;
    line-height: 1;
}

/* Answer input focus ring */
.answer-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

button:focus-visible,
input:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .shake {
        animation: none;
    }
}

img {
    max-width: 100%;
    height: auto;
}

/* Image modal */
.image-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 1050;
}

.image-modal__img {
    max-width: 97vw;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border-radius: 0.5rem;
    background: white;
}

.image-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
