* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ink: #111111;
    --ink-soft: #1f1a17;
    --paper: #f3eadf;
    --paper-2: #fff7ee;
    --paper-3: #d7c7b5;
    --muted: #5b5148;
    --line: rgba(17, 17, 17, 0.14);
    --night: #090b0e;
    --night-2: #12161c;
    --night-3: #1b2129;
    --night-line: rgba(255, 247, 238, 0.14);
    --accent: #ffcb2f;
    --accent-2: #d83a16;
    --info: #7e8fa3;
    --success: #79b63e;
    --success-bg: rgba(121, 182, 62, 0.18);
    --danger-bg: rgba(216, 58, 22, 0.12);
    --radius: 6px;
    --radius-sm: 3px;
    --shadow: 0 24px 56px rgba(0, 0, 0, 0.18);
}

body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at top center, rgba(255, 203, 47, 0.18), transparent 20%),
        repeating-linear-gradient(90deg, rgba(17, 17, 17, 0.04) 0, rgba(17, 17, 17, 0.04) 1px, transparent 1px, transparent 80px),
        var(--paper);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.55;
}

.container {
    width: 100%;
    max-width: 680px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.28s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

#screen-disclaimer .card,
#screen-results .card {
    background: var(--paper-2);
    color: var(--ink);
}

#screen-quiz .card,
#screen-prediction .card {
    background: var(--night);
    color: var(--paper-2);
    border-color: var(--night-line);
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .card {
        padding: 22px 18px;
    }
}

#screen-disclaimer .card {
    text-align: center;
}

.brand-kicker {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 14px;
}

.logo {
    font-size: 60px;
    line-height: 1;
    margin-bottom: 10px;
    filter: grayscale(1) contrast(1.2);
}

#screen-disclaimer h1,
#screen-prediction h2,
.results-card h1,
.question-text,
.duel-headline {
    font-family: 'Oswald', 'IBM Plex Sans Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: -0.03em;
}

#screen-disclaimer h1 {
    font-size: clamp(3rem, 9vw, 5.5rem);
    line-height: 0.9;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--ink-soft);
    font-size: 1.2rem;
    line-height: 1.25;
    max-width: 560px;
    margin: 0 auto 26px;
}

.disclaimer-box,
.challenge-callout,
.bias-summary,
.overconfidence-section,
.dk-result-section,
.duel-section {
    border-radius: var(--radius);
}

.disclaimer-box {
    background: rgba(255, 203, 47, 0.16);
    border: 1px solid rgba(17, 17, 17, 0.12);
    padding: 18px;
    margin-bottom: 22px;
    text-align: left;
}

.disclaimer-box p {
    color: var(--ink-soft);
    font-size: 1rem;
    margin-bottom: 8px;
}

.disclaimer-box p:last-child {
    margin-bottom: 0;
}

.disclaimer-dim {
    opacity: 0.8;
}

.challenge-callout {
    background: rgba(216, 58, 22, 0.1);
    border: 1px solid rgba(216, 58, 22, 0.24);
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.challenge-callout.hidden {
    display: none;
}

.challenge-label,
.question-counter,
.category-badge,
.oc-label,
.dk-label,
.duel-label,
.footer-note {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.challenge-label {
    color: var(--accent-2);
    margin-bottom: 8px;
}

.challenge-callout p {
    color: var(--ink);
    font-size: 0.98rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.btn-primary {
    background: var(--accent);
    color: var(--ink);
    border-color: rgba(17, 17, 17, 0.22);
}

.btn-primary:hover {
    transform: translateY(-1px);
    background: #ffd95d;
}

.btn-secondary {
    background: transparent;
    color: inherit;
}

#screen-disclaimer .btn-secondary,
#screen-results .btn-secondary {
    border-color: rgba(17, 17, 17, 0.14);
}

#screen-quiz .btn-secondary,
#screen-prediction .btn-secondary {
    border-color: rgba(255, 247, 238, 0.14);
}

.btn-secondary:hover {
    transform: translateY(-1px);
}

.btn-large {
    min-height: 56px;
    padding: 0 26px;
    font-size: 1rem;
}

.btn-arrow {
    font-size: 1.15em;
}

.quiz-header {
    margin-bottom: 26px;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 247, 238, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 14px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    transition: width 0.35s ease;
    width: 0;
}

.quiz-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.question-counter {
    color: rgba(255, 247, 238, 0.7);
}

.category-badge {
    color: var(--accent);
}

.question-text {
    font-size: clamp(2rem, 6vw, 3rem);
    line-height: 0.96;
    margin-bottom: 22px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    background: var(--night-2);
    color: var(--paper-2);
    border: 1px solid rgba(255, 247, 238, 0.12);
    border-radius: var(--radius);
    text-align: left;
    font-family: inherit;
    font-size: 1.02rem;
    line-height: 1.35;
    cursor: pointer;
    transition: border-color 0.14s ease, transform 0.14s ease, background-color 0.14s ease;
}

.option:hover:not(.disabled) {
    border-color: rgba(255, 203, 47, 0.6);
    transform: translateY(-1px);
}

.option-letter {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 203, 47, 0.14);
    color: var(--accent);
    border-radius: var(--radius-sm);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    flex-shrink: 0;
}

