
/* =========================================================
   READING DETECTIVE
   Games to Literacy
   ========================================================= */

:root {

    color-scheme: dark;

    --background: #0b1220;
    --panel: #131f32;
    --panel-light: #1b2940;

    --border: #304159;

    --text: #f1f5f9;
    --muted: #aebed1;

    --accent: #facc15;
    --accent-hover: #fde047;

    --green: #4ade80;
    --red: #fda4af;

    --paper: #f8f4e8;
    --paper-text: #273141;

    --radius: 18px;

    --shadow:
        0 12px 35px rgba(0, 0, 0, 0.17);

}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
}

body {

    margin: 0;

    font-family:
        Inter, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;

    background:
        radial-gradient(
            ellipse at top,
            #192a45 0%,
            var(--background) 55%
        );

    color: var(--text);

    min-height: 100vh;

    line-height: 1.65;

}

h1, h2, h3, p {
    margin-top: 0;
}

h1, h2, h3 {
    line-height: 1.25;
}

h2 {
    margin-bottom: 20px;
}

h3 {
    margin-bottom: 12px;
}

button,
select,
textarea {
    font: inherit;
}

button,
a,
select,
textarea,
summary,
input {
    -webkit-tap-highlight-color: transparent;
}

button,
summary {
    cursor: pointer;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible {

    outline: 3px solid var(--accent);
    outline-offset: 4px;

}

a {
    color: var(--accent);
}

fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}


/* HEADER */

.site-header {

    background: rgba(11, 18, 32, 0.96);

    border-bottom: 1px solid var(--border);

}

.header-inner {

    max-width: 1320px;
    margin: auto;

    padding: 16px 24px;

    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 20px;

}

.brand {

    display: flex;
    align-items: center;
    gap: 12px;

    text-decoration: none;
    color: var(--text);

}

.brand-icon {

    display: grid;
    place-items: center;

    width: 48px;
    height: 48px;

    background: var(--accent);

    border-radius: 13px;

    font-size: 25px;

}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 19px;
}

.brand small {
    font-size: 12px;
    color: var(--muted);
}

.header-stats {

    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 8px;

}

.stat-pill,
.mode-pill {

    padding: 7px 12px;

    border: 1px solid var(--border);
    border-radius: 999px;

    font-size: 12px;
    font-weight: 700;

    background: var(--panel);

}

.mode-pill.live {

    color: var(--green);

    border-color: #26764b;

    background: #102d26;

}


/* MAIN LAYOUT */

.container {

    max-width: 1250px;

    margin: 0 auto;

    padding: 32px 24px 60px;

}

.hero {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 30px;

    padding: 24px 0 36px;

}

.eyebrow {

    font-size: 12px;

    letter-spacing: 1.8px;

    text-transform: uppercase;

    font-weight: 800;

    color: var(--accent);

    margin-bottom: 10px;

}

.hero h1 {

    font-size: clamp(34px, 5.5vw, 64px);

    letter-spacing: -1.5px;

    max-width: 800px;

    margin: 0 0 18px;

}

.hero h1 span {
    color: var(--accent);
}

.hero-description {

    color: var(--muted);

    font-size: 17px;

    max-width: 680px;

    margin-bottom: 0;

}

.case-stamp {

    flex-shrink: 0;

    display: grid;

    place-content: center;

    text-align: center;

    width: 145px;
    height: 160px;

    border: 3px solid var(--accent);

    border-radius: 14px;

    color: var(--accent);

    transform: rotate(8deg);

    font-size: 24px;

    line-height: 1.2;

}

.case-stamp span {
    font-size: 36px;
    margin-bottom: 8px;
}

.panel {

    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 28px;

    margin-bottom: 24px;

    box-shadow: var(--shadow);

}

.small-text {

    font-size: 13px;

    color: var(--muted);

    line-height: 1.6;

}

.setup-panel .small-text {
    margin: 15px 0 0;
}


/* SETTINGS */

.settings-grid {

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;

    margin-bottom: 22px;

}

