:root {
  color-scheme: light;
  --ink: #263d3b;
  --ink-soft: #60736f;
  --paper: #fffdf7;
  --cream: #fff8df;
  --sky: #cceff5;
  --sky-deep: #79c7d7;
  --teal: #26766e;
  --teal-dark: #18564f;
  --mint: #dff3e8;
  --yellow: #f8c94f;
  --yellow-dark: #d89a22;
  --coral: #ef6657;
  --coral-dark: #b9463f;
  --blue: #398eaa;
  --line: #c9dad5;
  --shadow: rgba(45, 76, 72, .16);
  font-family: "Trebuchet MS", "Avenir Next", Avenir, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #e9f5ef;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 25%, rgba(255, 255, 255, .72) 0 3px, transparent 4px),
    radial-gradient(circle at 91% 71%, rgba(255, 255, 255, .65) 0 2px, transparent 3px),
    #e9f5ef;
  background-size: 62px 62px, 47px 47px, auto;
}

button,
input {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 4px solid #187f78;
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: .62;
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.page-texture {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: .3;
  background-image: repeating-linear-gradient(102deg, transparent 0 10px, rgba(38, 61, 59, .025) 11px, transparent 12px 23px);
}

.topbar {
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(24px, calc(24px + env(safe-area-inset-right, 0px))) 10px max(24px, calc(24px + env(safe-area-inset-left, 0px)));
  background: var(--cream);
  border-bottom: 2px solid #d9ded4;
  box-shadow: 0 4px 15px rgba(43, 78, 70, .08);
}

.back-link {
  justify-self: start;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  color: var(--teal);
  border-radius: 12px;
  font-weight: 900;
  text-decoration: none;
}

.back-link > span:first-child {
  font-size: 25px;
  line-height: 1;
}

.back-link:hover {
  background: #edf5e9;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 49px;
  height: 49px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--coral);
  border: 3px solid #fff;
  border-radius: 52% 46% 50% 43%;
  box-shadow: 0 0 0 2px var(--coral), 3px 4px 0 rgba(130, 55, 49, .14);
  transform: rotate(-5deg);
}

.brand-mark svg {
  width: 39px;
  height: 39px;
  overflow: visible;
}

.brand-mark path,
.brand-mark ellipse {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: clamp(21px, 2.2vw, 29px);
  letter-spacing: -.04em;
  line-height: 1;
}

.brand p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.top-actions {
  justify-self: end;
  display: flex;
  gap: 8px;
}

.round-button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 13px;
  color: var(--teal);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 3px 0 #b8cbc5;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.round-button:hover {
  background: #f1fbf7;
  border-color: #8dc7bb;
}

.round-button:active {
  box-shadow: 0 1px 0 #b8cbc5;
  transform: translateY(2px);
}

.round-button[aria-pressed="false"] {
  color: #7d8987;
  background: #edf0ed;
  box-shadow: none;
}

main {
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: 18px max(20px, env(safe-area-inset-right, 0px)) max(34px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
}

.mission-card {
  max-width: 960px;
  min-height: 67px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  margin: 0 auto 14px;
  padding: 9px 14px;
  background: rgba(255, 253, 247, .8);
  border: 2px dashed #a8cfc6;
  border-radius: 18px;
}

.mission-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 50% 45% 52% 47%;
  box-shadow: 2px 3px 0 #164f49;
  font-size: 22px;
  font-weight: 900;
  transform: rotate(-5deg);
}

.eyebrow {
  margin: 0;
  color: var(--coral-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.mission-card h2 {
  margin: 2px 0 0;
  font-size: clamp(17px, 2.2vw, 23px);
  letter-spacing: -.025em;
  line-height: 1.1;
}

.fair-tip {
  margin: 0;
  padding: 8px 12px;
  color: #705018;
  background: #fff1b8;
  border-radius: 12px;
  font-size: 12px;
}

.fair-tip span {
  margin-right: 4px;
  color: var(--coral);
}

.experiment-steps {
  position: relative;
  z-index: 0;
  max-width: 510px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 auto 14px;
  padding: 0;
  list-style: none;
}

.experiment-steps li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #83918e;
  font-size: 11px;
}

.experiment-steps li::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 15px;
  right: 50%;
  width: 100%;
  height: 3px;
  background: #c6d9d2;
}

