/* Number Rescue: a small midnight workshop, scoped away from existing games. */
#arithmetic{--ar-mint:#9cebd1;--ar-gold:#f5d599;--ar-muted:#a4b7c8;align-items:stretch;text-align:left;color:#f8f1df;overflow:auto;overscroll-behavior:contain;border:1px solid #314656;border-radius:24px;background:radial-gradient(ellipse at 80% 15%,#23404b90,transparent 50%),linear-gradient(150deg,#172c3b,#0d1a2b 70%);scrollbar-width:thin;isolation:isolate}
.ar-page{width:100%;min-height:100%;padding:0 20px 22px;background-image:radial-gradient(#7c9ca212 .8px,transparent .8px);background-size:16px 16px}
#arithmetic button{font:inherit;cursor:pointer;touch-action:manipulation;-webkit-appearance:none}
#arithmetic button:disabled{cursor:default;opacity:.55}#arithmetic button:focus-visible,#arithmetic summary:focus-visible{outline:3px solid #ffe4a9;outline-offset:4px}#arithmetic h1:focus,#arithmetic h2:focus{outline:none}
.ar-nav{display:flex;align-items:center;justify-content:space-between;gap:6px;border-bottom:1px solid #79949b30;padding:9px 0;margin-bottom:24px}.ar-nav>span{font:700 9px/1.4 sans-serif;letter-spacing:1.7px;color:#acc1cb}.ar-back{background:none;color:#d1e0e4;border:0;min-height:44px;padding:0 8px 0 0;font-size:12px!important}.ar-nav i{width:6px;height:6px;border-radius:50%;background:var(--ar-mint);box-shadow:0 0 10px #9cebd155}
.ar-eyebrow{font:700 10px/1.5 sans-serif;letter-spacing:2px;color:var(--ar-mint)}.ar-title{font-size:38px;line-height:1.35;letter-spacing:2px;margin:9px 0 4px;font-weight:900}.ar-title em{font-style:normal;color:var(--ar-gold)}.ar-intro{font-size:12px;color:var(--ar-muted);line-height:1.9;margin:6px 0}
.ar-hero{position:relative;margin:0 -13px -4px}.ar-bomb-art{display:block;width:100%;max-height:246px}.ar-hero-label{position:absolute;left:9px;bottom:17px;font:700 9px sans-serif;letter-spacing:1.4px;color:#aec0c9}.ar-hero-label:before{content:'';display:inline-block;width:14px;height:1px;background:var(--ar-mint);vertical-align:middle;margin-right:8px}.ar-hero-label small{display:block;margin:6px 0 0 22px;color:#8198aa;font-size:8px;letter-spacing:1px}
.ar-bomb-float{animation:ar-float 4s ease-in-out infinite;transform-origin:180px 150px}.ar-spark{animation:ar-spark 1.4s ease-in-out infinite;transform-origin:211px 23px}.ar-orbit{animation:ar-float 6s ease-in-out infinite}
.ar-mission{border:1px solid #50616d;border-radius:17px;overflow:hidden;margin:5px 0 18px;background:#ffffff04}.ar-mission-head{display:flex;justify-content:space-between;background:#8aafae0d;padding:11px 14px;font-size:10px;letter-spacing:1px;color:#cfdbdc;border-bottom:1px solid #50616d}.ar-mission-head b{color:var(--ar-gold);font-weight:700}.ar-specs{display:grid;grid-template-columns:repeat(3,1fr);padding:16px 5px}.ar-specs>div{text-align:center;border-right:1px solid #50616d}.ar-specs>div:last-child{border:0}.ar-specs b{font:600 27px/1.2 Fredoka,sans-serif;display:block;color:#f7ebd2}.ar-specs span{font-size:10px;display:block;color:#b5c5cf;margin-top:6px}
.ar-main,.ar-secondary{width:100%;min-height:53px;border-radius:13px;padding:14px 10px;font-size:14px!important;font-weight:900!important;letter-spacing:1px}.ar-main{background:linear-gradient(135deg,#baf4d9,#81d8bd);color:#173f39;border:1px solid #d0ffe7;box-shadow:0 4px 0 #416e65,0 9px 25px #08111b55;margin:4px 0 12px}.ar-main:active{transform:translateY(2px);box-shadow:0 2px 0 #416e65}.ar-main:after{content:' →';margin-left:10px}.ar-secondary{background:#233b4d;color:#d9e7e8;border:1px solid #5a7687;margin-top:10px}.ar-fine{font-size:10px;line-height:1.9;color:var(--ar-muted);text-align:center;margin:12px 0}.ar-fine strong{color:var(--ar-gold)}.ar-history{border-top:1px solid #6c939538;margin-top:20px;padding-top:16px;font-size:12px;color:#b6cbd4}.ar-history summary{cursor:pointer;min-height:35px}.ar-history>div{display:flex;justify-content:space-between;border-top:1px dashed #405363;padding:10px 0;font-size:11px}.ar-notice{border:1px solid #b79960;border-radius:12px;padding:14px;font-size:12px;line-height:1.8;color:#f2dba9;background:#5b4a211f}
.ar-status{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#abc1cc}.ar-status b{font:600 24px Fredoka,sans-serif;color:#f5e8cf}.ar-status b small{font-size:13px;color:#91a9b8}.ar-path{display:grid;grid-template-columns:repeat(10,1fr);gap:5px;margin:13px 0 22px;padding:0;list-style:none}.ar-path li{height:5px;border-radius:5px;background:#314556}.ar-path .current{background:#f5d599;box-shadow:0 0 8px #f5d533}.ar-path .right{background:var(--ar-mint)}.ar-path .wrong{background:#d5a887}
.ar-equation{text-align:center;font:600 clamp(37px,10vw,49px)/1.3 Fredoka,sans-serif;letter-spacing:1px;margin:10px -8px 6px;color:#fff1d6;white-space:nowrap}.ar-equation .ar-op{color:var(--ar-mint)}.ar-equation .ar-q{color:#b6c8d1}.ar-type{text-align:center;font-size:10px;letter-spacing:2px;color:#adc6c8;margin:8px 0 23px}.ar-answers{display:grid;grid-template-columns:1fr 1fr;gap:12px}.ar-choice{position:relative;min-height:78px;border:1px solid #69818e;border-bottom:4px solid #304757;border-radius:15px;background:linear-gradient(150deg,#344f60,#213649);color:#f9f2df;font:600 32px Fredoka,sans-serif!important;box-shadow:0 5px 14px #060f1f30}.ar-choice small{position:absolute;top:9px;left:12px;font:700 9px sans-serif;color:#9ebbc3}.ar-choice:active{transform:translateY(2px);border-bottom-width:2px}.ar-choice:hover{background:#395b69;border-color:#92becc}
.ar-fuse{height:39px;display:flex;gap:10px;align-items:center;justify-content:center;margin-top:13px;color:#c9b385;font-size:10px;letter-spacing:.8px}.ar-fuse span{width:48px;border-top:2px dashed #bd9c62}.ar-feedback-badge{display:grid;place-items:center;width:72px;height:72px;margin:9px auto 16px;border:1px solid #82d5b8;border-radius:50%;font:40px Fredoka,sans-serif;color:var(--ar-mint);background:#8bdfbd14;box-shadow:0 0 0 8px #8bdfbd08;animation:ar-arrive .5s ease}.ar-feedback-badge.learn{color:var(--ar-gold);border-color:#c1a775;background:#c1a77510}.ar-feedback-title{text-align:center;font-size:23px;line-height:1.5;margin:15px 0 10px}.ar-result-eq{border-bottom:1px solid #658b8d40;padding-bottom:20px;margin-bottom:20px}.ar-note{padding:17px 16px;background:#cfe6d309;border:1px solid #68897e70;border-radius:14px;margin:18px 0}.ar-note>span{font-size:10px;color:var(--ar-mint);letter-spacing:1px}.ar-note h3{font-size:14px;color:#e7eacb;margin:8px 0 12px}.ar-step{display:flex;align-items:center;gap:9px;font-size:12px;line-height:1.7;margin:9px 0;color:#e0e9dc}.ar-step i{font:600 12px Fredoka,sans-serif;flex-shrink:0;border:1px solid #6d9488;width:23px;height:23px;display:grid;place-items:center;border-radius:50%;color:var(--ar-mint)}.ar-note p{font-size:11px;line-height:1.85;color:#adbec5;margin:10px 0}
.ar-final{font:600 77px/1.2 Fredoka,sans-serif;color:#fae5b7;text-align:center;margin:12px 0}.ar-final small{font-size:25px;color:#93aebb}.ar-award{display:flex;flex-direction:column;gap:8px;align-items:center;padding:20px;margin:22px 0;border:1px solid #8f815c;border-radius:15px;background:#bb994c0c}.ar-award strong{font-size:26px;color:var(--ar-gold)}.ar-award span{font-size:11px;color:#c5cec9}.ar-round-review{margin:17px 0;font-size:12px;color:#b2c9ce}.ar-round-review summary{padding:13px 0;cursor:pointer}.ar-round-review>div{padding:12px;border-top:1px solid #51687150;font-size:11px;line-height:1.9}.ar-round-review b{color:#eee7ce}
#openArithmetic{border-color:#698e91;background:linear-gradient(125deg,#244b50,#1b2f48)}#openArithmetic .arithmetic-ic{background:linear-gradient(150deg,#bfead6,#73baac);color:#193b40;font:600 37px Fredoka,sans-serif}#openArithmetic .who small{font-size:10px;color:#bdd6cc}#openArithmeticScores{min-height:44px;width:100%;background:#254952;color:#d1eadd;border:1px solid #749c94;border-radius:12px;padding:12px;font:inherit;font-size:12px;margin:8px 0}#scores{overflow:auto}#scores>*{flex-shrink:0}
@keyframes ar-float{50%{transform:translateY(-5px) rotate(2deg)}}@keyframes ar-spark{50%{opacity:.5;transform:scale(.85)}}@keyframes ar-arrive{from{opacity:0;transform:translateY(8px) scale(.9)}to{opacity:1;transform:none}}
@media(max-width:350px){.ar-page{padding:0 15px 18px}.ar-title{font-size:33px}.ar-nav>span{font-size:8px;letter-spacing:1px}.ar-dial{width:120px;height:120px;margin-bottom:12px}.ar-nav{margin-bottom:18px}.ar-path{margin-bottom:16px}.ar-choice{min-height:68px}.ar-type{margin-bottom:17px}.ar-bomb-art{max-height:200px}.ar-hero-label{font-size:8px}.ar-specs b{font-size:25px}}
@media(prefers-reduced-motion:reduce){#arithmetic *,#arithmetic{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
/* Keep all four timed choices visible on short phones; learning notes may scroll. */
/* A real burning rope: JS trims the curve and moves its ember from the same clock. */
.ar-bomb-countdown{height:162px;margin:-6px -10px 4px}.ar-live-bomb{display:block;width:100%;height:100%;overflow:visible}.ar-live-bomb #arSeconds{font:600 42px Fredoka,sans-serif;font-variant-numeric:tabular-nums}.ar-fuse-caption{font:900 15px 'Noto Sans TC',sans-serif;letter-spacing:1px}.ar-fuse-sub{font:700 11px 'Noto Sans TC',sans-serif}.ar-live-body{transform-origin:67px 108px}.ar-ember-flare{animation:ar-burn .32s ease-in-out infinite alternate;transform-origin:0 0}.ar-ember-dust{animation:ar-cinders .7s ease-out infinite}.ar-burning-tip{filter:drop-shadow(0 0 4px #ff9e35)}.ar-bomb-countdown.urgent .ar-live-body{animation:ar-bomb-rattle .2s ease-in-out infinite alternate}.ar-bomb-countdown.urgent #arSeconds{fill:#ffad76}.ar-bomb-countdown.urgent .ar-fuse-caption{fill:#ff996c}.ar-bomb-countdown.urgent .ar-live-rope{stroke:#ff9c55}.ar-bomb-countdown.urgent .ar-burning-tip{filter:drop-shadow(0 0 8px #ff7935)}
.ar-outcome{text-align:center;padding:4px 0 15px}.ar-outcome-kicker{color:#ffb279;font:800 10px sans-serif;letter-spacing:3px}.ar-outcome h2{font-size:23px;line-height:1.6;margin:0 0 10px;color:#ffe4c1}.ar-outcome p{font-size:12px;line-height:1.9;color:#cfbfb5;margin:0 0 20px}.ar-blast-art{width:calc(100% + 32px);margin:10px -16px 0;display:block;overflow:visible}.ar-boom-word{font:700 76px Fredoka,sans-serif;letter-spacing:-2px}.ar-explosion-core{transform-origin:180px 155px;animation:ar-boom .5s cubic-bezier(.16,.8,.3,1.1) both}.ar-shockwave{transform-origin:180px 155px;animation:ar-shockwave .85s ease-out both}.ar-blast-smoke{transform-origin:180px 155px;animation:ar-smoke 1.7s ease-out both}.ar-blast-debris{transform-origin:180px 155px;animation:ar-debris .9s ease-out both}#arithmetic[data-ar-page="exploded"]{background:radial-gradient(ellipse at 50% 45%,#613b34,#211d30 65%,#0e1829)}#arithmetic[data-ar-page="exploded"] .ar-page{animation:ar-impact-shake .48s ease-out}#arithmetic[data-ar-page="exploded"] .ar-secondary{color:#ffe6c8;border-color:#bf7758;background:#57333a}.ar-defused-art{position:relative;margin:8px 0 0}.ar-defused-art .ar-bomb-art{max-height:245px}.ar-defused-art .ar-spark{display:none}.ar-defused-art .ar-bomb-float{animation:none}.ar-defused-art>span{position:absolute;right:11%;top:20%;width:68px;height:68px;display:grid;place-items:center;border-radius:50%;background:#9cebd1;color:#173f39;font:45px Fredoka,sans-serif;box-shadow:0 0 0 7px #9cebd128;animation:ar-arrive .35s ease-out}.defused .ar-outcome-kicker{color:var(--ar-mint)}
@keyframes ar-burn{to{transform:rotate(24deg) scale(.75)}}@keyframes ar-cinders{from{transform:translateY(4px);opacity:.9}to{transform:translate(5px,-14px);opacity:0}}@keyframes ar-bomb-rattle{from{transform:translateX(-1px) rotate(-2deg)}to{transform:translateX(1px) rotate(2deg)}}@keyframes ar-boom{0%{transform:scale(.12) rotate(-12deg);opacity:0}60%{transform:scale(1.08) rotate(2deg);opacity:1}100%{transform:scale(1);opacity:1}}@keyframes ar-shockwave{from{transform:scale(.1);opacity:1}to{transform:scale(1.4);opacity:0}}@keyframes ar-smoke{from{transform:scale(.6);opacity:0}35%{opacity:.9}to{transform:scale(1.14) translateY(-4px);opacity:.6}}@keyframes ar-debris{from{transform:scale(.3);opacity:0}40%{opacity:1}to{transform:scale(1.1);opacity:.8}}@keyframes ar-impact-shake{0%,100%{transform:translate(0)}15%{transform:translate(-7px,3px)}30%{transform:translate(6px,-3px)}45%{transform:translate(-4px,2px)}60%{transform:translate(3px,-1px)}80%{transform:translate(-1px)}}
@media(max-height:680px){#arithmetic[data-ar-page="question"] .ar-nav{margin-bottom:10px;padding:3px 0}#arithmetic[data-ar-page="question"] .ar-path{margin:8px 0 12px}#arithmetic[data-ar-page="question"] .ar-bomb-countdown{height:104px;margin:0 -7px 2px}#arithmetic[data-ar-page="question"] .ar-equation{font-size:36px;margin:6px -8px}#arithmetic[data-ar-page="question"] .ar-type{margin:6px 0 12px}#arithmetic[data-ar-page="question"] .ar-answers{gap:8px}#arithmetic[data-ar-page="question"] .ar-choice{min-height:60px;font-size:28px!important}#arithmetic[data-ar-page="question"] .ar-fuse{margin-top:6px;height:25px;font-size:8px;letter-spacing:0}.ar-blast-art{max-height:230px}.ar-outcome h2{font-size:20px}.ar-outcome p{margin-bottom:8px}.ar-defused-art .ar-bomb-art{max-height:200px}.ar-defused-art>span{width:50px;height:50px;font-size:32px}}
@media(prefers-reduced-motion:reduce){#arithmetic .ar-shockwave{opacity:.35}#arithmetic .ar-ember-dust{display:none}}
