/* Common styles shared across all quiz pages */

html, body {
    height: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 10px;
    box-sizing: border-box; 
}

.quiz-container {
    width: 100%;
    max-width: 680px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 4px 24px 40px;
    box-sizing: border-box;
    background: #f0ede6;
    border-radius: 32px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.1);
}

.quiz-header {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    padding: 4px 2px 0px;
    box-sizing: border-box;
}

.quiz-body {
    width: 100%;
    margin-top: 0px;
    padding-top: 5px;
    border-top: 1px solid #d9dde5;
    box-sizing: border-box;
}

.quiz-title {
    font-size: 20px;
    font-weight: 700;
    color: #1b1d21;
}

.quiz-meta {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #1b1d21;
}

.meta-chip .chip-label {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    background-color: #c3242c;
    color: #fff;
    letter-spacing: 0.03em;
}

.countdown {
    --ring-color: #6f7785;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 700;
    color: #4d5661;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: color 0.25s ease, background-color 0.25s ease;
}

.countdown-ring {
    position: absolute;
    inset: 0;
    transform: rotate(-90deg);
}

.countdown-ring__bg,
.countdown-ring__progress {
    fill: none;
    stroke-width: 4;
}

.countdown-ring__bg {
    stroke: #e2e6ec;
}

.countdown-ring__progress {
    stroke: var(--ring-color);
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
    transition: stroke 0.25s ease, stroke-dashoffset 1s linear;
}

.countdown-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.countdown.warning {
    --ring-color: #d66a2f;
    color: #b2491c;
    background: #fff3e8;
}

.countdown.expired {
    --ring-color: #b0212b;
    color: #b0212b;
    background: #ffe8e8;
}

.score-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #1b1d21;
}

.next-button {
    display: none;
    margin: 16px auto 0;
    padding: 10px 24px;
    border-radius: 999px;
    border: none;
    background-color: #0e3f70;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.next-button:hover {
    background-color: #0b3156;
}

.flag-container {
    position: relative; 
    z-index: 5;
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flag-container img {
    max-height: 100%;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    display: block;
    box-sizing: border-box;
    border-radius: 20px;
    border: 10px solid rgba(255, 255, 255, 0.9);
}

.results-layout {
    width: 100%;
    margin-top: 18px;
    display: flex;
}

.results-left,
.results-right {
    flex: 1;
}

.results-left {
    display: flex;
    align-items: center;
    justify-content: center;
}

.results-card {
    text-align: center;
    max-width: 260px;
}

.results-title {
    font-size: 20px;
    font-weight: 700;
    color: #1b1d21;
    margin-bottom: 16px;
}

.results-circle {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 20px;
    border-radius: 50%;
    border: 12px solid rgba(14, 63, 112, 0.12);
    background: #f7fbff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.results-badge {
    position: absolute;
    top: 16px;
    padding: 6px 18px;
    border-radius: 999px;
    background-color: #0e3f70;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.results-score-text {
    font-size: 32px;
    font-weight: 700;
    color: #0e3f70;
}

.results-points {
    margin-top: 4px;
    font-size: 14px;
    color: #4d5661;
}

.play-again-button {
    margin-top: 12px;
    padding: 10px 24px;
    border-radius: 999px;
    border: 1px solid #d0e2ff;
    background-color: #ffffff;
    color: #0e3f70;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 16px rgba(15, 76, 129, 0.15);
}

.play-again-button:hover {
    background-color: #f3f7ff;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .quiz-container {
        padding: 4px 16px 30px;
        gap: 1px;
        border-radius: 24px;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    }

    .quiz-header {
        flex-direction: column;
        gap: 8px;
    }

    .quiz-meta {
        width: 100%;
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 8px;
    }

    .countdown {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .quiz-title {
        display: none;
    }

    .quiz-meta .meta-chip {
        justify-self: start;
    }

    #question-progress {
        justify-self: center;
        font-weight: 600;
    }

    .score-box {
        justify-self: end;
    }

    .meta-chip .chip-label {
        display: none;
    }

    .flag-container {
        height: 180px;
    }

    .flag-container img {
        border-width: 5px; 
        border-radius: 10px; 
    }

    .results-layout {
        flex-direction: column;
    }

    .results-right {
        display: none;
    }
}