.experiment-steps li:first-child::before {
  display: none;
}

.experiment-steps span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: #d8e5e0;
  border: 2px solid #b8ccc5;
  border-radius: 50%;
  font-weight: 900;
}

.experiment-steps b {
  font-weight: 900;
}

.experiment-steps li.current,
.experiment-steps li.done {
  color: var(--ink);
}

.experiment-steps li.current span {
  color: #fff;
  background: var(--coral);
  border-color: var(--coral-dark);
  box-shadow: 0 3px 0 #a8413a;
  transform: rotate(-4deg) scale(1.08);
}

.experiment-steps li.done span {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal-dark);
}

.experiment-steps li.done::before,
.experiment-steps li.current::before {
  background: var(--teal);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(340px, .72fr);
  gap: 18px;
  align-items: start;
}

.lab-card,
.control-card,
.logbook {
  background: var(--paper);
  border: 2px solid #ccddd7;
  box-shadow: 0 12px 30px var(--shadow);
}

.lab-card {
  overflow: hidden;
  border-radius: 26px 26px 19px 19px;
}

.control-card {
  min-height: 650px;
  padding: 19px;
  border-radius: 23px 23px 18px 18px;
}

.scene-head {
  min-height: 79px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  background: var(--cream);
  border-bottom: 2px dashed #d6d6c8;
}

.scene-head h2,
.panel-heading h2,
.result-panel h2,
.logbook h2,
.modal-card h2 {
  margin: 2px 0 0;
  font-size: clamp(20px, 2.1vw, 27px);
  letter-spacing: -.03em;
  line-height: 1.08;
}

.live-measures {
  display: flex;
  gap: 8px;
}

.measure {
  min-width: 104px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 2px solid #b9d5d2;
  border-radius: 14px;
  box-shadow: 0 3px 0 #c4d5d1;
}

.measure-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 50%;
  font-size: 18px;
  font-weight: 900;
}

.distance-measure .measure-icon {
  background: var(--teal);
}

.measure small,
.measure output {
  display: block;
  white-space: nowrap;
}

