@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&family=Nunito:wght@700;800;900&display=swap');
:root{--ink:#173052;--blue:#3868dc;--purple:#704de1;--pink:#ff668a;--yellow:#ffd451;--mint:#42d2ab;--paper:#fffdf8}
*{box-sizing:border-box}[hidden]{display:none!important}html,body{width:100%;height:100%;margin:0;overflow:hidden}body{font-family:Nunito,Arial,sans-serif;color:var(--ink);background:radial-gradient(circle at 10% 0,#4e8ee8 0,transparent 34%),linear-gradient(145deg,#223a91,#6634a0 62%,#ca4f8c);touch-action:manipulation}button{font:inherit}.app{position:relative;display:flex;flex-direction:column;height:100dvh;min-height:510px;padding:clamp(6px,1vw,12px);gap:clamp(6px,1vw,10px);overflow:hidden}.app:before{content:"";position:fixed;inset:0;pointer-events:none;background-image:radial-gradient(#fff 1px,transparent 1px),radial-gradient(#79efff 1px,transparent 1px);background-position:0 0,18px 18px;background-size:42px 42px;opacity:.2}
.topbar{z-index:2;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;flex:0 0 54px;color:#fff;padding:0 8px}.home{justify-self:start;color:#fff;text-decoration:none;font-weight:900;background:#ffffff18;border:1px solid #ffffff38;border-radius:15px;padding:9px 14px;backdrop-filter:blur(12px)}.game-name{text-align:center;line-height:1}.game-name small{display:block;color:var(--yellow);font-size:9px;letter-spacing:2px}.game-name strong{font:800 clamp(19px,2.2vw,29px) "Baloo 2"}.header-actions{justify-self:end;display:flex;gap:7px}.stars,.sound{height:40px;display:flex;align-items:center;justify-content:center;color:#fff;background:#ffffff18;border:1px solid #ffffff38;border-radius:14px;backdrop-filter:blur(12px);font-weight:900}.stars{padding:0 12px}.sound{width:42px;cursor:pointer}
.screen{z-index:1;position:relative;flex:1;min-height:0;width:min(1220px,100%);margin:auto;border:1px solid #ffffff5c;border-radius:27px;overflow:hidden;box-shadow:0 25px 70px #17104480}.setup-screen{display:grid;grid-template-columns:41% 59%;background:var(--paper)}
.hero-card{position:relative;overflow:hidden;color:#fff;background:radial-gradient(circle at 15% 20%,#3edbef55 0,transparent 24%),radial-gradient(circle at 80% 70%,#f562c84d 0,transparent 31%),linear-gradient(145deg,#17377f,#4d268f)}.hero-card:after{content:"";position:absolute;inset:0;background-image:radial-gradient(#fff 1.2px,transparent 1.2px);background-size:32px 32px;opacity:.25}.bubble{position:absolute;border-radius:50%;border:2px solid #ffffff26;background:#ffffff0b}.b1{width:190px;height:190px;right:-55px;top:24%}.b2{width:80px;height:80px;left:10%;bottom:10%}.b3{width:36px;height:36px;right:20%;top:10%}.hero-copy{position:absolute;z-index:2;left:8%;right:7%;top:7%}.hero-copy span{font-size:10px;letter-spacing:2.3px;color:#71f1ff}.hero-copy h1{margin:5px 0 0;font:800 clamp(38px,5vw,63px)/.95 "Baloo 2"}.hero-copy p{margin:7px 0;color:#dfeaff;font-size:clamp(13px,1.4vw,17px)}
.hero-visual{position:absolute;z-index:3;left:8%;right:8%;top:35%;bottom:18%;display:flex;align-items:center;justify-content:center;gap:clamp(20px,3vw,45px)}.demo-pie{position:relative;width:clamp(155px,17vw,220px);aspect-ratio:1;border-radius:50%;overflow:hidden;transform:rotate(-45deg);filter:drop-shadow(0 16px 20px #10123c80)}.demo-pie i{position:absolute;width:50%;height:50%;border:4px solid #fff;background:linear-gradient(145deg,#ff7c82,#ffb346)}.demo-pie i:nth-child(1){left:0;top:0}.demo-pie i:nth-child(2){right:0;top:0;background:linear-gradient(145deg,#6ee7d4,#35b7d5)}.demo-pie i:nth-child(3){left:0;bottom:0}.demo-pie i:nth-child(4){right:0;bottom:0}.fraction-card{display:flex;flex-direction:column;align-items:center;justify-content:center;width:82px;height:120px;border:2px solid #ffffff80;border-radius:22px;background:#ffffff20;backdrop-filter:blur(13px);font:800 40px/1 "Baloo 2";box-shadow:0 15px 25px #10123c55}.fraction-card span{width:46px;height:4px;margin:5px;border-radius:4px;background:#ffd75d}.tip-card{position:absolute;z-index:3;left:7%;right:7%;bottom:4%;display:flex;align-items:center;gap:11px;padding:9px 13px;border:1px solid #ffffff35;border-radius:16px;background:#ffffff13;backdrop-filter:blur(10px)}.tip-card>span{font-size:26px}.tip-card p{margin:0;color:#e5eeff;font-size:11px;line-height:1.4}.tip-card b{color:#ffe36c}
.level-panel{display:flex;flex-direction:column;min-width:0;padding:clamp(18px,3vw,38px);background:linear-gradient(150deg,#fffdf8,#f5f3ff)}.panel-title small{color:#7958da;font-size:10px;letter-spacing:2px}.panel-title h2{margin:2px 0 0;font:800 clamp(28px,3vw,40px)/1 "Baloo 2"}.panel-title p{margin:4px 0 14px;color:#70809b;font-size:12px}.levels{display:grid;gap:10px;min-height:0}.level-card{display:grid;grid-template-columns:70px 1fr auto;align-items:center;gap:13px;min-height:103px;padding:12px 16px;border:2px solid transparent;border-radius:21px;text-align:left;cursor:pointer;transition:.18s;box-shadow:0 8px 20px #24325c12}.level-card:hover{transform:translateY(-3px);box-shadow:0 13px 24px #24325c22}.level-icon{display:grid;place-items:center;width:64px;aspect-ratio:1;border-radius:18px;font-size:38px;background:#fff;box-shadow:0 6px 14px #25356718}.level-copy>*{display:block}.level-copy small{font-size:9px;letter-spacing:1.7px}.level-copy b{margin:1px 0;font:800 clamp(19px,2vw,27px)/1.05 "Baloo 2"}.level-copy em{font-style:normal;font-size:10px;color:#60718a}.play{padding:9px 12px;border-radius:99px;color:#fff;font-size:10px;font-weight:900;white-space:nowrap}.easy{color:#14604e;background:linear-gradient(135deg,#e9fff6,#d9fbef);border-color:#9ee7d2}.easy .play{background:#27b78c}.medium{color:#66430d;background:linear-gradient(135deg,#fff9dd,#fff0bd);border-color:#f1d46b}.medium .play{background:#e79c24}.hard{color:#6c245b;background:linear-gradient(135deg,#fff0f7,#ffe0f2);border-color:#f3add0}.hard .play{background:#d94f98}.best-row{display:flex;justify-content:space-between;align-items:center;margin-top:11px;padding:10px 14px;border-radius:14px;color:#5c4a86;background:#eee8ff;font-size:11px}.best-row b{color:#7451dd;font-size:15px}
.game-screen{display:flex;flex-direction:column;background:#f9f8ff}.mission-bar{flex:0 0 60px;display:grid;grid-template-columns:auto minmax(180px,1fr) auto;gap:14px;align-items:center;padding:7px 13px;background:#fffffff4;border-bottom:1px solid #dedcf0}.mission-bar>button{height:38px;border:0;border-radius:12px;padding:0 12px;color:#4b4980;background:#eeecfb;font-weight:900;cursor:pointer}.mission-info small{display:block;margin-bottom:4px;text-align:center;color:#5d5682;font-size:9px;letter-spacing:1.2px}.progress{height:10px;background:#e3e1ef;border-radius:99px;overflow:hidden}.progress i{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#49d0ad,#7256e6);transition:.35s}.status-pills{display:flex;gap:5px}.status-pills span{padding:7px 9px;border-radius:11px;background:#f0eef9;font-size:10px;font-weight:900}
.game-stage{position:relative;flex:1;min-height:0;display:grid;grid-template-columns:52% 48%;overflow:hidden;background:linear-gradient(145deg,#f3f9ff,#f9f2ff)}.visual-panel,.answer-panel{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:clamp(15px,2.5vw,30px)}.visual-panel{border-right:1px solid #deddf0;background:radial-gradient(circle at 20% 20%,#d9f8ff 0,transparent 31%),radial-gradient(circle at 80% 80%,#efe1ff 0,transparent 35%)}.question-title{text-align:center}.question-title small,.answer-copy small{color:#7253d5;font-size:9px;letter-spacing:1.8px}.question-title h2,.answer-copy h2{margin:2px 0;font:800 clamp(23px,2.7vw,36px)/1 "Baloo 2"}.fraction-visual{display:grid;place-items:center;width:min(360px,70%);height:min(360px,60%);margin:10px auto}.count-hint{display:flex;align-items:center;gap:12px;padding:8px 15px;border-radius:99px;color:#54647d;background:#fff;border:1px solid #dce2ee;font-size:11px;font-weight:900;box-shadow:0 6px 16px #27315812}.count-hint i{width:5px;height:5px;border-radius:50%;background:#7858de}
.shape-svg{width:100%;height:100%;overflow:visible;filter:drop-shadow(0 18px 20px #34446b22)}.shape-svg .piece{stroke:#fff;stroke-width:3;transition:.3s}.shape-svg .filled{fill:url(#paint)}.shape-svg .empty{fill:#e9edf5}.shape-svg .outline{fill:#fff;stroke:#374e77;stroke-width:4}.shape-svg .shine{fill:#ffffff65;pointer-events:none}.visual-panel.pop .shape-svg{animation:pop .45s ease-out}
.answer-panel{align-items:stretch;background:#fff}.answer-copy{text-align:center}.answer-copy p{margin:4px 0 13px;color:#73809a;font-size:11px}.choices{display:grid;grid-template-columns:repeat(3,1fr);gap:11px}.choice{min-height:clamp(112px,15vw,160px);border:3px solid #dedcf0;border-radius:23px;color:#343b72;background:linear-gradient(145deg,#fff,#f3f1ff);box-shadow:0 8px 0 #b9b3d5,0 14px 22px #312b671b;cursor:pointer;transition:.16s}.choice:hover{transform:translateY(-4px)}.choice:active{transform:translateY(4px);box-shadow:0 4px 0 #b9b3d5}.mini-fraction{display:flex;flex-direction:column;align-items:center;font:800 clamp(37px,5vw,62px)/.72 "Baloo 2"}.mini-fraction i{width:55%;height:5px;margin:8px 0;border-radius:5px;background:#7255d8}.choice.correct{color:#075b43;border-color:#8fe3c5;background:linear-gradient(145deg,#effff8,#9aefcf);box-shadow:0 8px 0 #38a881}.choice.wrong{color:#8f2944;border-color:#ffb2c1;background:linear-gradient(145deg,#fff3f5,#ffadbc);box-shadow:0 8px 0 #cb536b;animation:shake .35s}.choice:disabled{cursor:default}.feedback{display:flex;align-items:center;justify-content:center;gap:10px;min-height:60px;margin-top:18px;padding:10px 15px;border-radius:17px;color:#5c6680;background:#f4f2fb;border:1px solid #e0ddec}.feedback>span{font-size:27px}.feedback p{margin:0;font-size:12px;font-weight:900}.feedback.correct{color:#12604d;background:#e6fff5;border-color:#8ce4c5}.feedback.wrong{color:#862b43;background:#fff0f3;border-color:#ffb3c2}
.result-screen{display:grid;grid-template-columns:40% 60%;color:#fff;background:radial-gradient(circle at 22% 50%,#4b8fff 0,transparent 31%),linear-gradient(145deg,#20378e,#71369c)}.trophy{z-index:2;align-self:center;justify-self:center;font-size:clamp(130px,18vw,230px);filter:drop-shadow(0 25px 18px #15123e8c);animation:float 1.5s ease-in-out infinite alternate}.result-card{z-index:2;align-self:center;padding:30px;text-align:center}.result-card>small{color:#7df1ff;letter-spacing:2px;font-weight:900}.result-card h2{margin:6px;font:800 clamp(38px,5vw,65px)/1 "Baloo 2"}.result-stars{font-size:clamp(35px,4.5vw,56px)}.result-card>p{font-size:15px}.result-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:14px 0}.result-stats div{padding:9px;border:1px solid #ffffff35;border-radius:16px;background:#ffffff13}.result-stats span,.result-stats small,.result-stats b{display:block}.result-stats span{font-size:20px}.result-stats small{font-size:8px;letter-spacing:1.5px}.result-stats b{font-size:23px;color:#ffe164}.result-actions{display:flex;justify-content:center;gap:7px;flex-wrap:wrap}.result-actions button,.result-actions a{border:0;border-radius:13px;padding:10px 13px;text-decoration:none;font-size:11px;font-weight:900;cursor:pointer}.result-actions button:first-child{color:#28346f;background:#ffd84c}.result-actions button:nth-child(2),.result-actions a{color:#28346f;background:#fff}.confetti i{position:absolute;width:12px;height:25px;border-radius:3px;animation:confetti 2s ease-in-out infinite}.confetti i:nth-child(1){left:7%;top:12%;background:#ffd54c}.confetti i:nth-child(2){left:28%;top:22%;background:#4de0d1;animation-delay:.3s}.confetti i:nth-child(3){left:45%;top:8%;background:#ff6f93;animation-delay:.7s}.confetti i:nth-child(4){right:12%;top:18%;background:#ffd54c;animation-delay:1s}.confetti i:nth-child(5){right:32%;bottom:12%;background:#56d7f2;animation-delay:.5s}.confetti i:nth-child(6){left:15%;bottom:14%;background:#ff7395;animation-delay:1.2s}
@keyframes pop{0%{transform:scale(.82);opacity:.2}70%{transform:scale(1.05)}100%{transform:scale(1)}}@keyframes shake{25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}@keyframes float{to{transform:translateY(-12px) rotate(4deg)}}@keyframes confetti{50%{transform:translateY(25px) rotate(180deg)}}
@media(max-width:760px){.app{min-height:470px;padding:5px;gap:5px}.topbar{flex-basis:47px;padding:0 2px}.home{padding:7px 9px}.home span{display:none}.game-name strong{font-size:17px}.game-name small{font-size:7px}.stars,.sound{height:36px}.stars{padding:0 8px}.sound{width:37px}.screen{border-radius:19px}.setup-screen{grid-template-columns:34% 66%}.hero-copy{left:7%;top:5%}.hero-copy h1{font-size:31px}.hero-copy p{font-size:10px}.hero-visual{top:31%;bottom:16%;gap:9px}.demo-pie{width:110px}.fraction-card{width:55px;height:80px;border-radius:14px;font-size:27px}.fraction-card span{width:31px;height:3px}.tip-card{padding:5px 7px}.tip-card>span{font-size:19px}.tip-card p{font-size:8px}.level-panel{padding:12px}.panel-title h2{font-size:25px}.panel-title p{margin-bottom:7px}.levels{gap:6px}.level-card{grid-template-columns:54px 1fr auto;min-height:86px;padding:8px 10px;border-radius:16px}.level-icon{width:50px;font-size:29px}.level-copy b{font-size:20px}.play{padding:7px 9px}.best-row{margin-top:6px;padding:7px 10px}.mission-bar{flex-basis:52px;gap:5px;padding:5px}.mission-bar>button{width:36px;height:34px;padding:0}.mission-bar>button span{display:none}.status-pills{gap:2px}.status-pills span{padding:5px 4px;font-size:8px}.game-stage{grid-template-columns:46% 54%}.visual-panel,.answer-panel{padding:10px}.question-title h2,.answer-copy h2{font-size:21px}.fraction-visual{width:85%;height:58%;margin:5px}.count-hint{padding:5px 8px;font-size:8px}.answer-copy p{font-size:9px;margin-bottom:7px}.choices{gap:5px}.choice{min-height:95px;border-radius:16px}.mini-fraction{font-size:35px}.feedback{min-height:47px;margin-top:10px;padding:6px}.feedback p{font-size:9px}.result-screen{grid-template-columns:34% 66%}.trophy{font-size:105px}.result-card{padding:13px}.result-card h2{font-size:31px}.result-card>p{font-size:10px}.result-stats{gap:4px;margin:8px 0}.result-stats div{padding:5px}.result-stats b{font-size:17px}.result-actions button,.result-actions a{padding:8px;font-size:9px}}
@media(max-width:520px) and (orientation:portrait){.setup-screen{grid-template-columns:1fr;grid-template-rows:25% 75%}.hero-copy{top:9px}.hero-copy h1{font-size:27px}.hero-copy p{margin:2px 0}.hero-visual{left:58%;right:3%;top:8%;bottom:8%}.demo-pie{width:88px}.fraction-card{width:43px;height:64px;font-size:21px}.tip-card{left:4%;right:51%;bottom:8%}.level-panel{padding:7px 10px}.panel-title{display:flex;align-items:baseline;gap:7px;flex-wrap:wrap}.panel-title h2{font-size:20px}.panel-title p{margin:0;font-size:9px}.levels{gap:4px}.level-card{grid-template-columns:45px 1fr auto;min-height:72px;padding:5px 8px}.level-icon{width:42px;font-size:25px}.level-copy b{font-size:17px}.level-copy em{font-size:8px}.play{font-size:8px}.best-row{font-size:9px}.game-stage{grid-template-columns:1fr;grid-template-rows:49% 51%}.visual-panel{border-right:0;border-bottom:1px solid #deddf0;padding:5px}.question-title h2{font-size:18px}.fraction-visual{width:180px;height:155px;margin:2px}.count-hint{position:absolute;left:10px;top:10px;flex-direction:column;gap:3px}.answer-panel{padding:6px 9px}.answer-copy h2{font-size:18px}.answer-copy p{display:none}.choice{min-height:72px}.mini-fraction{font-size:29px}.mini-fraction i{height:3px;margin:5px}.feedback{min-height:40px;margin-top:6px}.result-screen{grid-template-columns:1fr;grid-template-rows:27% 73%}.trophy{font-size:82px}.result-card{align-self:start}.result-card h2{font-size:30px}}
@media(max-height:610px){.topbar{flex-basis:42px}.level-panel{padding-top:8px;padding-bottom:8px}.panel-title h2{font-size:23px}.panel-title p{margin-bottom:5px}.level-card{min-height:76px;padding-top:5px;padding-bottom:5px}.level-icon{width:48px}.mission-bar{flex-basis:48px}.choice{min-height:83px}.feedback{margin-top:7px}.result-card h2{font-size:34px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
