:root {
  color-scheme: dark;
  --ink: #17192f;
  --paper: #f7f0d3;
  --cream: #fff9e9;
  --air: #ffb42b;
  --air-light: #fff0a8;
  --water: #1fc9dd;
  --water-light: #b9f5f4;
  --violet: #5c4da8;
  --danger: #ed5265;
  --success: #48d18d;
  --metal: #7984a5;
  --edge: #242746;
  font-family: "Trebuchet MS", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #10142c; }
body { min-width: 300px; min-height: 100%; margin: 0; overflow-x: hidden; color: var(--cream); background: radial-gradient(circle at 18% 8%, #37437b 0 7%, transparent 28%), linear-gradient(150deg, #151a39, #10142c 55%, #251b44); overscroll-behavior: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 4px solid #fff; outline-offset: 4px; }
[hidden] { display: none !important; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: linear-gradient(rgba(255,255,255,.08) 2px, transparent 2px), linear-gradient(90deg, rgba(255,255,255,.08) 2px, transparent 2px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

.lab-shell { position: relative; width: min(1100px, 100%); min-height: 100vh; margin: 0 auto; padding: 14px clamp(10px, 2.5vw, 28px) 32px; }
.lab-header { position: relative; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; min-height: 54px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; width: max-content; color: #eaf7ff; text-decoration: none; font-weight: 900; }
.back-link span { display: grid; place-items: center; width: 31px; height: 31px; color: var(--ink); background: var(--paper); border: 3px solid var(--edge); border-radius: 50%; box-shadow: 3px 3px 0 rgba(0,0,0,.34); font-size: 1.5rem; line-height: 1; }
.lab-stamp { padding: 7px 13px; color: #202443; background: #d3e8ed; border: 3px solid var(--edge); box-shadow: inset 0 0 0 2px #fff, 3px 4px 0 rgba(0,0,0,.26); transform: rotate(-1deg); font: 1000 .72rem/1 monospace; letter-spacing: .14em; }
.sound-button { justify-self: end; min-height: 41px; padding: 7px 12px; color: #202443; background: var(--paper); border: 3px solid var(--edge); border-radius: 3px; box-shadow: 3px 4px 0 rgba(0,0,0,.3); cursor: pointer; font-weight: 1000; }
.sound-button[aria-pressed="true"] { color: #e9eefb; background: #515976; }
.screen { position: relative; z-index: 2; }

/* Start: a wide mechanical poster, not a generic card. */
.start-screen { display: grid; grid-template-columns: minmax(320px, 1.08fr) minmax(310px, .92fr); align-items: center; min-height: calc(100vh - 100px); padding: 36px 4% 56px; }
.start-screen::before { content: ""; position: absolute; z-index: -1; inset: 5% 0 3%; background: linear-gradient(103deg, rgba(30,208,220,.08), rgba(255,180,43,.11)); border-block: 2px dashed rgba(233,243,255,.25); clip-path: polygon(0 7%, 93% 0, 100% 89%, 8% 100%); }
.hero-machine { position: relative; min-height: 500px; filter: drop-shadow(0 22px 15px rgba(0,0,0,.4)); }
.hero-cylinder { position: absolute; top: 84px; width: 130px; height: 330px; overflow: hidden; border: 10px solid var(--edge); border-radius: 20px 20px 35px 35px; box-shadow: inset 0 0 0 5px rgba(255,255,255,.8), inset 20px 0 24px rgba(255,255,255,.18); }
.hero-cylinder::before { content: ""; position: absolute; z-index: 3; left: 50%; top: -62px; width: 38px; height: 145px; background: linear-gradient(90deg, #747d99, #e6edee 42% 60%, #656e8a); border: 6px solid var(--edge); transform: translateX(-50%); }
.hero-cylinder::after { content: ""; position: absolute; z-index: 4; left: 12px; right: 12px; top: 70px; height: 24px; background: #dfe8e8; border: 6px solid var(--edge); box-shadow: 0 9px 0 rgba(24,27,50,.2); }
.hero-cylinder i { position: absolute; inset: 100px 9px 10px; opacity: .78; }
.hero-cylinder b { position: absolute; z-index: 6; left: 50%; bottom: 23px; padding: 5px 8px; color: var(--ink); background: var(--cream); border: 3px solid var(--edge); transform: translateX(-50%) rotate(-2deg); font: 1000 .72rem/1 monospace; letter-spacing: .12em; }
.hero-cylinder span { position: absolute; z-index: 2; top: 130px; left: 0; right: 0; color: #fff; text-align: center; font-size: 1.25rem; font-weight: 1000; letter-spacing: .2em; }
.hero-cylinder--air { left: 10%; background: linear-gradient(rgba(255,246,183,.55), rgba(255,177,33,.35)); transform: rotate(-6deg); }
.hero-cylinder--air i { background: repeating-radial-gradient(circle at 30% 30%, #fff 0 4px, #ffc039 5px 13px, transparent 14px 32px), linear-gradient(var(--air-light), var(--air)); animation: airSquash 1.9s cubic-bezier(.6,.05,.3,1) infinite; transform-origin: bottom; }
.hero-cylinder--water { right: 8%; background: rgba(180,250,255,.38); transform: rotate(6deg); }
.hero-cylinder--water i { background: repeating-radial-gradient(circle at 30% 15%, rgba(255,255,255,.8) 0 3px, transparent 4px 28px), linear-gradient(#65e9ed, #139fc8); clip-path: polygon(0 11%, 14% 4%, 30% 12%, 47% 3%, 66% 10%, 83% 4%, 100% 12%, 100% 100%, 0 100%); }
.hero-runner { position: absolute; z-index: 8; left: 50%; bottom: 68px; width: 144px; height: 178px; transform: translateX(-50%); animation: runnerBounce .72s ease-in-out infinite alternate; }
.hero-runner::before { content: ""; position: absolute; inset: 21px 12px 31px; background: #f5ecce; border: 8px solid var(--edge); border-radius: 48% 48% 35% 35%; box-shadow: inset 18px 0 rgba(31,201,221,.22), inset -18px 0 rgba(255,180,43,.25); }
.hero-runner::after { content: ""; position: absolute; left: 29px; right: 29px; top: 0; height: 51px; background: var(--danger); border: 7px solid var(--edge); border-radius: 50% 50% 12px 12px; }
.hero-runner i { position: absolute; z-index: 4; left: 41px; top: 71px; width: 18px; height: 18px; background: var(--edge); border-radius: 50%; box-shadow: 44px 0 var(--edge); }
.hero-runner b { position: absolute; z-index: 5; left: 49px; top: 104px; width: 46px; height: 21px; border-bottom: 7px solid var(--edge); border-radius: 50%; }
.pipe { position: absolute; top: 211px; width: 35%; height: 42px; border: 8px solid var(--edge); border-inline: 0; background: repeating-linear-gradient(90deg, #77839d 0 19px, #dce9e9 19px 34px); }
.pipe-a { left: 20%; transform: rotate(13deg); }.pipe-b { right: 19%; transform: rotate(-13deg); }
.hero-spark { position: absolute; z-index: 10; width: 40px; height: 40px; background: var(--air); clip-path: polygon(50% 0,61% 34%,100% 28%,70% 53%,91% 83%,57% 70%,44% 100%,34% 66%,0 70%,27% 48%,7% 18%,42% 31%); animation: sparkSpin 1.4s steps(2) infinite; }
.spark-a { left: 38%; top: 107px; }.spark-b { right: 35%; bottom: 92px; background: var(--water); animation-delay: -.5s; }
.start-copy { position: relative; z-index: 5; padding: 25px 0; }
.eyebrow { margin: 0; color: #8ceaf1; font: 1000 .75rem/1.3 monospace; letter-spacing: .17em; text-transform: uppercase; }
.start-copy h1 { margin: 10px 0 14px; color: var(--cream); font-size: clamp(2.7rem, 5.8vw, 5.4rem); font-weight: 1000; line-height: .92; letter-spacing: -.065em; text-shadow: 5px 6px 0 #3e356e, 9px 10px 0 rgba(0,0,0,.26); }
.start-copy h1 span { display: block; color: var(--air); font-size: .42em; letter-spacing: .06em; text-shadow: 3px 3px 0 #753d4b; transform: rotate(-2deg); transform-origin: left; }
.lead { margin: 0 0 23px; font-size: clamp(1rem, 2vw, 1.3rem); font-weight: 900; line-height: 1.8; }
.air-word { padding: 3px 7px; color: var(--ink); background: var(--air); box-decoration-break: clone; }.water-word { padding: 3px 7px; color: var(--ink); background: var(--water); box-decoration-break: clone; }
.start-lever { position: relative; min-height: 63px; padding: 0 76px 0 24px; color: #fff; background: var(--danger); border: 6px solid var(--edge); border-radius: 4px; box-shadow: 0 9px 0 #891f45, 0 14px 15px rgba(0,0,0,.34); cursor: pointer; font-size: 1.08rem; font-weight: 1000; transition: transform .12s, box-shadow .12s; }
.start-lever i { position: absolute; right: 18px; top: 50%; width: 36px; height: 36px; background: #ffdc3e; border: 5px solid var(--edge); border-radius: 50%; transform: translateY(-50%); box-shadow: inset 0 -6px #e9991c; }
.start-lever:hover { transform: translateY(4px); box-shadow: 0 5px 0 #891f45, 0 9px 10px rgba(0,0,0,.3); }
.start-lever.compact { min-height: 54px; border-width: 4px; box-shadow: 0 7px 0 #891f45; }
.quick-controls { color: #bfc9e7; font-size: .7rem; font-weight: 700; line-height: 1.7; }
.record-gauge { position: absolute; z-index: 12; left: 3%; bottom: 3%; width: 235px; padding: 12px 14px; color: var(--ink); background: #b9c8ca; border: 5px solid var(--edge); box-shadow: inset 0 0 0 3px #eef6ee, 6px 8px 0 rgba(0,0,0,.25); transform: rotate(1deg); }
.record-gauge h2 { margin: 0 0 6px; font: 1000 .68rem/1 monospace; letter-spacing: .12em; }
.record-gauge dl { margin: 0; }.record-gauge dl div { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 2px dashed #7c8790; font-size: .76rem; }.record-gauge dt { font-weight: 800; }.record-gauge dd { margin: 0; font-weight: 1000; }

/* Game instrumentation */
.play-screen { padding-top: 8px; }
.instrument-panel { display: grid; grid-template-columns: repeat(5, 1fr); color: #20243e; background: #bac6ca; border: 5px solid var(--edge); box-shadow: inset 0 0 0 3px #eef7f4, 0 8px 0 rgba(0,0,0,.3); }
.instrument-panel > div { min-width: 0; padding: 7px 11px; text-align: center; border-right: 3px solid #69768b; }
.instrument-panel > div:last-child { border-right: 0; }.instrument-panel span { display: block; color: #566078; font: 900 .65rem/1.2 monospace; letter-spacing: .08em; }.instrument-panel strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.08rem; }.instrument-panel b { color: #bc2e55; }.energy-cell strong { color: var(--success); letter-spacing: .12em; text-shadow: 1px 1px var(--edge); }
.wave-track { position: relative; height: 18px; margin: 7px 8px 9px; background: #292e4f; border: 3px solid var(--edge); overflow: visible; }
.wave-track i { display: block; width: 0; height: 100%; background: repeating-linear-gradient(90deg, var(--air) 0 19px, var(--water) 19px 38px); transition: width .45s ease; }.wave-track b { position: absolute; right: 8px; top: -20px; padding: 2px 7px; color: var(--ink); background: var(--cream); border: 2px solid var(--edge); font: 1000 .63rem/1 monospace; }
.course-frame { position: relative; overflow: hidden; background: #172041; border: 6px solid var(--edge); box-shadow: inset 0 0 0 3px #7383a5, 0 10px 0 rgba(0,0,0,.32); }
#gameCanvas { display: block; width: 100%; height: auto; max-height: min(54vh, 540px); background: #162344; touch-action: none; }
.action-callout { position: absolute; z-index: 4; top: 15px; left: 15px; min-width: 205px; padding: 8px 13px 8px 52px; color: var(--ink); background: var(--air-light); border: 4px solid var(--edge); box-shadow: 4px 5px 0 rgba(0,0,0,.28); clip-path: polygon(0 0,100% 0,100% 82%,92% 100%,0 100%); }
.action-callout::before { content: ""; position: absolute; left: 13px; top: 50%; width: 25px; height: 25px; background: var(--air); border: 4px solid var(--edge); border-radius: 50%; transform: translateY(-50%); }
.action-callout.is-water { background: var(--water-light); }.action-callout.is-water::before { background: var(--water); border-radius: 50% 50% 50% 8px; transform: translateY(-50%) rotate(-45deg); }
.action-callout b, .action-callout span { display: block; }.action-callout b { font: 1000 .66rem/1 monospace; letter-spacing: .09em; }.action-callout span { margin-top: 3px; font-size: .82rem; font-weight: 1000; }
.feedback-panel { position: absolute; z-index: 8; left: 50%; top: 48%; width: min(430px, 90%); padding: 16px 22px; color: var(--ink); text-align: center; background: var(--cream); border: 6px solid var(--edge); box-shadow: 10px 12px 0 rgba(0,0,0,.3); transform: translate(-50%,-50%) rotate(-1deg); }
.feedback-panel::before, .feedback-panel::after { content: ""; position: absolute; width: 26px; height: 26px; background: var(--air); clip-path: polygon(50% 0,62% 36%,100% 29%,70% 55%,89% 92%,56% 72%,36% 100%,32% 66%,0 72%,28% 49%,8% 15%,42% 31%); }
.feedback-panel::before { left: -16px; top: -18px; }.feedback-panel::after { right: -15px; bottom: -17px; background: var(--water); }
.feedback-panel strong { font-size: 1.35rem; }.feedback-panel span { display: inline-block; margin-left: 10px; color: #c12855; font-size: 1.2rem; font-weight: 1000; }.feedback-panel p { margin: 6px 0 0; font-size: .82rem; font-weight: 800; line-height: 1.55; }
.feedback-panel.is-miss { border-color: #79223d; background: #ffd4cf; }.feedback-panel.is-miss::before, .feedback-panel.is-miss::after { background: var(--danger); }
.control-deck { display: grid; grid-template-columns: 1fr 90px 1fr; align-items: stretch; gap: 10px; margin-top: 11px; }
.piston-button { display: grid; grid-template-columns: 82px 1fr auto; align-items: center; gap: 12px; min-height: 98px; padding: 10px 13px; color: var(--ink); text-align: left; border: 6px solid var(--edge); border-radius: 5px; box-shadow: 0 8px 0 rgba(0,0,0,.37); cursor: pointer; touch-action: none; user-select: none; transition: transform .08s, box-shadow .08s, filter .15s; }
.piston-button--air { background: var(--air-light); }.piston-button--water { background: var(--water-light); }
.piston-button:active, .piston-button.is-active { transform: translateY(6px); box-shadow: 0 2px 0 rgba(0,0,0,.42); filter: saturate(1.2); }
.piston-button.is-wrong { animation: wrongJolt .25s linear 2; }
.piston-button > span:nth-child(2) strong, .piston-button > span:nth-child(2) small { display: block; }.piston-button > span:nth-child(2) strong { font-size: clamp(.9rem, 2vw, 1.12rem); }.piston-button > span:nth-child(2) small { margin-top: 4px; font-size: .7rem; font-weight: 800; }
.piston-button kbd { align-self: start; padding: 3px 6px; color: #fff; background: var(--edge); border: 0; border-radius: 2px; font: 800 .62rem/1 monospace; }
.button-symbol { position: relative; display: block; width: 76px; height: 58px; overflow: hidden; background: rgba(255,255,255,.42); border: 4px solid var(--edge); }
.button-symbol i { position: absolute; z-index: 2; left: 9px; right: 9px; top: 9px; height: 14px; background: #dce7e6; border: 4px solid var(--edge); transition: top .1s, height .1s; }.is-active .button-symbol i { top: 31px; }
.button-symbol b { position: absolute; left: 0; right: 0; bottom: 3px; text-align: center; font-size: .7rem; letter-spacing: .08em; }
.piston-button--water .button-symbol b { color: #08799c; }.piston-button--air .button-symbol b { color: #a46300; }
.comparison-meter { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; color: #cfd6ee; font: 900 .58rem/1 monospace; }
.comparison-meter i { position: relative; width: 55px; height: 55px; background: conic-gradient(var(--air), var(--water), var(--air)); border: 5px solid var(--edge); border-radius: 50%; box-shadow: inset 0 0 0 6px #e8ece5; }
.comparison-meter b { position: absolute; left: 50%; bottom: 50%; width: 5px; height: 21px; background: var(--edge); border-radius: 5px; transform: translateX(-50%) rotate(-60deg); transform-origin: 50% 100%; transition: transform .12s; }

/* Checkpoint tank */
.quiz-screen { display: grid; place-items: center; min-height: calc(100vh - 90px); padding: 25px 0; }
.quiz-tank { position: relative; width: min(760px, 100%); min-height: 520px; overflow: hidden; padding: clamp(35px, 6vw, 66px); color: var(--ink); background: linear-gradient(180deg, rgba(239,255,255,.94), rgba(151,235,239,.92)); border: 12px solid var(--edge); border-radius: 80px 80px 28px 28px; box-shadow: inset 0 0 0 8px rgba(255,255,255,.6), 14px 16px 0 rgba(0,0,0,.32); }
.quiz-tank::before { content: ""; position: absolute; inset: 25px; border: 3px dashed #4e7891; border-radius: 52px 52px 12px 12px; pointer-events: none; }
.tank-bubbles { position: absolute; inset: 0; pointer-events: none; }.tank-bubbles i { position: absolute; width: 28px; height: 28px; border: 5px solid rgba(255,255,255,.75); border-radius: 50%; animation: bubbleUp 3s linear infinite; }.tank-bubbles i:nth-child(1) { left: 6%; bottom: -30px; }.tank-bubbles i:nth-child(2) { left: 88%; bottom: 9%; width: 19px; height: 19px; animation-delay: -1.3s; }.tank-bubbles i:nth-child(3) { left: 15%; bottom: 31%; width: 15px; height: 15px; animation-delay: -2s; }.tank-bubbles i:nth-child(4) { left: 79%; bottom: -30px; animation-delay: -.6s; }.tank-bubbles i:nth-child(5) { left: 93%; bottom: 54%; width: 13px; height: 13px; animation-delay: -2.4s; }
.quiz-kicker, .quiz-tank h2, .quiz-question, .quiz-choices, .quiz-explanation { position: relative; }.quiz-kicker { margin: 0; color: #046f8e; font: 1000 .72rem/1 monospace; letter-spacing: .14em; }.quiz-tank h2 { margin: 8px 0 20px; font-size: clamp(1.65rem, 4vw, 2.7rem); }.quiz-question { padding: 13px 16px; background: var(--cream); border-left: 10px solid var(--air); font-weight: 1000; line-height: 1.65; }
.quiz-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.quiz-choice { min-height: 64px; padding: 10px 13px; color: var(--ink); text-align: left; background: rgba(255,255,255,.8); border: 4px solid var(--edge); box-shadow: 4px 5px 0 rgba(26,39,69,.28); cursor: pointer; font-weight: 900; line-height: 1.4; }.quiz-choice:not(:disabled):hover { transform: translateY(2px); box-shadow: 2px 3px 0 rgba(26,39,69,.28); }.quiz-choice.is-correct::before { content: "○ "; color: #087a45; }.quiz-choice.is-wrong::before { content: "× "; color: #c52f50; }.quiz-choice.is-correct { background: #bff2d5; }.quiz-choice.is-wrong { background: #ffd0ca; }
.quiz-explanation { margin-top: 15px; padding: 14px; background: var(--paper); border: 4px solid var(--edge); box-shadow: 4px 5px rgba(0,0,0,.18); }.quiz-explanation strong { color: #bd2855; }.quiz-explanation p { margin: 5px 0 12px; font-size: .85rem; font-weight: 700; line-height: 1.7; }.quiz-explanation button { min-height: 43px; padding: 7px 15px; color: #fff; background: var(--violet); border: 3px solid var(--edge); box-shadow: 3px 4px #24213e; cursor: pointer; font-weight: 900; }

/* Result blueprint */
.result-screen { display: grid; place-items: start center; min-height: calc(100vh - 82px); padding: 27px 0; }
.result-blueprint { position: relative; width: min(850px, 100%); overflow: hidden; padding: clamp(27px, 5vw, 52px); color: var(--cream); text-align: center; background-color: #253d69; background-image: linear-gradient(rgba(125,206,230,.18) 2px, transparent 2px), linear-gradient(90deg, rgba(125,206,230,.18) 2px, transparent 2px); background-size: 34px 34px; border: 8px solid var(--edge); box-shadow: 13px 15px 0 rgba(0,0,0,.35); }
.result-blueprint::before { content: ""; position: absolute; inset: 15px; border: 3px dashed #87c9df; pointer-events: none; }.result-blueprint > * { position: relative; }
.result-piston { width: 150px; height: 95px; margin: 0 auto 4px; }.result-piston i { position: absolute; left: 50%; top: 0; width: 32px; height: 70px; background: #b8c5c9; border: 6px solid var(--edge); transform: translateX(-50%); }.result-piston b { position: absolute; left: 18px; right: 18px; bottom: 2px; height: 34px; background: var(--air); border: 6px solid var(--edge); }.result-piston span { position: absolute; z-index: 3; left: 50%; bottom: 9px; color: var(--cream); transform: translateX(-50%); font-size: 1.2rem; }
.result-blueprint h2 { margin: 8px 0; font-size: clamp(2rem, 5vw, 3.7rem); text-shadow: 4px 4px #191b36; }.result-blueprint > p:not(.eyebrow) { max-width: 630px; margin: 10px auto; color: #d8e8f0; font-weight: 700; line-height: 1.7; }
.final-score { display: inline-grid; grid-template-columns: auto auto; align-items: end; min-width: 290px; margin: 13px 0 20px; padding: 9px 24px; color: var(--ink); background: var(--air); border: 6px double var(--edge); transform: rotate(-1deg); }.final-score span { grid-column: 1 / -1; font: 1000 .7rem/1 monospace; letter-spacing: .14em; }.final-score strong { font-size: 3rem; line-height: 1; }.final-score small { padding-bottom: 4px; font-weight: 1000; }
.result-dials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; max-width: 630px; margin: 0 auto 22px; }.result-dials div { padding: 11px; background: #d6e3e3; border: 5px solid var(--edge); color: var(--ink); box-shadow: 4px 5px rgba(0,0,0,.23); }.result-dials i { display: block; width: 58px; height: 58px; margin: 0 auto 5px; background: conic-gradient(var(--success) calc(var(--dial) * 1%), #758093 0); border: 5px solid var(--edge); border-radius: 50%; box-shadow: inset 0 0 0 10px #eaf1eb; }.result-dials span, .result-dials strong { display: block; }.result-dials span { color: #667087; font: 900 .65rem/1 monospace; }.result-dials strong { margin-top: 3px; }
.result-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }.ranking-button { min-height: 54px; padding: 9px 20px; color: var(--ink); background: var(--water); border: 5px solid var(--edge); box-shadow: 0 7px 0 #087c9c; cursor: pointer; font-weight: 1000; }.ranking-panel { scroll-margin-top: 12px; margin-top: 26px; padding: 14px; color: var(--ink); text-align: left; background: #eef5e8; border: 5px solid var(--edge); }
.ranking-panel.itc-ranking { color: var(--ink); }
.ranking-panel .itc-ranking__tabs button[aria-pressed="true"] { color: var(--cream); background: var(--ink); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes airSquash { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(.48); } }
@keyframes runnerBounce { to { transform: translateX(-50%) translateY(-9px) rotate(2deg); } }
@keyframes sparkSpin { to { transform: rotate(90deg) scale(1.12); } }
@keyframes bubbleUp { from { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(-480px); opacity: 0; } }
@keyframes wrongJolt { 0%,100% { transform: translateX(0); } 35% { transform: translateX(-8px); } 70% { transform: translateX(8px); } }

@media (max-width: 800px) {
  .lab-shell { padding-inline: 9px; }.lab-stamp { display: none; }.lab-header { grid-template-columns: 1fr 1fr; }.start-screen { grid-template-columns: 1fr; padding-top: 10px; text-align: center; }.hero-machine { min-height: 310px; order: 0; transform: scale(.68); transform-origin: 50% 34%; margin-bottom: -98px; }.start-copy { order: 1; }.start-copy h1 span { transform-origin: center; }.record-gauge { position: relative; left: auto; bottom: auto; width: min(400px, 94%); margin: 6px auto 0; transform: rotate(-.5deg); }.instrument-panel { grid-template-columns: repeat(3, 1fr); }.instrument-panel > div:nth-child(3) { border-right: 0; }.instrument-panel > div:nth-child(-n+3) { border-bottom: 3px solid #69768b; }.instrument-panel > div:nth-child(4) { grid-column: span 1; }.energy-cell { grid-column: span 2; }.control-deck { grid-template-columns: 1fr 1fr; }.comparison-meter { display: none; }.piston-button { grid-template-columns: 56px 1fr; min-height: 105px; gap: 8px; padding: 8px; }.piston-button kbd { display: none; }.button-symbol { width: 54px; }.piston-button > span:nth-child(2) strong { font-size: .82rem; }.piston-button > span:nth-child(2) small { font-size: .62rem; }.action-callout { top: 7px; left: 7px; min-width: 178px; padding-left: 43px; }.action-callout::before { left: 9px; }.quiz-choices { grid-template-columns: 1fr; }.result-dials { gap: 6px; }
}

@media (max-width: 470px) {
  .lab-header { min-height: 44px; }.back-link { font-size: .75rem; }.back-link span { width: 26px; height: 26px; }.sound-button { min-height: 36px; font-size: .75rem; }.start-screen { min-height: auto; padding-inline: 2px; }.hero-machine { margin-top: -23px; }.start-copy h1 { font-size: 2.6rem; }.lead { font-size: .88rem; }.quick-controls { font-size: .61rem; }.start-lever { padding-left: 15px; padding-right: 62px; }.instrument-panel > div { padding: 5px 4px; }.instrument-panel span { font-size: .54rem; }.instrument-panel strong { font-size: .83rem; }.course-frame { border-width: 4px; }.action-callout { min-width: 153px; padding: 6px 8px 6px 38px; }.action-callout b { font-size: .55rem; }.action-callout span { font-size: .67rem; }.feedback-panel { padding: 10px 12px; border-width: 4px; }.feedback-panel strong { font-size: 1.05rem; }.feedback-panel p { font-size: .7rem; }.control-deck { gap: 5px; margin-top: 6px; }.piston-button { grid-template-columns: 41px 1fr; min-height: 88px; border-width: 4px; }.button-symbol { width: 41px; height: 47px; border-width: 3px; }.button-symbol i { left: 5px; right: 5px; border-width: 3px; }.piston-button > span:nth-child(2) strong { font-size: .7rem; }.piston-button > span:nth-child(2) small { font-size: .54rem; line-height: 1.25; }.quiz-tank { min-height: 0; padding: 42px 22px; border-width: 7px; border-radius: 42px 42px 16px 16px; }.quiz-tank::before { inset: 13px; }.quiz-tank h2 { margin-bottom: 12px; }.quiz-question { font-size: .84rem; }.quiz-choice { min-height: 52px; font-size: .76rem; }.result-blueprint { padding-inline: 17px; border-width: 5px; }.result-blueprint::before { inset: 8px; }.result-dials div { padding: 7px 3px; border-width: 3px; }.result-dials i { width: 45px; height: 45px; border-width: 4px; box-shadow: inset 0 0 0 7px #eaf1eb; }.result-dials strong { font-size: .75rem; }.final-score { min-width: 240px; }.final-score strong { font-size: 2.4rem; }
}

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