.measure small {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.measure output {
  margin-top: 2px;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.rocket-scene {
  position: relative;
  min-height: 550px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #d7f0ef;
}

#experiment-svg {
  width: 100%;
  height: auto;
  display: block;
}

.cloud {
  fill: rgba(255, 255, 255, .72);
  stroke: rgba(94, 153, 161, .22);
  stroke-width: 2;
}

.cloud-one {
  animation: cloud-drift 7s ease-in-out infinite alternate;
}

.cloud-two {
  animation: cloud-drift 9s 1s ease-in-out infinite alternate-reverse;
}

@keyframes cloud-drift {
  to { transform: translateX(13px); }
}

.wind-doodles {
  fill: none;
  stroke: #78b8c1;
  stroke-width: 4;
  stroke-linecap: round;
  opacity: .42;
}

.ground {
  fill: #cde8ca;
  stroke: #8bbf9e;
  stroke-width: 3;
}

.post {
  fill: url(#wood-gradient);
  stroke: #8c5b35;
  stroke-width: 3;
}

.post-highlight {
  fill: rgba(255, 255, 255, .35);
}

.post-base {
  fill: #cf9051;
  stroke: #875532;
  stroke-width: 3;
  stroke-linejoin: round;
}

.post-shadow {
  fill: rgba(59, 85, 77, .15);
}

.start-post circle,
.end-post > circle {
  fill: #f5d17a;
  stroke: #7d5837;
  stroke-width: 3;
}

.guide-string-shadow {
  stroke: rgba(31, 67, 63, .16);
  stroke-width: 7;
  stroke-linecap: round;
}

.guide-string {
  stroke: #fcf8de;
  stroke-width: 4;
  stroke-linecap: round;
}

.finish-flag > path:first-child {
  fill: none;
  stroke: #263d3b;
  stroke-width: 4;
  stroke-linecap: round;
}

.finish-flag > path:nth-child(2) {
  fill: var(--yellow);
  stroke: #9b6b23;
  stroke-width: 3;
  stroke-linejoin: round;
}

.flag-check {
  fill: none;
  stroke: rgba(115, 72, 25, .45);
  stroke-width: 2;
}

#rocket-motion {
  will-change: transform;
}

.straw {
  fill: #f9f4dc;
  stroke: #5e837e;
  stroke-width: 3;
}

.straw-shine {
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  opacity: .9;
}

.tape {
  fill: none;
  stroke: #f6c94f;
  stroke-width: 12;
  stroke-linecap: round;
  opacity: .9;
}

.balloon-body {
  fill: url(#balloon-gradient);
  stroke: #9d3636;
  stroke-width: 3;
}

.balloon-neck {
  fill: #d94d48;
  stroke: #963a37;
  stroke-width: 3;
  stroke-linejoin: round;
}

.balloon-shine {
  fill: rgba(255, 255, 255, .42);
}

.balloon-face circle {
  fill: #593935;
}

.balloon-face path {
  fill: none;
  stroke: #593935;
  stroke-width: 3;
  stroke-linecap: round;
}

.payload-rig > path {
  fill: none;
  stroke: #4d6863;
  stroke-width: 3;
  stroke-linecap: round;
}

.payload-rig .payload-tray {
  fill: #e5a84f;
  stroke: #815f37;
  stroke-width: 3;
  stroke-linejoin: round;
}

.payload-block {
  stroke: #66463b;
  stroke-width: 2;
}

.payload-block:nth-child(3n + 1) { fill: #51a89c; }
.payload-block:nth-child(3n + 2) { fill: #f3bd43; }
.payload-block:nth-child(3n) { fill: #e76d59; }

.payload-rig.empty {
  display: none;
}

.thrust-arrows {
  fill: none;
  stroke: var(--coral);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.air-puffs {
  fill: rgba(255, 255, 255, .85);
  stroke: #71bcc7;
  stroke-width: 3;
  opacity: 0;
}

.air-puffs path {
  fill: none;
  stroke-linecap: round;
}

.rocket-scene.launching .air-puffs {
  animation: puff-stream .55s ease-in-out infinite;
}

.rocket-scene.launching .thrust-arrows {
  animation: arrow-stream .7s ease-in-out infinite;
}

@keyframes puff-stream {
  0% { opacity: .25; transform: translateX(10px) scale(.8); }
  50% { opacity: .95; }
  100% { opacity: 0; transform: translateX(-25px) scale(1.15); }
}

@keyframes arrow-stream {
  0%, 100% { opacity: .3; transform: translateX(5px); }
  50% { opacity: .9; transform: translateX(-8px); }
}

.rocket-scene.launching #balloon-assembly {
  animation: balloon-wobble .2s ease-in-out infinite alternate;
  transform-origin: 45px 218px;
}

@keyframes balloon-wobble {
  from { transform: rotate(-1.2deg) translateY(-1px); }
  to { transform: rotate(1.2deg) translateY(1px); }
}

.rocket-scene.stopped #balloon-assembly {
  animation: tired-bob .65s ease-out 1;
  transform-origin: 45px 218px;
}

@keyframes tired-bob {
  30% { transform: rotate(4deg) translateY(3px); }
  65% { transform: rotate(-2deg) translateY(-1px); }
}

.ruler-base {
  stroke: #8ba8a1;
  stroke-width: 5;
  stroke-linecap: round;
  opacity: .55;
}

.distance-progress {
  stroke: var(--coral);
  stroke-width: 7;
  stroke-linecap: round;
}

.ruler-tick path {
  fill: none;
  stroke: #93a9a4;
  stroke-width: 3;
  stroke-linecap: round;
  opacity: .45;
}

.ruler-tick text {
  fill: #7a8e89;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  text-anchor: middle;
  opacity: .55;
}

.ruler-tick.active path {
  stroke: #435e59;
  opacity: .9;
}

.ruler-tick.active text {
  fill: #435e59;
  opacity: 1;
}

.countdown {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 110px;
  height: 110px;
  display: none;
  place-items: center;
  color: #fff;
  background: var(--coral);
  border: 6px solid #fff;
  border-radius: 50% 46% 52% 45%;
  box-shadow: 0 0 0 5px var(--coral-dark), 0 12px 30px rgba(74, 54, 45, .25);
  font-size: 57px;
  font-weight: 900;
  line-height: 1;
  transform: translate(-50%, -50%) rotate(-5deg);
}

.countdown.show {
  display: grid;
  animation: countdown-pop .5s ease both;
}

@keyframes countdown-pop {
  from { opacity: 0; transform: translate(-50%, -50%) rotate(-10deg) scale(.45); }
  65% { transform: translate(-50%, -50%) rotate(3deg) scale(1.12); }
  to { opacity: 1; transform: translate(-50%, -50%) rotate(-5deg) scale(1); }
}

.scene-message {
  position: absolute;
  left: 50%;
  bottom: 18px;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 8px 15px;
  color: var(--ink);
  background: rgba(255, 253, 247, .94);
  border: 2px solid #a9cbc4;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(52, 81, 76, .12);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}

.number-dot {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--coral);
  border: 2px solid var(--coral-dark);
  border-radius: 50%;
  box-shadow: 0 3px 0 #a84039;
  font-size: 20px;
  font-weight: 900;
}

.control-group {
  min-width: 0;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.control-group legend,
.prediction legend {
  width: 100%;
  margin-bottom: 8px;
  padding: 0;
  font-size: 13px;
  font-weight: 900;
}

.control-group legend > span {
  width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  margin-right: 5px;
  color: #fff;
  background: var(--teal);
  border-radius: 50%;
  font-size: 11px;
}

.balloon-options,
.payload-options,
.prediction-options {
  display: grid;
  gap: 7px;
}

.balloon-options {
  grid-template-columns: repeat(3, 1fr);
}

.balloon-options button,
.payload-options button,
.prediction-options button {
  position: relative;
  min-width: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  background: #fff;
  border: 2px solid #cbdad6;
  border-radius: 13px;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.balloon-options button {
  flex-direction: column;
  padding: 6px 4px 7px;
}

.balloon-options button:hover,
.payload-options button:hover,
.prediction-options button:hover {
  border-color: #79b5ac;
  transform: translateY(-2px);
}

.balloon-options button.selected,
.payload-options button.selected,
.prediction-options button.selected {
  color: var(--ink);
  background: #e6f6ef;
  border-color: var(--teal);
  box-shadow: 0 3px 0 #8fc5b8;
}

.balloon-options b,
.balloon-options small,
.payload-options b,
.payload-options small {
  display: block;
}

.balloon-options b,
.payload-options b {
  font-size: 12px;
  line-height: 1.05;
}

.balloon-options small,
.payload-options small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
}

.mini-balloon {
  position: relative;
  display: block;
  margin-bottom: 4px;
  background: var(--coral);
  border: 2px solid var(--coral-dark);
  border-radius: 50%;
}

.mini-balloon::after {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 7px;
  height: 7px;
  background: var(--coral);
  border: 2px solid var(--coral-dark);
  border-right: 0;
  transform: translateY(-50%) rotate(45deg);
}

.mini-balloon.small { width: 25px; height: 18px; }
.mini-balloon.medium { width: 34px; height: 24px; }
.mini-balloon.large { width: 43px; height: 30px; }

.string-group {
  padding: 10px 11px 8px;
  background: #f3f9f6;
  border: 2px dashed #b8d4cd;
  border-radius: 14px;
}

.range-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 5px;
}

.range-icon {
  width: 36px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 10px;
  font-size: 20px;
  font-weight: 900;
}

.range-label b,
.range-label small {
  display: block;
}

.range-label b {
  font-size: 16px;
}

.range-label small {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  height: 28px;
  margin: 0;
  accent-color: var(--coral);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  background: linear-gradient(90deg, var(--coral) var(--range-fill, 50%), #d6e2de var(--range-fill, 50%));
  border: 1px solid #a9bcb6;
  border-radius: 999px;
}

input[type="range"]::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -9px;
  background: var(--yellow);
  border: 3px solid #9c7024;
  border-radius: 50%;
  box-shadow: 0 2px 0 #815d22;
  -webkit-appearance: none;
}

input[type="range"]::-moz-range-track {
  height: 8px;
  background: #d6e2de;
  border: 1px solid #a9bcb6;
  border-radius: 999px;
}

input[type="range"]::-moz-range-progress {
  height: 8px;
  background: var(--coral);
  border-radius: 999px;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--yellow);
  border: 3px solid #9c7024;
  border-radius: 50%;
  box-shadow: 0 2px 0 #815d22;
}

.range-marks {
  display: flex;
  justify-content: space-between;
  color: #778b86;
  font-size: 9px;
  font-weight: 900;
}

.payload-options {
  grid-template-columns: repeat(4, 1fr);
}

.payload-options button {
  min-height: 59px;
  flex-direction: column;
  padding: 5px 2px;
}

.payload-options button > span:first-child {
  min-height: 16px;
  margin-bottom: 2px;
  color: #99a7a4;
  font-size: 16px;
  font-weight: 900;
}

.block-stack {
  position: relative;
  width: 17px;
  height: 14px;
  display: block;
  background: var(--yellow);
  border: 2px solid #7a5a2a;
  border-radius: 2px;
}

.block-stack.two::before,
.block-stack.three::before,
.block-stack.three::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 10px;
  background: #58aa9e;
  border: 2px solid #3e675f;
  border-radius: 2px;
}

.block-stack.two::before,
.block-stack.three::before {
  left: 5px;
  top: -7px;
}

.block-stack.three::after {
  left: -8px;
  top: -7px;
  background: var(--coral);
}

.force-preview {
  margin: 2px 0 13px;
  padding: 10px 11px;
  background: #fff8dd;
  border: 2px solid #efd17b;
  border-radius: 14px;
}

.force-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 8px;
}

.force-row + .force-row {
  margin-top: 6px;
}

.force-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.force-name i {
  width: 25px;
  font-size: 18px;
  font-style: normal;
  line-height: 1;
}

.arrow-forward { color: var(--teal); }
.arrow-back { color: var(--coral); }

.force-meter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.force-meter.brake {
  grid-template-columns: repeat(4, 1fr);
}

.force-meter i {
  height: 8px;
  background: #e7dfc4;
  border-radius: 999px;
}

.force-meter i.on {
  background: var(--teal);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .14);
}

