:root { color-scheme: light; font-family: "Trebuchet MS","Segoe UI",sans-serif; color: #294f52; background: #edf4eb; font-synthesis: none; }
* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; background: radial-gradient(circle at 8% 3%,rgba(255,255,255,.96),transparent 18%),radial-gradient(circle at 94% 12%,rgba(222,239,220,.84),transparent 23%),#edf4eb; }
button { font: inherit; }
button:focus-visible { outline: 4px solid rgba(241,184,68,.52); outline-offset: 3px; }
.app { width: min(1120px, calc(100% - 32px)); min-height: 100vh; margin: 0 auto; padding: 18px 0 44px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.brand,.sound-button,.quiet-button,.hint-button,.next-level-button { border: 0; cursor: pointer; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0; color: #294f52; text-align: left; background: transparent; }
.brand-mark { display: grid; width: 57px; height: 50px; place-items: center; }
.brand-mark .pie-icon { width: 49px; }
.brand strong,.brand small { display: block; }
.brand strong { font-size: 18px; line-height: 1.05; }
.brand small { margin-top: 3px; color: #68817b; font-size: 12px; font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.sound-button,.quiet-button,.hint-button,.next-level-button { min-height: 46px; padding: 0 17px; border: 2px solid #ccded5; border-radius: 16px; color: #385f5d; font-weight: 800; background: rgba(255,255,255,.86); box-shadow: 0 6px 14px rgba(43,82,75,.06); }
.sound-button { display: flex; align-items: center; gap: 8px; }
.quiet-button:hover,.sound-button:hover,.hint-button:hover:not(:disabled),.next-level-button:hover { border-color: #91b8ac; transform: translateY(-1px); }
.quiet-button.large { min-height: 54px; }

.eyebrow { margin: 0 0 10px; color: #43847a; font-size: 13px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
h1,h2,p { margin-top: 0; }
h1,h2 { color: #294f52; line-height: 1.07; letter-spacing: -.035em; }
.primary-button { min-height: 56px; padding: 0 24px; border: 0; border-radius: 18px; color: #fff; font: 900 17px/1 "Trebuchet MS","Segoe UI",sans-serif; cursor: pointer; background: #df735d; box-shadow: 0 10px 0 #b85743,0 16px 24px rgba(168,73,51,.2); transition: transform .15s,box-shadow .15s; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 12px 0 #b85743,0 19px 26px rgba(168,73,51,.2); }
.primary-button:active { transform: translateY(7px); box-shadow: 0 3px 0 #b85743; }
.primary-button span { margin-left: 8px; }
.primary-button.compact { min-height: 47px; padding: 0 18px; font-size: 15px; box-shadow: 0 7px 0 #b85743; }

.pie-icon { --fill:75%; position: relative; display: block; width: 100px; aspect-ratio: 1; border: 5px solid #8f5b3d; border-radius: 50%; background: conic-gradient(#efb85b 0 var(--fill),#fff4d4 var(--fill) 100%); box-shadow: inset 0 0 0 5px #f7d990,0 7px 0 #c87e47; }
.pie-icon > i { position: absolute; top: 20%; left: 29%; width: 9px; height: 9px; border-radius: 50%; background: #cf6251; box-shadow: 34px 12px 0 #cf6251,12px 40px 0 #cf6251; }
.pie-icon > b { position: absolute; inset: 9%; border: 2px dashed rgba(143,91,61,.4); border-radius: 50%; }

.hero { position: relative; display: grid; grid-template-columns: 1.04fr .96fr; min-height: 448px; overflow: hidden; border: 1px solid rgba(255,255,255,.78); border-radius: 36px; background: #fbf3dd; box-shadow: 0 22px 52px rgba(39,83,73,.13); }
.hero-copy { position: relative; z-index: 8; align-self: center; padding: 48px 16px 48px 52px; }
.hero h1 { max-width: 590px; margin-bottom: 19px; font-size: clamp(36px,4.25vw,59px); }
.hero-copy > p:not(.eyebrow) { max-width: 555px; margin-bottom: 27px; color: #5c746d; font-size: 17px; line-height: 1.55; }
.hero-scene { position: relative; min-height: 448px; overflow: hidden; background: linear-gradient(180deg,#d5ebe1 0,#edf0d8 69%,#d5a96d 70%,#a7774c 100%); clip-path: ellipse(88% 84% at 100% 50%); }
.hero-awning,.shop-awning { position: absolute; z-index: 8; top: 0; right: 0; left: 0; display: flex; height: 54px; }
.hero-awning i,.shop-awning i { flex: 1; border: 3px solid #8f5b3d; border-top: 0; border-radius: 0 0 22px 22px; background: #fff3d1; }
.hero-awning i:nth-child(odd),.shop-awning i:nth-child(odd) { background: #df735d; }
.hero-pie { position: absolute; z-index: 5; top: 20%; left: 9%; }
.hero-pie .pie-icon { width: 150px; transform: rotate(-8deg); }
.hero-pie > strong { position: absolute; z-index: 5; right: -24px; bottom: 3px; display: grid; width: 62px; height: 48px; place-items: center; border: 4px solid #294f52; border-radius: 13px; color: #294f52; font-size: 22px; background: #fff; }
.hero-chocolate { position: absolute; z-index: 5; top: 28%; right: 7%; display: grid; width: 133px; height: 104px; padding: 9px; grid-template-columns: repeat(2,1fr); gap: 6px; border: 6px solid #603f35; border-radius: 12px; background: #925644; box-shadow: 0 10px 0 #603f35; transform: rotate(7deg); }
.hero-chocolate i { border: 3px solid #603f35; border-radius: 5px; background: #b96d50; }
.hero-chocolate b { position: absolute; right: -20px; bottom: -20px; display: grid; width: 58px; height: 44px; place-items: center; border: 4px solid #294f52; border-radius: 12px; color: #294f52; font-size: 20px; background: #fff; }
.hero-order { position: absolute; z-index: 7; bottom: 9%; left: 8%; display: flex; align-items: center; gap: 9px; padding: 10px 14px; border: 4px solid #294f52; border-radius: 19px; background: #fff8dc; box-shadow: 0 7px 0 #294f52; }
.hero-order > span { font-size: 40px; }
.hero-order small,.hero-order strong { display: block; }
.hero-order small { color: #7c8073; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.hero-order strong { font-size: 13px; }
.hero-counter { position: absolute; right: 0; bottom: 0; left: 0; height: 55px; background: repeating-linear-gradient(90deg,#b87f4e 0 64px,#95603d 65px 71px); }

.how,.levels { padding: 48px 14px 0; }
.how > .eyebrow { text-align: center; }
.how-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 15px; }
.how-grid article { display: grid; grid-template-columns: 52px 1fr; gap: 3px 14px; padding: 19px; border: 1px solid #d8e6df; border-radius: 23px; background: rgba(255,255,255,.72); }
.how-grid article > span { grid-row: 1/3; display: grid; width: 52px; height: 52px; place-items: center; border-radius: 17px; color: #fff; font-size: 24px; font-weight: 900; background: #df735d; }
.how-grid article:nth-child(2) > span { background: #438f83; }
.how-grid article:nth-child(3) > span { background: #657bc0; }
.how-grid strong { align-self: end; font-size: 17px; }
.how-grid p { margin: 2px 0 0; color: #69817b; font-size: 13px; line-height: 1.4; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: clamp(29px,4vw,42px); }
.section-heading > p { max-width: 425px; margin: 0; color: #688079; line-height: 1.45; }
.level-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.level-card { position: relative; display: flex; min-width: 0; min-height: 330px; overflow: hidden; flex-direction: column; padding: 0; border: 2px solid rgba(255,255,255,.9); border-radius: 27px; color: #294f52; text-align: left; cursor: pointer; background: #fff; box-shadow: 0 12px 25px rgba(43,84,77,.09); transition: transform .18s,box-shadow .18s; }
.level-card:hover { transform: translateY(-5px); box-shadow: 0 19px 35px rgba(43,84,77,.15); }
.level-number { position: absolute; z-index: 9; top: 13px; left: 13px; display: grid; width: 38px; height: 38px; place-items: center; border: 3px solid rgba(255,255,255,.9); border-radius: 50%; color: #fff; font-weight: 900; background: var(--accent); }
.level-preview { position: relative; display: block; height: 145px; overflow: hidden; background: linear-gradient(180deg,#d7eadf 0,#efe9ce 72%,#b98250 73%); }
.preview-awning { position: absolute; z-index: 6; top: 0; right: 0; left: 0; display: flex; height: 24px; }
.preview-awning i { flex: 1; border-radius: 0 0 10px 10px; background: #fff3d1; }
.preview-awning i:nth-child(odd) { background: var(--accent); }
.preview-pie { position: absolute; left: 21%; bottom: 13px; }
.preview-pie .pie-icon { width: 80px; border-width: 4px; box-shadow: inset 0 0 0 4px #f7d990,0 5px 0 #c87e47; }
.preview-choco { position: absolute; right: 8%; bottom: 20px; display: grid; width: 69px; height: 57px; padding: 5px; grid-template-columns: repeat(2,1fr); gap: 3px; border: 4px solid #603f35; border-radius: 8px; background: #925644; }
.preview-choco i { border: 2px solid #603f35; border-radius: 3px; background: #b96d50; }
.preview-fraction { position: absolute; z-index: 7; top: 31px; right: 11px; padding: 6px 9px; border-radius: 10px; color: #fff; background: var(--accent); }
.level-copy { display: flex; flex: 1; flex-direction: column; padding: 19px 19px 10px; }
.level-copy small { color: var(--accent); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.level-copy strong { margin: 5px 0 7px; font-size: 22px; }
.level-copy em { color: #6b817c; font-size: 14px; font-style: normal; line-height: 1.42; }
.level-status { display: flex; min-height: 52px; align-items: center; justify-content: space-between; margin: 0 18px; border-top: 1px solid #e2ece7; color: #69817b; font-size: 13px; font-weight: 800; }
.level-status b { color: var(--accent); font-size: 24px; }
.mini-stars { color: #ecb63f; letter-spacing: 2px; }
.adult-note { display: flex; align-items: center; gap: 18px; margin: 34px 14px 0; padding: 20px 24px; border: 1px solid #d4e3d3; border-radius: 22px; background: rgba(233,244,226,.88); }
.adult-note > span { font-size: 34px; }
.adult-note p { margin: 0; color: #60776f; line-height: 1.5; }
.adult-note strong { display: block; color: #3d6b60; }

.game-shell { padding: 28px; border: 1px solid rgba(255,255,255,.9); border-radius: 34px; background: rgba(250,253,248,.84); box-shadow: 0 20px 48px rgba(39,83,73,.12); }
.game-head { display: flex; align-items: end; justify-content: space-between; gap: 22px; }
.game-head h1 { margin: 0; font-size: clamp(26px,3.7vw,43px); }
.round-count { display: flex; align-items: baseline; gap: 5px; color: #78918b; }
.round-count strong { color: var(--level-accent); font-size: 35px; }
.round-count span { font-weight: 900; }
.progress-track { display: grid; grid-template-columns: repeat(10,1fr); gap: 7px; margin: 20px 0; }
.progress-track i { height: 8px; border-radius: 999px; background: #dbe8e2; }
.progress-track i.done { background: var(--level-accent); }
.progress-track i.current { background: #efc35e; box-shadow: 0 0 0 3px rgba(239,195,94,.24); }
.fraction-game { display: grid; grid-template-columns: minmax(0,1.03fr) minmax(380px,.97fr); gap: 20px; }

.assembly-area { position: relative; display: flex; min-height: 490px; overflow: hidden; flex-direction: column; align-items: center; padding: 70px 24px 58px; border: 5px solid #fafbf2; border-radius: 29px; background: linear-gradient(180deg,#d5eae0 0,#f0eed7 77%,#bb804e 78%,#96613e 100%); box-shadow: inset 0 0 42px rgba(38,86,76,.08),0 9px 21px rgba(33,83,91,.12); }
.customer-order { display: flex; width: min(360px,100%); align-items: center; gap: 10px; padding: 9px 13px; border: 3px solid #294f52; border-radius: 17px; background: #fff8dc; box-shadow: 0 6px 0 #294f52; }
.customer-order > span { font-size: 40px; }
.customer-order p { margin: 0; }
.customer-order small,.customer-order strong { display: block; }
.customer-order small { color: #818176; font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.customer-order strong { font-size: 14px; }
.whole-display { display: flex; min-height: 158px; align-items: center; justify-content: center; gap: 16px; margin: 14px 0 6px; }
.whole { --fill:0%; position: relative; display: block; width: 136px; height: 136px; transition: background .35s; }
.whole.pie { border: 7px solid #8f5b3d; border-radius: 50%; background: conic-gradient(#efb85b 0 var(--fill),#fff4d4 var(--fill) 100%); box-shadow: inset 0 0 0 6px #f7d990,0 8px 0 #c87e47; }
.whole.pie > i { position: absolute; inset: 12%; border: 3px dashed rgba(143,91,61,.38); border-radius: 50%; }
.whole.chocolate { height: 105px; border: 7px solid #603f35; border-radius: 12px; background: linear-gradient(90deg,#b96d50 0 var(--fill),#f4e4c9 var(--fill) 100%); box-shadow: 0 8px 0 #603f35; }
.whole.chocolate > i { position: absolute; inset: 8px; opacity: .7; background: repeating-linear-gradient(90deg,transparent 0 28%,#603f35 29% 32%,transparent 33% 65%,#603f35 66% 69%,transparent 70%),repeating-linear-gradient(180deg,transparent 0 43%,#603f35 44% 49%,transparent 50%); }
.whole > b { position: absolute; z-index: 3; top: -10px; left: -10px; display: grid; width: 31px; height: 31px; place-items: center; border: 3px solid #fff; border-radius: 50%; color: #fff; font-size: 12px; background: var(--level-accent); box-shadow: 0 0 0 2px #294f52; }
.whole > em { position: absolute; z-index: 3; right: -7px; bottom: -7px; padding: 5px 7px; border: 3px solid #294f52; border-radius: 9px; color: #294f52; font-size: 10px; font-style: normal; font-weight: 900; background: #fff; }
.whole.complete { animation: whole-pop .5s cubic-bezier(.2,.9,.3,1.3); }
@keyframes whole-pop { 50% { transform: scale(1.06) rotate(2deg); } }
.amount-meter { width: min(390px,100%); }
.amount-meter > div { height: 13px; overflow: hidden; border: 3px solid #294f52; border-radius: 99px; background: #fff; }
.amount-meter i { display: block; height: 100%; border-radius: 99px; background: var(--level-accent); transition: width .35s; }
.amount-meter > span { display: block; margin-top: 4px; color: #667d77; font-size: 11px; text-align: center; }
.amount-meter strong { color: var(--level-accent); font-size: 16px; }
.selected-pieces { display: flex; min-height: 33px; overflow-x: auto; align-items: center; justify-content: center; gap: 5px; width: 100%; margin-top: 5px; }
.selected-pieces > span:not(.empty-selection) { display: grid; min-width: 37px; height: 27px; place-items: center; border: 2px solid #294f52; border-radius: 8px; color: #294f52; font-size: 10px; font-weight: 900; background: #fff1bd; }
.empty-selection { color: #81918b; font-size: 10px; }
.undo-button { min-height: 42px; margin-top: 5px; padding: 0 13px; border: 2px solid #b8cec5; border-radius: 13px; color: #496f68; font-size: 11px; font-weight: 900; cursor: pointer; background: #fff; }
.undo-button:disabled { cursor: default; opacity: .4; }
.undo-button.attention { border-color: #df735d; color: #a44e3d; background: #fff0e9; animation: undo-pulse .8s ease-in-out infinite alternate; }
@keyframes undo-pulse { to { transform: scale(1.04); box-shadow: 0 0 0 5px rgba(223,115,93,.14); } }
.shop-counter { position: absolute; right: 0; bottom: 0; left: 0; height: 49px; border-top: 5px solid #764b34; background: repeating-linear-gradient(90deg,#b87f4e 0 64px,#95603d 65px 71px); }

.stock-shelf { display: flex; min-width: 0; min-height: 490px; flex-direction: column; padding: 22px; border: 2px solid #d8e8e2; border-radius: 29px; background: #fffdf5; }
.shelf-heading { margin-bottom: 10px; text-align: center; }
.shelf-heading small,.shelf-heading strong { display: block; }
.shelf-heading small { color: #718780; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.shelf-heading strong { margin-top: 3px; font-size: 18px; }
.fraction-rule { display: flex; min-height: 54px; align-items: center; justify-content: center; gap: 7px; margin-bottom: 10px; padding: 7px; border: 2px solid #d8e4db; border-radius: 14px; background: #f2f7ee; }
.fraction-rule > span { color: #72857f; font-size: 9px; text-align: center; }
.fraction-rule span b { display: block; color: #294f52; font-size: 15px; }
.fraction-rule > i,.fraction-rule > em { color: #79918a; font-size: 19px; font-style: normal; font-weight: 900; }
.fraction-rule > strong { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #fff; background: var(--level-accent); }
.piece-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: auto; }
.piece-card { position: relative; display: flex; min-width: 0; min-height: 151px; overflow: hidden; flex-direction: column; align-items: center; justify-content: center; padding: 8px 4px; border: 3px solid #d5d1b4; border-radius: 15px; color: #294f52; cursor: pointer; background: #fff3cc; box-shadow: 0 5px 0 #d4c08a; transition: transform .14s,border-color .14s; }
.piece-card:hover:not(:disabled) { z-index: 2; border-color: var(--level-accent); transform: translateY(-3px); }
.piece-card:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #d4c08a; }
.piece-card > small { position: absolute; top: 5px; left: 6px; color: #8b866e; font-size: 9px; font-weight: 900; }
.piece-card > strong { margin-top: 5px; font-size: 18px; }
.piece-card > b,.piece-card > em { color: #73837d; font-size: 7px; font-style: normal; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.piece-shape { --piece:25%; position: relative; display: block; width: 57px; height: 57px; }
.piece-shape.pie { border: 4px solid #8f5b3d; border-radius: 50%; background: conic-gradient(#efb85b 0 var(--piece),#fff8e2 var(--piece) 100%); }
.piece-shape.pie i { position: absolute; inset: 12%; border: 1px dashed rgba(143,91,61,.4); border-radius: 50%; }
.piece-shape.chocolate { height: 47px; border: 4px solid #603f35; border-radius: 7px; background: linear-gradient(90deg,#b96d50 0 var(--piece),#f6ead7 var(--piece) 100%); }
.piece-shape.chocolate i { position: absolute; inset: 4px; background: repeating-linear-gradient(90deg,transparent 0 30%,rgba(96,63,53,.65) 31% 35%,transparent 36% 66%,rgba(96,63,53,.65) 67% 71%,transparent 72%); }
.piece-card.selected { opacity: .38; filter: grayscale(.55); transform: translateY(4px); box-shadow: 0 1px 0 #d4c08a; }
.piece-card.selected::after { position: absolute; z-index: 5; display: grid; width: 31px; height: 31px; place-items: center; border: 3px solid #fff; border-radius: 50%; color: #fff; content: "✓"; font-weight: 900; background: #4fa878; }
.piece-card.recommended { border-color: #efb94a; background: #fff8d9; box-shadow: 0 5px 0 #d7a532,0 0 0 5px rgba(239,185,74,.16); animation: recommend-pulse .8s ease-in-out infinite alternate; }
@keyframes recommend-pulse { to { transform: translateY(-4px) scale(1.025); } }
.piece-card.wrong { border-color: #e49382; background: #ffebe6; box-shadow: 0 5px 0 #dda99c; animation: shake .25s ease-in-out; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.piece-card:disabled { cursor: default; }
.game-tools { display: flex; justify-content: flex-end; margin: 14px 0; }
.hint-button:disabled { cursor: default; opacity: .48; }
.feedback-card { display: flex; min-height: 82px; align-items: center; gap: 14px; padding: 14px 18px; border: 2px solid #d5e5df; border-radius: 23px; background: #fff; }
.feedback-card.correct { border-color: #aedbc5; background: #eefaf2; }
.feedback-card.wrong { border-color: #edc3b8; background: #fff3ef; }
.feedback-card.hint { border-color: #ead89d; background: #fff9df; }
.feedback-icon { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 16px; font-size: 25px; background: #e8f4f1; }
.feedback-card p { flex: 1; margin: 0; }
.feedback-card strong,.feedback-card small { display: block; }
.feedback-card strong { margin-bottom: 3px; }
.feedback-card small { color: #6a817b; line-height: 1.35; }

.result-wrap { display: grid; min-height: 680px; padding: 40px 18px; place-items: center; overflow: hidden; border-radius: 35px; background: linear-gradient(180deg,#d4e9df 0,#eeecd3 73%,#b67d4b 74%); box-shadow: 0 20px 46px rgba(31,77,83,.16); }
.result-card { width: min(660px,100%); padding: 32px 34px 35px; border: 4px solid rgba(255,255,255,.75); border-radius: 31px; text-align: center; background: #fffdf4; box-shadow: 0 21px 44px rgba(45,75,61,.2); }
.result-shop { position: relative; display: grid; height: 174px; margin: -7px auto 8px; place-items: center; }
.result-shop > span { width: 125px; transform: translateX(-45px) rotate(-7deg); }
.result-shop > b { position: absolute; right: 22%; bottom: 27px; font-size: 76px; transform: rotate(7deg); }
.result-shop > i { position: absolute; left: 19%; bottom: 0; font-size: 51px; font-style: normal; }
.result-shop > em { position: absolute; z-index: 7; right: 18%; top: 8px; display: grid; width: 48px; height: 48px; place-items: center; border: 4px solid #fff; border-radius: 50%; color: #fff; font-size: 27px; font-style: normal; font-weight: 900; background: #4fa878; box-shadow: 0 0 0 3px #294f52; }
.result-card h1 { margin-bottom: 10px; font-size: clamp(35px,5vw,51px); }
.result-card > p:not(.eyebrow) { max-width: 490px; margin: 0 auto 10px; color: #647c76; line-height: 1.5; }
.result-stars { margin: 10px 0 18px; color: #efb83f; font-size: 42px; letter-spacing: 7px; }
.result-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 24px; }
.result-stats span { padding: 13px 8px; border-radius: 17px; background: #edf5ed; }
.result-stats strong,.result-stats small { display: block; }
.result-stats strong { color: #3f887a; font-size: 25px; }
.result-stats small { color: #6d837e; font-size: 11px; font-weight: 800; }
.result-actions { display: flex; justify-content: center; gap: 13px; }

@media (max-width: 1000px) {
  .hero-copy { padding-left: 38px; }
  .level-card { min-height: 344px; }
  .fraction-game { grid-template-columns: minmax(0,.96fr) minmax(370px,1.04fr); }
  .game-shell { padding: 23px; }
  .piece-grid { gap: 6px; }
  .piece-card { min-height: 143px; }
}

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 42px; }
  .hero-scene { min-height: 345px; clip-path: ellipse(78% 93% at 50% 100%); }
  .hero-pie { left: 25%; }
  .hero-chocolate { right: 18%; }
  .hero-order { left: 20%; }
  .how-grid { grid-template-columns: 1fr; }
  .level-grid { grid-template-columns: 1fr; }
  .level-card { display: grid; min-height: 180px; grid-template-columns: 37% 1fr; }
  .level-preview { height: 100%; min-height: 180px; grid-row: 1/3; }
  .level-copy { padding: 23px 20px 5px; }
  .level-status { align-self: end; }
  .fraction-game { grid-template-columns: 1fr; }
  .assembly-area { min-height: 470px; }
  .stock-shelf { min-height: 490px; }
  .piece-card { min-height: 150px; }
}

@media (max-width: 700px) {
  .app { width: min(1120px,calc(100% - 20px)); padding-top: 10px; }
  .topbar { gap: 8px; margin-bottom: 12px; }
  .brand-mark { width: 48px; }
  .brand-mark .pie-icon { width: 42px; }
  .brand strong { font-size: 15px; }
  .brand small { display: none; }
  .sound-button { width: 47px; padding: 0; justify-content: center; }
  .sound-button span:last-child { display: none; }
  .top-actions .quiet-button { padding: 0 12px; font-size: 13px; }
  .hero { border-radius: 26px; }
  .hero-copy { padding: 31px 23px 38px; }
  .hero h1 { font-size: clamp(34px,10vw,48px); }
  .hero-copy > p:not(.eyebrow) { font-size: 15px; }
  .hero-scene { min-height: 295px; }
  .hero-pie { top: 23%; left: 18%; transform: scale(.79); transform-origin: top left; }
  .hero-chocolate { top: 29%; right: 8%; transform: scale(.79) rotate(7deg); }
  .hero-order { left: 12%; transform: scale(.85); transform-origin: bottom left; }
  .how,.levels { padding: 37px 2px 0; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 10px; }
  .adult-note { margin-right: 2px; margin-left: 2px; padding: 17px; }
  .game-shell { padding: 16px; border-radius: 25px; }
  .game-head { align-items: center; }
  .game-head .eyebrow { font-size: 10px; }
  .game-head h1 { font-size: 25px; }
  .round-count strong { font-size: 29px; }
  .assembly-area { min-height: 450px; padding: 66px 17px 53px; border-width: 3px; }
  .whole { width: 120px; height: 120px; }
  .whole.chocolate { height: 94px; }
  .stock-shelf { min-height: 475px; padding: 17px; }
  .feedback-card.correct { flex-wrap: wrap; }
  .feedback-card.correct p { min-width: calc(100% - 70px); }
  .feedback-card.correct .primary-button { width: 100%; flex-basis: 100%; margin-top: 8px; }
  .result-wrap { min-height: 610px; padding: 25px 10px; border-radius: 27px; }
  .result-card { padding: 25px 16px 28px; }
  .result-actions { flex-direction: column; }
  .result-actions > * { width: 100%; }
}

@media (max-width: 520px) {
  .level-card { display: flex; min-height: 320px; }
  .level-preview { width: 100%; min-height: 135px; height: 135px; }
  .level-status { align-self: auto; width: calc(100% - 36px); }
  .whole-display { min-height: 134px; gap: 9px; }
  .whole { width: 105px; height: 105px; }
  .whole.chocolate { height: 83px; }
  .piece-grid { grid-template-columns: repeat(4,1fr); gap: 5px; }
  .piece-card { min-height: 133px; padding-right: 2px; padding-left: 2px; }
  .piece-shape { width: 49px; height: 49px; }
  .piece-shape.chocolate { height: 42px; }
  .piece-card > strong { font-size: 16px; }
  .piece-card > b,.piece-card > em { font-size: 6px; }
  .result-stats { gap: 5px; }
  .result-stats span { padding: 11px 4px; }
}

@media (max-width: 390px) {
  .app { width: calc(100% - 16px); }
  .top-actions .quiet-button { max-width: 90px; padding: 0 9px; font-size: 11px; }
  .primary-button { width: 100%; padding: 0 15px; }
  .hero-copy { padding-right: 18px; padding-left: 18px; }
  .hero h1 { font-size: 34px; }
  .hero-scene { min-height: 260px; }
  .hero-pie { left: 11%; transform: scale(.68); }
  .hero-chocolate { right: 1%; transform: scale(.68) rotate(7deg); }
  .hero-order { left: 5%; transform: scale(.73); }
  .how-grid article { padding: 15px; }
  .game-shell { padding: 12px; }
  .game-head h1 { font-size: 21px; }
  .round-count strong { font-size: 25px; }
  .progress-track { gap: 4px; margin: 14px 0; }
  .assembly-area { min-height: 420px; padding: 61px 10px 48px; }
  .customer-order > span { font-size: 34px; }
  .whole-display { min-height: 116px; margin-top: 9px; }
  .whole { width: 89px; height: 89px; border-width: 5px; }
  .whole.chocolate { height: 70px; }
  .whole > em { font-size: 8px; }
  .stock-shelf { min-height: 450px; padding: 12px; }
  .fraction-rule { gap: 4px; }
  .piece-card { min-height: 119px; border-width: 2px; }
  .piece-shape { width: 43px; height: 43px; }
  .piece-shape.chocolate { height: 36px; }
  .piece-card > strong { font-size: 14px; }
  .piece-card > b { display: none; }
  .feedback-card { padding: 12px; }
  .feedback-icon { width: 42px; height: 42px; }
  .result-stars { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
