@font-face{font-family:Outfit;font-style:normal;font-weight:100 900;src:url('/assets/outfit-latin.woff2') format('woff2');font-display:swap}*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:#f6f3ec;color:#24352e;font:16px/1.45 Outfit,system-ui,sans-serif}body{--game-accent:#25796a;--wash:#e9eee6;background-image:radial-gradient(ellipse at 80% 12%,#dee8db88,transparent 55%)}button,a{-webkit-tap-highlight-color:transparent;touch-action:manipulation}button{font:inherit;color:inherit;background:#fffcf6;border:1px solid #cbd5ca;border-radius:13px;min-height:44px;padding:9px 14px;cursor:pointer}button:hover:not(:disabled){border-color:var(--game-accent)}button:disabled{opacity:.42;cursor:default}a{color:var(--game-accent)}[hidden]{display:none!important}:focus-visible{outline:3px solid var(--game-accent);outline-offset:3px}.math-header{height:78px;max-width:1120px;margin:auto;padding:16px 28px;display:flex;align-items:center;justify-content:space-between;gap:12px}.math-brand{font-size:25px;letter-spacing:-1px;text-decoration:none;color:#24352e;font-weight:500;white-space:nowrap}.math-brand span{color:var(--game-accent);margin-right:8px}.math-header nav{display:flex;gap:7px}.math-header nav button{background:transparent}#help-open{width:44px;padding:0;font-size:20px}.math-shell{max-width:1064px;margin:26px auto 24px;padding:0 28px;display:grid;grid-template-columns:270px minmax(0,1fr);gap:52px;align-items:start}.math-sidebar h1{font-size:32px;line-height:1.1;font-weight:500;letter-spacing:-1px;margin:8px 0 14px}.math-category{font-size:11px;letter-spacing:1.8px;text-decoration:none}.eyebrow{font-size:11px;letter-spacing:1.5px;color:#59685b;text-transform:uppercase;margin:22px 0 8px}#mission-brief{color:#59685b;font-size:15px;margin:0 0 22px}.score-line{display:flex;align-items:baseline;gap:7px;flex-wrap:wrap;color:#59685b;font-size:12px}.score-line strong{font-size:25px;font-weight:500;color:#24352e}.score-line small{font-size:11px}#math-live{min-height:66px;font-size:14px;color:#435747;margin:16px 0 18px}.math-actions{display:flex;gap:6px;flex-wrap:wrap}.math-actions button{font-size:13px;padding:8px 12px}.math-actions small{font-size:10px;display:block;color:#59685b}.save-note{font-size:12px;color:#59685b;margin:14px 0}.collection-back{font-size:13px;text-decoration:none}.math-play{position:relative;min-width:0;border:1px solid #d7dfd3;border-radius:30px;padding:26px;background:#fffdf7c9;box-shadow:0 16px 60px #36473409;min-height:390px}.math-objective{display:flex;justify-content:center;align-items:center;gap:14px;margin-bottom:18px;min-height:44px;text-align:center;font-size:16px;color:#52624f}.math-objective strong{font-size:32px;line-height:1.1;color:#24352e;font-weight:500}.math-objective .value-box{display:grid;gap:3px;min-width:80px}.math-objective small{font-size:11px;letter-spacing:1px;text-transform:uppercase}.math-board{width:100%;max-width:480px;margin:0 auto}.tile-grid{display:grid;gap:9px;touch-action:none;user-select:none}.number-tile{aspect-ratio:1;border-radius:17px;min-height:44px;padding:0;font-size:clamp(22px,3vw,34px);background:#f0f3e9;border-color:#dce4d3;transition:background .12s,transform .12s,box-shadow .12s}.number-tile.selected{background:var(--game-accent);color:white;border-color:var(--game-accent);transform:scale(.95)}.number-tile.hinted{box-shadow:inset 0 0 0 3px var(--game-accent)}.number-tile.over{background:#a64036;color:white}.number-tile.fresh{animation:tile-arrive .22s ease-out}@keyframes tile-arrive{from{opacity:.45;transform:scale(.84)}to{opacity:1;transform:scale(1)}}.selection-note{text-align:center;font-size:12px;color:#59685b;margin:14px 0 0;min-height:18px}.math-primary{background:var(--game-accent);color:#fff;border-color:transparent;min-height:48px;padding:11px 20px;border-radius:14px;font-weight:500}.math-primary:hover:not(:disabled){filter:brightness(1.08)}.route-board{position:relative;display:grid;gap:12px}.route-row{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;position:relative;z-index:1}.route-tile{font-size:21px;min-height:48px;padding:7px;background:#faf8f1}.route-tile.current{border:2px solid var(--game-accent);background:#f0ebf7}.route-tile.chosen{background:var(--game-accent);color:#fff;opacity:1}.route-tile.hinted{box-shadow:0 0 0 3px #d8caec}.route-links{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}.scale{min-height:180px;position:relative;padding-top:16px;margin-bottom:24px;display:grid;grid-template-columns:1fr 1fr;gap:35px}.scale:before{content:'';position:absolute;left:16%;right:16%;top:23px;height:4px;border-radius:4px;background:var(--game-accent);transform:rotate(var(--tilt,0deg));transition:transform .24s}.scale:after{content:'';position:absolute;left:calc(50% - 13px);top:29px;width:26px;height:56px;background:#d6c6ab;clip-path:polygon(50% 0,100% 100%,0 100%)}.pan{position:relative;z-index:1;border-bottom:4px solid #b99c78;border-radius:0 0 24px 24px;background:#eee6d67a;text-align:center;min-height:138px;padding:20px 8px 10px;transform:translateY(var(--drop,0px));transition:transform .24s}.pan strong{display:block;font-size:32px;font-weight:500}.pan small{color:#5a6052;font-size:12px}.pan-items{display:flex;justify-content:center;gap:5px;flex-wrap:wrap;margin-top:10px}.pan-items button{min-width:44px;font-size:15px;padding:4px 8px;background:#fff9ef}.weight-tray{display:flex;justify-content:center;flex-wrap:wrap;gap:9px;touch-action:none}.weight{min-width:64px;min-height:62px;font-size:25px;border-radius:16px;background:#f3e6d5;border-color:#d9c3a5;cursor:grab}.weight.placed{background:#ede9df;opacity:.45}.weight.hinted{outline:3px solid var(--game-accent)}.token-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;min-height:190px}.token{position:relative;min-height:90px;display:grid;align-content:center;gap:8px;padding:14px 10px;border-radius:20px;background:#eaf0f3;border:2px solid transparent}.token strong{font-size:32px;line-height:1}.token small{font-size:12px;overflow-wrap:anywhere;color:#4b6269}.token.selected{border-color:var(--game-accent);box-shadow:0 0 0 3px #d6e2eb}.token.hinted{outline:3px solid #a3bed2}.selection-order{position:absolute;top:6px;left:8px;font-size:11px;color:var(--game-accent)}.operation-row{display:flex;gap:7px;justify-content:center;margin-top:18px}.operation-row button{font-size:24px;min-width:48px;padding:4px 12px}.operation-row button[aria-pressed=true]{background:var(--game-accent);color:#fff}#pair-preview{font-size:14px;text-align:center;min-height:21px;margin:12px 0}#combine{display:block;min-width:220px;margin:auto}.math-result{text-align:center;padding:24px 10px}.math-result h2{font-size:31px;letter-spacing:-1px;font-weight:500}.math-result>strong{font-size:66px;font-weight:500;letter-spacing:-2px}.math-result>span{color:#59685b;font-size:13px}#result-stars{font-size:34px;letter-spacing:5px;color:var(--game-accent);margin:4px 0}#result-detail{font-size:14px;overflow-wrap:anywhere;color:#4b5b4d}.math-result .math-primary{min-width:200px;margin:12px auto}.result-actions{display:flex;justify-content:center;gap:8px;flex-wrap:wrap}#share-status{font-size:12px}.pause-screen{position:absolute;inset:0;border-radius:inherit;z-index:8;background:#f6f3ecf5;display:flex;align-items:center;justify-content:center;flex-direction:column}.pause-screen h2{font-size:26px;font-weight:500}dialog{color:#24352e;background:#fffdf7;border:1px solid #d7dfd3;border-radius:24px;width:min(620px,calc(100vw - 24px));max-height:calc(100dvh - 28px);padding:24px;overflow:auto;overscroll-behavior:contain}dialog::backdrop{background:#132d28aa;backdrop-filter:blur(5px)}.dialog-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.dialog-heading h2{font-size:28px;font-weight:500;letter-spacing:-1px;margin:0}.dialog-heading button,.account-close{min-width:44px;padding:0;font-size:24px}.account-close{float:right}dialog p{font-size:15px;color:#52624f}.help-options{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:20px 0}.math-levels{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.math-levels button{display:grid;gap:5px;min-height:65px;padding:7px 4px}.math-levels small{font-size:10px}.math-levels .selected{border:2px solid var(--game-accent)}.no-script{padding:30px}
@media(max-width:700px){.math-header{height:64px;padding:10px 14px}.math-brand{font-size:22px}.math-brand span{display:none}.math-header nav{gap:5px}.math-header nav button{font-size:12px;padding:7px 10px}.math-shell{display:flex;flex-direction:column;gap:14px;margin:12px auto 16px;padding:0 14px;max-width:530px}.math-sidebar{display:contents}.puzzle-meta{order:0;width:100%}.math-category{display:none}.eyebrow{margin:0 0 5px;font-size:9px}.math-sidebar h1{font-size:25px;margin:0 0 5px}.math-sidebar #mission-brief{font-size:13px;margin:0 0 5px}.score-line{font-size:11px;gap:5px}.score-line strong{font-size:19px}#math-live{font-size:13px;min-height:20px;margin:5px 0 0}.math-play{order:1;width:100%;padding:18px;border-radius:24px;min-height:260px}.math-actions{order:2;justify-content:center;width:100%;gap:8px}.math-actions button{min-width:74px}.save-note{order:3;margin:0;font-size:11px;text-align:center;width:100%}.collection-back{order:4;align-self:center;font-size:12px}.math-objective{margin-bottom:13px;gap:10px;min-height:34px}.math-objective strong{font-size:27px}.number-tile{font-size:28px;border-radius:14px}.tile-grid{gap:7px}.route-tile{font-size:19px}.scale{gap:26px;min-height:165px;margin-bottom:12px}.weight{min-width:54px;min-height:54px;font-size:24px}.token-grid{min-height:164px;gap:10px}.token{min-height:78px}.token strong{font-size:29px}.operation-row{margin-top:14px}.operation-row button{min-width:44px;padding:4px 10px}#combine{min-height:44px}.math-result{padding:5px}.math-result h2{font-size:27px}.math-result>strong{font-size:55px}}
@media(max-height:720px) and (max-width:700px){.math-header{height:54px;padding-top:5px;padding-bottom:5px}.math-shell{margin-top:5px;gap:8px}.math-sidebar h1{font-size:20px}.math-sidebar #mission-brief{display:none}.puzzle-meta .eyebrow{display:inline-block;margin:0 8px 3px 0}.score-line{display:inline-flex}.score-line strong{font-size:16px}.score-line small{display:none}#math-live{font-size:12px;line-height:1.3;min-height:16px;margin:2px 0}.math-play{padding:12px;min-height:230px}.math-objective{margin-bottom:8px}.math-objective strong{font-size:24px}.tile-grid{max-width:244px;margin:auto;gap:5px}.number-tile{font-size:24px}.route-board{gap:6px}.route-tile{min-height:44px;padding:5px}.math-actions button{padding:5px 10px}.collection-back{display:none}.selection-note{margin-top:6px;min-height:0}.token-grid{min-height:136px;gap:7px}.token{min-height:64px;padding:10px 6px}.token strong{font-size:26px}.token small{font-size:11px}.operation-row{margin-top:9px}#pair-preview{margin:6px 0;font-size:12px}.scale{min-height:135px;margin-bottom:8px}.pan{min-height:112px;padding:14px 5px 7px}.pan strong{font-size:27px}.weight{min-height:44px;min-width:44px;font-size:22px}.weight-tray{gap:6px}.math-result .eyebrow{margin-top:8px}.math-result h2{margin:12px 0}}
@media(max-width:360px){.math-header{padding-left:12px;padding-right:12px}.math-brand{font-size:20px}.math-header nav button{padding:6px 8px}.math-shell{padding:0 10px}.math-play{padding:10px}.number-tile{min-height:44px}.math-objective{font-size:14px}.weight{min-width:46px}.route-row{gap:10px}.operation-row{gap:5px}.operation-row button{padding:4px 8px}}
@media(min-width:701px) and (max-height:600px){.math-header{height:54px;padding:5px 20px}.math-shell{margin:8px auto;padding:0 18px;grid-template-columns:215px minmax(0,1fr);gap:24px;max-width:980px}.math-sidebar h1{font-size:23px;margin-bottom:6px}.math-sidebar #mission-brief{display:none}.puzzle-meta .eyebrow{margin:10px 0 5px}.math-category{font-size:9px}.score-line strong{font-size:20px}#math-live{min-height:48px;font-size:12px;margin:7px 0}.math-actions{gap:4px}.math-actions button{font-size:12px;padding:5px 8px}.save-note{font-size:10px;margin:9px 0}.collection-back{font-size:11px}.math-play{padding:8px 16px;min-height:270px;border-radius:20px}.math-objective{margin-bottom:6px;min-height:30px;font-size:13px}.math-objective strong{font-size:23px}.math-objective small{font-size:9px}.tile-grid{max-width:244px;margin:auto;gap:4px}.number-tile{font-size:23px;border-radius:10px}.selection-note{margin-top:4px;font-size:10px;min-height:0}.route-board{gap:4px}.route-tile{min-height:44px;padding:3px;font-size:18px}.token-grid{min-height:126px;gap:7px}.token{min-height:60px;padding:8px}.token strong{font-size:25px}.token small{font-size:10px}.operation-row{margin-top:7px}.operation-row button{min-width:44px;min-height:44px;font-size:22px;padding:2px 8px}#pair-preview{font-size:12px;margin:4px 0}#combine{min-height:44px;padding:5px 16px}.scale{min-height:133px;margin:0 0 8px}.pan{min-height:110px;padding-top:17px}.pan strong{font-size:26px}.pan-items{margin-top:4px}.pan-items button{padding:2px 7px}.weight{min-width:44px;min-height:44px;font-size:21px}.weight-tray{gap:5px}.math-result{padding:0}.math-result .eyebrow{margin:8px 0}.math-result h2{font-size:24px;margin:10px 0}.math-result>strong{font-size:45px}.math-result #result-stars{font-size:27px}.math-result .math-primary{margin:6px 0}#result-detail{margin:8px 0}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

@media(max-height:720px) and (max-width:700px){body[data-math="daily-24"] #selection-note{display:none}}

#result-stars{font-family:Arial,system-ui,sans-serif}.math-brand span{display:inline-flex;vertical-align:middle}@media(max-width:700px){.math-brand span{display:none}}
body[data-complete] .math-actions,body[data-complete] #math-live{display:none}.math-result{padding:12px 6px}.math-result .eyebrow{display:none}.math-result h2{font-size:27px;line-height:1.15;margin:6px 0 12px}.math-result>strong{font-size:58px;line-height:1.1}.math-result #result-stars{font-size:29px;line-height:1.2;margin:8px 0}.math-result #result-detail{font-size:13px;line-height:1.4;margin:8px 0}.math-result .math-primary{min-height:44px;margin:8px auto}.math-result #share-status:empty{display:none}
@media(max-height:720px){.math-result{padding:4px}.math-result h2{font-size:22px;margin:4px 0 8px}.math-result>strong{font-size:44px}.math-result #result-stars{font-size:25px;margin:6px 0}.math-result #result-detail{font-size:12px;margin:5px 0}.math-result .math-primary{margin:6px auto;padding:8px 16px}.math-result .result-actions button{font-size:13px;padding:7px 13px}}

/* Compact pans avoid duplicating the tray controls on short screens. */
.pan-count{display:none}
@media(max-height:720px) and (max-width:700px){
 .math-shell{gap:3px;margin-bottom:3px}
 body[data-math="balance-lab"] .scale{min-height:114px;padding-top:14px;gap:20px}
 body[data-math="balance-lab"] .pan{min-height:94px;padding:12px 5px 7px;border-radius:0 0 18px 18px}
 body[data-math="balance-lab"] .pan strong{font-size:25px}
}
@media(max-height:720px) and (max-width:700px),(max-height:600px) and (min-width:701px){
 .pan-items{display:none}
 .pan-count{display:block;margin-top:4px}
 .weight.placed{opacity:1;border-style:dashed;border-color:var(--game-accent)}
}
@media(min-width:701px) and (max-height:600px){.math-shell{margin:4px auto 0}}

/* Ceramic pieces on a paper board: depth stays still while the player thinks. */
html { color-scheme:light }
body { -webkit-font-smoothing:antialiased;font-synthesis:none }
.math-header { border-bottom:1px solid #51664720 }
.math-brand { font-weight:550 }
.math-play {
  background:radial-gradient(ellipse at 50% 0,#fffefa,transparent 85%),#fffdf6;
  border-color:#d2d9cb;
  box-shadow:0 24px 70px #354a2b0a,0 3px 8px #354a2b06,inset 0 1px 0 #fff
}
.math-objective { font-variant-numeric:tabular-nums }
.math-objective .value-box small { letter-spacing:.14em }
.math-objective strong { font-weight:550 }
.number-tile {
  background:linear-gradient(155deg,#f8faf1,#e8eddf);
  border-color:#d4ddca;
  box-shadow:inset 0 1px 0 #fff,0 3px 0 #d5ddcb,0 5px 10px #3b4b2f08;
  font-weight:500;
  font-variant-numeric:tabular-nums
}
.number-tile.selected {
  background:linear-gradient(145deg,color-mix(in srgb,var(--game-accent),white 10%),var(--game-accent));
  box-shadow:inset 0 1px 0 #ffffff30,0 2px 0 color-mix(in srgb,var(--game-accent),black 20%),0 5px 12px #233e2d18
}
.number-tile.over { background:linear-gradient(140deg,#bb5a4b,#9e3b32);border-color:#9e3b32;box-shadow:inset 0 1px 0 #fff3,0 2px 0 #792f28 }
.route-tile { background:linear-gradient(155deg,#fffef8,#f0ece1);box-shadow:inset 0 1px 0 #fff,0 2px 0 #d9d7ca }
.route-tile.current { background:linear-gradient(145deg,#faf6ff,#ece4f4);box-shadow:0 3px 10px #634c7b12 }
.route-tile.chosen { background:linear-gradient(145deg,color-mix(in srgb,var(--game-accent),white 10%),var(--game-accent));box-shadow:inset 0 1px 0 #fff3,0 2px 0 color-mix(in srgb,var(--game-accent),black 20%) }
.weight { background:linear-gradient(135deg,#fff0db,#e8d3b5);box-shadow:inset 0 1px 0 #fff9,0 3px 0 #cbb393,0 6px 12px #50341a0a;font-weight:500 }
.weight.placed { background:#ede9df;box-shadow:inset 0 1px 3px #75634715 }
.pan { background:linear-gradient(180deg,#f8f1e436,#e7dcc6a8);box-shadow:0 7px 12px #80664109 }
.token { background:linear-gradient(145deg,#f0f6f8,#e0ebef);border-color:#cbdce3;box-shadow:inset 0 1px 0 #fff,0 3px 0 #c6d6dd,0 6px 14px #23465908 }
.token.selected { background:linear-gradient(145deg,#edf5fa,#dceaf2);box-shadow:inset 0 1px 0 #fff,0 0 0 3px #d6e2eb,0 3px 0 #bdcfd9 }
.math-primary { background:linear-gradient(135deg,color-mix(in srgb,var(--game-accent),white 8%),var(--game-accent));box-shadow:inset 0 1px 0 #ffffff40,0 3px 8px #223f2e16 }
.math-levels button.selected { background:var(--wash);box-shadow:inset 0 1px 0 #fff8 }
.math-result>strong { color:var(--game-accent);font-variant-numeric:tabular-nums }
.math-result #result-stars { color:var(--game-accent);text-shadow:0 2px 0 #4c64300b }
.math-actions button { box-shadow:inset 0 1px 0 #fff9,0 2px 4px #25412705 }
@media(hover:hover) {
  .number-tile:hover:not(:disabled):not(.selected) { background:linear-gradient(145deg,#fffffa,#eaf1dd);border-color:var(--game-accent) }
  .weight:hover:not(:disabled) { border-color:var(--game-accent) }
}

@media(max-height:720px) and (max-width:700px){
 body[data-math="daily-24"] .math-objective{margin-bottom:6px}
 body[data-math="daily-24"] .operation-row{margin-top:6px}
 body[data-math="daily-24"] #pair-preview{margin:4px 0}
}
body[data-complete] .math-actions{display:flex}
body[data-complete] .math-actions>button{display:none}
@media(min-width:701px) and (max-height:600px){
 .math-actions button{padding-inline:6px}
 .weight{padding:5px 8px}
}

/* The puzzle and its controls are the main surface. */
.math-header{border-bottom:1px solid #1c382326;background:transparent;box-shadow:none}
.math-header nav button{min-width:44px;min-height:44px}
.math-header #help-open{width:auto;padding-inline:10px}
.math-play{box-shadow:none;border-radius:14px}
.math-sidebar h1{letter-spacing:-.035em;line-height:1.08}
.math-actions button{min-height:44px;border-radius:9px;box-shadow:none}
.math-primary{box-shadow:none}
.math-actions #hint small{white-space:nowrap}
@media(max-width:700px){
 .math-header{gap:5px}
 .math-brand{font-size:clamp(16px,4.6vw,21px);line-height:1.1}
 .math-header nav button{padding-inline:7px}
 .math-header #help-open{padding-inline:7px}
 .math-play{border-radius:12px}
}

.math-header #help-open{font-size:13px}

@media(max-width:700px) and (max-height:720px){
 .math-header{height:51px;padding-block:3px}
 .math-shell{margin-block:4px 0;gap:6px}
 .math-play{padding-block:9px}
 #math-live{min-height:0}
}