.force-meter.brake i.on {
  background: var(--coral);
}

.force-preview p {
  margin: 8px 0 0;
  color: #70562a;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
}

.prediction {
  min-width: 0;
  margin: 0 0 13px;
  padding: 9px 10px 10px;
  background: #eef7fb;
  border: 2px dashed #9bc6d3;
  border-radius: 14px;
}

.prediction legend {
  width: auto;
  margin: 0;
  padding: 0 4px;
  color: #326f81;
}

.prediction p {
  margin: 0 0 7px;
  font-size: 11px;
  font-weight: 900;
}

.prediction-options {
  grid-template-columns: 1fr 1fr;
}

.prediction-options button {
  min-height: 39px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 900;
}

.prediction-options button > span {
  margin-right: 5px;
}

.launch-button,
.primary-button,
.secondary-button {
  width: 100%;
  min-height: 53px;
  border-radius: 15px;
  font-weight: 900;
  cursor: pointer;
}

.launch-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 8px 15px;
  color: #fff;
  background: var(--coral);
  border: 2px solid var(--coral-dark);
  box-shadow: 0 5px 0 #a63e38;
  text-align: left;
}

.launch-button:hover {
  background: #f27664;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #a63e38;
}

.launch-button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #a63e38;
}

.launch-glyph {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  color: var(--coral-dark);
  background: var(--yellow);
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 24px;
}