.option.locked {
    border-color: rgba(255, 203, 47, 0.6);
    background: rgba(255, 203, 47, 0.12);
    opacity: 1;
}

.option.locked .option-letter {
    background: var(--accent);
    color: var(--ink);
}

.option.correct {
    border-color: rgba(121, 182, 62, 0.4);
    background: rgba(121, 182, 62, 0.14);
}

.option.correct .option-letter {
    background: var(--success);
    color: var(--ink);
}

.option.wrong {
    border-color: rgba(216, 58, 22, 0.45);
    background: rgba(216, 58, 22, 0.16);
}

.option.wrong .option-letter {
    background: var(--accent-2);
    color: var(--paper-2);
}

.option.disabled {
    cursor: default;
    opacity: 0.58;
}

.option.correct,
.option.wrong {
    opacity: 1;
}

.confidence-section,
.explanation {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 247, 238, 0.12);
}

.confidence-section.hidden,
.explanation.hidden {
    display: none;
}

.confidence-label,
.prediction-subtitle,
.result-subtitle,
.duel-text {
    font-size: 1rem;
    line-height: 1.3;
}

.confidence-label {
    margin-bottom: 12px;
    text-align: center;
    color: var(--paper-2);
}

.dk-slider-wrap {
    margin-bottom: 18px;
}

.dk-slider-wrap input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: rgba(255, 247, 238, 0.12);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

.dk-slider-wrap input[type="range"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.dk-slider-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--ink);
    cursor: pointer;
}

.dk-slider-wrap input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--ink);
    cursor: pointer;
}

.confidence-range-labels {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    color: rgba(255, 247, 238, 0.72);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
}

.confidence-range-labels span:nth-child(2) {
    color: var(--accent);
    font-size: 18px;
    font-family: 'Oswald', sans-serif;
    letter-spacing: -0.02em;
}

.confidence-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.confidence-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 14px 4px;
    background: var(--night-2);
    color: var(--paper-2);
    border: 1px solid rgba(255, 247, 238, 0.12);
    border-radius: var(--radius);
    font-family: 'Oswald', sans-serif;
    font-size: 1.3rem;
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: border-color 0.14s ease, transform 0.14s ease, background-color 0.14s ease;
    min-height: 48px;
}

.confidence-btn:hover {
    border-color: rgba(255, 203, 47, 0.6);
    transform: translateY(-1px);
}

.confidence-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.confidence-btn-hint {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 247, 238, 0.5);
}

.explanation-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.explanation-header {
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    font-size: 1.75rem;
    line-height: 0.95;
    margin-bottom: 8px;
}

.explanation-header.correct {
    color: var(--success);
}

.explanation-header.wrong {
    color: var(--accent);
}

.explanation-text {
    color: rgba(255, 247, 238, 0.86);
    font-size: 0.98rem;
    line-height: 1.55;
    margin-bottom: 10px;
}

.explanation-source {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: rgba(255, 247, 238, 0.55);
    margin-bottom: 18px;
}

.prediction-card {
    text-align: center;
}

.prediction-emoji,
.result-emoji {
    font-size: 54px;
    line-height: 1;
    margin-bottom: 10px;
}

.prediction-card h2 {
    font-size: clamp(2.3rem, 7vw, 3.5rem);
    line-height: 0.92;
    margin-bottom: 10px;
}

.prediction-subtitle {
    color: rgba(255, 247, 238, 0.76);
    margin-bottom: 24px;
}

.dk-display {
    color: var(--accent);
}

.results-card {
    text-align: center;
}

.results-card h1 {
    font-size: clamp(2.8rem, 8vw, 4.6rem);
    line-height: 0.9;
    margin-bottom: 26px;
}

.score-ring-container {
    position: relative;
    width: 170px;
    height: 170px;
    margin: 0 auto 22px;
}

.score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: rgba(17, 17, 17, 0.1);
    stroke-width: 10;
}

