@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&display=swap");

:root {
    --green: #58cc02;
    --green-shadow: #46a302;
    --blue: #1cb0f6;
    --blue-shadow: #1899d6;
    --red: #ff4b4b;
    --red-shadow: #ea2b2b;
    --gold: #ffc800;
    --ink: #243b53;
    --muted: #718096;
    --line: #e5e5e5;
    --page: #f4faff;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 32px 18px;
    background: radial-gradient(circle at top, #e2f7ff, var(--page) 62%);
    color: var(--ink);
    font-family: "Nunito", sans-serif;
}

button,
select {
    font: inherit;
}

.game-shell {
    width: min(100%, 760px);
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    margin: 0 0 16px 4px;
    color: #2572a8;
    font-weight: 800;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.game-card {
    padding: clamp(22px, 5vw, 40px);
    border: 2px solid #e3edf3;
    border-bottom-width: 6px;
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 18px 45px rgb(38 91 126 / 10%);
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.eyebrow,
.question-kicker {
    margin: 0 0 7px;
    color: #2585bd;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 5px;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 900;
}

.intro {
    margin-bottom: 0;
    color: var(--muted);
}

.adverb-mark {
    display: grid;
    width: 74px;
    height: 74px;
    flex: 0 0 auto;
    place-items: center;
    border: 3px solid #f2c000;
    border-radius: 23px;
    background: #fff3b0;
    color: #947000;
    font-size: 1.55rem;
    font-weight: 900;
    transform: rotate(5deg);
}

.progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 900;
}

.progress-track {
    height: 14px;
    flex: 1;
    overflow: hidden;
    border-radius: 20px;
    background: #e8edf1;
}

.progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--green);
    transition: width 0.25s ease;
}

.score {
    min-width: 52px;
    color: #ad8500;
    text-align: right;
}

#setup-screen h2,
.results-screen h2 {
    margin-bottom: 16px;
    font-size: 1.25rem;
    font-weight: 900;
}

.mode-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 22px;
}

.mode-option {
    display: flex;
    min-height: 170px;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    padding: 16px;
    border: 2px solid var(--line);
    border-bottom-width: 5px;
    border-radius: 17px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.mode-option:hover {
    transform: translateY(-2px);
}

.mode-option.selected {
    border-color: var(--blue);
    background: #f0faff;
}

.mode-option strong {
    font-size: 1rem;
    font-weight: 900;
}

.mode-option > span:last-child {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.mode-icon {
    display: grid;
    width: 37px;
    height: 37px;
    place-items: center;
    border-radius: 12px;
    background: #e2f6ff;
    color: #1688bf;
    font-weight: 900;
}

.category-label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.9rem;
    font-weight: 900;
}

#category-select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-weight: 700;
}

.primary-button {
    width: 100%;
    margin-top: 16px;
    padding: 14px 18px;
    border: 0;
    border-radius: 14px;
    background: var(--green);
    box-shadow: 0 4px 0 var(--green-shadow);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: filter 0.15s, transform 0.15s;
}

.primary-button:hover {
    filter: brightness(1.04);
}

.primary-button:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--green-shadow);
}

.primary-button:focus-visible,
.mode-option:focus-visible,
.answer-option:focus-visible,
#category-select:focus-visible,
.back-link:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
}

.question-prompt {
    margin-bottom: 17px;
    font-size: clamp(1.25rem, 4vw, 1.65rem);
    font-weight: 900;
    text-align: center;
}

.sentence-card {
    margin: 0 0 18px;
    padding: 20px;
    border: 2px solid #d8edfa;
    border-radius: 16px;
    background: #f3fbff;
    font-size: clamp(1.15rem, 4vw, 1.5rem);
    font-weight: 900;
    line-height: 1.5;
    text-align: center;
}

.answer-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.answer-option {
    min-height: 58px;
    padding: 12px;
    border: 2px solid var(--line);
    border-bottom-width: 5px;
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 800;
    transition: border-color 0.15s, background 0.15s;
}

.answer-option:hover:not(:disabled) {
    border-color: var(--blue);
    background: #f0faff;
}

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

.answer-option.correct {
    border-color: var(--green);
    background: #edffdf;
}

.answer-option.incorrect {
    border-color: var(--red);
    background: #fff0f0;
}

.feedback {
    margin-top: 14px;
    padding: 13px 15px;
    border-radius: 13px;
    background: #f1f6fa;
    font-weight: 800;
    line-height: 1.5;
}

.feedback.correct {
    background: #edffdf;
    color: #397d0b;
}

.feedback.incorrect {
    background: #fff0f0;
    color: #b52e2e;
}

.error-message {
    margin: 12px 0 0;
    color: #b52e2e;
    font-weight: 800;
}

.results-screen {
    padding: 16px 0 0;
    text-align: center;
}

.result-star {
    display: block;
    margin-bottom: 4px;
    color: var(--gold);
    font-size: 3.5rem;
}

.result-score {
    margin-bottom: 6px;
    color: #1688bf;
    font-size: 2.4rem;
    font-weight: 900;
}

.results-screen > p:not(.result-score) {
    color: var(--muted);
}

.hidden {
    display: none !important;
}

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

    .game-card {
        border-radius: 20px;
    }

    .adverb-mark {
        width: 58px;
        height: 58px;
        border-radius: 18px;
        font-size: 1.2rem;
    }

    .mode-options,
    .answer-options {
        grid-template-columns: 1fr;
    }

    .mode-option {
        min-height: 130px;
    }
}
