:root { color-scheme: light; --ink: #213e37; --muted: #63756c; --green: #285c4d; --green-dark: #194333; --cream: #f7f6f0; --line: #dce3d9; --gold: #e5bd6b; font-family: 'Trebuchet MS', 'Segoe UI', sans-serif; font-size: 18px; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--cream); color: var(--ink); }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
a { color: inherit; }
button, a, input, select { outline-offset: 5px; }
:focus-visible { outline: 3px solid #96701d; }
[hidden] { display: none !important; }
.header { min-height: 98px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px max(5vw, calc((100vw - 1160px) / 2)); background: #fffef9; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; font-weight: bold; text-decoration: none; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--green); color: white; font-size: 1.7rem; }
nav { display: flex; gap: 10px; }
nav a { padding: 10px 18px; border-radius: 9px; text-decoration: none; color: var(--muted); }
nav a[aria-current] { background: #e9efe5; color: var(--green-dark); font-weight: bold; }
nav a:hover { background: #edf0e8; }
main { max-width: 1160px; padding: 0 28px; margin: 0 auto; min-height: calc(100vh - 190px); }
.screen-heading { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin: 44px 0 28px; }
.eyebrow { font-size: .69rem; font-weight: bold; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
h1 { font-size: clamp(1.65rem, 3vw, 2.1rem); font-weight: 700; margin: 0; letter-spacing: -.035em; line-height: 1.2; }
.pill { border: 1px solid var(--line); padding: 9px 16px; border-radius: 24px; white-space: nowrap; color: var(--muted); font-size: .8rem; }
.trainer-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.card { background: #fffefb; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 4px 16px #29463505; }
.question-card { padding: 28px 34px 20px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-top .eyebrow { margin: 0; }
.keyboard-note, .level-position { color: var(--muted); font-size: .7rem; }
.question-caption { text-align: center; font-size: .9rem; color: var(--muted); margin: 35px 0 18px; }
.equation { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -.04em; text-align: center; white-space: nowrap; min-height: 85px; display: flex; align-items: center; justify-content: center; gap: 12px; font-variant-numeric: tabular-nums; }
.equation.idle { font-size: clamp(1.6rem, 3vw, 2.3rem); gap: 6px; }
.answer { color: var(--green); min-width: 1.05em; max-width: 50%; white-space: normal; overflow-wrap: anywhere; }
.feedback { min-height: 28px; text-align: center; font-size: .85rem; color: var(--muted); margin: 12px 0 22px; }
.feedback.incorrect { color: #aa4934; }
.feedback.correct { color: var(--green); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.keypad button { min-height: 68px; border: 1px solid #dbe2d7; border-radius: 12px; background: #f2f4ec; color: var(--ink); font-size: 1.55rem; font-weight: bold; transition: background .12s, transform .12s; }
.keypad button:hover:enabled { background: #e5ecdf; }
.keypad button:active:enabled { transform: translateY(2px); }
.keypad .utility-key { background: #f9f7ef; }
.keypad .enter-key { background: var(--green); color: #fff; border-color: var(--green); font-size: 1rem; }
.keypad .enter-key:hover:enabled { background: var(--green-dark); }
.keypad-footer { text-align: center; color: var(--muted); font-size: .75rem; margin: 22px 0 0; }
kbd { font: inherit; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; background: #f5f5ef; }
.wrong-answers { color: #a24936; font-size: .85rem; line-height: 1.5; overflow-wrap: anywhere; }
.level-card { padding: 28px; }
h2 { font-size: 1.55rem; margin: 27px 0 8px; letter-spacing: -.025em; }
.level-title { font-size: 1.1rem; color: var(--muted); line-height: 1.4; margin: 0 0 24px; }
.muted { color: var(--muted); line-height: 1.6; font-size: .95rem; }
.button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; border-radius: 10px; min-height: 54px; padding: 12px 20px; font-weight: bold; border: 1px solid transparent; }
.primary { background: var(--green); color: white; }
.primary:hover { background: var(--green-dark); }
.secondary { background: transparent; color: var(--green); border-color: #b9c9b7; }
.secondary:hover { background: #edf2e8; }
#start-quiz { margin: 27px 0 12px; justify-content: space-between; }
.small-note { font-size: .75rem; color: var(--muted); line-height: 1.7; margin: 23px 0 0; }
.tip-card { display: flex; align-items: start; gap: 16px; border-radius: 16px; background: #efeedd; padding: 24px; margin-top: 20px; }
.tip-icon { color: #826020; font-size: 1.7rem; }
h3 { font-size: .95rem; margin: 1px 0 8px; }
.tip-card p { color: var(--muted); font-size: .8rem; line-height: 1.6; margin: 0; }
.metric-label { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; color: var(--muted); }
.metric-label strong { color: var(--ink); font-size: 1.3rem; }
progress { width: 100%; height: 9px; accent-color: var(--green); border: none; border-radius: 8px; overflow: hidden; }
progress::-webkit-progress-bar { background: #e8ecdf; }
progress::-webkit-progress-value { background: var(--green); }
progress::-moz-progress-bar { background: var(--green); }
.countdown { font-size: 5.2rem; text-align: center; font-variant-numeric: tabular-nums; font-weight: bold; margin-top: 24px; line-height: 1.1; }
.countdown.urgent { color: #aa4934; }
.timer-label { text-align: center; color: var(--muted); font-size: .85rem; margin: 5px 0 28px; }
.practice-time { color: var(--muted); font-size: .8rem; margin-bottom: 25px; }
.hint-box { background: #f1f3e9; border-radius: 12px; padding: 20px; margin-bottom: 24px; min-height: 148px; }
.hint-box p:last-child { font-size: .9rem; line-height: 1.6; margin: 0; }
.hint-box p.revealed { font-size: 1.6rem; font-weight: bold; color: var(--green); }
.history-card { padding: 28px; }
.history-summary { font-size: .9rem; color: var(--muted); margin-bottom: 20px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { text-transform: uppercase; color: var(--muted); font-size: .7rem; letter-spacing: .12em; background: #f1f3eb; }
th, td { padding: 18px; border-bottom: 1px solid var(--line); }
td { font-size: .95rem; line-height: 1.5; }
td:first-child { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); line-height: 1.7; }
.settings-card { max-width: 720px; padding: 34px; }
.setting { padding-bottom: 30px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
label { display: block; font-weight: bold; font-size: 1.1rem; }
output { float: right; color: var(--green); font-size: .9rem; }
select, input[type=text] { width: 100%; color: var(--ink); background: #fff; border: 1px solid #b9c9b7; border-radius: 8px; min-height: 52px; padding: 12px; }
input[type=range] { width: 100%; accent-color: var(--green); margin: 16px 0; height: 24px; cursor: pointer; }
.range-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; }
.reset-setting h2 { font-size: 1.1rem; margin-top: 0; }
.danger { color: #a63f31; background: #fff4ef; border-color: #e0b4a8; }
.danger:hover { background: #ffe6dc; }
.reset-setting .button { width: auto; }
.notice, .active-link { padding: 15px 20px; border-radius: 10px; background: #fff0ce; color: #704912; font-size: .85rem; line-height: 1.5; }
.active-link { display: block; background: #e6eee1; color: var(--green); margin: 24px 0 0; }
footer { text-align: center; font-size: .7rem; color: var(--muted); padding: 36px 20px; }
dialog { border: 1px solid var(--line); border-radius: 20px; padding: 34px; color: var(--ink); background: #fffefb; max-width: 490px; width: calc(100% - 40px); box-shadow: 0 20px 90px #16362730; }
dialog::backdrop { background: #20382c70; backdrop-filter: blur(4px); }
dialog h2 { font-size: 1.65rem; line-height: 1.3; margin: 0 0 16px; }
dialog p { color: var(--muted); font-size: .95rem; line-height: 1.6; }
.dialog-mark { color: #8d6625; font-size: 2rem; margin-bottom: 20px; }
dialog .button { margin-top: 22px; }
.dialog-actions { display: flex; gap: 12px; }
#reset-code { margin-top: 12px; }
.reset-error { color: #a63f31; min-height: 24px; margin-bottom: 0; }
@media (max-width: 760px) { .header { padding: 18px 22px; flex-wrap: wrap; gap: 16px; } nav { width: 100%; } nav a { flex: 1; text-align: center; padding: 10px 14px; } main { padding: 0 20px; } .screen-heading { margin-top: 30px; } .pill { display: none; } .trainer-grid { grid-template-columns: 1fr; gap: 20px; } .information-column { grid-row: 1; } .level-card { padding: 22px; } .level-card h2 { margin-top: 18px; } .level-title { margin-bottom: 12px; } #ready-info { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } #ready-info .muted, #ready-info .small-note { grid-column: 1 / -1; margin: 0; } #start-quiz { margin: 0; } .small-note br { display: none; } .tip-card { display: none; } .question-card { padding: 24px; } .equation { font-size: 2.8rem; } .equation.idle { font-size: 1.8rem; } .countdown { font-size: 3.6rem; margin-top: 10px; } .hint-box { min-height: auto; margin-bottom: 16px; } .settings-card, .history-card { padding: 22px; } }
@media (max-width: 390px) { .brand { font-size: 1.05rem; } .keyboard-note { display: none; } .equation { font-size: 2.3rem; gap: 8px; } .equation.idle { font-size: 1.5rem; } main { padding: 0 14px; } .button { font-size: .85rem; padding: 12px; } }
@media (max-width: 760px) { .session-running #trainer .screen-heading { display: none; } .session-running .trainer-grid { margin-top: 16px; } .session-running .information-column { grid-row: 2; } .session-running .question-caption { margin-top: 18px; } .session-running .active-link { position: sticky; top: 8px; z-index: 2; box-shadow: 0 4px 16px #29463520; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
