:root {
    color-scheme: light;
    --ink: #17212a;
    --muted: #505b64;
    --paper: #fbfaf7;
    --line: #e9e8e2;
    --green: #246b58;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Arial, "Helvetica Neue", sans-serif;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
}
body.tests-page-active { background: #000; }
button, a { font: inherit; }
a { color: inherit; }
.page-header {
    display: flex;
    width: min(100% - 48px, 1050px);
    min-height: 82px;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-inline: auto;
}
.main-nav { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.header-button {
    position: relative;
    display: inline-flex;
    min-width: 195px;
    min-height: 48px;
    align-items: center;
    justify-content: flex-start;
    padding: 6px 53px 6px 15px;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 7px 0 rgba(28, 42, 52, .12), inset 0 1px 0 rgba(255,255,255,.35);
    cursor: pointer;
    text-align: left;
    transition: transform 150ms ease, filter 150ms ease;
}
.header-button:hover { transform: translateY(-2px); filter: brightness(1.04); }
.header-button:focus-visible { outline: 3px solid #293b4a; outline-offset: 3px; }
.header-caption { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.header-caption strong {
    overflow: hidden;
    color: #172d3a;
    font-size: .73rem;
    font-weight: 900;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}
.header-caption small { color: rgba(255,255,255,.88); font-size: .68rem; font-weight: 600; white-space: nowrap; }
.header-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid rgba(44, 59, 67, .1);
    border-radius: 50%;
    background: linear-gradient(145deg, #fff, #e9eef0);
    box-shadow: 0 2px 6px rgba(27, 40, 48, .2);
    color: #314653;
    font-size: 1.2rem;
}
.header-icon svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.class-button { background: linear-gradient(105deg, #f65a23, #ffad08); }
.game-button { background: linear-gradient(105deg, #0755be, #158cd1); }
.speaking-nav-button { background: linear-gradient(105deg, #7923b5, #bb55d8); }
.home-nav-button { background: linear-gradient(105deg, #09a75d, #56d861); }
main { width: min(100% - 48px, 1050px); margin-inline: auto; }
.page-view { padding: 62px 0 42px; }
.home-view { max-width: 920px; margin-inline: auto; }
.age-view { max-width: 850px; margin-inline: auto; }
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border: 0;
    background: transparent;
    color: #52636b;
    cursor: pointer;
    font-size: .88rem;
    font-weight: 700;
}
.back-link:hover { color: var(--green); }
.back-link:focus-visible, .age-button:focus-visible {
    outline: 3px solid #293b4a;
    outline-offset: 3px;
}
.page-heading { padding-top: 37px; }
.page-heading h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.age-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 36px;
}
.age-button {
    display: flex;
    min-height: 190px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 9px;
    padding: 24px;
    border: 2px solid transparent;
    border-radius: 20px;
    color: var(--ink);
    cursor: pointer;
    font-family: "Manrope", sans-serif;
    font-size: clamp(1.25rem, 3vw, 1.7rem);
    font-weight: 800;
    transition: transform 160ms ease, box-shadow 160ms ease;
}
.age-button > strong { font-family: "Manrope", sans-serif; font-size: 1.55rem; }
.age-button > span { color: #5e6c70; font-size: .9rem; }
.age-button .age-arrow { margin-top: 10px; color: var(--green); font-weight: 700; }
.age-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(36, 55, 49, .11);
}
.age-children { background: #fff2bc; border-color: #f2df91; }
.age-adolescents { background: #dbe8fa; border-color: #bfd4f2; }
.age-view[hidden], .home-view[hidden] { display: none; }
.level-coming {
    padding: 18px;
    margin-top: 20px;
    border-radius: 13px;
    background: #f2f5f2;
    color: var(--muted);
    line-height: 1.6;
}
.level-view, .speaking-view, .games-view, .tests-view, .unrelated-view, .vanishing-view, .class-view {
    max-width: 920px;
    margin-inline: auto;
}
.tests-view { color: #fff; }
.tests-view .back-link { color: #e5e7eb; }
.tests-view .eyebrow { color: #9de0c0; }
.tests-view .hero-description { color: #e5e7eb; }
.tests-view .tests-wheel-card {
    border-color: #000;
    background: #000;
    box-shadow: none;
}
.tests-view .wheel-result { color: #fff; }
.game-result[hidden], .answer-section[hidden] { display: none; }
.wheel-spin-button:focus-visible, .vanishing-entry-button:focus-visible,
.answer-option:focus-visible, .play-again-button:focus-visible {
    outline: 3px solid #293b4a;
    outline-offset: 3px;
}
.speaking-practice-card, .vanishing-game-card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: white;
    box-shadow: 0 10px 30px rgba(36,55,49,.05);
}
.level-wheel-card[hidden] { display: none; }
.practice-wheel-wrap, .game-wheel-wrap {
    position: relative;
    width: min(100%, 440px);
    margin-inline: auto;
    aspect-ratio: 1;
}
.practice-wheel, .game-wheel {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 12px 14px rgba(27,39,54,.22));
}
.wheel-outer-ring { fill: #fff; stroke: #243746; stroke-width: 8; }
.wheel-segments { transform-origin: 200px 200px; }
.game-wheel .wheel-segments { transform-origin: 250px 250px; }
.wheel-segment-label {
    fill: #fff;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 800;
    paint-order: stroke;
    pointer-events: none;
    stroke: rgba(25, 39, 53, .52);
    stroke-linejoin: round;
    stroke-width: 2px;
}
.game-wheel .wheel-segment-label { font-size: 10px; }
.wheel-hub { fill: #fffdf8; stroke: #243746; stroke-width: 5; }
.wheel-pointer {
    position: absolute;
    z-index: 2;
    top: -3px;
    left: 50%;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border-top: 0;
    border-right: 15px solid transparent;
    border-bottom: 30px solid #ff5252;
    border-left: 15px solid transparent;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,.18));
}
.wheel-spin-button {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    width: 90px;
    height: 90px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0;
    transform: translate(-50%, -50%);
    border: 5px solid white;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #397f9b, #163d57 72%);
    box-shadow: 0 4px 12px rgba(14, 35, 52, .34), inset 0 1px 2px rgba(255,255,255,.25);
    color: white;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 800;
}
.wheel-spin-button span { font-size: 1.45rem; line-height: 1; }
.wheel-spin-button:disabled { cursor: wait; opacity: .75; }
.wheel-result {
    min-height: 28px;
    margin: 18px 0 0;
    color: var(--green);
    font-size: 1.08rem;
    font-weight: 800;
    text-align: center;
}
.level-key {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.6;
    text-align: center;
}
.games-wheel-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(220px, .9fr);
    align-items: center;
    gap: 30px;
    padding: 20px 24px;
    border: 1px solid #d9e9e5;
    border-radius: 20px;
    background: linear-gradient(145deg, #f0f7f3, #f8f7f0);
}
.game-wheel-info > p:not(.wheel-result) { color: #505b64; font-size: .9rem; font-weight: 600; line-height: 1.6; }
.game-wheel-info .wheel-result { text-align: left; }
.play-again-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 17px;
    border: 0;
    border-radius: 11px;
    background: var(--green);
    color: white;
    cursor: pointer;
    font-size: .86rem;
    font-weight: 700;
}
.play-again-button:hover { background: #194f42; }
.game-entry-button {
    width: min(100%, 230px);
    min-width: 0;
    min-height: 44px;
    padding: 5px 43px 5px 12px;
    margin-top: 10px;
}
.game-entry-button .header-caption { gap: 1px; }
.game-entry-button .header-caption strong { font-size: .68rem; }
.game-entry-button .header-caption small { font-size: .62rem; }
.game-entry-button .header-icon { top: 4px; right: 4px; width: 36px; height: 36px; font-size: 1.05rem; }
.unrelated-status {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    background: #f0f6f2;
}
.unrelated-status > div { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.unrelated-status-label { color: #505b64; font-size: .72rem; font-weight: 700; }
.unrelated-status strong { color: var(--ink); font-size: 1.05rem; }
.unrelated-status .unrelated-target { color: var(--green); font-size: 1.25rem; }
.unrelated-status .game-clock { color: #9c592a; }
.unrelated-instruction { min-height: 24px; margin: 14px 0 8px; color: #505b64; font-size: .9rem; font-weight: 700; }
.unrelated-fall-zone {
    position: relative;
    min-height: 420px;
    overflow: hidden;
    border: 1px solid #dce6df;
    border-radius: 14px;
    background: linear-gradient(180deg, #f5fbff, #f5f8f1);
}
.falling-word {
    position: absolute;
    top: -48px;
    left: var(--fall-left);
    z-index: 1;
    max-width: 45%;
    padding: 9px 13px;
    border: 1px solid #b6d6c5;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(25, 43, 58, .12);
    color: var(--ink);
    cursor: pointer;
    font-size: .9rem;
    font-weight: 800;
    white-space: nowrap;
    animation: falling-word-drop var(--fall-duration) linear forwards;
}
.falling-word:hover { border-color: var(--green); background: #eaf6ee; }
.falling-word:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
@keyframes falling-word-drop {
    to { transform: translateY(var(--fall-distance)); }
}
.unrelated-result { display: block; margin-top: 14px; }
.unrelated-result[hidden] { display: none; }
.unrelated-result > strong { display: block; }
.unrelated-result .play-again-button { margin-top: 14px; }
.unrelated-word-meanings { margin-top: 14px; }
.unrelated-word-meanings[hidden] { display: none; }
.unrelated-word-meanings h2 { margin-bottom: 10px; font-size: 1.05rem; }
.unrelated-word-meanings dl { display: grid; grid-template-columns: minmax(90px, .25fr) minmax(0, 1fr); gap: 8px 14px; margin: 0; }
.unrelated-word-meanings dt { color: var(--ink); font-weight: 800; }
.unrelated-word-meanings dd { margin: 0; color: #505b64; font-size: .9rem; line-height: 1.5; }
.message-form {
    display: grid;
    max-width: 680px;
    gap: 10px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(36,55,49,.05);
}
.message-form label { margin-top: 7px; color: var(--ink); font-size: .94rem; font-weight: 700; }
.message-form input, .message-form select, .message-form textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #cbd4d0;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}
.message-form textarea { min-height: 150px; resize: vertical; }
.message-form input:focus-visible, .message-form select:focus-visible, .message-form textarea:focus-visible {
    outline: 3px solid #9bc9b3;
    outline-offset: 2px;
}
.message-submit-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    justify-self: start;
    padding: 0 18px;
    margin-top: 8px;
    border: 0;
    border-radius: 11px;
    background: var(--green);
    color: #fff;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 800;
}
.message-submit-button:hover { background: #194f42; }
.message-form-note { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.vanishing-level-select {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0 0 15px;
}
.vanishing-level-button {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #d8e4dd;
    border-radius: 999px;
    background: white;
    color: #52636b;
    cursor: pointer;
    font-size: .84rem;
    font-weight: 700;
}
.vanishing-level-button[aria-pressed="true"] {
    border-color: var(--green);
    background: #eaf4ee;
    color: var(--green);
}
.vanishing-level-button:focus-visible {
    outline: 3px solid #293b4a;
    outline-offset: 3px;
}
.game-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f0f6f2;
    color: #38594d;
    font-size: .9rem;
    font-weight: 600;
}
.game-clock {
    min-width: 65px;
    color: #9c592a;
    font: 800 1.15rem "Manrope", sans-serif;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.passage-card {
    margin: 16px 0 20px;
    padding: 23px 24px;
    border: 1px solid #ece8dc;
    border-radius: 14px;
    background: #fffdf7;
    font-family: "Manrope", sans-serif;
    font-size: clamp(1.04rem, 2vw, 1.27rem);
    font-weight: 600;
    line-height: 2;
}
.passage-card p { margin-bottom: 7px; }
.passage-card p:last-child { margin-bottom: 0; }
.passage-card h2 { margin-bottom: 12px; font-size: 1.35rem; }
.passage-word { transition: opacity 250ms ease, color 250ms ease; }
.passage-word.word-vanished { visibility: hidden; }
.passage-word.word-blank { visibility: visible; color: #9c592a; font-weight: 800; }
.answer-section { padding-top: 6px; }
.answer-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 13px;
}
.answer-heading h2 { margin-bottom: 5px; font-size: 1.15rem; }
.answer-heading p { margin-bottom: 0; color: var(--muted); font-size: .81rem; line-height: 1.45; }
.score-display {
    display: flex;
    min-width: 82px;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    border-radius: 12px;
    background: #fff2bc;
}
.score-display span { color: #7f6b32; font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.score-display strong { font: 800 1.3rem "Manrope", sans-serif; }
.answer-list { display: flex; flex-wrap: wrap; gap: 12px; }
.answer-option {
    display: flex;
    min-width: 88px;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid #e6e9e5;
    border-radius: 11px;
    background: white;
    color: var(--ink);
    cursor: pointer;
    text-align: center;
    transition: border-color 150ms ease, background-color 150ms ease;
}
.answer-option:hover:not(:disabled) { border-color: #89ae9f; background: #f8fbf8; }
.answer-word { font-family: "Manrope", sans-serif; font-size: .91rem; line-height: 1.3; text-transform: capitalize; }
.answer-option.answer-correct { border-color: #5ea787; background: #eaf6ee; }
.answer-option.answer-selected-wrong { border-color: #dc8b7d; background: #fff0ed; }
.answer-option.answer-missed { border-color: #d9b454; background: #fff9df; }
.answer-option:disabled { cursor: default; }
.game-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f0f6f2;
}
.game-result strong { line-height: 1.5; }
.eyebrow {
    margin: 0 0 13px;
    color: var(--green);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .13em;
}
.eyebrow-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 50%;
    background: #e0a44b;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Arial Black", Arial, sans-serif; font-weight: 900; }
h1 {
    margin-bottom: 13px;
    font-size: clamp(2.5rem, 5.6vw, 4.1rem);
    font-weight: 800;
    letter-spacing: -.065em;
    line-height: 1.08;
}
h1 span { color: var(--green); }
.hero-description {
    max-width: 590px;
    margin-bottom: 30px;
    color: #505b64;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.7;
}
.site-guide {
    padding: 20px 22px;
    margin-top: 28px;
    border: 1px solid #e4e9df;
    border-radius: 17px;
    background: #fffefa;
}
.site-guide h2 {
    margin-bottom: 9px;
    font-size: 1.28rem;
    letter-spacing: -.035em;
}
.site-guide p {
    margin: 0;
    color: #505b64;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.65;
}
.site-guide p + p { margin-top: 7px; }
.site-guide strong { color: var(--ink); }
.skill-wheel-card { max-width: 560px; margin: 28px auto 0; }
.skill-wheel-card .practice-wheel-wrap { width: min(100%, 380px); }
@media (max-width: 620px) {
    .page-header { width: min(100% - 32px, 440px); min-height: 0; padding-block: 12px 7px; }
    .main-nav { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .header-button { min-width: 0; min-height: 44px; padding: 5px 41px 5px 12px; }
    .header-caption strong { font-size: .66rem; }
    .header-caption small { font-size: .59rem; }
    .header-icon { top: 2px; right: 2px; width: 38px; height: 38px; font-size: 1rem; }
    main { width: min(100% - 32px, 440px); }
    .page-view { padding: 43px 0 32px; }
    .home-view { padding-top: 48px; }
    h1 { font-size: clamp(2.45rem, 11vw, 3.3rem); }
    .hero-description { font-size: .92rem; }
    .site-guide { padding: 17px; margin-top: 22px; }
    .skill-wheel-card { margin-top: 22px; padding: 14px; }
    .age-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 22px; }
    .age-button { min-height: 145px; }
    .speaking-practice-card, .vanishing-game-card { padding: 14px; }
    .unrelated-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .unrelated-fall-zone { min-height: 390px; }
    .unrelated-word-meanings dl { grid-template-columns: 1fr; gap: 2px; }
    .unrelated-word-meanings dd { margin-bottom: 8px; }
    .message-form { padding: 16px; }
    .practice-wheel-wrap, .game-wheel-wrap { width: 100%; }
    .games-wheel-layout { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
    .game-wheel-info { padding: 0 6px 10px; }
    .game-wheel-info .wheel-result { text-align: center; }
    .game-wheel-info > p:not(.wheel-result) { text-align: center; }
    .game-status { align-items: flex-start; font-size: .8rem; }
    .passage-card { padding: 16px; font-size: 1rem; line-height: 1.85; }
    .answer-list { gap: 10px; }
    .answer-heading { align-items: flex-start; }
    .game-result { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
