:root {
  --bg: #080b14;
  --bg-2: #101827;
  --panel: rgba(12, 17, 29, 0.78);
  --panel-strong: rgba(16, 24, 39, 0.92);
  --line: rgba(255, 238, 197, 0.14);
  --line-strong: rgba(255, 209, 112, 0.38);
  --text: #fff7e8;
  --muted: rgba(255, 247, 232, 0.72);
  --faint: rgba(255, 247, 232, 0.56);
  --gold: #f5b94d;
  --amber: #d97706;
  --teal: #32d5c6;
  --blue: #4d7cff;
  --rose: #e35a6d;
  --green: #76d26f;
  --violet: #9b5cff;
  --ink: #090b11;
  --font-sans: "Outfit", system-ui, sans-serif;
  --font-display: "Bebas Neue", Impact, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    linear-gradient(115deg, rgba(50, 213, 198, 0.09), transparent 32%),
    linear-gradient(245deg, rgba(227, 90, 109, 0.08), transparent 36%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.lab-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
  contain: layout paint;
  clip-path: inset(0);
  pointer-events: none;
  z-index: 0;
}

.lab-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.44;
  mix-blend-mode: screen;
  background:
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(50, 213, 198, 0.11) 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(245, 185, 77, 0.08) 80px);
  mask-image: linear-gradient(180deg, transparent, #000 10%, #000 88%, transparent);
  animation: grid-flicker 9s steps(2, end) infinite;
}

.lab-sun {
  position: absolute;
  right: 6vw;
  top: -23vh;
  width: min(62vw, 780px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, rgba(255, 225, 151, 0.45) 0 1deg, transparent 1deg 7deg),
    radial-gradient(circle at 50% 50%, #fff4c2 0 10%, #ffcf66 17%, rgba(217, 119, 6, 0.72) 31%, rgba(217, 119, 6, 0.1) 52%, transparent 67%);
  filter: blur(0.4px) saturate(1.1);
  opacity: 0.78;
  animation: sun-turn 70s linear infinite;
}

.lab-grid {
  position: absolute;
  inset: 7% 9% 6%;
  border: 1px solid rgba(245, 185, 77, 0.1);
  background:
    linear-gradient(90deg, transparent 0 calc(25% - 1px), rgba(255, 247, 232, 0.07) calc(25% - 1px) 25%, transparent 25% calc(50% - 1px), rgba(255, 247, 232, 0.07) calc(50% - 1px) 50%, transparent 50% calc(75% - 1px), rgba(255, 247, 232, 0.07) calc(75% - 1px) 75%, transparent 75%),
    linear-gradient(0deg, transparent 0 calc(33.333% - 1px), rgba(255, 247, 232, 0.06) calc(33.333% - 1px) 33.333%, transparent 33.333% calc(66.666% - 1px), rgba(255, 247, 232, 0.06) calc(66.666% - 1px) 66.666%, transparent 66.666%);
  transform: perspective(900px) rotateX(58deg) translateY(19vh);
  transform-origin: 50% 100%;
  opacity: 0.4;
  animation: grid-drift 18s ease-in-out infinite alternate;
}

.lab-constellation {
  position: absolute;
  left: 6vw;
  top: 16vh;
  width: 34vw;
  height: 40vh;
  opacity: 0.36;
  background:
    radial-gradient(circle at 8% 18%, var(--teal) 0 2px, transparent 3px),
    radial-gradient(circle at 34% 9%, var(--gold) 0 2px, transparent 3px),
    radial-gradient(circle at 49% 37%, var(--rose) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 25%, var(--blue) 0 2px, transparent 3px),
    radial-gradient(circle at 92% 64%, var(--gold) 0 2px, transparent 3px),
    linear-gradient(26deg, transparent 0 19%, rgba(50, 213, 198, 0.24) 19.2% 19.7%, transparent 20%),
    linear-gradient(153deg, transparent 0 44%, rgba(245, 185, 77, 0.22) 44.2% 44.7%, transparent 45%),
    linear-gradient(93deg, transparent 0 65%, rgba(227, 90, 109, 0.2) 65.2% 65.7%, transparent 66%);
  animation: constellation-pulse 6s ease-in-out infinite alternate;
}

.lab-orbitarium {
  position: absolute;
  left: 6vw;
  bottom: -18vh;
  width: min(56vw, 720px);
  aspect-ratio: 1.28;
  opacity: 0.4;
  transform: rotate(-11deg);
  background:
    repeating-radial-gradient(ellipse at center, transparent 0 42px, rgba(50, 213, 198, 0.22) 43px 44px, transparent 45px 78px),
    conic-gradient(from 18deg, transparent 0 8deg, rgba(245, 185, 77, 0.24) 9deg 10deg, transparent 11deg 34deg, rgba(227, 90, 109, 0.2) 35deg 36deg, transparent 37deg);
  mask-image: radial-gradient(ellipse at center, transparent 0 19%, #000 20% 71%, transparent 72%);
  animation: orbit-drift 24s ease-in-out infinite alternate;
}

.lab-orbitarium::before,
.lab-orbitarium::after {
  content: "";
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(255, 238, 197, 0.17);
  border-radius: 50%;
  transform: rotate(24deg) skewX(-9deg);
}

.lab-orbitarium::after {
  inset: 26%;
  border-color: rgba(227, 90, 109, 0.18);
  transform: rotate(-21deg) skewX(12deg);
}

@keyframes sun-turn {
  to { transform: rotate(360deg); }
}

@keyframes grid-drift {
  from { transform: perspective(900px) rotateX(58deg) translateY(19vh) translateX(-1.2vw); }
  to { transform: perspective(900px) rotateX(58deg) translateY(17vh) translateX(1.2vw); }
}

@keyframes grid-flicker {
  0%, 100% { opacity: 0.42; }
  38% { opacity: 0.5; }
  39% { opacity: 0.28; }
  41% { opacity: 0.48; }
  68% { opacity: 0.38; }
}

@keyframes constellation-pulse {
  from { opacity: 0.28; filter: saturate(0.9); }
  to { opacity: 0.52; filter: saturate(1.35); }
}

@keyframes orbit-drift {
  from { transform: rotate(-13deg) translate3d(0, 0, 0); }
  to { transform: rotate(-8deg) translate3d(1.6vw, -1.2vh, 0); }
}

.lab-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.65'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.lab-top,
.lab-shell {
  position: relative;
  z-index: 2;
}

.lab-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 2.8vw, 2rem) 0;
}