.field label,
.reasoning-box label {

    display: block;

    font-size: 14px;

    font-weight: 750;

    margin-bottom: 7px;

}

select,
textarea {

    width: 100%;

    border: 1px solid #40516b;

    border-radius: 10px;

    background: #0d1727;

    color: var(--text);

    padding: 12px;

}

select {
    min-height: 48px;
}

textarea {

    resize: vertical;

    min-height: 120px;

    line-height: 1.7;

}


/* BUTTONS */

.button {

    display: inline-flex;

    justify-content: center;
    align-items: center;

    min-height: 46px;

    padding: 11px 22px;

    border-radius: 10px;

    border: 1px solid transparent;

    font-weight: 750;

    text-align: center;

    transition:
        background 0.15s ease,
        transform 0.15s ease;

}

.button:not(:disabled):active {
    transform: translateY(1px);
}

.primary {

    background: var(--accent);

    color: #172033;

}

.primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.secondary {

    background: var(--panel-light);

    color: var(--text);

    border-color: var(--border);

}

.secondary:hover:not(:disabled) {
    background: #263954;
}

.button-row {

    display: flex;
    flex-wrap: wrap;

    gap: 12px;

    margin-top: 24px;

}


/* EMPTY STATE */

.empty-state {

    padding: 45px 15px;

    text-align: center;

}

.empty-state p:not(.eyebrow) {

    color: var(--muted);

    max-width: 460px;

    margin: 0 auto 24px;

}

.empty-icon {
    font-size: 54px;
    margin-bottom: 15px;
}


/* ACTIVE CASE */

.case-heading {

    display: flex;

    flex-wrap: wrap;

    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 24px;

}

.case-heading h2 {

    margin-bottom: 0;

    font-size: clamp(24px, 4vw, 35px);

}

.tags {

    display: flex;

    flex-wrap: wrap;

    gap: 7px;

}

.tag,
.source-tag {

    border-radius: 999px;

    border: 1px solid var(--border);

    background: var(--panel-light);

    color: var(--muted);

    padding: 5px 11px;

    font-size: 12px;

    letter-spacing: 0;

    text-transform: none;

}

.source-tag {
    margin-left: 7px;
}

.investigation-grid {

    display: grid;

    grid-template-columns: minmax(0, 1fr);

    align-items: start;

    gap: 24px;

}

.investigation-grid.questions-open {

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

}


/* READING PAPER */

.reading-file {

    color-scheme: light;

    background: var(--paper);

    color: var(--paper-text);

    padding: clamp(20px, 3vw, 35px);

    border: 1px solid #d8d1bd;

    border-radius: 14px;

    box-shadow:
        inset 0 0 30px rgba(100, 80, 40, 0.04);

}

.reading-file h3 {
    font-size: 24px;
}

.paper-eyebrow {

    font-size: 12px;

    letter-spacing: 1.7px;

    font-weight: 800;

    color: #75613b;

}

.reading-tools {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding-bottom: 14px;

    border-bottom: 1px solid #d7d0bf;

    gap: 12px;

    font-size: 12px;

    color: #665b48;

}

.font-tools {
    display: flex;
    gap: 5px;
}

.font-tools button {

    min-width: 38px;
    min-height: 38px;

    border: 1px solid #c9bfa7;

    border-radius: 7px;

    font-weight: 700;

    background: #fffdf6;

    color: #273141;

}

.passage-text {

    font-family:
        Georgia, "Times New Roman", serif;

    font-size: 20px;

    line-height: 1.9;

    padding: 16px 0;

    overflow-wrap: anywhere;

    user-select: text;

}

.passage-paragraph {

    position: relative;

    padding-left: 35px;

    margin-bottom: 20px;

}

.paragraph-number {

    position: absolute;

    left: 0;
    top: 6px;

    width: 24px;
    height: 24px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    font: 700 12px system-ui, sans-serif;

    background: #e6dfcd;

    color: #625537;

}

.paper-note {

    margin: 0;

    color: #645b49;

    font-size: 13px;

    border-top: 1px solid #d7d0bf;

    padding-top: 14px;

}

