: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: 59px; height: 50px; place-items: center; overflow: hidden; }
.brand-mark .machine { width: 58px; transform: translateY(4px); }
.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; }
.machine { display: block; width: 100%; height: auto; }

.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(160deg,#d8eee5 0,#a8d7d2 54%,#719d99 55%,#456c6d 100%); clip-path: ellipse(88% 84% at 100% 50%); }
.hero-gears i { position: absolute; display: grid; width: 55px; height: 55px; place-items: center; border: 8px dotted rgba(41,79,82,.26); border-radius: 50%; color: rgba(41,79,82,.25); font-style: normal; font-size: 24px; }
.hero-gears i:first-child { top: 8%; right: 8%; }
.hero-gears i:nth-child(2) { top: 25%; right: 25%; width: 37px; height: 37px; border-width: 6px; }
.hero-gears i:last-child { left: 8%; bottom: 14%; width: 44px; height: 44px; }
.hero-machine { position: absolute; z-index: 4; right: 5%; bottom: 10%; width: 42%; filter: drop-shadow(0 16px 9px rgba(31,63,59,.22)); }
.hero-equation { position: absolute; z-index: 7; top: 18%; left: 6%; display: flex; align-items: center; gap: 8px; padding: 15px 17px; border: 4px solid rgba(255,255,255,.76); border-radius: 22px; color: #294f52; background: rgba(255,250,224,.9); box-shadow: 0 12px 25px rgba(38,83,75,.15); }
.hero-equation span,.hero-equation strong { display: grid; min-width: 45px; height: 51px; place-items: center; border-radius: 13px; font-size: 27px; background: #fff; }
.hero-equation b { display: grid; width: 49px; height: 49px; place-items: center; border: 4px dashed #df735d; border-radius: 14px; color: #df735d; font-size: 29px; }
.hero-equation i { font-size: 25px; font-style: normal; font-weight: 900; }
.hero-equation strong { color: #fff; background: #3f9475; }
.hero-signs { position: absolute; z-index: 6; right: 8%; bottom: 8%; display: flex; gap: 7px; }
.hero-signs i { display: grid; width: 42px; height: 42px; place-items: center; border: 3px solid #294f52; border-radius: 12px; color: #294f52; font-size: 24px; font-style: normal; font-weight: 900; background: #f4ca61; box-shadow: 0 5px 0 #294f52; }
.hero-wires { position: absolute; right: 0; bottom: 0; left: 0; height: 55px; opacity: .35; background: repeating-linear-gradient(90deg,#294f52 0 5px,transparent 5px 55px); }

.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(150deg,#d5ebe3,#80aaa5); }
.preview-machine { position: absolute; right: 3%; bottom: -7px; width: 38%; }
.preview-equation { position: absolute; z-index: 4; left: 20%; bottom: 30px; display: flex; align-items: center; gap: 4px; padding: 7px; border: 2px solid rgba(255,255,255,.8); border-radius: 11px; background: rgba(255,250,226,.88); }
.preview-equation b,.preview-equation strong { font-size: 15px; }
.preview-equation i { display: grid; width: 24px; height: 24px; place-items: center; border: 2px dashed var(--accent); border-radius: 7px; color: var(--accent); font-style: normal; font-weight: 900; }
.preview-equation em { font-style: normal; }
.preview-lamps i { position: absolute; top: 14px; width: 9px; height: 9px; border: 2px solid #294f52; border-radius: 50%; background: #f2c258; }
.preview-lamps i:first-child { left: 31%; }
.preview-lamps i:nth-child(2) { left: 48%; background: #58ad87; }
.preview-lamps i:last-child { left: 65%; background: #df735d; }
.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); }
.sign-game { display: grid; grid-template-columns: minmax(0,1.06fr) minmax(365px,.94fr); gap: 20px; }

.expression-machine { position: relative; min-height: 455px; overflow: hidden; padding: 81px 28px 65px; border: 5px solid #fafbf2; border-radius: 29px; background: linear-gradient(160deg,#cce7df 0,#83b7b0 62%,#557e7c 63%,#355c5e 100%); box-shadow: inset 0 0 45px rgba(32,77,69,.12),0 9px 21px rgba(33,83,91,.12); }
.machine-lights { position: absolute; top: 20px; right: 10%; left: 10%; display: flex; justify-content: space-between; }
.machine-lights::before { position: absolute; top: 7px; right: 0; left: 0; height: 4px; content: ""; background: #294f52; }
.machine-lights i { z-index: 2; width: 16px; height: 16px; border: 3px solid #294f52; border-radius: 50%; background: #efc35e; box-shadow: 0 0 9px rgba(239,195,94,.7); }
.machine-lights i:nth-child(2),.machine-lights i:nth-child(4) { background: #58ad87; }
.machine-body { position: relative; z-index: 4; display: grid; grid-template-columns: 1fr 82px 1fr 43px 1fr; gap: 10px; align-items: center; padding: 35px 19px; border: 6px solid #294f52; border-radius: 26px; background: #eaf3e8; box-shadow: inset 0 -13px 0 rgba(52,90,80,.12),0 13px 0 #294f52; }
.number-cell,.result-cell,.sign-socket { display: grid; min-width: 0; min-height: 112px; place-items: center; padding: 9px; border: 4px solid #8da9a1; border-radius: 19px; text-align: center; background: #fffdf2; }
.number-cell small,.result-cell small,.sign-socket small { color: #748b84; font-size: 9px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.number-cell strong,.result-cell strong { font-size: clamp(35px,4.4vw,54px); }
.result-cell { border-color: #4d9d7d; color: #fff; background: #58ad87; }
.result-cell small { color: rgba(255,255,255,.78); }
.sign-socket { position: relative; border: 4px dashed var(--sign-color); color: var(--sign-color); background: #fff9df; }
.sign-socket strong { font-size: 53px; }
.sign-socket > i { position: absolute; right: -8px; bottom: -8px; width: 18px; height: 18px; border: 4px solid #294f52; border-radius: 50%; background: #f0c35e; }
.sign-socket.filled { border-style: solid; color: #fff; background: var(--sign-color); animation: sign-in .5s cubic-bezier(.2,.9,.3,1.3); }
.sign-socket.filled small { color: rgba(255,255,255,.8); }
@keyframes sign-in { 0% { opacity: .2; transform: translateY(-45px) rotate(-8deg); } 100% { opacity: 1; transform: none; } }
.equals { color: #294f52; font-size: 36px; font-weight: 900; text-align: center; }
.energy-line { position: absolute; z-index: 2; right: 10%; bottom: 70px; left: 10%; display: flex; justify-content: space-between; }
.energy-line::before { position: absolute; top: 10px; right: 0; left: 0; height: 6px; border-radius: 99px; content: ""; background: #294f52; }
.energy-line i { z-index: 2; width: 25px; height: 25px; border: 5px solid #294f52; border-radius: 50%; background: #8ca7a0; }
.energy-line.active i { background: #f2c45c; box-shadow: 0 0 14px #ffe07e; animation: energy-pulse .8s ease-in-out infinite alternate; }
@keyframes energy-pulse { to { transform: scale(1.18); } }
.machine-status { position: absolute; right: 0; bottom: 0; left: 0; display: flex; height: 53px; align-items: center; justify-content: space-between; padding: 0 24px; border-top: 5px solid #294f52; color: #fff4cf; background: #466f6e; }
.machine-status span { font-size: 12px; font-weight: 900; }
.machine-status b { color: #f2c45c; }

.workbench { display: flex; min-width: 0; min-height: 455px; flex-direction: column; padding: 22px; border: 2px solid #d8e8e2; border-radius: 29px; background: #fffdf5; }
.bench-heading { margin-bottom: 11px; text-align: center; }
.bench-heading small,.bench-heading strong { display: block; }
.bench-heading small { color: #718780; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.bench-heading strong { margin-top: 3px; font-size: 20px; }
.sign-guide { display: grid; min-height: 104px; grid-template-columns: repeat(2,1fr); gap: 6px; margin-bottom: 10px; }
.sign-guide span { display: flex; align-items: center; gap: 7px; padding: 7px; border-radius: 12px; color: #688079; font-size: 10px; font-weight: 800; background: #eff5ec; }
.sign-guide b { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border-radius: 9px; color: #fff; font-size: 19px; background: #5e8980; }
.relation-clue { min-height: 104px; margin-bottom: 10px; padding: 9px 12px; border: 2px solid #e5d397; border-radius: 16px; text-align: center; background: #fff8dd; }
.relation-clue > span { display: inline-grid; min-width: 37px; height: 34px; place-items: center; border: 2px solid #b8cdc5; border-radius: 9px; font-weight: 900; background: #fff; }
.relation-clue > i { margin: 0 10px; color: var(--level-accent); font-size: 25px; font-style: normal; font-weight: 900; }
.relation-clue p { margin: 5px 0 0; color: #6c7c76; font-size: 10px; line-height: 1.3; }
.sign-options { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: auto; }
.sign-option { position: relative; min-height: 119px; overflow: hidden; border: 3px solid #cfdfd9; border-radius: 21px; color: #294f52; cursor: pointer; background: #eef6f1; box-shadow: 0 6px 0 #b9d3ca; transition: transform .14s,border-color .14s; }
.sign-option:hover:not(:disabled) { z-index: 2; border-color: var(--sign); transform: translateY(-3px); }
.sign-option:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 #b9d3ca; }
.sign-option > small { position: absolute; top: 8px; left: 10px; color: #78928b; font-weight: 900; }
.sign-option > span { display: grid; width: 55px; height: 55px; place-items: center; margin: 0 auto 5px; border: 4px solid #294f52; border-radius: 16px; color: #fff; font-size: 38px; font-weight: 900; background: var(--sign); box-shadow: 0 5px 0 #294f52; }
.sign-option > strong { display: block; color: #668078; font-size: 11px; text-transform: uppercase; }
.sign-option.wrong { border-color: #e49382; background: #ffebe6; box-shadow: 0 6px 0 #dda99c; animation: shake .25s ease-in-out; }
.sign-option.correct { border-color: #55a883; color: #fff; background: #58ad87; box-shadow: 0 6px 0 #368263; }
.sign-option.correct > strong { color: rgba(255,255,255,.85); }
.sign-option.eliminated { opacity: .42; filter: grayscale(1); }
.sign-option.eliminated::after { position: absolute; z-index: 5; top: 51%; left: 8%; width: 84%; height: 6px; border: 2px solid #fff; border-radius: 99px; content: ""; background: #c45e4d; transform: rotate(-18deg); }
.sign-option > em { position: absolute; z-index: 6; right: 8px; bottom: 7px; padding: 3px 5px; border-radius: 6px; color: #fff; font-size: 8px; font-style: normal; font-weight: 900; background: #8d5550; }
.sign-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(160deg,#cce7df 0,#82b5ae 62%,#426d6c 63%); 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,.72); border-radius: 31px; text-align: center; background: #fffdf4; box-shadow: 0 21px 44px rgba(8,52,55,.23); }
.result-machine { position: relative; display: grid; height: 176px; margin: -8px auto 7px; place-items: center; }
.result-machine > span { width: 180px; filter: drop-shadow(0 12px 7px rgba(35,70,61,.2)); }
.result-machine > i { position: absolute; display: grid; width: 42px; height: 42px; place-items: center; border: 3px solid #294f52; border-radius: 12px; color: #fff; font-size: 25px; font-style: normal; font-weight: 900; background: #df735d; }
.result-machine > i:nth-child(2) { top: 12px; left: 15%; }
.result-machine > i:nth-child(3) { top: 15px; right: 15%; background: #3f9475; }
.result-machine > i:nth-child(4) { bottom: 11px; left: 10%; background: #667bc2; }
.result-machine > i:nth-child(5) { right: 10%; bottom: 11px; background: #d49b3f; }
.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; }
  .sign-game { grid-template-columns: minmax(0,.98fr) minmax(350px,1.02fr); }
  .game-shell { padding: 23px; }
  .machine-body { grid-template-columns: 1fr 70px 1fr 35px 1fr; gap: 6px; padding-right: 12px; padding-left: 12px; }
}

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 42px; }
  .hero-scene { min-height: 335px; clip-path: ellipse(78% 93% at 50% 100%); }
  .hero-machine { right: 14%; width: 32%; }
  .hero-equation { 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; }
  .sign-game { grid-template-columns: 1fr; }
  .expression-machine { min-height: 420px; }
  .workbench { min-height: 455px; }
  .machine-body { grid-template-columns: 1fr 90px 1fr 45px 1fr; }
}

@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 .machine { width: 48px; }
  .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-equation { top: 15%; left: 7%; transform: scale(.88); transform-origin: left; }
  .hero-machine { right: 8%; width: 37%; }
  .hero-signs { transform: scale(.82); transform-origin: right; }
  .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; }
  .expression-machine { min-height: 390px; padding: 68px 15px 59px; border-width: 3px; }
  .machine-body { grid-template-columns: 1fr 67px 1fr 33px 1fr; padding: 25px 10px; border-width: 5px; }
  .number-cell,.result-cell,.sign-socket { min-height: 97px; padding: 5px; border-width: 3px; }
  .number-cell small,.result-cell small,.sign-socket small { font-size: 7px; }
  .number-cell strong,.result-cell strong { font-size: 36px; }
  .sign-socket strong { font-size: 43px; }
  .workbench { 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); }
  .machine-body { grid-template-columns: 1fr 56px 1fr 24px 1fr; gap: 4px; padding: 22px 7px; }
  .number-cell,.result-cell,.sign-socket { min-height: 86px; border-radius: 14px; }
  .number-cell strong,.result-cell strong { font-size: 31px; }
  .sign-socket strong { font-size: 37px; }
  .equals { font-size: 25px; }
  .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: 250px; }
  .hero-equation { left: 2%; transform: scale(.73); }
  .hero-machine { right: 3%; width: 41%; }
  .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; }
  .expression-machine { min-height: 350px; padding: 57px 8px 53px; }
  .machine-lights { top: 13px; }
  .machine-body { grid-template-columns: 1fr 49px 1fr 21px 1fr; gap: 3px; border-width: 4px; }
  .number-cell,.result-cell,.sign-socket { min-height: 76px; padding: 3px; border-width: 2px; border-radius: 11px; }
  .number-cell strong,.result-cell strong { font-size: 27px; }
  .sign-socket strong { font-size: 33px; }
  .sign-socket > i { display: none; }
  .machine-status { height: 48px; padding: 0 13px; }
  .workbench { min-height: 420px; padding: 12px; }
  .sign-option { min-height: 107px; }
  .sign-option > span { width: 49px; height: 49px; font-size: 33px; }
  .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; }
}
