/* Style global de la page de résultat */
#result-page {
    background-color: #eefbff;
}

/* Header dynamique (Vert en cas de succès, Rouge en cas d'échec) */
#result-header {
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

#result-header.success {
    background-color: #2e7d32;
    color: #ffffff;
}

#result-header.fail {
    background-color: #d32f2f;
    color: #ffffff;
}

.share-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: white;
}

/* Zone héroïque supérieure */
.result-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
}

.trophy-container {
    position: relative;
    margin-bottom: 12px;
}

.trophy-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.trophy-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.laugh-badge {
    position: absolute;
    top: 10px;
    right: -15px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid #888;
    background-color: rgba(0, 0, 0, 0.26);
    display: flex;
    align-items: center;
    justify-content: center;
}

.laugh-badge img {
    width: 25px;
    height: 25px;
}

.laugh-badge.hidden {
    display: none;
}

#result-score-label {
    font-size: 21px;
    font-weight: bold;
    color: #000;
    margin: 5px 0;
}

.score-display {
    font-size: 30px;
    font-weight: bold;
    color: #000;
}

/* Étoiles de score */
.stars-rating {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.stars-rating .star-icon {
    width: 45px;
    height: 45px;
}

/* Container de la liste défilante */
.result-questions-wrapper {
    flex: 1;
    background-color: #dae4e7;
    border-top: 4px solid #2e7d32; /* Devient rouge si échec */
    padding: 10px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
}

.result-questions-wrapper.fail {
    border-top-color: #d32f2f;
}

.result-questions-list {
    width: 80%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Cartes de question */
.result-question-card {
    height: 90px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.result-question-card:active {
    transform: scale(0.98);
}

.result-question-card.correct {
    background-color: rgba(76, 175, 80, 0.9);
}

.result-question-card.incorrect {
    background-color: rgba(244, 67, 54, 0.9);
}

.card-number {
    font-size: 28px;
    font-weight: bold;
}

.card-status {
    font-size: 14px;
    font-weight: bold;
}

/* Barre de boutons inférieure */
.result-footer {
    display: flex;
    justify-content: space-evenly;
    padding: 12px;
    gap: 10px;
    background-color: #ffffff;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.btn-result {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-replay {
    background-color: #ff9800;
}

.btn-next {
    background-color: #0084ff;
}

.btn-next.hidden {
    display: none;
}

/* Styles de la boite de dialogue (Modal Détail) */
.dialog-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: min(92vw, 520px);
    width: 520px;
    overflow: hidden;
}

.dialog-content .modal-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid #edf1f7;
}

.dialog-content .modal-body {
    padding: 16px 20px;
    border: 0;
}

.dialog-content .modal-footer {
    padding: 12px 20px 16px;
}

.question-dialog-img {
    width: 100%;
    height: 220px;
    margin: 0 0 14px;
    border-radius: 14px;
    overflow: hidden;
    background: #f3f6fb;
}

.question-dialog-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.dialog-label {
    font-weight: bold;
    font-size: 14px;
    margin-top: 10px;
}

.dialog-label-blue { color: #1976d2; }
.dialog-label-green { color: #2e7d32; }

.dialog-text {
    font-size: 16px;
    margin: 6px 0;
}

.dialog-answer-box {
    background-color: rgba(76, 175, 80, 0.1);
    border: 2px solid #4caf50;
    border-radius: 8px;
    padding: 10px;
    color: #1b5e20;
    font-weight: 500;
    margin-top: 6px;
}

.btn-dialog-close {
    background: none;
    border: none;
    color: #1976d2;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: bold;
}

.mini-logo {
    width: 25px;
    height: 25px;
}