.reading-actions {
    text-align: center;
}


/* QUESTIONS */

.question-panel {
    min-width: 0;
}

.question-progress {

    margin-bottom: 22px;

    color: var(--muted);

    font-size: 13px;

}

progress {

    display: block;

    width: 100%;
    height: 9px;

    margin-top: 8px;

    accent-color: var(--accent);

    border: 0;
    border-radius: 10px;

    overflow: hidden;

    background: #0b1220;

}

progress::-webkit-progress-bar {
    background: #0b1220;
}

progress::-webkit-progress-value {
    background: var(--accent);
}

progress::-moz-progress-bar {
    background: var(--accent);
}

.question-card {

    background: #0e1829;

    border: 1px solid var(--border);

    border-radius: 13px;

    padding: 18px;

    margin-bottom: 16px;

    min-width: 0;

}

.question-label {

    padding: 0;

    width: 100%;

    margin-bottom: 14px;

    font-weight: 750;

    font-size: 16px;

    line-height: 1.5;

}

.question-skill {

    display: block;

    color: var(--accent);

    font-size: 11px;

    text-transform: uppercase;

    letter-spacing: 1px;

    margin-bottom: 7px;

}

.answer-option {

    display: flex;

    align-items: flex-start;

    gap: 11px;

    padding: 11px 13px;

    margin-bottom: 8px;

    border: 1px solid var(--border);

    border-radius: 8px;

    background: var(--panel);

    cursor: pointer;

    font-size: 14px;

    overflow-wrap: anywhere;

}

.answer-option:hover {
    border-color: #7586a0;
}

.answer-option:has(input:checked) {

    border-color: var(--accent);

    background: #2b2a1d;

}

.answer-option input {

    accent-color: var(--accent);

    margin: 5px 0 0;

    flex-shrink: 0;

}

.answer-option.correct-option {

    border-color: var(--green);

    background: #123523;

}

.answer-option.wrong-option {

    border-color: var(--red);

    background: #381c29;

}

.answer-option .option-result {

    display: block;

    font-size: 12px;

    font-weight: 800;

    margin-top: 5px;

}

.hint {

    margin-top: 12px;

    color: var(--accent);

    font-size: 13px;

}

.hint p {

    color: var(--muted);

    margin: 8px 0 0;

}

.reasoning-box {

    margin: 22px 0;

    padding: 16px;

    border-radius: 12px;

    background: var(--panel-light);

    border: 1px solid var(--border);

}

.reasoning-box p {
    font-size: 14px;
}

.reasoning-box .small-text {
    margin: 8px 0 0;
    font-size: 12px;
}

.optional {

    font-weight: 400;

    color: var(--muted);

}

#checkBtn {
    width: 100%;
}


/* FEEDBACK */

.feedback-heading {

    display: flex;

    align-items: center;

    gap: 25px;

    margin-bottom: 24px;

}

.score-ring {

    display: grid;
    place-items: center;

    flex-shrink: 0;

    width: 120px;
    height: 120px;

    border-radius: 50%;

    background:
        conic-gradient(
            var(--accent) 0%,
            #334155 0%
        );

}

.score-ring > div {

    width: 104px;
    height: 104px;

    border-radius: 50%;

    background: var(--panel);

    display: grid;

    align-content: center;

    text-align: center;

}

.score-ring strong {

    font-size: 36px;

    line-height: 1.2;

    color: var(--accent);

}

.score-ring small {
    color: var(--muted);
}

.skill-results {

    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin-bottom: 24px;

}

.skill-result {

    background: var(--panel-light);

    padding: 7px 12px;

    border: 1px solid var(--border);

    border-radius: 8px;

    font-size: 13px;

}

.review-card {

    padding: 18px;

    border: 1px solid var(--border);

    border-left: 4px solid var(--accent);

    border-radius: 10px;

    margin-bottom: 14px;

    background: #0e1829;

    overflow-wrap: anywhere;

}

.review-card.correct {
    border-left-color: var(--green);
}

.review-card.incorrect {
    border-left-color: var(--red);
}