.lab-brand,
.lab-season,
.lab-top-link {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 247, 232, 0.1), rgba(255, 247, 232, 0.035)),
    rgba(8, 11, 20, 0.62);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.lab-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.9rem;
  font-family: var(--font-display);
  font-size: 1.28rem;
  letter-spacing: 0.06em;
}

.lab-brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(245, 185, 77, 0.34), 0 0 24px rgba(245, 185, 77, 0.24);
}

.lab-season {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0 1rem;
  text-align: center;
}

.lab-season span,
.label,
.panel-head span,
.vital span,
.result-grid span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.lab-season strong,
.season-card strong,
.panel-head strong {
  font-family: var(--font-mono);
  color: var(--gold);
  letter-spacing: 0.08em;
}

.lab-top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  color: var(--muted);
  font-weight: 700;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.lab-top-link:hover {
  color: var(--text);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.lab-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
  gap: clamp(1rem, 2vw, 1.5rem);
  min-height: calc(100vh - 68px);
  padding: 1rem clamp(1rem, 2.8vw, 2rem) 1.5rem;
}

.lab-stage-panel,
.lab-side {
  min-width: 0;
}

.lab-stage-panel {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.lab-command {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(130px, 1fr));
  gap: 0.75rem;
}

.season-card,
.lab-panel,
.sim-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 247, 232, 0.09), rgba(255, 247, 232, 0.025)),
    rgba(9, 13, 24, 0.76);
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.season-card::after,
.lab-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(120deg, transparent 0 34%, rgba(255, 247, 232, 0.12) 42%, transparent 50%),
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(255, 247, 232, 0.025) 29px);
  opacity: 0.14;
  transform: translateX(-42%);
  animation: panel-wake 9s var(--ease) infinite;
}

.season-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72px;
  padding: 0.8rem 1rem;
  overflow: hidden;
}

.season-card--wide {
  background:
    linear-gradient(90deg, rgba(50, 213, 198, 0.12), rgba(245, 185, 77, 0.08)),
    rgba(9, 13, 24, 0.76);
}

.season-card strong {
  margin-top: 0.28rem;
  overflow-wrap: anywhere;
  font-size: clamp(0.96rem, 1.28vw, 1.18rem);
  line-height: 1.08;
}

.sim-frame {
  flex: 1;
  flex: none;
  height: clamp(460px, calc(100vh - 248px), 680px);
  min-height: 460px;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(16, 33, 58, 0.42), rgba(9, 12, 22, 0.74)),
    url("../images/lab/daedalus-sky.png") center / cover no-repeat,
    var(--bg-2);
}

#flight-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.sim-frame::before,
.sim-frame::after {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  z-index: 2;
  border: 1px solid rgba(255, 238, 197, 0.1);
}

.sim-frame::after {
  inset: 0;
  border: 0;
  background:
    linear-gradient(90deg, rgba(50, 213, 198, 0.09), transparent 14%, transparent 86%, rgba(227, 90, 109, 0.08)),
    linear-gradient(180deg, rgba(255, 247, 232, 0.08), transparent 22%, transparent 72%, rgba(3, 5, 10, 0.48));
  mix-blend-mode: screen;
}

