/* =========================================================
   CIVIL TRIVIA VARIABLES
   ========================================================= */

:root {
    --ink: #173547;
    --muted: #647480;
    --paper: #f6f8fb;
    --line: #dce3e4;

    --green: #116a56;
    --gold: #d9aa56;
    --white: #ffffff;
    --red: #a13c3c;

    --blue: #2563eb;
}


/* =========================================================
   GLOBAL
   ========================================================= */

* {
    box-sizing: border-box;
}


html {
    min-height: 100%;
}


body {
    min-height: 100vh;

    margin: 0;

    color: var(--ink);

    font:
        16px/1.6
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background-color: #ffffff;

    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.94),
            rgba(255, 255, 255, 0.94)
        ),
        url("/images/learn/nodes-background.webp");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}


button,
a {
    touch-action: manipulation;
}


button {
    font: inherit;
    cursor: pointer;
}


button:disabled {
    cursor: wait;
    opacity: 0.55;
}


button:focus-visible,
a:focus-visible {
    outline: 3px solid #bc852f;
    outline-offset: 4px;
}


a {
    color: inherit;
}


/* =========================================================
   GAME HEADER
   ========================================================= */

.game-header {
    position: sticky;

    top: 0;

    z-index: 100;

    display: grid;

    grid-template-columns:
        50px
        1fr
        50px;

    align-items: center;

    min-height: 72px;

    padding: 10px 28px;

    background:
        rgba(255, 255, 255, 0.92);

    backdrop-filter: blur(12px);

    border-bottom:
        1px solid rgba(23, 53, 71, 0.09);
}


/* Home icon */

.game-home {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    color: var(--ink);

    font-size: 1.25rem;

    text-decoration: none;

    border-radius: 12px;

    transition:
        background 0.18s ease,
        color 0.18s ease;
}


.game-home:hover {
    color: var(--blue);

    background:
        rgba(37, 99, 235, 0.07);
}


/* Center title */

.game-header-title {
    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;

    line-height: 1.2;
}


.game-header-title span {
    margin-bottom: 4px;

    color: var(--blue);

    font-size: 0.68rem;
    font-weight: 750;

    letter-spacing: 0.12em;

    text-transform: uppercase;
}


.game-header-title strong {
    color: var(--ink);

    font-size: 1.08rem;
    font-weight: 750;
}


.game-header-spacer {
    width: 42px;
}


/* =========================================================
   MAIN
   ========================================================= */

main {
    max-width: 1116px;

    margin: 42px auto 70px;

    padding: 0 24px;

    min-height: 65vh;
}


/* =========================================================
   TYPOGRAPHY
   ========================================================= */

.eyebrow {
    margin: 0 0 18px;

    color: var(--green);

    font-size: 12px;
    font-weight: 800;

    letter-spacing: 2px;

    text-transform: uppercase;
}


h1,
h2,
h3,
p {
    margin-top: 0;
}


h1 {
    margin-bottom: 24px;

    font-size:
        clamp(36px, 5vw, 60px);

    line-height: 1.1;

    letter-spacing: -2px;

    font-weight: 750;
}


h2 {
    font-size: 28px;

    line-height: 1.35;

    letter-spacing: -0.6px;
}


h3 {
    font-size: 17px;
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
    display: grid;

    grid-template-columns:
        1.3fr
        1fr;

    gap: 45px;

    align-items: center;

    padding: 25px 0 45px;
}