.review-card p {
    margin-bottom: 9px;
}

.review-card .evidence {

    padding: 12px;

    background: var(--panel-light);

    border-radius: 7px;

    color: var(--muted);

    font-size: 14px;

}

.review-card button {
    margin-top: 10px;
}

.model-answer {

    background: var(--panel-light);

    padding: 20px;

    border-radius: 12px;

    margin-top: 22px;

}


/* PROGRESS */

.progress-grid {

    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 12px;

    margin-bottom: 20px;

}

.progress-card {

    padding: 20px 12px;

    background: #0e1829;

    border: 1px solid var(--border);

    border-radius: 12px;

    text-align: center;

}

.progress-card strong {

    display: block;

    font-size: 30px;

    color: var(--accent);

}

.progress-card span {

    font-size: 13px;

    color: var(--muted);

}

.rank-card {

    display: flex;

    gap: 13px;

    align-items: center;

    padding: 15px;

    background: var(--panel-light);

    border: 1px solid var(--border);

    border-radius: 12px;

    margin-bottom: 18px;

}

.rank-card > span {
    font-size: 32px;
}

.rank-card small,
.rank-card strong {
    display: block;
}

.rank-card small {
    color: var(--muted);
}

.rank-card strong {
    color: var(--accent);
}

.progress-panel .small-text {
    margin: 12px 0 0;
}


/* EDUCATIONAL CONTENT */

.educational-content p,
.educational-content li {
    color: var(--muted);
}

.educational-content h3 {
    margin-top: 24px;
}

.related-games {

    display: flex;

    flex-wrap: wrap;

    gap: 12px;

}

.related-games a {

    padding: 10px 15px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: var(--panel-light);

    text-decoration: none;

}

.related-games a:hover {
    border-color: var(--accent);
}

.site-footer {

    border-top: 1px solid var(--border);

    padding: 25px;

    text-align: center;

    font-size: 13px;

    color: var(--muted);

}

.site-footer p {
    margin: 4px 0;
}


/* UTILITIES */

.message {

    background: #23334b;

    border: 1px solid var(--border);

    color: var(--text);

    padding: 12px 16px;

    border-radius: 10px;

}

.message:empty {
    display: none;
}

.loading-overlay {

    position: fixed;

    inset: 0;

    z-index: 100;

    display: grid;

    place-items: center;

    padding: 20px;

    background: rgba(4, 8, 15, 0.88);

}

.loading-card {

    text-align: center;

    padding: 35px;

    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: 18px;

    max-width: 440px;

}

.spinner {

    width: 48px;
    height: 48px;

    border: 4px solid var(--border);

    border-top-color: var(--accent);

    border-radius: 50%;

    margin: 0 auto 20px;

    animation: spin 0.8s linear infinite;

}

@keyframes spin {

    to {
        transform: rotate(360deg);
    }

}

.sr-only {

    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;

    margin: -1px;

    overflow: hidden;

    clip-path: inset(50%);

    white-space: nowrap;

    border: 0;

}


/* RESPONSIVE DESIGN */

@media (max-width: 960px) {

    .settings-grid {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

    }

    .investigation-grid.questions-open {

        grid-template-columns:
            minmax(0, 1fr);

    }

}

@media (max-width: 600px) {

    .header-inner {

        flex-direction: column;

        align-items: flex-start;

        padding: 14px 16px;

    }

    .container {
        padding: 18px 12px 35px;
    }

    .panel {
        padding: 18px;
    }

    .hero {
        padding: 15px 5px 25px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .case-stamp {
        display: none;
    }

    .settings-grid {

        grid-template-columns:
            minmax(0, 1fr);

    }

    .progress-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .feedback-heading {

        flex-direction: column;

        text-align: center;

    }

    .button-row .button,
    .setup-panel .button,
    .reading-actions .button {
        width: 100%;
    }

    .reading-file {
        padding: 20px 16px;
    }

    .question-card {
        padding: 14px;
    }

}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {

        scroll-behavior: auto !important;

        animation-duration: 0.01ms !important;

        transition: none !important;

    }

}