.sim-radar {
  position: absolute;
  right: 1rem;
  bottom: 8.7rem;
  z-index: 5;
  width: clamp(92px, 10vw, 138px);
  aspect-ratio: 1;
  border: 1px solid rgba(50, 213, 198, 0.38);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(50, 213, 198, 0.18) 0 2px, transparent 3px),
    repeating-radial-gradient(circle, transparent 0 18px, rgba(50, 213, 198, 0.2) 19px 20px),
    linear-gradient(rgba(50, 213, 198, 0.22), rgba(50, 213, 198, 0.22)) 50% 0 / 1px 100% no-repeat,
    linear-gradient(90deg, rgba(50, 213, 198, 0.18), rgba(50, 213, 198, 0.18)) 0 50% / 100% 1px no-repeat,
    rgba(6, 9, 16, 0.42);
  box-shadow: 0 0 32px rgba(50, 213, 198, 0.16), inset 0 0 24px rgba(50, 213, 198, 0.08);
  backdrop-filter: blur(8px);
}

.sim-radar::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(50, 213, 198, 0.5), transparent 34deg 360deg);
  mix-blend-mode: screen;
  animation: radar-sweep 2.8s linear infinite;
}

.sim-radar i {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 16px rgba(245, 185, 77, 0.75);
  animation: blip 2.8s ease-in-out infinite;
}

.sim-radar i:nth-child(1) { left: 29%; top: 38%; animation-delay: -0.4s; }
.sim-radar i:nth-child(2) { left: 58%; top: 24%; animation-delay: -1.1s; }
.sim-radar i:nth-child(3) { left: 67%; top: 61%; animation-delay: -1.8s; background: var(--rose); }
.sim-radar i:nth-child(4) { left: 41%; top: 72%; animation-delay: -2.3s; background: var(--teal); }

.sim-warning-rail {
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 5.78rem;
  z-index: 3;
  display: flex;
  gap: 0.4rem;
  overflow: hidden;
  pointer-events: none;
  contain: layout paint;
  opacity: 0.78;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.sim-warning-rail span {
  flex: 0 0 auto;
  min-width: 170px;
  padding: 0.34rem 0.55rem;
  border: 1px solid rgba(245, 185, 77, 0.18);
  background:
    repeating-linear-gradient(135deg, rgba(245, 185, 77, 0.14) 0 8px, rgba(227, 90, 109, 0.08) 9px 16px),
    rgba(8, 11, 20, 0.45);
  color: rgba(255, 247, 232, 0.72);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: rail-shift 12s linear infinite;
}

.sim-axis {
  position: absolute;
  top: 8.1rem;
  right: 0.85rem;
  bottom: 7rem;
  z-index: 3;
  display: grid;
  align-content: space-between;
  pointer-events: none;
  color: rgba(255, 247, 232, 0.62);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sim-axis span {
  justify-self: end;
  padding: 0.22rem 0.36rem;
  border: 1px solid rgba(255, 238, 197, 0.12);
  border-radius: 6px;
  background: rgba(6, 9, 16, 0.78);
  color: rgba(255, 247, 232, 0.95);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.62);
}

.sim-axis::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: -0.34rem;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 238, 197, 0.28), transparent);
}

.sim-corners {
  position: absolute;
  inset: 12px;
  z-index: 4;
  pointer-events: none;
}

.sim-corners i {
  position: absolute;
  width: 42px;
  height: 42px;
  border-color: rgba(245, 185, 77, 0.55);
  border-style: solid;
  animation: corner-flicker 3.4s steps(2, end) infinite;
}

.sim-corners i:nth-child(1) { left: 0; top: 0; border-width: 2px 0 0 2px; }
.sim-corners i:nth-child(2) { right: 0; top: 0; border-width: 2px 2px 0 0; animation-delay: -0.8s; }
.sim-corners i:nth-child(3) { right: 0; bottom: 0; border-width: 0 2px 2px 0; animation-delay: -1.6s; }
.sim-corners i:nth-child(4) { left: 0; bottom: 0; border-width: 0 0 2px 2px; animation-delay: -2.2s; }

