@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root { color-scheme: light; --paper: #f8f8f5; --ink: #262924; --muted: #81847c; --line: #dedfd8; --accent: #4b6245; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: 'DM Sans', sans-serif; -webkit-font-smoothing: antialiased; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
button:disabled { cursor: wait; opacity: .6; }
main { max-width: 920px; margin: auto; padding: 38px 40px 25px; }
header { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.wordmark { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; font-size: 14px; font-weight: 600; letter-spacing: -.3px; }
.logo { font-family: 'Space Mono', monospace; font-size: 29px; letter-spacing: -4px; margin-right: 4px; }
.edition { font-size: 11px; color: var(--muted); }
.game { max-width: 560px; margin: 81px auto 49px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); padding-bottom: 20px; }
.stats > div { display: flex; flex-direction: column; gap: 6px; }
.stats > div:nth-child(2) { align-items: center; }
.stats > div:last-child { align-items: flex-end; }
.label, .eyebrow { font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: 1.6px; color: var(--muted); }
.stat { font-family: 'Space Mono', monospace; font-size: 25px; line-height: 1.3; }
.unit { font-size: 14px; margin-left: 3px; color: var(--muted); }
.timer-track { height: 2px; background: var(--line); }
#timer-bar { height: 100%; background: var(--accent); width: 100%; transition: width .15s linear; }
.screen { min-height: 365px; text-align: center; padding-top: 45px; }
[hidden] { display: none !important; }
.eyebrow { margin: 0 0 19px; font-size: 9px; }
h1 { margin: 0; font-size: clamp(34px, 5.5vw, 45px); font-weight: 500; line-height: 1.18; letter-spacing: -1.8px; }
.description { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 19px 0 26px; }
.primary { border: 0; border-radius: 5px; background: var(--ink); color: var(--paper); padding: 14px 21px; font-size: 13px; min-width: 165px; display: inline-flex; justify-content: space-between; gap: 30px; transition: background .15s; }
.primary:hover { background: var(--accent); }
.hint { color: var(--muted); font-size: 11px; margin: 14px 0 0; }
.hint-dot { padding: 0 8px; }
.equation { font-family: 'Space Mono', monospace; font-size: clamp(32px, 6vw, 46px); font-weight: 400; padding: 14px 0 35px; letter-spacing: -2px; }
.equation .equals { color: #a3a69c; padding: 0 10px; }
.equation .unknown { color: var(--accent); }
.answers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.answer { position: relative; border: 1px solid var(--line); border-radius: 5px; min-height: 76px; background: transparent; color: var(--ink); font-family: 'Space Mono', monospace; font-size: 20px; transition: background .12s, border-color .12s; padding: 15px 5px 23px; }
.answer:not(:disabled):hover { border-color: #9ca594; background: #eeefe8; }
.answer .key { position: absolute; bottom: 7px; left: 0; right: 0; color: var(--muted); font-size: 9px; }
.answer.correct { border-color: #6a865e; background: #e6eddf; }
.answer.wrong { border-color: #bc8277; background: #f2e5e1; }
.answer:disabled { cursor: default; opacity: 1; }
.feedback { height: 19px; margin: 17px 0 0; color: var(--accent); font-size: 12px; }
.feedback.error { color: #9d5b50; }
#quiz .hint { margin-top: 7px; }
.leaderboard { max-width: 560px; margin: 0 auto 35px; border-top: 1px solid var(--line); padding-top: 22px; }
.leaderboard-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.leaderboard h2 { font-size: 15px; font-weight: 500; margin: 0; letter-spacing: -.3px; }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: 11px; padding: 5px 0 5px 10px; }
.text-button:hover { color: var(--ink); }
.leaderboard-caption, .leaderboard-status { color: var(--muted); font-size: 11px; line-height: 1.7; }
.leaderboard-status:empty { display: none; }
#score-form { padding: 17px 0 10px; }
#score-form label { display: block; font-size: 12px; margin-bottom: 10px; }
.score-form-fields { display: flex; gap: 9px; }
.score-form-fields input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 5px; background: transparent; font: inherit; font-size: 13px; color: var(--ink); padding: 12px; }
.score-form-fields .primary { min-width: auto; white-space: nowrap; }
.leaderboard-table-wrapper { overflow-x: auto; }
.leaderboard table { width: 100%; border-collapse: collapse; font-size: 12px; }
.leaderboard th { color: var(--muted); font-weight: 400; font-size: 10px; }
.leaderboard th, .leaderboard td { padding: 13px 5px; text-align: right; border-bottom: 1px solid var(--line); }
.leaderboard th:first-child, .leaderboard td:first-child { text-align: left; width: 30px; color: var(--muted); }
.leaderboard th:nth-child(2), .leaderboard td:nth-child(2) { text-align: left; overflow-wrap: anywhere; max-width: 190px; }
.leaderboard td:nth-child(n+3) { font-family: 'Space Mono', monospace; font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.reference { max-width: 560px; margin: 0 auto 58px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
summary { display: flex; justify-content: space-between; padding: 17px 0; color: var(--muted); font-size: 12px; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary span { font-size: 17px; line-height: 1; }
details[open] summary span { transform: rotate(45deg); }
.reference-content { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; padding: 10px 0 17px; }
.reference-content b { font-family: 'Space Mono', monospace; font-size: 14px; font-weight: 400; }
.reference-content p { font-size: 11px; line-height: 1.9; color: var(--muted); margin: 9px 0 0; }
.reference-content .reference-note { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 13px; margin-top: 5px; }
footer { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
footer span { font-family: 'Space Mono', monospace; letter-spacing: 2px; }
@media (max-width: 600px) { main { padding: 24px; } .edition { display: none; } .game { margin-top: 58px; margin-bottom: 26px; } .screen { min-height: 355px; } .answers { gap: 7px; } .answer { font-size: 17px; } .reference { margin-bottom: 35px; } .reference-content { grid-template-columns: repeat(2, 1fr); } footer { font-size: 9px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