.hero p.intro {
    max-width: 510px;

    color: var(--muted);

    font-size: 18px;

    line-height: 1.75;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.primary,
.secondary {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 12px;

    padding: 12px 22px;

    border-radius: 9px;

    font-weight: 700;

    text-decoration: none;
}


.primary {
    color: #ffffff;

    background: var(--green);

    border:
        1px solid var(--green);
}


.primary:hover {
    background: #0c5142;
}


.secondary {
    color: var(--ink);

    background: transparent;

    border:
        1px solid #b9c7ce;
}


.secondary:hover {
    background: #eaf0f0;
}


.actions {
    display: flex;

    gap: 12px;

    flex-wrap: wrap;
}


.hero .primary {
    padding: 15px 26px;
}


.small {
    color: var(--muted);

    font-size: 13px;
}


.hero small {
    display: block;

    margin-top: 14px;

    color: var(--muted);
}


/* =========================================================
   HERO ILLUSTRATION
   ========================================================= */

.illustration {
    position: relative;

    overflow: hidden;

    aspect-ratio: 1.18;

    background: #e7eeeb;

    border-radius: 24px;
}


.illustration svg {
    display: block;

    width: 100%;
    height: 100%;
}


.illus-caption {
    position: absolute;

    bottom: 16px;
    left: 20px;

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 2px;
}


/* =========================================================
   STATS
   ========================================================= */

.stats {
    display: flex;

    gap: 28px;

    margin: 28px 0 0;
}


.stats strong {
    display: block;

    font-size: 26px;

    line-height: 1.2;
}


.stats span {
    color: var(--muted);

    font-size: 12px;
}


/* =========================================================
   SECTION HEADER
   ========================================================= */

.section-head {
    display: flex;

    align-items: baseline;
    justify-content: space-between;

    gap: 12px;

    padding-top: 27px;

    border-top:
        1px solid var(--line);
}


.section-head h2 {
    margin-bottom: 18px;

    font-size: 21px;
}


/* =========================================================
   TOPICS
   ========================================================= */

.topics {
    display: grid;

    grid-template-columns:
        repeat(5, 1fr);

    gap: 12px;
}


.topic-tile {
    padding: 16px 14px;

    background: #ffffff;

    border:
        1px solid var(--line);

    border-radius: 11px;

    font-size: 13px;
    font-weight: 650;
}


.topic-tile span {
    display: block;

    margin-bottom: 8px;

    color: var(--green);

    font-size: 11px;

    letter-spacing: 1px;
}


/* =========================================================
   QUIZ LAYOUT
   ========================================================= */

.quiz-layout {
    display: grid;

    grid-template-columns:
        1fr
        245px;

    gap: 28px;

    align-items: start;
}


.quiz-top {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 12px;

    color: var(--muted);

    font-size: 13px;
}


/* =========================================================
   PROGRESS
   ========================================================= */

.progress {
    overflow: hidden;

    height: 5px;

    margin-bottom: 25px;

    background: #dce5e3;

    border-radius: 10px;
}


.progress div {
    height: 100%;

    background: var(--green);

    transition:
        width 0.25s;
}


/* =========================================================
   CARDS
   ========================================================= */

.card {
    padding: 32px;

    background: #ffffff;

    border:
        1px solid var(--line);

    border-radius: 17px;
}


/* =========================================================
   QUESTION
   ========================================================= */

.tag {
    display: inline-block;

    margin-bottom: 17px;

    padding: 6px 10px;

    color: var(--green);

    background: #eaf3ee;

    border-radius: 5px;

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 1px;

    text-transform: uppercase;
}


.question-title {
    margin-bottom: 27px;

    font-size: 27px;

    line-height: 1.45;

    letter-spacing: -0.5px;
}


/* =========================================================
   ANSWER CHOICES
   ========================================================= */

.choices {
    display: grid;

    gap: 12px;
}


.choice {
    display: flex;

    align-items: center;

    gap: 15px;

    width: 100%;

    padding: 16px;

    color: var(--ink);

    background: #ffffff;

    border:
        1px solid #d6dfe3;

    border-radius: 10px;

    font-size: 16px;

    line-height: 1.45;

    text-align: left;
}


.choice:hover {
    background: #f3f7f5;

    border-color:
        #73a391;
}


.choice.selected {
    padding: 15px;

    background: #eaf4ef;

    border:
        2px solid var(--green);
}


.letter {
    display: grid;

    place-items: center;

    flex:
        0 0 30px;

    width: 30px;
    height: 30px;

    background: #f0f3f5;

    border-radius: 6px;

    font-size: 12px;
    font-weight: 800;
}


.selected .letter {
    color: #ffffff;

    background: var(--green);
}


/* =========================================================
   QUIZ BOTTOM
   ========================================================= */

.quiz-bottom {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 8px;

    margin-top: 25px;
}


.text-button {
    padding: 8px;

    color: var(--muted);

    background: none;

    border: 0;

    font-size: 13px;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.side {
    padding: 23px;
}


.side h3 {
    margin-bottom: 5px;
}


.number-grid {
    display: grid;

    grid-template-columns:
        repeat(5, 1fr);

    gap: 8px;

    margin: 22px 0;
}


.number {
    padding: 0;

    aspect-ratio: 1;

    color: var(--ink);

    background: #ffffff;

    border:
        1px solid var(--line);

    border-radius: 7px;

    font-size: 13px;
    font-weight: 650;
}


.number.answered {
    background: #e9f4ec;

    border-color:
        #94b7a4;
}


.number.current {
    border:
        2px solid var(--ink);
}


.side .primary {
    width: 100%;

    padding: 12px 6px;

    font-size: 14px;
}


.legend {
    margin-top: 18px;

    color: var(--muted);

    font-size: 12px;
}


.save-line {
    min-height: 20px;

    margin: 12px 0 0;

    color: var(--muted);

    font-size: 12px;
}


/* =========================================================
   REPORT
   ========================================================= */

.report-hero {
    display: flex;

    align-items: center;

    gap: 36px;

    margin-bottom: 34px;

    padding: 36px;
}


.score-circle {
    display: grid;

    place-items: center;

    flex-shrink: 0;

    width: 156px;
    height: 156px;

    background:
        conic-gradient(
            var(--green)
            var(--angle),
            #e8eeea 0
        );

    border-radius: 50%;
}


.score-inner {
    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    width: 130px;
    height: 130px;

    background: #ffffff;

    border-radius: 50%;
}


.score-inner strong {
    font-size: 36px;

    line-height: 1.1;
}


.score-inner span {
    color: var(--muted);

    font-size: 13px;
}


.report-hero h1 {
    margin-bottom: 12px;

    font-size: 38px;

    letter-spacing: -1px;
}


.report-stats {
    display: flex;

    gap: 20px;

    margin: 15px 0 22px;

    font-size: 13px;
}


.report-stats strong {
    font-size: 18px;
}


/* =========================================================
   REVIEW
   ========================================================= */

.review-head {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin: 30px 0 16px;
}


.review-head h2 {
    margin: 0;

    font-size: 23px;
}


.review-card {
    margin: 0 0 16px;

    padding: 25px 28px;
}


.review-label {
    display: flex;

    justify-content: space-between;

    gap: 10px;

    margin-bottom: 10px;

    color: var(--muted);

    font-size: 12px;
}


.status {
    color: var(--green);

    font-weight: 800;
}


.status.wrong {
    color: var(--red);
}


.review-options {
    display: grid;

    grid-template-columns:
        1fr
        1fr;

    gap: 8px;

    margin-top: 17px;
}


.review-option {
    padding: 10px 12px;

    border:
        1px solid var(--line);

    border-radius: 7px;

    font-size: 14px;
}


.review-option.correct {
    background: #edf7f0;

    border-color:
        #72a38c;
}


.review-option.wrong {
    background: #fff1f0;

    border-color:
        #d8a1a1;
}


.review-option small {
    display: block;

    font-size: 11px;
    font-weight: 750;
}


.explanation {
    margin: 16px 0 0;

    color: var(--muted);

    font-size: 14px;
}


/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    max-width: 1116px;

    margin: 0 auto;

    padding:
        22px 24px
        30px;

    color: var(--muted);

    border-top:
        1px solid rgba(23, 53, 71, 0.10);

    font-size: 0.78rem;
}


/* =========================================================
   NOTICE
   ========================================================= */

.notice {
    position: fixed;

    bottom: 20px;
    left: 50%;

    z-index: 20;

    transform:
        translateX(-50%);

    max-width: 90vw;

    padding: 14px 20px;

    color: #ffffff;

    background: #842f2f;

    border-radius: 10px;

    box-shadow:
        0 5px 25px #0002;
}


.loading {
    padding: 60px 0;
}


/* =========================================================
   DIALOG
   ========================================================= */

dialog {
    width:
        calc(100% - 32px);

    max-width: 490px;

    padding: 30px;

    color: var(--ink);

    border:
        1px solid var(--line);

    border-radius: 16px;
}


dialog::backdrop {
    background: #102d3a77;
}


dialog p {
    color: var(--muted);
}


[hidden] {
    display: none !important;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 800px) {

    .hero {
        grid-template-columns: 1fr;

        gap: 24px;
    }


    .illustration {
        max-height: 270px;

        aspect-ratio: 1.8;
    }


    .topics {
        grid-template-columns:
            repeat(2, 1fr);
    }


    .quiz-layout {
        grid-template-columns: 1fr;
    }


    .side {
        order: 2;
    }


    .number-grid {
        grid-template-columns:
            repeat(10, 1fr);
    }


    .card {
        padding: 23px;
    }


    .question-title {
        font-size: 23px;
    }


    .report-hero {
        gap: 22px;
    }


    .report-hero h1 {
        font-size: 30px;
    }


    .report-options {
        grid-template-columns: 1fr;
    }


    main {
        margin-top: 25px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 520px) {

    .game-header {
        grid-template-columns:
            42px
            1fr
            42px;

        min-height: 64px;

        padding:
            8px
            14px;
    }


    .game-home {
        width: 38px;
        height: 38px;
    }


    .game-header-title strong {
        font-size: 0.95rem;
    }


    .game-header-title span {
        font-size: 0.6rem;
    }


    main {
        padding: 0 16px;
    }


    .report-hero {
        flex-direction: column;

        text-align: center;
    }


    .report-stats,
    .report-hero .actions {
        justify-content: center;
    }


    .review-options {
        grid-template-columns: 1fr;
    }


    .quiz-bottom .secondary,
    .quiz-bottom .primary {
        padding: 10px 14px;
    }


    .question-title {
        font-size: 21px;
    }


    .site-footer {
        flex-direction: column;

        gap: 6px;

        text-align: center;
    }


    .number-grid {
        gap: 5px;
    }


    .stats {
        gap: 24px;
    }


    .section-head {
        align-items: start;

        flex-direction: column;
    }


    .section-head h2 {
        margin-bottom: 0;
    }


    .section-head .small {
        margin-bottom: 15px;
    }

}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    * {
        transition: none !important;
    }

}


/* =========================================================
   PRINT
   ========================================================= */

@media print {

    .game-header,
    .site-footer,
    .actions,
    .review-head .small {
        display: none;
    }


    .card {
        break-inside: avoid;
    }


    .report-hero {
        border: 0;
    }


    body {
        background: #ffffff;
    }


    main {
        max-width: none;

        margin: 0;

        padding: 0;
    }

}