.sim-vitals {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.vital {
  min-width: 0;
  padding: 0.65rem 0.72rem;
  border: 1px solid rgba(255, 238, 197, 0.12);
  border-radius: 8px;
  background: rgba(6, 9, 16, 0.58);
  backdrop-filter: blur(14px);
}

.vital strong {
  display: block;
  margin-top: 0.24rem;
  font-family: var(--font-mono);
  font-size: clamp(0.86rem, 1.35vw, 1.1rem);
  color: var(--text);
  white-space: nowrap;
}

.vital--heat strong { color: var(--rose); }
.vital--wax strong { color: var(--teal); }

.sim-badge {
  position: absolute;
  left: 1rem;
  bottom: 8rem;
  z-index: 5;
  max-width: min(420px, calc(100% - 2rem));
  padding: 0.7rem 0.82rem;
  border: 1px solid rgba(245, 185, 77, 0.28);
  border-radius: 8px;
  background: rgba(6, 9, 16, 0.68);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.4;
  backdrop-filter: blur(14px);
}

.sim-launch-panel {
  position: absolute;
  right: 1rem;
  bottom: 4.2rem;
  z-index: 6;
  display: grid;
  grid-template-columns: auto minmax(170px, 320px);
  align-items: center;
  gap: 0.7rem;
  max-width: min(520px, calc(100% - 2rem));
  padding: 0.55rem;
  border: 1px solid rgba(245, 185, 77, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(50, 213, 198, 0.13), rgba(227, 90, 109, 0.1)),
    rgba(6, 9, 16, 0.72);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(14px);
}

.sim-launch-panel span {
  min-width: 0;
  color: rgba(255, 247, 232, 0.78);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  line-height: 1.45;
  text-transform: uppercase;
}

.stage-ledger {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.stage-ledger b {
  min-width: 0;
  overflow: hidden;
  padding: 0.28rem 0.38rem;
  border: 1px solid rgba(255, 238, 197, 0.1);
  border-radius: 6px;
  background: rgba(255, 247, 232, 0.045);
  color: rgba(255, 247, 232, 0.82);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.sim-launch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.85rem;
  border: 1px solid rgba(50, 213, 198, 0.4);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(50, 213, 198, 0.24), rgba(77, 124, 255, 0.18));
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}

.sim-launch-button svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sim-launch-button:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 185, 77, 0.55);
  box-shadow: 0 12px 28px rgba(50, 213, 198, 0.16);
}

.sim-launch-button:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.sim-result-strip {
  position: absolute;
  left: 1rem;
  bottom: 4.2rem;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.34rem;
  width: min(420px, calc(100% - 540px));
  min-width: 300px;
  padding: 0.55rem;
  border: 1px solid rgba(50, 213, 198, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(50, 213, 198, 0.13), rgba(245, 185, 77, 0.08)),
    rgba(6, 9, 16, 0.76);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(14px);
}

.sim-result-strip[hidden] {
  display: none;
}

.sim-result-strip span {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 247, 232, 0.68);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sim-result-strip b {
  color: var(--text);
  font-size: 0.68rem;
}

.burn-meter {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 5;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.74rem 0.82rem;
  border: 1px solid rgba(255, 238, 197, 0.12);
  border-radius: 8px;
  background: rgba(6, 9, 16, 0.68);
  backdrop-filter: blur(14px);
}

.burn-meter > span {
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  background: var(--gold);
  box-shadow: 0 0 18px rgba(245, 185, 77, 0.7);
}

.burn-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 247, 232, 0.12);
}

.burn-track i {
  display: block;
  width: 61%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--rose));
  background-size: 180% 100%;
  box-shadow: 0 0 18px rgba(245, 185, 77, 0.42);
  transition: width 0.6s var(--ease);
  animation: meter-flow 2.8s linear infinite;
}

