:root {
    --sky-top: #082f49;
    --sky-bottom: #14532d;
    --ink: #133b2c;
    --muted: #4f6f62;
    --card: rgba(255, 253, 247, 0.92);
    --card-border: rgba(19, 59, 44, 0.12);
    --accent: #f59e0b;
    --accent-strong: #d97706;
    --good: #15803d;
    --bad: #c2410c;
    --shadow: 0 24px 60px rgba(19, 59, 44, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Baloo 2", cursive;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.86), transparent 28%),
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 26%),
        linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
    display: flex;
    flex-direction: column;
}

body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 999px;
    pointer-events: none;
    opacity: 0.65;
}

body::before {
    width: 260px;
    height: 260px;
    left: -70px;
    bottom: -70px;
    background: rgba(245, 158, 11, 0.15);
}

body::after {
    width: 300px;
    height: 300px;
    right: -120px;
    top: 90px;
    background: rgba(16, 185, 129, 0.14);
}

.app-shell {
    flex: 1;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 12px;
}

.layout-grid {
    width: min(1240px, 100%);
    display: grid;
    grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
    min-height: calc(100vh - 24px);
}

.quiz-card,
.leaderboard-card {
    border: 1px solid var(--card-border);
    border-radius: 28px;
    background: var(--card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.quiz-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 100%;
    padding: 18px 20px;
}

.leaderboard-card {
    order: -1;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 18px 16px;
}

.eyebrow,
.intro,
.helper-copy,
.status-pill,
.prompt-label,
.feedback-message,
.result-copy,
.save-message,
.leaderboard-copy,
.leaderboard-status,
.leaderboard-table,
.name-input,
.start-button,
.next-button,
.restart-button,
.answer-option,
.fact-card-eyebrow,
.fact-card-value {
    font-family: "Nunito", sans-serif;
}

.eyebrow {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

h1,
h2 {
    margin: 0;
    line-height: 1.05;
}

h1 {
    margin-top: 6px;
    font-size: clamp(1.85rem, 3vw, 2.8rem);
}

.intro {
    max-width: 620px;
    margin: 4px 0 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.start-panel {
    padding: 10px 0 0;
}

.name-form {
    padding: 14px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(235, 252, 243, 0.92));
    border: 1px solid rgba(19, 59, 44, 0.08);
}

.name-label {
    display: block;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 800;
}

.name-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.name-input {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid rgba(19, 59, 44, 0.18);
    border-radius: 16px;
    font-size: 0.98rem;
    color: var(--ink);
    background: white;
    appearance: none;
}

.name-input:focus {
    outline: 2px solid rgba(245, 158, 11, 0.28);
    border-color: rgba(245, 158, 11, 0.55);
}

.helper-copy {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.helper-copy.error {
    color: var(--bad);
}

.status-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.status-pill {
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(19, 59, 44, 0.08);
    font-size: 0.84rem;
    font-weight: 800;
}

#bonus-pill {
    background: rgba(245, 158, 11, 0.14);
    color: var(--accent-strong);
}

.progress-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(19, 59, 44, 0.1);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 10%;
    border-radius: inherit;
    background: linear-gradient(90deg, #facc15, var(--accent));
    transition: width 0.25s ease;
}

.prompt-panel {
    margin: 10px 0 10px;
    padding: 10px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(235, 252, 243, 0.92));
    border: 1px solid rgba(19, 59, 44, 0.08);
}

.prompt-label {
    margin: 0 0 6px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--muted);
}

#question-title {
    font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.media-stage {
    margin-bottom: 12px;
    min-height: 252px;
    padding: 16px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(19, 59, 44, 0.08);
    display: grid;
    place-items: center;
}

.club-image {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: contain;
}

.fact-card {
    width: min(100%, 460px);
    min-height: 180px;
    border-radius: 24px;
    padding: 18px;
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 35%),
        linear-gradient(135deg, #0f766e, #14532d);
    color: white;
    box-shadow: 0 18px 38px rgba(15, 118, 110, 0.24);
    display: grid;
    align-content: center;
    gap: 8px;
    text-align: center;
}

.fact-card-eyebrow {
    margin: 0;
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 800;
    opacity: 0.78;
}

