:root{font-family:'DM Sans',Arial,sans-serif;color:#382840;background:#f7f2fa;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,select{font:inherit}button,a{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid #ea9e21;outline-offset:3px}main{max-width:1220px;margin:auto;padding:22px 34px}.page-header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}.site-home{display:block;flex:0 1 225px}.site-home img{display:block;width:100%;height:auto}.top-controls{position:relative;z-index:5;display:flex;flex:1 1 720px;flex-wrap:wrap;justify-content:flex-end;align-items:stretch;gap:6px}.top-controls details{position:static}.top-controls summary,.top-controls>button{display:inline-flex;align-items:center;justify-content:center;list-style:none;min-height:44px;margin:0;padding:10px 13px;border:1px solid #c6aed8;border-radius:12px;background:#e8ddf2;color:#5b406e;font:600 13px/1.25 'DM Sans',Arial,sans-serif;cursor:pointer;text-align:center;white-space:nowrap}.top-controls summary::-webkit-details-marker{display:none}.top-controls details[open]>summary,.top-controls>button[aria-pressed=true]{background:#dac5e9;border-color:#a786be}.top-controls>button[aria-pressed=false]{background:#f5eff9}.top-controls #fullscreen{width:44px;min-width:44px;padding:8px}.top-controls #fullscreen svg{display:block}.control-panel{position:absolute;right:0;top:calc(100% + 8px);width:min(560px,calc(100vw - 36px));max-height:70svh;overflow:auto;padding:18px 22px;background:#fffefd;border:1px solid #d6c5e3;border-radius:16px;box-shadow:0 12px 32px #533a631f;font-size:14px;line-height:1.6;color:#6e6177}.control-panel h2{font-size:22px;margin:0 0 8px}.control-panel ol,.control-panel ul{padding-left:22px;margin:8px 0}.control-panel li{margin:7px 0}.control-panel p{margin:10px 0}.rule-example{display:inline-block;padding:4px 8px;border-radius:5px;background:#f2eaf8;color:#715187;font-weight:700}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:20px;align-items:start}.game{position:relative;min-width:0;padding:28px 34px 20px;background:#fff;border:1px solid #e6ddeb;border-radius:26px;box-shadow:0 12px 55px #52326209}.game-title{display:flex;flex-direction:column;align-items:center;gap:3px;margin:0;text-align:center;font-family:'Outfit','DM Sans',Arial,sans-serif;letter-spacing:-1px;line-height:1.1}.game-title span:first-child{font-size:clamp(25px,3vw,34px);font-weight:650;color:#382840}.game-title span:last-child{font-size:clamp(20px,2.6vw,29px);font-weight:600;color:#9165a6}.game-intro{text-align:center;font-size:14px;color:#827788;margin:9px 0 20px}.round-heading{min-height:62px;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px}.levelbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:1;min-width:0}.levelbar>div{display:flex;align-items:center;gap:12px;min-width:0}.level-pill{flex:0 0 auto;padding:7px 9px;border-radius:6px;background:#f7f0fb;color:#9a61b7;font-size:11px;font-weight:800;letter-spacing:.4px}.levelbar strong{color:#503d58;font-size:15px;overflow-wrap:anywhere}.levelbar>span{color:#847989;font-size:13px;white-space:nowrap}.clock{display:flex;flex:0 0 auto;flex-direction:column;align-items:center;justify-content:center;width:62px;height:62px;border:4px solid #e9d7f1;border-top-color:#a76bc4;border-radius:50%}.clock strong{font-size:24px;line-height:1;font-variant-numeric:tabular-nums}.clock span{margin-top:4px;font-size:8px;letter-spacing:.5px}.clock.urgent{border-color:#ffe0dc;border-top-color:#e65347;color:#c74336}.clock[hidden]{display:none!important}.board-wrap{position:relative}.column-labels{display:flex;justify-content:space-between;margin:0 0 10px;color:#a097a4;font-size:10px;letter-spacing:1.4px;font-weight:750}.board{position:relative;display:flex;justify-content:space-between;gap:12%;padding:0 0 8px;user-select:none}.column{display:flex;flex-direction:column;gap:10px;width:53%;z-index:1}.answers{width:35%}.fraction-tile{position:relative;display:flex;align-items:center;justify-content:center;min-height:58px;padding:7px 12px;border:2px solid #efe8f2;border-radius:12px;background:#fdfafe;color:#473352;font-family:'Outfit','DM Sans',Arial,sans-serif;font-size:clamp(18px,2.2vw,24px);font-weight:550;line-height:1.1;touch-action:none;transition:background .15s,border-color .15s,box-shadow .15s}.fraction-tile:hover{border-color:#dabde9}.fraction-tile::after{content:'';position:absolute;top:calc(50% - 5px);right:-7px;width:10px;height:10px;border:2px solid #d6c5df;border-radius:50%;background:#fff}.answers .fraction-tile::after{right:auto;left:-7px}.fraction-tile.selected{border-color:#ae70cd;background:#f8f1fc;box-shadow:0 0 0 2px #e8d7ef}.fraction-tile.linked{border-color:#d6bbe3;background:#f8f1fc;color:#7c5191}.fraction-tile.correct{border-color:#78ba92;background:#eff9f0;color:#246846}.fraction-tile.incorrect{border-color:#e7988e;background:#fff1ef;color:#9c453a}.fraction{display:inline-flex;align-items:center;justify-content:center;gap:.18em;white-space:nowrap}.fraction-stack{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;min-width:1.15em;line-height:1}.fraction-stack .numerator{padding:0 .12em .1em}.fraction-stack .denominator{border-top:1.5px solid currentColor;padding:.1em .12em 0}.mixed-whole{margin-right:.05em}.fraction-separator{padding:0 .24em}#lines{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:0}.actions{display:flex;justify-content:flex-end;gap:10px;margin-top:12px}.actions button,.secondary{min-height:40px;padding:8px 16px;border:1px solid #e6ddeb;border-radius:10px;background:white;color:#776281;font-size:13px;font-weight:650}.actions button:disabled{opacity:.4;cursor:default}.actions #backToLevels{margin-right:auto}.primary{display:block;min-height:46px;padding:12px 22px;border:0;border-radius:11px;background:#a763c9;color:white;font-weight:650;box-shadow:0 5px 15px #a763c932}.primary:hover{background:#9350b4}.primary:disabled{opacity:.45;cursor:not-allowed}.primary span{margin-left:18px}.level-progress{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px;margin-top:16px}.progress-level{height:7px;overflow:hidden;border-radius:8px;background:#eee8f1}.progress-level span{display:block;height:100%;width:0;background:#a763c9;transition:width .2s}.progress-level.done span{width:100%;background:#8ac49c}.table-sidebar{min-width:0;padding:20px 19px 18px;border:1px solid #e2d5ec;border-radius:18px;background:#f1eaf6}.table-sidebar h2{margin:0 0 8px;color:#5b406e;font-size:20px}.sidebar-intro{font-size:14px;line-height:1.5;font-weight:650;color:#654875;margin:0 0 13px}.sidebar-intro.flash{animation:reminder-flash .55s ease-in-out 3}@keyframes reminder-flash{50%{background:#e0c5ee;color:#3e2154;box-shadow:0 0 0 5px #e0c5ee;border-radius:4px}}.table-picker{display:flex;flex-direction:column;gap:10px;margin:0;padding:0;border:0}.table-picker>button{align-self:flex-start;min-height:33px;padding:5px 11px;border:1px solid #c6aed8;border-radius:8px;background:#fff;color:#654875;font-size:12px;font-weight:700}.table-grid{display:grid;grid-template-columns:1fr;gap:5px}.table-chip{display:flex;align-items:center;gap:8px;min-height:32px;padding:4px 9px;border:1px solid transparent;border-radius:8px;color:#594666;font-size:13px;cursor:pointer}.table-chip:hover{background:#f8f4fb}.table-chip:has(input:checked){background:#e1d2ee;border-color:#c7aedb;color:#513969}.table-chip input{width:17px;height:17px;margin:0;accent-color:#9161ae}.selection-help{min-height:20px;margin:12px 0 0;color:#654875;font-size:13px;font-weight:700}.selection-help[hidden]{display:none}.selection-help.flash{animation:reminder-flash .55s ease-in-out 3}footer{display:flex;justify-content:flex-start;padding:13px 3px;font-size:11px;line-height:1.6;color:#94879a}.copyright{display:block}.overlay{position:absolute;inset:0;z-index:3;display:flex;align-items:center;justify-content:center;padding:20px;border-radius:25px;background:#ffffffdc;backdrop-filter:blur(5px)}.overlay[hidden]{display:none}.overlay-card{width:min(100%,350px);padding:22px;text-align:center;border:1px solid #eadff0;border-radius:18px;background:#fffefd;box-shadow:0 12px 38px #52326216}.mini-label{font-size:10px;font-weight:800;letter-spacing:1.4px;color:#a36ebd}.overlay-card h2{margin:11px 0 8px;font-family:'Outfit','DM Sans',Arial,sans-serif;font-size:26px;line-height:1.12;color:#473352}.overlay-card p{margin:0 0 16px;color:#87798e;font-size:13px;line-height:1.5}.overlay-card label{display:block;margin:0 0 7px;text-align:left;color:#6e6177;font-size:12px;font-weight:700}.level-choice{width:100%;min-height:43px;margin:0 0 13px;padding:8px 10px;border:1px solid #d9c9e1;border-radius:8px;background:#fff;color:#493953}.overlay-card .primary{width:100%}.overlay-card .primary span{float:right}.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}#resetDialog{width:min(440px,calc(100vw - 32px));max-height:85svh;overflow:auto;padding:24px;border:1px solid #c9b1da;border-radius:16px;color:#53415e;background:#fffefd;box-shadow:0 16px 48px #49315130}#resetDialog::backdrop{background:#30213c77}#resetDialog h2{margin:0 0 12px;font-size:24px}#resetDialog p{line-height:1.55;font-size:14px}#resetDialog>div{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}#resetDialog button{min-height:42px;padding:9px 15px;border:1px solid #c6aed8;border-radius:8px;color:#5b406e;background:#f3edf8;font-weight:650}#resetDialog #confirmReset{background:#e0cdeb}
@media(max-width:900px){main{padding:18px}.game-layout{grid-template-columns:minmax(0,1fr) 210px;gap:14px}.game{padding:24px}.site-home{flex-basis:185px}.top-controls{flex-basis:100%;justify-content:flex-end}.table-sidebar{padding:16px}}
@media(max-width:650px){main{padding:10px}.page-header{gap:8px;margin-bottom:13px}.site-home{flex-basis:180px;max-width:56%}.top-controls{flex-basis:100%;gap:5px;justify-content:flex-end}.top-controls summary,.top-controls>button{min-height:38px;padding:7px 8px;font-size:11px;white-space:normal;flex:1 1 auto}.top-controls #fullscreen{flex:0 0 40px;width:40px;min-width:40px}.control-panel{width:min(460px,calc(100vw - 20px));right:0;padding:14px;font-size:13px}.game-layout{grid-template-columns:1fr;gap:12px}.game{padding:18px 13px 14px;border-radius:20px}.game-intro{margin:7px 0 14px;font-size:12px}.round-heading{min-height:48px;margin-bottom:8px}.levelbar{gap:5px}.levelbar>div{gap:6px}.level-pill{font-size:9px;padding:6px}.levelbar strong{font-size:12px}.levelbar>span{font-size:11px}.clock{width:48px;height:48px;border-width:3px}.clock strong{font-size:18px}.clock span{font-size:7px}.column-labels{font-size:8px;letter-spacing:.8px;margin-bottom:7px}.board{gap:9%;}.column{width:55%;gap:7px}.answers{width:36%}.fraction-tile{min-height:52px;padding:6px 4px;font-size:clamp(16px,5vw,21px);border-radius:9px}.fraction-tile::after{width:8px;height:8px;right:-6px}.answers .fraction-tile::after{left:-6px}.actions{gap:6px;margin-top:9px}.actions button{min-height:37px;padding:7px 10px;font-size:11px}.level-progress{gap:3px;margin-top:12px}.table-sidebar{padding:13px;border-radius:14px}.table-sidebar h2{font-size:17px}.sidebar-intro{font-size:12px;margin-bottom:9px}.table-picker{gap:8px}.table-picker>button{min-height:31px}.table-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}.table-chip{justify-content:flex-start;gap:5px;min-height:34px;padding:4px 5px;font-size:11px}.table-chip input{width:15px;height:15px;flex:0 0 auto}.overlay{padding:12px;border-radius:20px}.overlay-card{padding:18px 15px}.overlay-card h2{font-size:23px}.overlay-card p{font-size:12px}footer{padding:10px 2px;font-size:10px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}.sidebar-intro.flash,.selection-help.flash{animation:none;background:#e0c5ee;outline:2px solid #9b75b5}}
.selection-help{min-height:20px;margin:12px 0 0;color:#654875;font-size:13px;font-weight:700}.selection-help[hidden]{display:none}.game-layout{display:block}
.overlay-card{width:min(100%,680px);max-height:88svh;overflow:auto}.level-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:56svh;overflow:auto;text-align:left;margin:12px 0 14px;padding:2px}.level-option{display:flex;flex-direction:column;gap:6px;min-width:0;padding:10px 12px;border:1px solid #e6ddeb;border-radius:10px;background:#fff;color:#594666;text-align:left}.level-option.selected{border-color:#a763c9;background:#f7f0fb;box-shadow:0 0 0 1px #a763c9}.level-option-heading{display:flex;flex-direction:column;gap:3px}.level-option-heading strong{color:#a36ebd;font-size:10px;letter-spacing:.5px}.level-option-heading b{font-size:13px;line-height:1.25}.level-option-detail{font-size:11px;line-height:1.35;color:#827788}.level-option-score{display:flex;align-items:center;gap:8px;margin-top:auto}.level-option-score small{white-space:nowrap;color:#75677e;font-size:10px}.mini-progress{height:6px;flex:1;overflow:hidden;border-radius:5px;background:#eee8f1}.mini-progress span{display:block;height:100%;border-radius:inherit;background:#a763c9}
@media(max-width:650px){.level-choices{grid-template-columns:1fr;max-height:54svh}.overlay-card{width:min(100%,520px);max-height:91svh;padding:16px}.level-option{padding:9px 10px}}
.completion-banner{display:flex;align-items:center;gap:14px;margin:0 0 14px;padding:12px 16px;border:1px solid #b9ddc5;border-radius:14px;background:#eff9f1;color:#286443}.completion-banner[hidden]{display:none!important}.completion-banner.retry{border-color:#ead7a4;background:#fff9e9;color:#745a19}.completion-icon{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;border-radius:50%;background:#8ac49c;color:#fff;font-size:32px;font-weight:800;line-height:1}.completion-banner.retry .completion-icon{background:#e7c45e;font-size:25px}.completion-copy{display:flex;flex-direction:column;gap:2px}.completion-copy strong{font-size:18px}.completion-copy>span{font-size:13px}.fastest-time{margin:13px 0 6px;color:#75677e;font-size:12px;font-weight:700}.level-progress{align-items:start}.progress-item{min-width:0;text-align:center}.progress-item small{display:block;margin-top:4px;color:#8c8192;font-size:9px;line-height:1}.progress-item .progress-level{height:7px}.progress-item .progress-level span{display:block;height:100%;background:#a763c9;transition:width .2s}.progress-item .progress-level.done span{background:#8ac49c}
.game-title{display:block;margin:0 0 10px;font-size:clamp(25px,3vw,34px);line-height:1.1;color:#382840}.fraction-tabs{display:flex;gap:6px;overflow-x:auto;margin:0 0 14px;padding:3px 1px 7px;scrollbar-width:thin}.fraction-tabs button{flex:0 0 auto;min-height:38px;padding:8px 12px;border:1px solid #d8c7e3;border-radius:10px;background:#f4eef8;color:#665071;font-size:12px;font-weight:650;white-space:nowrap}.fraction-tabs button.active{background:#dac5e9;border-color:#aa87c0;color:#4e3860}.fraction-tab-placeholder{display:grid;place-items:center;min-height:240px;padding:24px;border:1px dashed #d8c7e3;border-radius:16px;background:#faf7fc;color:#715b7b;text-align:center;font-size:16px}.timer-check{display:flex;align-items:center;gap:6px;flex:0 0 auto;color:#695779;font-size:12px;font-weight:700;white-space:nowrap}.timer-check input{width:18px;height:18px;margin:0;accent-color:#9066aa}.level-actions{display:flex;align-items:center;gap:7px}.new-level-button{min-height:42px;padding:9px 16px;border:1px solid #a786be;border-radius:10px;background:#e5d6ef;color:#583d6a;font-weight:750;font-size:14px;white-space:nowrap}.new-level-button:hover{background:#dac5e9}.fullscreen-exit{display:grid;place-items:center;width:42px;height:42px;border:1px solid #a786be;border-radius:10px;background:#e5d6ef;color:#583d6a}.fullscreen-exit[hidden]{display:none!important}.levelbar>div{min-width:0}.levelbar strong{white-space:normal}.level-progress{display:grid}.progress-item .progress-level{overflow:hidden}.fraction-tab-placeholder[hidden],#equivalentPanel[hidden]{display:none!important}
@media(max-width:900px){.game{padding:22px}.fraction-tabs button{font-size:11px;padding:7px 10px}.round-heading{gap:8px}.new-level-button{padding:8px 12px}}
@media(max-width:650px){.game-title{font-size:25px;margin-bottom:8px}.fraction-tabs{margin-bottom:10px}.fraction-tabs button{min-height:35px;font-size:10px;padding:7px 9px}.round-heading{flex-wrap:wrap;justify-content:flex-start}.levelbar{flex-basis:100%;order:3}.timer-check{order:2}.clock{order:1}.new-level-button{min-height:38px;font-size:12px;padding:7px 10px}.fullscreen-exit{width:38px;height:38px}.completion-banner{padding:9px 11px;margin-bottom:9px}.completion-icon{width:38px;height:38px;flex-basis:38px;font-size:28px}.completion-copy strong{font-size:16px}.completion-copy>span{font-size:11px}.fastest-time{font-size:11px}}
html:fullscreen,html:fullscreen body{width:100%;height:100%;overflow:hidden;background:#f7f2fa}html:fullscreen main{display:flex;flex-direction:column;gap:0;width:100%;height:100dvh;max-width:none;margin:0;padding:10px 16px;overflow:hidden}html:fullscreen .page-header,html:fullscreen footer{display:none!important}html:fullscreen .game-layout{display:flex;flex:1;min-height:0;margin:0}html:fullscreen .game{display:flex;flex:1;flex-direction:column;min-height:0;height:100%;padding:10px 20px 12px;border-radius:18px;overflow:hidden}html:fullscreen .game-title{font-size:clamp(22px,2.5vw,30px);margin-bottom:6px}html:fullscreen .fraction-tabs{flex:0 0 auto;margin-bottom:5px}html:fullscreen #equivalentPanel{display:flex;flex:1;flex-direction:column;min-height:0}html:fullscreen .game-intro{margin:4px 0 7px}html:fullscreen .round-heading{flex:0 0 auto;min-height:50px;margin-bottom:5px}html:fullscreen .completion-banner{flex:0 0 auto;padding:7px 12px;margin:0 0 6px}html:fullscreen .completion-icon{width:34px;height:34px;flex-basis:34px;font-size:25px}html:fullscreen .board-wrap{display:flex;flex:1;flex-direction:column;min-height:0}html:fullscreen .board{flex:1;min-height:0;padding-bottom:3px}html:fullscreen .column{justify-content:space-between;gap:4px}html:fullscreen .fraction-tile{min-height:40px;padding:4px 8px;font-size:clamp(18px,2.2vh,23px)}html:fullscreen .actions{flex:0 0 auto;margin-top:5px}html:fullscreen .fastest-time{flex:0 0 auto;margin:6px 0 3px}html:fullscreen .level-progress{flex:0 0 auto;margin-top:3px}html:fullscreen .progress-item small{font-size:9px}html:fullscreen .overlay{position:fixed;z-index:8}html:fullscreen .overlay-card{max-height:92dvh}html:fullscreen .level-actions{position:relative;z-index:9}

.game-layout{grid-template-columns:minmax(0,1fr)}

.attempt-history{margin:10px 0 0}.attempt-history-heading{display:flex;justify-content:space-between;margin-bottom:6px;color:#958a9b;font-size:10px;font-weight:700;letter-spacing:.5px}.attempt-bar{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;height:9px}.attempt-segment{display:block;min-width:0;border-radius:5px;background:#efebf1;border:1px solid #e5e0e8}.attempt-segment.very-fast{background:#73aa86;border-color:#659a78}.attempt-segment.fast{background:#a0cfaf;border-color:#90bf9f}.attempt-segment.correct{background:#d2ebda;border-color:#bedbc7}.attempt-segment.missed{background:#f8dada;border-color:#efc1c1}html:fullscreen .attempt-history{flex:0 0 auto;margin:3px 0 0}html:fullscreen .attempt-history-heading{margin-bottom:4px;font-size:9px}
.level-card-attempts{flex:1;min-width:72px}

.level-option-heading b{color:#8c61a3}.level-option-example{display:block;margin-top:4px;color:#695178;font-weight:650}.level-option-example .fraction-stack{font-size:.95em}html:fullscreen .overlay-card{width:min(1180px,calc(100vw - 32px));max-height:calc(100dvh - 20px);overflow:visible;padding:8px 16px}html:fullscreen .level-choices{grid-template-columns:repeat(3,minmax(0,1fr));max-height:none;overflow:visible;gap:6px;margin:8px 0;padding:0}html:fullscreen .level-option{padding:7px 9px;gap:4px}html:fullscreen .level-option-detail{font-size:10px;line-height:1.25}html:fullscreen .level-option-heading b{font-size:12px}html:fullscreen .level-option-score{gap:5px}html:fullscreen .level-option-score small{font-size:9px}.level-card-attempts{flex:1;min-width:72px}@media(max-width:700px){html:fullscreen .level-choices{grid-template-columns:repeat(2,minmax(0,1fr))}html:fullscreen .level-option-detail{font-size:9px}}@media(max-height:620px) and (min-width:701px){html:fullscreen .level-choices{grid-template-columns:repeat(4,minmax(0,1fr))}html:fullscreen .level-option{padding:5px 7px}html:fullscreen .level-option-detail{font-size:9px}}
.levelbar strong{color:#8c61a3}
@media(max-height:520px) and (max-width:700px){html:fullscreen .level-choices{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}html:fullscreen .level-option{padding:5px 7px;gap:3px}html:fullscreen .level-option-detail{display:none}}
.overlay-card{width:min(100%,1040px);max-height:none;overflow:visible;padding:14px 18px}.level-choices{grid-template-columns:repeat(3,minmax(0,1fr));max-height:none;overflow:visible;gap:7px}.level-option-heading strong{color:#382840;font-size:12px;letter-spacing:.3px}.level-option-example{color:#827788}.level-option-detail{font-size:11px;line-height:1.3}@media(max-width:650px){.overlay-card{padding:8px 7px}.level-choices{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.level-option{padding:7px 8px;gap:4px}.level-option-heading strong{font-size:10px}.level-option-detail{font-size:9px;line-height:1.2}.level-option-score{gap:4px}.level-option-score small{font-size:8px}.level-card-attempts{min-width:54px}}

html:fullscreen .overlay-card{height:calc(100dvh - 20px);max-height:calc(100dvh - 20px);display:flex;flex-direction:column;justify-content:center;overflow:visible}html:fullscreen .overlay-card h2{font-size:clamp(20px,3vh,28px);margin:4px 0}html:fullscreen .overlay-card>p{margin:4px 0;font-size:clamp(10px,1.7vh,13px)}html:fullscreen .level-choices{width:100%;height:min(66dvh,580px);flex:0 0 auto;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));max-height:none;overflow:visible}html:fullscreen .level-option{min-height:0;overflow:hidden}html:fullscreen .level-option-example{font-size:10px}@media(max-height:520px){html:fullscreen .level-choices{height:65dvh}html:fullscreen .level-option-example{display:none}html:fullscreen .level-option-detail{font-size:9px}}
.fraction-tabs{flex-wrap:wrap;overflow:visible}.fraction-tabs button{flex:0 1 auto;white-space:normal}
.fraction-tabs button{background:#eff7ef;border-color:#c9dfc9;color:#45634a}
.fraction-tabs button:hover{background:#e5f1e5;border-color:#a9c9ab}
.fraction-tabs button.active{background:#dceedd;border-color:#9bc49e;color:#31563a}
.answers{align-self:center}
.overlay{inset:var(--level-overlay-top,0px) 0 0}
.overlay-card{max-height:100%;overflow:auto}
.level-choices{grid-template-columns:repeat(2,minmax(0,1fr));max-height:100%}
html:fullscreen .overlay{position:absolute;z-index:8}
html:fullscreen .overlay-card{height:100%;max-height:100%;padding:8px 12px;overflow:hidden}
html:fullscreen .level-choices{width:100%;height:auto;flex:1;min-height:0;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(var(--choice-row-count,3),minmax(0,1fr));max-height:none;overflow:visible;margin:4px 0;padding:0}
.level-choices.mixed-directions{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));grid-auto-flow:column}
html:fullscreen .level-choices.mixed-directions{grid-template-rows:repeat(3,minmax(0,1fr));grid-auto-flow:column}
/* The level picker begins just below the activity tabs instead of floating mid-panel. */
html:not(:fullscreen) .overlay{align-items:flex-start;padding-top:12px}
.fraction-tabs{position:relative;z-index:10}
.overlay{background:#fff}
.fraction-tile{height:72px;min-height:72px}
html:fullscreen .fraction-tile{height:clamp(52px,7vh,72px);min-height:clamp(52px,7vh,72px)}
.board{align-items:stretch}
.column{justify-content:space-between}
.answers{align-self:stretch}
.fraction-tabs{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden}
.fraction-tabs button{flex:0 0 auto;white-space:nowrap}
html:fullscreen .fraction-tabs button{min-height:40px;padding:8px 12.6px;font-size:13.23px}
html:fullscreen .level-option-heading strong{font-size:24px;line-height:1.15}
html:fullscreen .level-option-heading b{font-size:26px;line-height:1.2}
html:fullscreen .level-option-detail{font-size:20px;line-height:1.25}
html:fullscreen .level-option-example{font-size:20px}
html:fullscreen .level-option-score small{font-size:18px}
html:fullscreen .level-option{gap:4px;overflow:auto}
/* Keep the six activity tabs in one evenly sized row across the game panel. */
html:fullscreen .fraction-tabs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));width:100%;gap:8px;overflow:visible;align-items:stretch}
html:fullscreen .fraction-tabs button{display:flex;align-items:center;justify-content:center;min-width:0;min-height:58px;height:auto;padding:8px 6px;font-size:clamp(13px,1.35vw,19px);line-height:1.15;text-align:center;white-space:normal;overflow-wrap:anywhere}
@media(max-width:700px){html:fullscreen .fraction-tabs{gap:4px}html:fullscreen .fraction-tabs button{min-height:50px;padding:5px 2px;font-size:clamp(8px,1.8vw,13px);line-height:1.1}}

html:fullscreen [data-mode='multiply'] .level-choices,html:fullscreen [data-mode='divide'] .level-choices,html:fullscreen [data-mode='addsub'] .level-choices{grid-template-rows:repeat(3,minmax(0,1fr))}

/* Full-screen level cards: slightly smaller on larger screens and compact on phones. */
html:fullscreen .level-option{gap:4px;overflow:hidden}
html:fullscreen .level-option-heading strong{font-size:21.6px;line-height:1.15}
html:fullscreen .level-option-heading b{font-size:23.4px;line-height:1.2}
html:fullscreen .level-option-detail{font-size:18px;line-height:1.25}
html:fullscreen .level-option-example{font-size:18px}
html:fullscreen .level-option-score small{font-size:16.2px}
@media(max-width:700px){
  html:fullscreen .overlay-card{padding:5px 7px}
  html:fullscreen .level-choices{gap:4px}
  html:fullscreen .level-option{padding:5px 6px;gap:3px}
  html:fullscreen .level-option-heading strong{font-size:16px;line-height:1.1}
  html:fullscreen .level-option-heading b{font-size:17px;line-height:1.1}
  html:fullscreen .level-option-detail{font-size:12px;line-height:1.15}
  html:fullscreen .level-option-example{font-size:12px}
  html:fullscreen .level-option-score{gap:3px}
  html:fullscreen .level-option-score small{font-size:10px}
  html:fullscreen .level-card-attempts{min-width:38px}
}