.burn-meter b {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

.launch-strip {
  display: grid;
  grid-template-columns: minmax(140px, 0.7fr) minmax(180px, 1.4fr) minmax(140px, 0.7fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 238, 197, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(245, 185, 77, 0.08), rgba(50, 213, 198, 0.055), rgba(227, 90, 109, 0.07)),
    rgba(6, 9, 16, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.launch-readout {
  min-width: 0;
  padding: 0.58rem 0.65rem;
  border: 1px solid rgba(255, 238, 197, 0.1);
  border-radius: 8px;
  background: rgba(255, 247, 232, 0.045);
}

.launch-readout span {
  display: block;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.launch-readout strong {
  display: block;
  margin-top: 0.18rem;
  overflow: hidden;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.launch-slider {
  min-width: 0;
}

.launch-slider input {
  display: block;
}

.lab-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

#test-flight {
  display: none;
}

.lab-page.has-result #test-flight {
  display: inline-flex;
}

.ranked-note {
  flex: 1 1 100%;
  margin: 0;
  color: rgba(255, 247, 232, 0.72);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-align: right;
  text-transform: uppercase;
}

.ash-ledger {
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  color: rgba(255, 247, 232, 0.74);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-align: right;
  text-transform: uppercase;
}

.ash-ledger span {
  min-width: 0;
  overflow: hidden;
  padding: 0.38rem 0.5rem;
  border: 1px solid rgba(255, 238, 197, 0.1);
  border-radius: 6px;
  background: rgba(255, 247, 232, 0.045);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ash-ledger b {
  color: var(--gold);
}

.lab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.lab-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lab-btn--ghost {
  background: rgba(255, 247, 232, 0.06);
  border-color: rgba(255, 238, 197, 0.12);
  color: var(--muted);
}

.lab-btn--secondary {
  background: linear-gradient(135deg, rgba(50, 213, 198, 0.16), rgba(77, 124, 255, 0.16));
  border-color: rgba(50, 213, 198, 0.28);
}

.lab-btn--primary {
  background: linear-gradient(135deg, #d27b22, #9d2638 62%, #351a16);
  border-color: rgba(245, 185, 77, 0.42);
  box-shadow: 0 14px 34px rgba(185, 28, 67, 0.28);
  animation: button-flare 4.5s ease-in-out infinite;
}

.lab-btn--primary.is-armed {
  background:
    repeating-linear-gradient(135deg, rgba(255, 247, 232, 0.12) 0 8px, transparent 9px 16px),
    linear-gradient(135deg, #e35a6d, #8a1228 62%, #1a0b0d);
  border-color: rgba(255, 247, 232, 0.52);
  box-shadow: 0 18px 44px rgba(227, 90, 109, 0.38), 0 0 30px rgba(245, 185, 77, 0.2);
}

.lab-btn:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.lab-top a:focus-visible,
.lab-btn:focus-visible,
.sim-launch-button:focus-visible,
.controller-card:focus-visible,
.lab-disclosure > summary.panel-head:focus-visible,
input[type="range"]:focus-visible {
  outline: 3px solid rgba(50, 213, 198, 0.86);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(50, 213, 198, 0.16);
}

.lab-btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.lab-btn--primary.is-locked,
.lab-btn--primary:disabled {
  border-color: rgba(255, 238, 197, 0.14);
  background: rgba(255, 247, 232, 0.07);
  box-shadow: none;
  color: rgba(255, 247, 232, 0.64);
  animation: none;
}

.lab-side {
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.lab-panel {
  overflow: hidden;
  padding: 0.9rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.panel-head strong {
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
}

.lab-disclosure {
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease), transform 0.22s var(--ease);
}

.lab-disclosure:not([open]) {
  background:
    linear-gradient(145deg, rgba(255, 247, 232, 0.075), rgba(50, 213, 198, 0.035)),
    rgba(9, 13, 24, 0.66);
}

.lab-disclosure > summary.panel-head {
  min-height: 44px;
  padding-block: 0.2rem;
  margin-bottom: 0;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.lab-disclosure > summary.panel-head::-webkit-details-marker {
  display: none;
}

.lab-disclosure > summary.panel-head::after {
  content: "";
  flex: 0 0 auto;
  width: 0.58rem;
  height: 0.58rem;
  border-right: 2px solid rgba(245, 185, 77, 0.82);
  border-bottom: 2px solid rgba(245, 185, 77, 0.82);
  transform: rotate(45deg) translateY(-0.14rem);
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease);
}

.lab-disclosure[open] > summary.panel-head {
  margin-bottom: 0.85rem;
}

.lab-disclosure[open] > summary.panel-head::after {
  border-color: rgba(50, 213, 198, 0.86);
  transform: rotate(225deg) translateY(-0.06rem);
}

.lab-disclosure:hover {
  border-color: rgba(245, 185, 77, 0.24);
  transform: translateY(-1px);
}

.lab-page.is-replaying .season-card::after,
.lab-page.is-replaying .lab-backdrop::after,
.lab-page.is-replaying .lab-panel::after,
.lab-page.is-replaying .sim-radar::before,
.lab-page.is-replaying .sim-radar i,
.lab-page.is-replaying .sim-warning-rail span,
.lab-page.is-replaying .sim-corners i,
.lab-page.is-replaying .lab-sun,
.lab-page.is-replaying .lab-grid,
.lab-page.is-replaying .lab-constellation,
.lab-page.is-replaying .lab-orbitarium,
.lab-page.is-replaying .blueprint-art::before,
.lab-page.is-replaying .blueprint-art,
.lab-page.is-replaying .furnace-core,
.lab-page.is-replaying .furnace-core::before,
.lab-page.is-replaying .furnace-core::after,
.lab-page.is-replaying .furnace-core i,
.lab-page.is-replaying .burn-track i,
.lab-page.is-replaying .lab-btn--primary {
  animation-play-state: paused;
}

.lab-page.is-replaying .sim-warning-rail,
.lab-page.is-replaying .sim-radar {
  opacity: 0.42;
}

.lab-page.has-result .sim-launch-panel {
  display: none;
}

.blueprint-art {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(50, 213, 198, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(50, 213, 198, 0.2), rgba(77, 124, 255, 0.08)),
    url("../images/lab/blueprint-parchment.png") center / cover no-repeat,
    rgba(4, 10, 18, 0.68);
  background-blend-mode: screen, multiply, normal;
  animation: blueprint-breathe 12s ease-in-out infinite;
}

.blueprint-art::before {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  top: -18%;
  z-index: 3;
  height: 28%;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent, rgba(50, 213, 198, 0.22), transparent),
    linear-gradient(90deg, transparent, rgba(255, 247, 232, 0.2), transparent);
  mix-blend-mode: screen;
  animation: scan-sweep 4.8s linear infinite;
}

.blueprint-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(50, 213, 198, 0.12) 24px),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(50, 213, 198, 0.1) 24px);
  opacity: 0.35;
}

.blueprint-stamp {
  position: absolute;
  right: 0.7rem;
  bottom: 0.65rem;
  z-index: 4;
  padding: 0.26rem 0.44rem;
  border: 1px solid rgba(227, 90, 109, 0.55);
  color: rgba(227, 90, 109, 0.88);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(-4deg);
  background: rgba(4, 10, 18, 0.62);
}

#blueprint-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

.control-stack {
  display: grid;
  gap: 0.78rem;
  margin-top: 0.9rem;
}

.blueprint-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.55rem;
  color: rgba(255, 247, 232, 0.44);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.blueprint-meta span {
  min-width: 0;
  overflow: hidden;
  padding: 0.32rem 0.4rem;
  border: 1px solid rgba(50, 213, 198, 0.12);
  border-radius: 6px;
  background: rgba(50, 213, 198, 0.045);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slider-row {
  display: grid;
  gap: 0.45rem;
}

.slider-row span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.slider-row b {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

input[type="range"] {
  width: 100%;
  height: 44px;
  border-radius: 999px;
  appearance: none;
  background:
    linear-gradient(90deg, rgba(50, 213, 198, 0.75), rgba(245, 185, 77, 0.85)) 0 50% / 100% 8px no-repeat;
  outline: none;
}

input[type="range"]:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  filter: saturate(0.55);
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 30px;
  height: 30px;
  border: 2px solid var(--text);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 5px rgba(245, 185, 77, 0.14), 0 0 20px rgba(50, 213, 198, 0.45);
  cursor: pointer;
}

input[type="range"]:disabled::-webkit-slider-thumb {
  cursor: not-allowed;
  box-shadow: 0 0 0 4px rgba(255, 238, 197, 0.08);
}

input[type="range"]::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border: 2px solid var(--text);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 5px rgba(245, 185, 77, 0.14), 0 0 20px rgba(50, 213, 198, 0.45);
  cursor: pointer;
}

input[type="range"]:disabled::-moz-range-thumb {
  cursor: not-allowed;
  box-shadow: 0 0 0 4px rgba(255, 238, 197, 0.08);
}

.controller-grid {
  display: grid;
  gap: 0.55rem;
}

.controller-card {
  position: relative;
  display: grid;
  gap: 0.24rem;
  width: 100%;
  padding: 0.72rem 0.8rem;
  border: 1px solid rgba(255, 238, 197, 0.12);
  border-radius: 8px;
  background: rgba(255, 247, 232, 0.045);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}

.controller-card b {
  color: var(--text);
  font-size: 0.92rem;
}

.controller-card span {
  font-size: 0.78rem;
  line-height: 1.35;
}

.controller-card::before {
  content: "";
  position: absolute;
  left: 0.65rem;
  top: 0.85rem;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: var(--faint);
}

.controller-card b,
.controller-card span {
  padding-left: 1.15rem;
}

.controller-card:hover,
.controller-card.is-active {
  transform: translateX(3px);
  border-color: rgba(50, 213, 198, 0.42);
  background: linear-gradient(90deg, rgba(50, 213, 198, 0.13), rgba(245, 185, 77, 0.05));
}

.controller-card:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  filter: saturate(0.55);
}

.controller-card:disabled:hover {
  transform: none;
  border-color: rgba(255, 238, 197, 0.12);
  background: rgba(255, 247, 232, 0.045);
}

.controller-card.is-active {
  box-shadow: inset 3px 0 0 rgba(50, 213, 198, 0.75), 0 0 22px rgba(50, 213, 198, 0.08);
}

.controller-card.is-active::before {
  background: var(--teal);
  box-shadow: 0 0 18px rgba(50, 213, 198, 0.72);
}

.economy-panel {
  background:
    linear-gradient(145deg, rgba(227, 90, 109, 0.13), rgba(50, 213, 198, 0.035)),
    rgba(9, 13, 24, 0.78);
}

.furnace-core {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 132px;
  overflow: hidden;
  border: 1px solid rgba(245, 185, 77, 0.2);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 247, 232, 0.2) 0 2px, transparent 3px),
    conic-gradient(from -90deg, rgba(227, 90, 109, 0.85) 0 var(--furnace-progress, 61%), rgba(50, 213, 198, 0.14) var(--furnace-progress, 61%) 100%),
    linear-gradient(180deg, rgba(8, 11, 20, 0.12), rgba(8, 11, 20, 0.54)),
    url("../images/lab/cera-furnace-core.png") center / cover no-repeat,
    radial-gradient(circle at 50% 50%, rgba(245, 185, 77, 0.26), rgba(8, 11, 20, 0.18) 38%, rgba(4, 7, 12, 0.92) 70%);
  background-blend-mode: screen, color-dodge, multiply, normal, normal;
  box-shadow: inset 0 0 42px rgba(245, 185, 77, 0.08), 0 0 34px rgba(227, 90, 109, 0.1);
  animation: furnace-surface 5.4s ease-in-out infinite;
}