.launch-button b,
.launch-button small {
  display: block;
}

.launch-button b {
  font-size: 16px;
}

.launch-button small {
  margin-top: 2px;
  color: #ffe7dc;
  font-size: 10px;
}

.result-panel {
  animation: panel-in .35s ease both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
}

.result-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.result-sticker {
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  color: #654711;
  background: var(--yellow);
  border: 3px solid var(--yellow-dark);
  border-radius: 50% 45% 52% 46%;
  box-shadow: 3px 4px 0 #c48a1c;
  font-size: 15px;
  font-weight: 900;
  transform: rotate(-8deg);
}

.result-sticker.stopped {
  color: #fff;
  background: var(--blue);
  border-color: #276f84;
  box-shadow: 3px 4px 0 #276f84;
}

.result-numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 11px;
}

.result-numbers > div {
  padding: 12px;
  text-align: center;
  background: #edf7f4;
  border: 2px solid #acd1c8;
  border-radius: 15px;
}

.result-numbers span,
.result-numbers strong {
  display: block;
}

.result-numbers span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.result-numbers strong {
  margin-top: 3px;
  font-size: 23px;
  font-variant-numeric: tabular-nums;
}

.prediction-result {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 11px;
  padding: 8px 10px;
  color: #285f58;
  background: #e6f4df;
  border-radius: 12px;
  font-size: 11px;
}