.score-ring-fill {
    fill: none;
    stroke: var(--accent-2);
    stroke-width: 10;
    stroke-dasharray: 439.82;
    stroke-dashoffset: 439.82;
    transition: stroke-dashoffset 1.2s ease;
}

.score-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-number,
.score-percent,
.oc-value,
.gap-value,
.dk-val,
.duel-value {
    font-family: 'Oswald', sans-serif;
    letter-spacing: -0.03em;
}

.score-number {
    font-size: 4rem;
    line-height: 1;
}

.score-percent {
    font-size: 1.4rem;
    align-self: flex-end;
    margin-bottom: 8px;
}

.result-subtitle {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent-2);
    margin-bottom: 10px;
}

.result-description {
    color: var(--ink-soft);
    font-size: 1.02rem;
    margin: 0 auto 24px;
    max-width: 520px;
}

.duel-section {
    background: rgba(216, 58, 22, 0.08);
    border: 1px solid rgba(216, 58, 22, 0.22);
    padding: 20px;
    margin-bottom: 18px;
}

.duel-section h3,
.overconfidence-section h3,
.dk-result-section h3,
.bias-summary h3 {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.duel-headline {
    font-size: 2rem;
    margin-bottom: 8px;
}

.duel-text {
    color: var(--ink-soft);
    margin-bottom: 14px;
}

.duel-grid,
.overconfidence-grid,
.dk-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.duel-item,
.oc-item,
.dk-item,
.bias-summary,
.duel-overlap {
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(17, 17, 17, 0.08);
}

.duel-item,
.oc-item,
.dk-item {
    padding: 14px;
    border-radius: var(--radius);
}

.duel-item-you {
    background: rgba(255, 203, 47, 0.2);
}

.duel-label,
.oc-label,
.dk-label {
    color: var(--muted);
    margin-bottom: 6px;
}

.duel-value,
.oc-value,
.dk-val {
    font-size: 2rem;
    line-height: 0.94;
}

.duel-subvalue {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.duel-overlap {
    margin-top: 10px;
    padding: 12px;
    border-radius: var(--radius);
    font-size: 0.94rem;
    color: var(--ink-soft);
}

.overconfidence-section,
.dk-result-section,
.bias-summary {
    padding: 20px;
    margin-bottom: 18px;
    text-align: left;
}

.overconfidence-section {
    background: rgba(255, 203, 47, 0.16);
    border: 1px solid rgba(17, 17, 17, 0.1);
}

.dk-result-section {
    background: rgba(126, 143, 163, 0.12);
    border: 1px solid rgba(17, 17, 17, 0.08);
}

.bias-summary {
    background: rgba(17, 17, 17, 0.04);
    border: 1px solid rgba(17, 17, 17, 0.08);
}

.oc-item.oc-gap {
    grid-column: 1 / -1;
    background: rgba(216, 58, 22, 0.12);
}

.gap-value {
    font-size: 2.1rem;
    line-height: 0.94;
}

.gap-overconfident {
    color: var(--accent-2);
}

.gap-underconfident {
    color: var(--info);
}

.gap-calibrated {
    color: var(--success);
}

.dk-diff {
    margin-top: 10px;
    padding: 12px;
    border-radius: var(--radius);
    font-size: 0.96rem;
    font-weight: 600;
}

.dk-diff.overestimate {
    color: var(--accent-2);
    background: rgba(216, 58, 22, 0.12);
}

.dk-diff.underestimate {
    color: var(--success);
    background: var(--success-bg);
}

.dk-diff.exact {
    color: var(--ink);
    background: rgba(255, 203, 47, 0.2);
}

.bias-summary ul {
    list-style: none;
}

.bias-summary li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(17, 17, 17, 0.08);
    color: var(--ink-soft);
}

.bias-summary li:last-child {
    border-bottom: none;
}

.bias-name {
    color: var(--ink);
    font-weight: 700;
}

.no-bias {
    color: var(--success);
    font-weight: 700;
}

.result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.footer-note {
    color: var(--muted);
    opacity: 0.9;
}

.toast {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 16px;
    background: var(--ink);
    color: var(--paper-2);
    border: 1px solid rgba(255, 247, 238, 0.14);
    border-radius: var(--radius-sm);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 100;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
    .duel-grid,
    .overconfidence-grid,
    .dk-grid {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions .btn,
    .btn-large,
    .confidence-section .btn {
        width: 100%;
    }

    .score-ring-container {
        width: 154px;
        height: 154px;
    }

    .score-number {
        font-size: 3.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .screen.active,
    .progress-fill,
    .score-ring-fill,
    .toast,
    .btn,
    .option {
        transition: none;
        animation: none;
    }
}
