: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,.5);
  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: 11px;
  padding: 0;
  color: #294f52;
  text-align: left;
  background: transparent;
}

.brand-mark {
  position: relative;
  display: block;
  width: 54px;
  height: 48px;
  overflow: hidden;
}

.brand-mark .tower {
  position: absolute;
  right: 4px;
  bottom: 1px;
}

.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; }

.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;
}

.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; }

.hero-scene {
  position: relative;
  min-height: 448px;
  overflow: hidden;
  background: linear-gradient(180deg,#bde4e0 0,#dcefe0 58%,#d7c28e 59%,#b68e5b 100%);
  clip-path: ellipse(88% 84% at 100% 50%);
}

.hero-clouds i,
.scene-clouds i {
  position: absolute;
  z-index: 1;
  display: block;
  width: 95px;
  height: 29px;
  border-radius: 40px;
  opacity: .72;
  background: #fff;
}

.hero-clouds i::before,
.hero-clouds i::after,
.scene-clouds i::before,
.scene-clouds i::after {
  position: absolute;
  bottom: 8px;
  border-radius: 50%;
  content: "";
  background: inherit;
}

.hero-clouds i::before,
.scene-clouds i::before { left: 17px; width: 40px; height: 40px; }
.hero-clouds i::after,
.scene-clouds i::after { right: 14px; width: 50px; height: 50px; }
.hero-clouds i:nth-child(1) { top: 14%; left: 13%; transform: scale(.75); }
.hero-clouds i:nth-child(2) { top: 27%; right: -10px; transform: scale(.58); }
.hero-clouds i:nth-child(3) { top: 7%; right: 22%; transform: scale(.42); }

.hero-crane {
  position: absolute;
  z-index: 3;
  top: 5%;
  right: -1%;
  width: 51%;
  height: 83%;
}

.crane { display: block; width: 100%; height: 100%; }

.hero-tower {
  position: absolute;
  z-index: 5;
  left: 21%;
  bottom: 11%;
}

.hero-block {
  position: absolute;
  z-index: 7;
  top: 16%;
  left: 5%;
  display: grid;
  min-width: 119px;
  padding: 13px 16px;
  border: 3px solid rgba(255,255,255,.82);
  border-radius: 20px;
  color: #294f52;
  text-align: center;
  background: rgba(255,250,222,.86);
  box-shadow: 0 12px 24px rgba(50,86,73,.14);
}

.hero-block small { color: #71847d; font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.hero-block strong { margin: 4px 0; font-size: 26px; }
.hero-block b { color: #df735d; font-size: 20px; }

.hero-ground {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  height: 71px;
  background: repeating-linear-gradient(135deg,#bd975d 0 16px,#c7a56d 16px 32px);
}

.hero-ground i { position: absolute; bottom: 18px; width: 38px; height: 21px; border: 3px solid #6d765f; background: #e68661; }
.hero-ground i:nth-child(1) { left: 7%; }
.hero-ground i:nth-child(2) { left: 15%; bottom: 37px; }
.hero-ground i:nth-child(3) { right: 9%; }

.tower {
  position: relative;
  width: 145px;
}

.tower-stack {
  display: flex;
  width: 100%;
  flex-direction: column-reverse;
  align-items: center;
}

.tower-floor {
  position: relative;
  display: flex;
  width: 100%;
  height: 25px;
  flex: 0 0 25px;
  align-items: center;
  justify-content: center;
  gap: 22px;
  border: 3px solid rgba(58,78,70,.2);
  border-bottom: 0;
  opacity: .24;
  background: rgba(255,255,255,.35);
}

.tower-floor:nth-child(3n+2) { width: 94%; }
.tower-floor:nth-child(3n) { width: 89%; }
.tower-floor.built { border-color: #425e58; opacity: 1; background: var(--wall); box-shadow: inset 0 -5px 0 rgba(65,66,51,.12); }
.tower-floor.new-floor { animation: floor-in .65s cubic-bezier(.22,.85,.28,1.25); }
.tower-floor > i { width: 17px; height: 14px; border: 3px solid #425e58; border-radius: 2px 2px 0 0; background: #dff0dc; }
.tower-floor.planned > i { border-color: rgba(66,94,88,.35); background: transparent; }
.tower-floor > b { position: absolute; left: 5px; color: rgba(255,255,255,.8); font-size: 8px; }

@keyframes floor-in {
  0% { opacity: .2; transform: translateY(-55px) rotate(3deg); }
  100% { opacity: 1; transform: translateY(0) rotate(0); }
}

.tower-base {
  position: relative;
  display: flex;
  width: 118%;
  height: 25px;
  align-items: center;
  justify-content: space-around;
  margin-left: -9%;
  border: 4px solid #425e58;
  border-radius: 4px;
  background: #efc760;
}

.tower-base i { width: 25%; height: 5px; background: rgba(76,83,61,.32); }
.tower-base b { width: 22px; height: 15px; border: 3px solid #425e58; border-bottom: 0; border-radius: 4px 4px 0 0; background: #dff0dc; }
.tower > em { position: absolute; z-index: 3; top: -35px; left: 50%; width: 52px; height: 33px; padding: 2px 0 0 8px; color: #fff6bd; font-style: normal; font-weight: 900; background: #df735d; clip-path: polygon(0 0,100% 0,76% 50%,100% 100%,0 100%); }
.tower > em::after { position: absolute; top: 0; left: 0; width: 4px; height: 45px; content: ""; background: #425e58; }

.compact-tower { width: 48px; }
.compact-tower .tower-floor { height: 6px; flex-basis: 6px; gap: 4px; border-width: 1px; }
.compact-tower .tower-floor > i { width: 5px; height: 4px; border-width: 1px; }
.compact-tower .tower-base { height: 6px; border-width: 1px; }
.compact-tower .tower-base i { height: 1px; }
.compact-tower .tower-base b { width: 6px; height: 4px; border-width: 1px; }

.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: 6; 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,#bfe4df 0 70%,#c5a36b 71%); }
.blue .level-preview { background: linear-gradient(180deg,#a7cfdf 0 70%,#9d9874 71%); }
.preview-sky i { position: absolute; width: 52px; height: 16px; border-radius: 20px; background: rgba(255,255,255,.65); }
.preview-sky i:first-child { top: 28px; left: 28%; }
.preview-sky i:last-child { top: 16px; right: 7%; transform: scale(.65); }
.preview-crane { position: absolute; right: -7px; bottom: -4px; width: 107px; height: 142px; }
.preview-tower { position: absolute; left: 29%; bottom: 8px; }
.preview-example { position: absolute; z-index: 5; top: 17px; right: 12px; padding: 7px 10px; border-radius: 12px; color: #fff; background: rgba(54,84,75,.52); }
.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); }
.tower-game { display: grid; grid-template-columns: minmax(0,1.02fr) minmax(360px,.98fr); gap: 20px; }

.build-scene {
  position: relative;
  min-height: 455px;
  overflow: hidden;
  border: 5px solid #fafbf2;
  border-radius: 29px;
  background: linear-gradient(180deg,#bde0df 0,#e2eddd 74%,#c9aa72 75%,#a98355 100%);
  box-shadow: inset 0 0 40px rgba(38,91,84,.09),0 9px 21px rgba(33,83,91,.12);
}

.scene-clouds i:nth-child(1) { top: 12%; left: 10%; transform: scale(.75); }
.scene-clouds i:nth-child(2) { top: 24%; right: 5%; transform: scale(.5); }
.scene-clouds i:nth-child(3) { top: 6%; right: 30%; transform: scale(.38); }
.city-silhouette { position: absolute; right: 0; bottom: 22%; left: 0; height: 120px; opacity: .21; }
.city-silhouette i { position: absolute; bottom: 0; width: 54px; border: 3px solid #52756f; background: repeating-linear-gradient(180deg,transparent 0 11px,#52756f 12px 15px); }
.city-silhouette i:nth-child(1) { left: 1%; height: 70px; }
.city-silhouette i:nth-child(2) { left: 28%; height: 115px; }
.city-silhouette i:nth-child(3) { right: 26%; height: 88px; }
.city-silhouette i:nth-child(4) { right: 2%; height: 125px; }
.scene-crane { position: absolute; z-index: 3; top: 3%; right: -2%; width: 49%; height: 78%; }
.game-tower { position: absolute; z-index: 5; bottom: 67px; left: 19%; }
.game-tower .tower { width: 150px; }

.crane-load { position: absolute; z-index: 7; right: 9%; width: 55px; height: 34px; border: 4px solid #425e58; background: #e68661; transition: bottom .65s ease; }
.crane-load::before { position: absolute; right: 24px; bottom: 30px; width: 4px; height: 160px; content: ""; background: #425e58; }
.crane-load i, .crane-load b { position: absolute; top: 8px; width: 12px; height: 12px; border: 2px solid #425e58; background: #dff0dc; }
.crane-load i { left: 7px; }
.crane-load b { right: 7px; }
.crane-load.lifting { animation: load-swing .7s ease-in-out; }

@keyframes load-swing {
  0%,100% { transform: rotate(0); }
  45% { transform: rotate(5deg) translateY(-5px); }
}

.build-status { position: absolute; z-index: 8; top: 17px; left: 18px; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 2px solid rgba(255,255,255,.7); border-radius: 15px; color: #466963; background: rgba(255,255,255,.66); backdrop-filter: blur(5px); }
.build-status strong { color: var(--level-accent); font-size: 22px; }
.build-status span { font-size: 11px; font-weight: 900; }
.site-ground { position: absolute; z-index: 4; right: 0; bottom: 0; left: 0; height: 69px; background: repeating-linear-gradient(135deg,#bd975d 0 17px,#c7a56d 17px 34px); }
.site-ground span { position: absolute; left: 6%; bottom: 16px; font-size: 33px; }
.site-ground i,.site-ground b { position: absolute; right: 10%; bottom: 13px; width: 42px; height: 23px; border: 3px solid #6b705d; background: #e68661; }
.site-ground b { right: 20%; bottom: 34px; }

.task-panel { display: flex; min-width: 0; min-height: 455px; flex-direction: column; padding: 24px; border: 2px solid #d9e7e1; border-radius: 29px; background: #fffdf5; }
.equation-board { padding: 22px 18px; border: 2px dashed #bdd4cc; border-radius: 22px; text-align: center; background: #f0f6ed; }
.equation-board > small { display: block; margin-bottom: 7px; color: #68817a; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.equation-board > div { display: flex; align-items: center; justify-content: center; gap: 13px; }
.equation-board strong,.equation-board b { font-size: clamp(41px,5vw,61px); }
.equation-board i { color: #78918a; font-size: 35px; font-style: normal; font-weight: 900; }
.equation-board b { color: var(--level-accent); }
.task-tip { display: grid; min-height: 102px; place-items: center; margin: 8px 0; color: #728a84; text-align: center; font-size: 14px; font-weight: 800; }

.group-hint { min-height: 118px; padding: 8px 0 5px; text-align: center; }
.group-hint > small { display: block; margin-bottom: 7px; color: #687f79; font-size: 11px; font-weight: 800; }
.group-bricks { display: flex; max-height: 58px; overflow: auto; align-items: center; justify-content: center; gap: 4px; padding: 2px; }
.group-bricks > span { display: grid; min-width: 28px; padding: 4px; grid-template-columns: repeat(3,5px); justify-content: center; gap: 2px; border: 2px solid #c6dcd3; border-radius: 8px; background: #fff; }
.group-bricks i { width: 5px; height: 5px; border-radius: 1px; background: var(--level-accent); }
.group-hint > b { display: block; overflow: hidden; margin-top: 5px; color: #4b7069; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.blueprint-options { display: grid; grid-template-columns: repeat(2,1fr); gap: 11px; margin-top: auto; }
.blueprint-option { position: relative; min-height: 91px; overflow: hidden; border: 3px solid #cedfd9; border-radius: 19px; color: #2d5759; cursor: pointer; background: #eef6f1; box-shadow: 0 6px 0 #b9d3ca; transition: transform .14s,border-color .14s; }
.blueprint-option:hover:not(:disabled) { z-index: 2; border-color: #5aa799; transform: translateY(-3px); }
.blueprint-option:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 #b9d3ca; }
.blueprint-option > small { position: absolute; top: 8px; left: 10px; color: #739089; font-weight: 900; }
.blueprint-option strong { position: relative; z-index: 2; font-size: 35px; }
.blueprint-option > span { position: absolute; inset: 8px; opacity: .35; }
.blueprint-option > span i { position: absolute; border: 2px solid #62a99c; }
.blueprint-option > span i:nth-child(1) { top: 7px; right: 8px; width: 48px; height: 28px; }
.blueprint-option > span i:nth-child(2) { right: 8px; bottom: 7px; width: 48px; height: 24px; }
.blueprint-option > span i:nth-child(3) { top: 7px; right: 29px; height: 52px; }
.blueprint-option.wrong { border-color: #e49382; color: #9a4d43; background: #ffebe6; box-shadow: 0 6px 0 #dda99c; animation: shake .25s ease-in-out; }
.blueprint-option.correct { border-color: #55a883; color: #fff; background: #58ad87; box-shadow: 0 6px 0 #368263; }
.blueprint-option:disabled { cursor: default; }

@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.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,#afdcd9 0,#e6eee0 69%,#c29f68 70%); 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,.74); border-radius: 31px; text-align: center; background: rgba(255,253,244,.95); box-shadow: 0 21px 44px rgba(52,78,65,.2); }
.result-building { position: relative; display: grid; height: 185px; margin: -10px auto 8px; place-items: end center; overflow: hidden; }
.result-building .tower { width: 100px; }
.result-building .tower-floor { height: 14px; flex-basis: 14px; gap: 12px; border-width: 2px; }
.result-building .tower-floor > i { width: 11px; height: 8px; border-width: 2px; }
.result-building .tower-base { height: 15px; border-width: 2px; }
.result-building > span { position: absolute; top: 27px; font-size: 49px; opacity: .8; }
.result-building > span:nth-child(2) { left: 14%; }
.result-building > span:nth-child(3) { right: 12%; top: 70px; transform: scale(.72); }
.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; }
  .tower-game { grid-template-columns: minmax(0,.94fr) minmax(350px,1.06fr); }
  .game-shell { padding: 23px; }
  .game-tower { left: 13%; }
}

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 42px; }
  .hero-scene { min-height: 340px; clip-path: ellipse(78% 93% at 50% 100%); }
  .hero-crane { right: 9%; width: 38%; }
  .hero-tower { left: 32%; bottom: 12%; }
  .hero-block { top: 18%; left: 16%; }
  .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; }
  .tower-game { grid-template-columns: 1fr; }
  .build-scene { min-height: 425px; }
  .task-panel { min-height: 455px; }
  .game-tower { left: 25%; }
  .scene-crane { right: 7%; width: 39%; }
  .crane-load { right: 13%; }
}

@media (max-width: 700px) {
  .app { width: min(1120px,calc(100% - 20px)); padding-top: 10px; }
  .topbar { gap: 8px; margin-bottom: 12px; }
  .brand-mark { width: 47px; }
  .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: 285px; }
  .hero-crane { right: 4%; width: 43%; }
  .hero-tower { left: 29%; transform: scale(.82); transform-origin: bottom; }
  .hero-block { left: 8%; }
  .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; }
  .build-scene { min-height: 390px; border-width: 3px; }
  .game-tower { left: 21%; transform: scale(.9); transform-origin: bottom; }
  .scene-crane { right: 2%; width: 45%; }
  .task-panel { min-height: 440px; 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); }
  .game-tower { left: 14%; }
  .scene-crane { right: -7%; width: 52%; }
  .crane-load { right: 6%; }
  .equation-board > div { gap: 8px; }
  .equation-board strong,.equation-board b { font-size: 43px; }
  .equation-board i { font-size: 28px; }
  .group-bricks { justify-content: flex-start; }
  .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: 255px; }
  .hero-tower { left: 24%; transform: scale(.72); }
  .hero-block { top: 13%; min-width: 100px; padding: 9px 11px; }
  .hero-crane { right: -3%; width: 49%; }
  .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; }
  .build-scene { min-height: 350px; }
  .game-tower { left: 8%; transform: scale(.78); }
  .scene-crane { right: -12%; width: 60%; }
  .crane-load { right: 3%; transform: scale(.82); }
  .task-panel { min-height: 420px; padding: 12px; }
  .equation-board { padding: 17px 8px; }
  .blueprint-option { min-height: 83px; }
  .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; transition-duration: .01ms !important; }
}