.prediction-result.wrong {
  color: #795322;
  background: #fff0c5;
}

.prediction-result > span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 50%;
  font-weight: 900;
}

.prediction-result.wrong > span {
  background: var(--yellow-dark);
}

.prediction-result p {
  margin: 0;
  line-height: 1.3;
}

.discovery-card {
  display: flex;
  gap: 9px;
  margin-bottom: 11px;
  padding: 11px;
  background: #fff8df;
  border: 2px solid #efd486;
  border-radius: 14px;
}

.discovery-card .bulb {
  flex: 0 0 auto;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--coral);
  border-radius: 50%;
}

.discovery-card b {
  font-size: 12px;
}

.discovery-card p {
  margin: 3px 0 0;
  color: #695734;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.comparison-card {
  margin-bottom: 13px;
  padding: 10px 11px;
  background: #edf7fb;
  border-left: 5px solid var(--blue);
  border-radius: 8px 13px 13px 8px;
}

.comparison-card p:last-child {
  margin: 4px 0 0;
  color: #42616a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.result-actions {
  display: grid;
  grid-template-columns: 1.3fr .9fr;
  gap: 8px;
}

.primary-button {
  padding: 9px 13px;
  color: #fff;
  background: var(--teal);
  border: 2px solid var(--teal-dark);
  box-shadow: 0 4px 0 var(--teal-dark);
}

.primary-button:hover {
  background: #31877e;
  transform: translateY(-1px);
  box-shadow: 0 5px 0 var(--teal-dark);
}

.primary-button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--teal-dark);
}

.secondary-button {
  padding: 9px 12px;
  color: var(--teal);
  background: #fff;
  border: 2px solid #a8c9c2;
  box-shadow: 0 4px 0 #b9d2cc;
}

.secondary-button:hover {
  background: #eef9f5;
}

.logbook {
  margin-top: 18px;
  overflow: hidden;
  border-radius: 20px;
}

.logbook-head {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 17px;
  background: var(--cream);
  border-bottom: 2px dashed #d6d6c8;
}

.logbook h2 {
  font-size: 21px;
}

.logbook-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.logbook-actions > span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 900;
}