.fact-card-value {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2.3rem);
    font-weight: 800;
    line-height: 1.12;
}

.choices-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.answer-option {
    border: 3px solid transparent;
    border-radius: 18px;
    padding: 14px 12px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 34px rgba(19, 59, 44, 0.08);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--ink);
    text-align: left;
}

.answer-option:hover:not(:disabled),
.answer-option:focus-visible:not(:disabled) {
    transform: translateY(-4px);
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 18px 36px rgba(19, 59, 44, 0.14);
    outline: none;
}

.answer-option:disabled {
    cursor: default;
}

.answer-option.correct {
    border-color: rgba(21, 128, 61, 0.7);
    background: rgba(21, 128, 61, 0.09);
    color: var(--good);
}

.answer-option.wrong {
    border-color: rgba(194, 65, 12, 0.7);
    background: rgba(194, 65, 12, 0.09);
    color: var(--bad);
}

.feedback-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
}

.feedback-message {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--muted);
}

.feedback-message.good {
    color: var(--good);
}

.feedback-message.bad {
    color: var(--bad);
}

.start-button,
.next-button,
.restart-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    font-size: 0.93rem;
    font-weight: 800;
    color: white;
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(217, 119, 6, 0.26);
    text-decoration: none;
}

.start-button:disabled,
.next-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    box-shadow: none;
}

.hidden {
    display: none;
}

#result-screen {
    padding: 12px 0 2px;
}

.result-badge {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.14);
    font-family: "Nunito", sans-serif;
    font-weight: 800;
    color: var(--accent-strong);
}

#final-score {
    margin-top: 12px;
    font-size: clamp(1.7rem, 3vw, 2.7rem);
}

.result-copy {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.placement-message {
    min-height: 1.2em;
    margin: 10px 0 0;
    font-family: "Nunito", sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--accent-strong);
}

.save-message {
    min-height: 1.3em;
    margin: 12px 0 0;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--muted);
}

.save-message.success {
    color: var(--good);
}

.save-message.error {
    color: var(--bad);
}

.result-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.secondary-button {
    background: white;
    color: var(--ink);
    border: 1px solid rgba(19, 59, 44, 0.12);
    box-shadow: 0 10px 22px rgba(19, 59, 44, 0.08);
}

.leaderboard-header h2 {
    margin-top: 6px;
    font-size: 1.7rem;
}

.leaderboard-copy {
    margin: 6px 0 10px;
    color: var(--muted);
    font-size: 0.88rem;
}

.leaderboard-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.leaderboard-tab {
    appearance: none;
    border: 1px solid rgba(19, 59, 44, 0.12);
    border-radius: 999px;
    padding: 9px 10px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--muted);
    font-family: "Nunito", sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.leaderboard-tab.is-active {
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
    color: white;
    border-color: transparent;
}

.leaderboard-status {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-strong);
    font-size: 0.88rem;
    font-weight: 800;
}

.table-wrap {
    flex: 1;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(19, 59, 44, 0.08);
    background: rgba(255, 255, 255, 0.85);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 9px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(19, 59, 44, 0.08);
}

.placement-cell {
    font-weight: 800;
}

.leaderboard-table th {
    font-size: 0.77rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: 0;
}

.empty-row td {
    text-align: center;
    color: var(--muted);
    font-weight: 700;
}

.confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.confetti-canvas.is-active {
    opacity: 1;
}

.version-stamp {
    margin: 0;
    padding: 0 12px 10px;
    text-align: center;
    font-family: "Nunito", sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 980px) {
    .layout-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .leaderboard-card {
        order: 2;
    }
}

@media (max-width: 720px) {
    .app-shell {
        padding: 12px;
    }

    .quiz-card,
    .leaderboard-card {
        padding: 18px;
        border-radius: 24px;
    }

    .name-row,
    .choices-grid {
        grid-template-columns: 1fr;
    }

    .feedback-row {
        flex-direction: column;
        align-items: stretch;
    }

    .start-button,
    .next-button,
    .restart-button,
    .secondary-button {
        width: 100%;
    }

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

    .media-stage {
        min-height: 220px;
    }

    .fact-card {
        min-height: 160px;
    }
}
