:root{--paper:#f5f4ee;--ink:#263e35;--muted:#83897e;--line:#e2e5dc;--green:#285744;--lime:#dfed9d;--soft:#eef2e6;--white:#fffefb;--red:#b9533f;font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;touch-action:manipulation;color:inherit;border:0}button:focus-visible,a:focus-visible{outline:3px solid #b38e32;outline-offset:3px}button:disabled{cursor:default;opacity:.45}button:active:not(:disabled){transform:translateY(1px)}[hidden]{display:none!important}.app{max-width:1280px;margin:auto;padding:0 42px}.header{height:96px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #dedfd5}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--ink)}.brand-mark{font-size:37px;line-height:1;color:var(--green)}.brand strong{font-size:29px;letter-spacing:-1.3px}.brand strong span{font-size:20px;letter-spacing:-1px;margin-left:3px}.brand-caption{font-size:11px;color:var(--muted);margin-left:12px;letter-spacing:1px}.quiet{background:none;min-height:44px;padding:8px 13px;font-size:12px;font-weight:600;border-radius:9px}.quiet:hover{background:#e9ecdf}.quiet>span:first-child{font-size:18px;margin-right:5px}.heading{display:flex;align-items:center;justify-content:space-between;margin:34px 0 29px}.eyebrow{font-size:10px;letter-spacing:2.1px;font-weight:700;color:#829175}.heading h1{font-size:31px;letter-spacing:1.2px;margin:10px 0}.heading p{font-size:12px;color:var(--muted);margin:0;letter-spacing:1px}.daily-tag{display:flex;align-items:center;gap:12px;font-size:10px;line-height:1.9;color:#849078;padding:10px 18px;border-left:1px solid #d9decd}.daily-tag b{font-weight:500;color:var(--ink)}.sun{font-size:34px;color:#83975c}.toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px;gap:12px}.modes{display:flex;gap:5px;padding:5px;background:#eaece3;border-radius:14px}.mode{min-height:43px;padding:8px 23px;background:transparent;border-radius:10px;display:flex;gap:9px;align-items:center;font-size:12px;font-weight:600;color:#77806f}.mode>span{font-size:20px;line-height:1}.mode.selected{background:var(--green);color:white;box-shadow:0 3px 5px #203e3515}.toolbar-actions{display:flex;gap:8px}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:24px;align-items:start}.board-card{background:var(--white);border:1px solid var(--line);border-radius:19px;padding:20px 22px 13px;box-shadow:0 4px 12px #25392d03}.board-top{display:flex;align-items:center;justify-content:space-between;padding:0 0 17px;font-size:11px}.board-top strong{font-weight:600}.board-top>span{font-size:10px;color:var(--muted)}.live-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#96ad6b;margin-right:9px}.board-wrap{position:relative}.board{display:grid;grid-template-columns:repeat(11,minmax(0,1fr));gap:1px;background:#dce2d3;border:1px solid #dce2d3;border-radius:8px;overflow:hidden;aspect-ratio:1}.cell{display:flex;align-items:center;justify-content:center;min-width:0;padding:0;background:#fffefb;font-size:clamp(14px,1.6vw,22px);font-variant-numeric:tabular-nums;position:relative}.cell.header-cell{font-weight:650;background:#eef1e7;color:#56684d}.cell.corner{color:var(--green);background:#e2e9d6;font-size:26px}.cell.related{background:#f5f8ed}.cell.header-cell.active-header{background:#dfed9d;color:#35512e}.cell.active{box-shadow:inset 0 0 0 2.5px #567743;background:#f1f6d9;z-index:1}.cell.correct{background:#e5eddc;color:#648452;font-size:17px}.cell.wrong{color:var(--red);background:#fff0e9;box-shadow:inset 0 0 0 2px #c7745c}.cell.div-answer{font-size:clamp(10px,1.2vw,15px);gap:2px;flex-wrap:wrap}.cell.div-answer small{font-size:.65em}.board-cover{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border-radius:8px;background:#fffefbcb;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)}.cover-content{text-align:center}.cover-badge{display:inline-block;color:#6b7d47;background:#e9efcc;font-size:10px;font-weight:800;letter-spacing:2px;padding:7px 12px;border-radius:20px;transform:rotate(-6deg)}.cover-content h2{font-size:30px;line-height:1.7;letter-spacing:1.2px;margin:20px 0 12px}.cover-content p{font-size:12px;color:#7b8573;line-height:1.9;margin-bottom:24px}.primary{background:var(--green);color:white;min-height:52px;padding:12px 26px;border-radius:11px;font-size:14px;font-weight:650;display:flex;align-items:center;justify-content:center;gap:25px}.primary:hover{background:#1e4938}.cover-content .primary{margin:auto;min-width:205px}.cover-content small{display:block;margin-top:14px;font-size:10px;color:#8a927f}.board-bottom{display:flex;justify-content:space-between;align-items:center;font-size:9px;color:#8b9281;min-height:36px;gap:8px}.board-bottom b{padding:0 3px;font-size:13px}.legend-dot{display:inline-block;background:#dce8cf;width:7px;height:7px;border-radius:2px;margin-right:6px}.side-panel{display:flex;flex-direction:column;gap:17px}.stats{background:#ecefe1;border:1px solid #e2e7d6;border-radius:17px;padding:18px 20px 13px}.timer-row{display:flex;align-items:center;justify-content:space-between}.small-label{display:block;font-size:10px;font-weight:600;letter-spacing:1px;color:#8b947e}#timer{display:block;font-size:34px;font-weight:500;letter-spacing:1px;margin-top:3px;font-variant-numeric:tabular-nums}#timer span{font-size:18px;color:#99a38b}.pause-button{width:44px;height:44px;border:1px solid #cdd6be;border-radius:50%;background:transparent;font-size:17px}.progress-row{display:flex;align-items:center;justify-content:space-between;margin:15px 0 9px;font-size:10px}.progress-row b{font-size:18px;font-weight:600}.progress-row small{color:#8b947e}.progress-track{height:5px;border-radius:6px;background:#d9dfcb;overflow:hidden}#progress-bar{width:0;background:#6d8a4c;height:100%;transition:width .2s}.best{display:flex;justify-content:space-between;font-size:10px;color:#8b947e;margin:12px 0 0}.best span{font-variant-numeric:tabular-nums}.answer-card{background:var(--white);border:1px solid var(--line);border-radius:17px;padding:18px}.answer-top{display:flex;align-items:center;justify-content:space-between}.answer-top>span:last-child{font-size:9px;color:#9a9e90}.equation{text-align:center;font-size:29px;font-weight:500;letter-spacing:3px;margin:17px 0 12px;font-variant-numeric:tabular-nums}.answer-display{border:1.5px solid #cbd8b5;background:#f7f9f0;border-radius:9px;min-height:51px;display:flex;align-items:center;justify-content:center;font-size:26px;letter-spacing:2px;font-variant-numeric:tabular-nums}.answer-display .placeholder{font-size:12px;letter-spacing:2px;color:#b1b8a0}.answer-display small{font-size:12px;letter-spacing:0;padding:0 8px}.feedback{height:32px;display:flex;align-items:center;justify-content:center;text-align:center;font-size:10px;color:#8b947e}.feedback.error{color:var(--red)}.feedback.success{color:#5b7e3a}.keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.keypad button{background:#f0f2ea;border:1px solid #e7eadf;border-bottom:2px solid #dfe4d4;border-radius:9px;min-height:51px;font-size:23px;font-weight:500}.keypad button:hover{background:#e4ead8}.keypad .utility{color:#8a967a;font-size:19px}.submit{width:100%;margin-top:12px;min-height:49px;font-size:12px;justify-content:space-between;padding:12px 19px}.remainder{width:100%;background:#eef2e5;min-height:40px;border-radius:7px;margin-top:8px;font-size:12px}.side-note{font-size:10px;text-align:center;color:#969c8c;line-height:1.9;margin:-3px 0 0}footer{display:flex;justify-content:space-between;color:#a0a496;font-size:9px;padding:26px 2px 22px;letter-spacing:.5px}.footer-dot{padding:0 8px}dialog{border:1px solid #dbe2ce;border-radius:23px;padding:0;width:min(460px,calc(100% - 32px));max-height:85dvh;color:var(--ink);background:var(--white);box-shadow:0 25px 100px #17342625}dialog::backdrop{background:#253d3566;backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}.modal-inner{padding:35px;position:relative}.modal-close{position:absolute;right:13px;top:10px;width:44px;height:44px;background:none;font-size:26px;color:#86917b}dialog h2{font-size:25px;margin:12px 0 20px}#modal-body{font-size:13px;line-height:1.9;color:#718167}#modal-body p{margin:10px 0}#modal-body b{color:var(--ink)}.modal-actions{display:flex;flex-direction:column;gap:10px;margin-top:25px}.secondary{min-height:44px;background:#edf1e4;border-radius:10px;padding:10px 16px;font-size:12px}.result-time{font-size:53px;letter-spacing:1px;color:var(--green);font-variant-numeric:tabular-nums;line-height:1.5}.result-summary{display:flex;gap:15px;justify-content:space-between;background:#f0f4e7;border-radius:12px;padding:15px;margin:12px 0}.record-list{list-style:none;padding:0;margin:0}.record-list li{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding:10px 0;font-size:11px}.record-list b{font-size:16px;font-variant-numeric:tabular-nums}.record-list small{display:block;color:#929a88}.new-record{color:#6a852d;font-weight:bold}.storage-warning{font-size:11px;color:var(--red)}
@media(min-width:1000px) and (max-height:850px){.header{height:72px}.heading{margin:23px 0}.heading h1{font-size:28px}.toolbar{margin-bottom:18px}.app{max-width:1130px}.game-layout{grid-template-columns:minmax(0,1fr) 267px;gap:20px}.board-card{padding:16px 19px 8px}.side-panel{gap:12px}.stats{padding:13px 18px 10px}.answer-card{padding:14px 16px}.equation{margin:10px 0}.keypad button{min-height:45px}.side-note{display:none}footer{padding-top:20px}}
@media(max-width:999px){.app{padding:0 24px}.header{height:78px}.heading{margin:27px 0}.brand-caption{display:none}.mode{padding:8px 15px}.game-layout{grid-template-columns:minmax(0,1fr) 235px;gap:16px}.board-card{padding:14px 12px 7px}.board-top{font-size:10px;padding-bottom:12px}.board-top>span{font-size:9px}.answer-card{padding:14px}.stats{padding:14px}.keypad button{min-height:48px}.equation{font-size:25px}.toolbar-actions{gap:0}.quiet{padding:7px 9px;font-size:11px}.cover-content h2{font-size:24px}.board-bottom{font-size:8px}.side-note{display:none}.cell.correct{font-size:15px}}
@media(min-width:701px) and (max-width:899px){.game-layout{grid-template-columns:minmax(0,1fr) 215px;gap:14px}.app{padding:0 20px}.toolbar-actions #help-button span{display:none}.mode{padding:8px 13px}.board{aspect-ratio:auto;grid-auto-rows:44px}.cell{font-size:17px}.cell.correct{font-size:15px}.cell.div-answer{font-size:12px}.board-bottom{flex-wrap:wrap;padding-top:5px}.keypad button{min-height:53px}.side-panel{gap:15px}.daily-tag{padding-right:0}.heading h1{font-size:29px}}
@media(max-width:700px){.app{padding:0 15px}.header{height:68px}.heading{margin:25px 0}.heading h1{font-size:27px}.daily-tag{display:none}.toolbar{flex-wrap:wrap;gap:8px}.modes{width:100%;justify-content:space-between}.mode{flex:1;justify-content:center;padding:8px 4px;font-size:11px}.toolbar-actions{width:100%;justify-content:space-between}.game-layout{grid-template-columns:1fr}.board-card{padding:13px 10px 6px}.board{min-height:330px}.cell{font-size:16px}.cell.correct{font-size:14px}.cell.div-answer{font-size:11px}.cover-content h2{font-size:24px;line-height:1.5;margin:12px 0}.cover-content p{margin:10px 0 14px}.side-panel{display:grid;grid-template-columns:1fr 1.35fr;gap:12px}.stats{align-self:start}.timer-row{flex-wrap:wrap;gap:7px}#timer{font-size:28px}.pause-button{width:44px;height:44px}.answer-card{padding:12px}.answer-top>span:last-child{display:none}.equation{font-size:23px;margin:10px 0}.keypad button{min-height:45px;font-size:21px}.submit{font-size:10px;padding:12px 10px;gap:4px}.feedback{font-size:9px;height:34px}.answer-display{min-height:44px}.best{flex-wrap:wrap;gap:5px}footer{font-size:8px}footer>span:last-child{display:none}.modal-inner{padding:30px 24px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
/* Keep the complete controls within a landscape iPad viewport. */
@media(min-width:900px) and (max-height:900px){.header{height:50px}.heading{margin:12px 0}.heading .eyebrow{font-size:9px}.heading h1{font-size:24px;margin:6px 0}.heading p{display:none}.daily-tag{padding:0 12px;font-size:9px}.sun{font-size:29px}.toolbar{margin-bottom:10px}.game-layout{grid-template-columns:minmax(0,calc(100dvh - 245px)) 260px;justify-content:center;gap:20px}.board-card{padding:13px 13px 5px}.board-top{padding-bottom:12px}.board-bottom{min-height:29px}.side-panel{gap:10px}.stats{padding:11px 15px}.timer-row .small-label{font-size:9px}#timer{font-size:27px}.progress-row{margin:7px 0 6px}.best{margin-top:8px}.answer-card{padding:12px 15px}.equation{font-size:25px;margin:6px 0}.answer-display{min-height:40px}.feedback{height:26px}.keypad{gap:6px}.keypad button{min-height:44px;font-size:21px}.submit{min-height:44px;margin-top:8px}.remainder{min-height:36px;margin-top:6px}.side-note{display:none}footer{padding:14px 2px}.cell.correct{font-size:16px}.cell.div-answer{font-size:12px}}
#help-button>span{font-size:inherit;margin-right:0}

/* Cumulative allowance, kept in the lower right of the game layout. */
.wallet-card{background:#f0edda;border:1px solid #ded8b3;border-radius:17px;padding:15px 18px;display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center}
.wallet-heading{display:flex;align-items:center;gap:9px;font-size:11px;font-weight:650;color:#706438}.wallet-heading small{display:block;font-size:9px;font-weight:400;margin-top:4px;color:#8e8158}.coin-mark{border:1px solid #bdad68;background:#e9dfab;width:28px;height:28px;display:grid;place-items:center;border-radius:50%;font-size:17px}.wallet-total{display:flex;gap:4px;align-items:baseline;color:#66562d;font-variant-numeric:tabular-nums}.wallet-total strong{font-size:32px;font-weight:650;letter-spacing:-.7px}.wallet-total>span{font-size:12px}.wallet-card p{grid-column:1/-1;margin:0;font-size:9px;color:#95865c}.wallet-card p.storage-warning{color:var(--red)}
.pause-button{width:auto;min-width:82px;border-radius:9px;padding:0 9px;font-size:11px;white-space:nowrap}.pause-button span{margin-right:3px}.toolbar-actions{gap:2px}.toolbar-actions .quiet{padding-left:9px;padding-right:9px;white-space:nowrap}
@media(min-width:701px) and (max-width:999px){.toolbar{flex-wrap:wrap}.toolbar-actions{margin-left:auto}.wallet-card{padding:13px 12px;gap:8px}.wallet-total strong{font-size:27px}.coin-mark{display:none}.wallet-heading{font-size:10px}}
@media(max-width:700px){.wallet-card{grid-column:2;padding:12px}.wallet-heading{font-size:10px}.wallet-total strong{font-size:27px}.coin-mark{display:none}.pause-button{min-width:74px}}
@media(min-width:900px) and (max-height:900px){.heading{margin:7px 0}.heading .eyebrow,.daily-tag{display:none}.heading h1{font-size:23px;margin:5px 0}.stats{padding:8px 14px}.stats .best{display:none}.progress-row{margin:4px 0}.side-panel{gap:8px}.wallet-card{padding:10px 14px;gap:4px}.wallet-total strong{font-size:27px}.game-layout{grid-template-columns:minmax(0,calc(100dvh - 210px)) 260px}.board-card{align-self:start}.wallet-heading{font-size:10px}}

.wallet-card .paid-history{display:flex;justify-content:space-between;gap:8px;font-size:10px;border-top:1px solid #ded8b3;padding-top:8px;color:#8a7c54}.paid-history b{font-weight:600;font-variant-numeric:tabular-nums}.payout-button{grid-column:1/-1;min-height:44px;border:1px solid #d4c796;border-radius:8px;background:#faf7e7;color:#85713d;font-size:11px;margin-top:2px}.payout-button:hover:not(:disabled){background:#e8dfbb}.payment-amount{font-size:42px;font-weight:600;color:#766332;font-variant-numeric:tabular-nums}.payment-amount small{font-size:16px}
@media(min-width:900px) and (max-height:900px){.wallet-card .paid-history{padding-top:5px;font-size:9px}.wallet-card{gap:3px;padding:8px 14px}.stats{position:relative;min-height:65px;padding:6px 14px}.timer-row{align-items:flex-start}.timer-row .small-label{display:none}.stats #timer{font-size:24px;margin-top:0}.stats .pause-button{height:44px}.stats .progress-row{position:absolute;left:14px;top:37px;gap:8px;margin:0;font-size:9px}.stats .progress-row b{font-size:12px}.stats .progress-track{margin-top:5px;height:3px}.answer-card{padding-top:9px;padding-bottom:9px}.answer-top{display:none}.equation{margin:3px 0 6px}.header{height:43px}.heading{margin:5px 0}.heading h1{font-size:21px}.modes{padding:3px}.mode{min-height:40px}.toolbar{margin-bottom:8px}.game-layout{grid-template-columns:minmax(0,calc(100dvh - 190px)) 260px}}

.header-actions{display:flex;align-items:center;gap:8px}.sound-toggle{font-size:11px;min-width:76px}.division-step{font-size:10px;color:#7f8c6b;background:#f0f4e6;text-align:center;padding:7px 5px;border-radius:6px;margin-top:10px}.answer-display small{color:#7c8a64}.division-step+ .equation{margin-top:10px}
@media(min-width:900px) and (max-height:900px){.division-step{margin-top:0;padding:5px;font-size:9px}.division-step+ .equation{margin-top:5px}}
@media(max-width:700px){.header-actions{gap:0}.sound-toggle{min-width:68px}.division-step{font-size:9px}}

.save-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px;border-top:1px solid var(--line);color:#77816c;font-size:10px}.save-tools [data-ready="true"]{color:var(--green)}.save-tools .quiet{white-space:nowrap}.save-tools+footer{padding-top:6px}