.logbook-actions button {
  width: 36px;
  height: 36px;
  color: var(--teal);
  background: #fff;
  border: 2px solid #b7ccc6;
  border-radius: 11px;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.attempt-list {
  min-height: 112px;
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 10px;
  padding: 13px;
  overflow-x: auto;
}

.empty-logbook {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #758782;
  text-align: left;
}

.empty-logbook > span {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #a5c8c0;
  border-radius: 50%;
  font-size: 25px;
  font-weight: 900;
}

.empty-logbook p,
.empty-logbook b,
.empty-logbook small {
  display: block;
  margin: 0;
}

.empty-logbook b {
  font-size: 13px;
}

.empty-logbook small {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 700;
}

.attempt-card {
  position: relative;
  min-width: 210px;
  padding: 10px 11px;
  background: #fff;
  border: 2px solid #c7d9d4;
  border-radius: 14px;
  box-shadow: 0 3px 0 #d4e1dd;
}

.attempt-card.latest {
  border-color: var(--teal);
  box-shadow: 0 3px 0 #94c2b8;
}

.attempt-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.attempt-number {
  color: var(--coral-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.attempt-outcome {
  padding: 3px 7px;
  color: #2f665f;
  background: #e2f2dd;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}

.attempt-outcome.stopped {
  color: #78541f;
  background: #fff0c0;
}

.attempt-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.attempt-settings span {
  padding: 3px 6px;
  color: #536964;
  background: #eef5f2;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
}

.attempt-bar {
  height: 8px;
  margin-bottom: 7px;
  overflow: hidden;
  background: #e3eae7;
  border-radius: 999px;
}

.attempt-bar i {
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--coral), var(--yellow));
  border-radius: inherit;
}

.attempt-metrics {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.attempt-metrics strong {
  font-variant-numeric: tabular-nums;
}

.modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) max(18px, env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  overflow-y: auto;
  background: rgba(24, 54, 51, .66);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  padding: 25px;
  overflow-y: auto;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: 11px 13px 0 rgba(20, 45, 42, .28);
}

.modal-close {
  position: absolute;
  right: 13px;
  top: 13px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: #fff;
  border: 2px solid #bdcec9;
  border-radius: 13px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.modal-rocket {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  color: #fff;
  background: var(--coral);
  border: 3px solid var(--coral-dark);
  border-radius: 50% 45% 50% 47%;
  font-size: 32px;
  font-weight: 900;
  transform: rotate(-6deg);
}

.modal-card > h2 {
  padding-right: 45px;
  font-size: clamp(25px, 4vw, 34px);
}

.how-to-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 17px 0;
  padding: 0;
  list-style: none;
}

.how-to-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  background: #f2f8f5;
  border: 2px solid #d1e0db;
  border-radius: 13px;
}

.how-to-list li > span {
  flex: 0 0 auto;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.how-to-list p,
.how-to-list b {
  display: block;
  margin: 0;
}

.how-to-list p {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.how-to-list b {
  color: var(--ink);
  font-size: 12px;
}

.concept-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.concept-grid article {
  padding: 12px;
  background: #fff7dc;
  border: 2px solid #efd17a;
  border-radius: 14px;
}

.concept-grid article > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--coral);
  border-radius: 50%;
  font-size: 20px;
  font-weight: 900;
}

.concept-grid h3 {
  margin: 7px 0 3px;
  font-size: 14px;
}

.concept-grid p {
  margin: 0;
  color: #685a3b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.real-world-note {
  margin: 13px 0;
  padding: 10px 12px;
  color: #42625c;
  background: #e9f5ef;
  border-left: 5px solid var(--teal);
  border-radius: 8px 12px 12px 8px;
  font-size: 11px;
  line-height: 1.4;
}

.modal-start {
  width: auto;
  min-width: 170px;
}

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

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, .8fr);
  }

  .rocket-scene {
    min-height: 470px;
  }

  .attempt-list {
    grid-template-columns: repeat(3, minmax(210px, 1fr));
  }
}