.furnace-core::before,
.furnace-core::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px dashed rgba(255, 247, 232, 0.18);
  border-radius: 50%;
  animation: furnace-spin 18s linear infinite;
}

.furnace-core::after {
  inset: 38px;
  border-style: solid;
  border-color: rgba(50, 213, 198, 0.28);
  animation-duration: 9s;
  animation-direction: reverse;
}

.furnace-core i {
  position: relative;
  z-index: 1;
  width: 46px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 247, 232, 0.5);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fff7e8 0 12%, #f5b94d 22%, #e35a6d 49%, rgba(8, 11, 20, 0.78) 74%);
  box-shadow: 0 0 34px rgba(245, 185, 77, 0.45), 0 0 60px rgba(227, 90, 109, 0.22);
  animation: furnace-breathe 2.8s ease-in-out infinite;
}

.furnace-core span {
  position: absolute;
  left: 0.75rem;
  bottom: 0.66rem;
  z-index: 1;
  color: rgba(255, 247, 232, 0.5);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.economy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.economy-grid div {
  min-width: 0;
  padding: 0.66rem;
  border: 1px solid rgba(255, 238, 197, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(245, 185, 77, 0.08), rgba(50, 213, 198, 0.035)),
    rgba(255, 247, 232, 0.04);
}

.economy-grid span {
  display: block;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.economy-grid b {
  display: block;
  margin-top: 0.28rem;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.furnace-tape {
  margin-top: 0.6rem;
  overflow: hidden;
  padding: 0.46rem 0.56rem;
  border: 1px solid rgba(227, 90, 109, 0.18);
  border-radius: 6px;
  background:
    repeating-linear-gradient(90deg, rgba(227, 90, 109, 0.08) 0 8px, rgba(50, 213, 198, 0.05) 9px 18px),
    rgba(4, 7, 12, 0.5);
  color: rgba(255, 247, 232, 0.58);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.result-grid div {
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid rgba(255, 238, 197, 0.1);
  border-radius: 8px;
  background: rgba(255, 247, 232, 0.045);
}

.result-grid b {
  display: block;
  margin-top: 0.32rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.event-log {
  display: grid;
  gap: 0.42rem;
  max-height: 130px;
  margin: 0.75rem 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.4;
}

.event-log li {
  position: relative;
  padding-left: 1rem;
}

.event-log li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.45em;
  width: 5px;
  height: 5px;
  transform: rotate(45deg);
  background: var(--gold);
}

.leaderboard {
  display: grid;
  gap: 0.48rem;
}

.leader-row {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0.7rem;
  border: 1px solid rgba(255, 238, 197, 0.1);
  border-radius: 8px;
  background: rgba(255, 247, 232, 0.042);
}

.leader-row.is-player {
  border-color: rgba(50, 213, 198, 0.45);
  background: rgba(50, 213, 198, 0.09);
}

@keyframes panel-wake {
  0% { transform: translateX(-58%); opacity: 0; }
  20% { opacity: 0.12; }
  42%, 100% { transform: translateX(58%); opacity: 0; }
}

@keyframes scan-sweep {
  to { transform: translateY(560%) rotate(0.01deg); }
}

@keyframes rail-shift {
  to { transform: translateX(-174px); }
}

@keyframes radar-sweep {
  to { transform: rotate(360deg); }
}

@keyframes blip {
  0%, 100% { opacity: 0.26; transform: scale(0.72); }
  50% { opacity: 1; transform: scale(1.18); }
}

@keyframes corner-flicker {
  0%, 100% { opacity: 0.54; }
  50% { opacity: 1; }
}

@keyframes meter-flow {
  to { background-position: 180% 0; }
}

@keyframes button-flare {
  0%, 100% { box-shadow: 0 14px 34px rgba(185, 28, 67, 0.28), 0 0 0 rgba(245, 185, 77, 0); }
  50% { box-shadow: 0 18px 42px rgba(185, 28, 67, 0.34), 0 0 34px rgba(245, 185, 77, 0.2); }
}

@keyframes furnace-spin {
  to { transform: rotate(360deg); }
}

@keyframes furnace-breathe {
  0%, 100% { transform: scale(0.94); filter: saturate(1); }
  50% { transform: scale(1.08); filter: saturate(1.38); }
}

@keyframes blueprint-breathe {
  0%, 100% { background-position: center, 50% 50%, center; filter: saturate(1); }
  50% { background-position: center, 51.5% 47%, center; filter: saturate(1.18); }
}

@keyframes furnace-surface {
  0%, 100% { filter: saturate(1) contrast(1); }
  48% { filter: saturate(1.28) contrast(1.08); }
  64% { filter: saturate(1.06) contrast(1.18); }
}

.leader-rank {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  background: rgba(245, 185, 77, 0.12);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.leader-name {
  min-width: 0;
}

.leader-name b,
.leader-score {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 800;
}

.leader-name span {
  display: block;
  margin-top: 0.12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.leader-score {
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

@media (max-width: 1180px) {
  .lab-shell {
    grid-template-columns: 1fr;
  }

  .lab-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blueprint-panel,
  .leaderboard-panel {
    grid-column: span 1;
  }
}

@media (max-width: 820px) {
  .lab-top {
    grid-template-columns: 1fr auto;
  }

  .lab-season {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }

  .lab-command {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sim-vitals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lab-side {
    grid-template-columns: 1fr;
  }

  .lab-actions {
    justify-content: stretch;
    position: sticky;
    bottom: 0.75rem;
    z-index: 20;
    padding: 0.55rem;
    border: 1px solid rgba(255, 238, 197, 0.12);
    border-radius: 8px;
    background:
      linear-gradient(135deg, rgba(50, 213, 198, 0.1), rgba(227, 90, 109, 0.08)),
      rgba(6, 9, 16, 0.82);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(16px);
  }

  .ranked-note {
    text-align: left;
  }

  .ash-ledger {
    text-align: left;
  }

  .lab-actions .lab-btn {
    flex: 1 1 180px;
  }

  input[type="range"] {
    background:
      linear-gradient(90deg, rgba(50, 213, 198, 0.78), rgba(245, 185, 77, 0.9)) 0 50% / 100% 10px no-repeat;
  }

  .launch-strip {
    grid-template-columns: 1fr;
  }

  .sim-warning-rail {
    top: 8.2rem;
  }

  .blueprint-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .lab-top {
    padding-inline: 0.75rem;
  }

  .lab-shell {
    padding: 0.75rem;
  }

  .lab-brand,
  .lab-top-link {
    min-height: 46px;
  }

  .lab-top-link {
    font-size: 0.82rem;
  }

  .lab-season {
    min-height: auto;
    padding: 0.8rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.24rem;
  }

  .lab-command,
  .economy-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .lab-command {
    order: 4;
  }

  .sim-frame {
    order: 1;
  }

  .launch-strip {
    order: 2;
  }

  .lab-actions {
    order: 3;
  }

  #test-flight {
    order: 1;
  }

  #ranked-flight {
    order: 2;
  }

  #reset-blueprint {
    order: 3;
  }

  .lab-actions .ranked-note {
    order: 4;
  }

  .launch-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0.58rem;
  }

  .launch-slider {
    grid-column: 1 / -1;
    order: 3;
  }

  .launch-readout {
    padding: 0.5rem 0.55rem;
  }

  .ranked-note {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .sim-frame,
  #flight-canvas {
    min-height: 430px;
  }

  .sim-frame {
    height: 430px;
  }

  .sim-vitals {
    top: 0.7rem;
    left: 0.7rem;
    right: 0.7rem;
    gap: 0.45rem;
  }

  .vital {
    padding: 0.55rem;
  }

  .sim-radar {
    display: none;
  }

  .sim-warning-rail {
    display: none;
  }

  .sim-axis {
    display: none;
  }

  .sim-badge {
    left: 0.7rem;
    right: 0.7rem;
    bottom: 9.7rem;
    max-width: none;
    padding: 0.55rem 0.64rem;
    font-size: 0.68rem;
  }

  .lab-page:not(.has-result) .sim-badge {
    bottom: 15rem;
  }

  .lab-page.has-result .sim-badge {
    bottom: 12.75rem;
  }

  .sim-launch-panel {
    left: 0.7rem;
    right: 0.7rem;
    bottom: 4.15rem;
    grid-template-columns: 1fr;
    max-width: none;
    gap: 0.38rem;
    padding: 0.48rem;
  }

  .sim-launch-button {
    width: 100%;
    min-height: 44px;
  }

  .sim-launch-panel span {
    font-size: 0.62rem;
    letter-spacing: 0.03em;
    text-align: center;
  }

  .stage-ledger {
    grid-template-columns: 1fr;
  }

  .stage-ledger b {
    font-size: 0.56rem;
  }

  .sim-result-strip {
    left: 0.7rem;
    right: 0.7rem;
    bottom: 4.15rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto;
    min-width: 0;
  }

  .ash-ledger {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    font-size: 0.64rem;
  }


  .burn-meter {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .burn-meter b {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