@media (max-width: 930px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .control-card {
    min-height: 0;
  }

  #setup-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
  }

  .panel-heading,
  .force-preview,
  .prediction,
  .launch-button {
    grid-column: 1 / -1;
  }

  .control-group:nth-of-type(3) {
    grid-column: 1 / -1;
  }

  .force-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
  }

  .force-row + .force-row {
    margin-top: 0;
  }

  .force-preview p {
    grid-column: 1 / -1;
  }

  .result-panel {
    max-width: 680px;
    margin: 0 auto;
  }
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    gap: 9px;
    padding-left: max(11px, env(safe-area-inset-left, 0px));
    padding-right: max(11px, env(safe-area-inset-right, 0px));
  }

  .back-label,
  .action-label,
  .brand p {
    display: none;
  }

  .back-link {
    width: 44px;
    justify-content: center;
    padding: 0;
  }

  .brand {
    justify-self: center;
    gap: 8px;
  }

  .brand-mark {
    width: 41px;
    height: 41px;
  }

  .brand-mark svg {
    width: 33px;
    height: 33px;
  }

  .brand h1 {
    font-size: clamp(18px, 5vw, 24px);
  }

  main {
    padding: 12px max(10px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  }

  .mission-card {
    grid-template-columns: auto 1fr;
    padding: 8px 10px;
  }

  .mission-icon {
    width: 36px;
    height: 36px;
  }

  .fair-tip {
    grid-column: 1 / -1;
    padding: 7px 9px;
    text-align: center;
  }

  .scene-head {
    align-items: flex-start;
    padding: 11px 12px;
  }

  .scene-head h2 {
    font-size: 18px;
  }

  .live-measures {
    gap: 4px;
  }

  .measure {
    min-width: 78px;
    gap: 5px;
    padding: 6px;
    border-radius: 11px;
  }

  .measure-icon {
    width: 23px;
    height: 23px;
    font-size: 14px;
  }

  .measure output {
    font-size: 13px;
  }

  .measure small {
    font-size: 8px;
  }

  .rocket-scene {
    min-height: clamp(170px, 46vw, 340px);
  }

  #experiment-svg {
    width: 100%;
  }

  .scene-message {
    bottom: 9px;
    padding: 6px 10px;
    font-size: 10px;
  }

  .control-card {
    padding: 14px;
  }

  #setup-panel {
    display: block;
  }

  .force-preview {
    display: block;
  }

  .force-row + .force-row {
    margin-top: 6px;
  }

  .payload-options button {
    min-height: 57px;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }

  .attempt-list {
    grid-template-columns: repeat(2, minmax(210px, 1fr));
  }

  .how-to-list,
  .concept-grid {
    grid-template-columns: 1fr;
  }

  .modal-card {
    padding: 19px;
  }
}

@media (max-width: 460px) {
  .brand-mark {
    display: none;
  }

  .round-button {
    min-width: 41px;
    min-height: 41px;
    padding: 0 10px;
  }

  .mission-card h2 {
    font-size: 16px;
  }

  .experiment-steps {
    margin-bottom: 10px;
  }

  .experiment-steps b {
    font-size: 10px;
  }

  .scene-head {
    display: block;
  }

  .live-measures {
    margin-top: 9px;
  }

  .measure {
    flex: 1;
  }

  .rocket-scene {
    min-height: clamp(170px, 50vw, 230px);
  }

  .balloon-options {
    gap: 5px;
  }

  .payload-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .attempt-list {
    grid-template-columns: repeat(1, minmax(220px, 1fr));
  }

  .result-top {
    align-items: flex-start;
  }

  .result-sticker {
    width: 58px;
    height: 58px;
    font-size: 13px;
  }
}

@media (max-height: 650px) and (min-width: 931px) {
  .mission-card {
    display: none;
  }

  main {
    padding-top: 10px;
  }

  .rocket-scene {
    min-height: 420px;
  }
}

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