/* ---------- Pack Rocket mini game ---------- */
.rocket-pack-level {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 68px clamp(16px, 3vw, 38px) 20px;
  background:
    linear-gradient(180deg, rgba(7, 7, 20, 0.2), rgba(7, 7, 20, 0.92)),
    radial-gradient(
      ellipse at 38% 62%,
      rgba(126, 231, 255, 0.16),
      transparent 34%
    ),
    radial-gradient(
      circle at 78% 24%,
      rgba(255, 214, 107, 0.12),
      transparent 28%
    ),
    #070714;
}
.rocket-pack-back {
  position: fixed;
  left: 24px;
  top: 24px;
  z-index: 44;
  min-height: 60px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.76);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 12px 18px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.solar-rocket-reset {
  min-height: 48px;
  border: 1px solid rgba(255, 214, 107, 0.42);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.8);
  color: #fff7d8;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.solar-rocket-actions {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 44;
  display: flex;
  gap: 10px;
  align-items: center;
}
.solar-rocket-control {
  min-height: 48px;
  border: 1px solid rgba(126, 231, 255, 0.48);
  border-radius: 999px;
  background: linear-gradient(180deg, #7ee7ff, #2c9dff);
  color: #05101a;
  font-family: inherit;
  font-size: 13px;
  font-weight: 1000;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}
.solar-rocket-key-hint {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 214, 107, 0.42);
  border-radius: 999px;
  background: rgba(13, 12, 32, 0.82);
  color: #fff7d8;
  font-size: 12px;
  font-weight: 900;
  padding: 10px 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---------- Rocket Cause and Effect lab ---------- */
.rocket-cause-level {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  padding: 68px clamp(16px, 3vw, 38px) 24px;
  background:
    radial-gradient(circle at 18% 22%, rgba(126, 231, 255, 0.16), transparent 30%),
    radial-gradient(circle at 82% 14%, rgba(255, 214, 107, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(5, 7, 18, 0.18), rgba(5, 7, 18, 0.96)),
    #050714;
}
.rocket-cause-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  min-height: min(720px, calc(100vh - 104px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(360px, 1fr) minmax(280px, 340px);
  grid-template-areas: "copy stage controls";
  gap: 16px;
  align-items: stretch;
}
.rocket-cause-copy,
.rocket-cause-controls,
.rocket-cause-stage {
  border: 1px solid rgba(126, 231, 255, 0.24);
  border-radius: 8px;
  background: rgba(13, 12, 32, 0.72);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.rocket-cause-copy {
  grid-area: copy;
  padding: clamp(18px, 2.5vw, 28px);
}
.rocket-cause-controls {
  grid-area: controls;
}
.rocket-cause-stage {
  grid-area: stage;
}
.rocket-cause-copy > span,
.rocket-cause-control span {
  color: #9be8ff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}
.rocket-cause-copy h1 {
  margin: 8px 0 10px;
  max-width: 14ch;
  color: #fff7d8;
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 0.98;
}
.rocket-cause-copy p,
.rocket-cause-result span {
  color: rgba(255, 248, 216, 0.82);
  font-weight: 700;
}
.rocket-cause-prompt,
.rocket-cause-result,
.rocket-force-balance,
.rocket-prediction-panel {
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 214, 107, 0.12);
  border: 1px solid rgba(255, 214, 107, 0.24);
}
.rocket-cause-prompt strong,
.rocket-cause-result strong,
.rocket-force-balance > strong,
.rocket-prediction-panel strong {
  display: block;
  color: #fff7d8;
  font-size: 17px;
  line-height: 1.18;
}
.rocket-cause-prompt button,
.rocket-cause-stepper button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #7ee7ff, #2c9dff);
  color: #06101a;
  font-family: inherit;
  font-weight: 1000;
  cursor: pointer;
}
.rocket-cause-prompt button {
  margin: 12px 8px 0 0;
  padding: 10px 14px;
}
.rocket-force-balance {
  display: grid;
  gap: 9px;
  background: rgba(126, 231, 255, 0.1);
  border-color: rgba(126, 231, 255, 0.24);
}
.rocket-force-balance span {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.rocket-force-balance em {
  overflow: hidden;
  color: #d8f5ff;
  font-size: 12px;
  font-style: normal;
  font-weight: 1000;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.rocket-force-balance i {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}
.rocket-force-balance b {
  display: block;
  min-width: 18px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(126, 231, 255, 0.72), rgba(255, 214, 107, 0.86));
}
.rocket-force-balance span.cargo b {
  background: linear-gradient(90deg, rgba(255, 177, 212, 0.72), rgba(255, 108, 108, 0.82));
}
.rocket-force-balance span.fins b {
  background: linear-gradient(90deg, rgba(141, 255, 178, 0.72), rgba(126, 231, 255, 0.82));
}
.rocket-force-balance small {
  grid-column: 2;
  color: rgba(255, 248, 216, 0.74);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}
.rocket-prediction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.rocket-prediction-row button {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff7d8;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
}
.rocket-prediction-row button.selected {
  background: linear-gradient(180deg, #ffd66b, #ff9a30);
  color: #241400;
  border-color: rgba(255, 216, 107, 0.76);
  box-shadow: 0 0 18px rgba(255, 216, 107, 0.22);
}
.rocket-prediction-panel em {
  display: block;
  margin-top: 9px;
  color: rgba(255, 248, 216, 0.78);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}
.rocket-prediction-panel em.matched {
  color: #b9ffce;
}
.rocket-cause-stage {
  position: relative;
  min-height: min(720px, calc(100vh - 104px));
  overflow: hidden;
  display: grid;
  place-items: end center;
  background: #061023;
  isolation: isolate;
}
.rocket-cause-stage::before {
  content: "";
  position: absolute;
  inset: auto 18% 34px 18%;
  z-index: 1;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 214, 107, 0.34), transparent 68%);
  filter: blur(10px);
}
.rocket-cause-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}
.rocket-cause-height {
  position: absolute;
  inset: 24px auto 24px 18px;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  align-items: center;
  color: rgba(255, 248, 216, 0.76);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}
.rocket-cause-height i {
  width: 4px;
  height: 100%;
    border-radius: 999px;
  background: linear-gradient(180deg, #ffd66b, rgba(126, 231, 255, 0.22));
}
.rocket-cause-readouts {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: grid;
  gap: 8px;
  width: min(164px, 36%);
}
.rocket-cause-readout {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #fff7d8;
  font-size: 12px;
  font-weight: 1000;
  background: rgba(5, 9, 24, 0.68);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}
.rocket-cause-readout.fuel {
  border-color: rgba(255, 154, 60, 0.42);
}
.rocket-cause-readout.fins {
  border-color: rgba(126, 231, 255, 0.42);
}
.rocket-cause-readout.cargo {
  border-color: rgba(229, 231, 235, 0.34);
}
.rocket-cause-ship {
  position: absolute;
  left: 50%;
  bottom: 42px;
  z-index: 3;
  width: min(184px, 26vw);
  transform: translate(-50%, calc(0px - var(--rocket-result-settle)));
  animation:
    rocket-cause-live-hover 1.8s ease-in-out infinite alternate,
    rocket-cause-live-wobble calc(1.15s + (var(--rocket-fins) * 0.18s)) ease-in-out infinite alternate;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.42));
  will-change: transform;
}
.rocket-cause-ship > img,
.rocket-cause-ship > .safe-asset-image {
  width: 100%;
  display: block;
}
.rocket-cause-ship > img:not(.rocket-cause-flame) {
  position: relative;
  z-index: 2;
  transform:
    scaleX(calc(0.92 + (var(--rocket-fins) * 0.04)))
    scaleY(calc(0.96 + (var(--rocket-cargo) * 0.015)));
  transform-origin: bottom center;
}
.rocket-cause-flame {
  position: absolute;
  left: 50%;
  bottom: -126px;
  z-index: 1;
  width: calc(62% + (var(--rocket-fuel) * 15%));
  height: auto;
  object-fit: contain;
  object-position: bottom center;
  transform: translateX(-50%) scaleY(calc(0.45 + (var(--rocket-fuel) * 0.18)));
  transform-origin: top center;
  opacity: calc(0.58 + (var(--rocket-fuel) * 0.12));
  filter: drop-shadow(0 0 20px rgba(255, 214, 107, 0.55));
}
.rocket-cause-controls {
  padding: clamp(16px, 2vw, 22px);
  display: grid;
  gap: 10px;
  align-content: start;
}
.rocket-cause-control {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid transparent;
}
.rocket-cause-control.fuel {
  border-color: rgba(255, 154, 60, 0.2);
}
.rocket-cause-control.fins {
  border-color: rgba(126, 231, 255, 0.2);
}
.rocket-cause-control.cargo {
  border-color: rgba(229, 231, 235, 0.18);
}
.rocket-cause-control > div:first-child {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}
.rocket-cause-control strong {
  color: #fff7d8;
  font-size: 16px;
}
.rocket-cause-stepper {
  display: grid;
  grid-template-columns: 48px minmax(92px, 1fr) 48px;
  gap: 8px;
  align-items: center;
}
.rocket-cause-stepper span {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(7, 7, 20, 0.48);
  color: #fff7d8;
  text-transform: none;
}
.rocket-cause-meter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.rocket-cause-meter i {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}
.rocket-cause-control[data-level="1"] .rocket-cause-meter i:nth-child(1),
.rocket-cause-control[data-level="2"] .rocket-cause-meter i:nth-child(-n + 2),
.rocket-cause-control[data-level="3"] .rocket-cause-meter i {
  background: linear-gradient(90deg, #ffd66b, #7ee7ff);
  box-shadow: 0 0 12px rgba(126, 231, 255, 0.24);
}
@keyframes rocket-cause-live-hover {
  0% {
    translate: 0 7px;
  }
  100% {
    translate: 0 -9px;
  }
}
@keyframes rocket-cause-live-wobble {
  0% {
    rotate: var(--rocket-result-counter-wobble);
  }
  100% {
    rotate: var(--rocket-result-wobble);
  }
}
@media (max-width: 920px) {
  .rocket-cause-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "stage"
      "controls";
    min-height: auto;
  }
  .rocket-cause-copy h1 {
    max-width: 14ch;
  }
  .rocket-cause-stage {
    min-height: min(520px, 58svh);
  }
  .rocket-cause-ship {
    width: min(150px, 38vw);
  }
}

/* ---------- UFO Builder mini game ---------- */
.ufo-builder-level {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  padding: 68px clamp(16px, 3vw, 38px) 24px;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 214, 107, 0.15), transparent 30%),
    radial-gradient(circle at 80% 62%, rgba(181, 117, 255, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(8, 12, 38, 0.26), rgba(7, 7, 20, 0.95)),
    #070714;
}
.ufo-builder-shell {
  position: relative;
  z-index: 1;
  width: min(1160px, 100%);
  min-height: calc(100vh - 104px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(230px, 0.78fr) minmax(300px, 1fr) minmax(300px, 0.95fr);
  gap: clamp(16px, 2.4vw, 28px);
  align-items: stretch;
}
.ufo-builder-copy,
.ufo-builder-stage,
.ufo-part-grid {
  border: 1px solid rgba(126, 231, 255, 0.24);
  border-radius: 18px;
  background: rgba(13, 12, 32, 0.72);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.ufo-builder-copy {
  padding: clamp(18px, 2.5vw, 28px);
}
.ufo-builder-copy > span {
  color: #9be8ff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}
.ufo-builder-copy h1 {
  margin: 8px 0 10px;
  max-width: 11ch;
  color: #fff7d8;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.94;
}
.ufo-builder-copy p,
.ufo-builder-message span,
.ufo-part-card small {
  color: rgba(255, 248, 216, 0.82);
  font-weight: 700;
}
.ufo-builder-message {
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 214, 107, 0.12);
  border: 1px solid rgba(255, 214, 107, 0.24);
}
.ufo-builder-message strong,
.ufo-part-card strong {
  display: block;
  color: #fff7d8;
  font-size: 18px;
}
.ufo-builder-message span {
  display: block;
  margin-top: 5px;
}
.ufo-flight-check {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}
.ufo-flight-check span {
  min-height: 48px;
  display: grid;
  grid-template-columns: 30px minmax(62px, 0.34fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(126, 231, 255, 0.18);
  border-radius: 8px;
  background: rgba(126, 231, 255, 0.08);
  color: rgba(255, 248, 216, 0.72);
  padding: 7px 9px;
}
.ufo-flight-check span.ready {
  border-color: rgba(141, 255, 178, 0.34);
  background: rgba(141, 255, 178, 0.12);
  color: #fff8d8;
}
.ufo-flight-check em {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-style: normal;
  font-weight: 1000;
}
.ufo-flight-check span.ready em {
  background: rgba(141, 255, 178, 0.28);
  color: #caffd8;
}
.ufo-flight-check strong {
  overflow: hidden;
  color: inherit;
  font-size: 12px;
  font-weight: 1000;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.ufo-flight-check small {
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}
.ufo-builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.ufo-builder-actions button,
.ufo-part-card {
  font-family: inherit;
  cursor: pointer;
}
.ufo-builder-actions button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #7ee7ff, #2c9dff);
  color: #06101a;
  font-weight: 1000;
  padding: 10px 14px;
}
.ufo-piece-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.ufo-piece-controls button {
  min-height: 42px;
  border: 1px solid rgba(126, 231, 255, 0.28);
  border-radius: 12px;
  background: rgba(8, 12, 30, 0.68);
  color: #fff8d8;
  font-family: inherit;
  font-weight: 900;
}
.ufo-piece-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}
.ufo-saved-builds {
  margin-top: 14px;
  display: grid;
  gap: 7px;
}
.ufo-saved-builds > span {
  color: #9be8ff;
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}
.ufo-saved-builds small {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 248, 216, 0.86);
  font-weight: 800;
}
.ufo-builder-stage {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.ufo-light-burst {
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 205, 0.82), rgba(255, 214, 107, 0.24) 42%, transparent 66%);
  opacity: 0;
  transform: scale(0.62);
}
.ufo-builder-stage.beaming .ufo-light-burst {
  animation: ufo-materialize 0.82s ease-out both;
}
.ufo-spark-trail {
  position: absolute;
  width: 72%;
  height: 4px;
  transform: rotate(-12deg);
  background: linear-gradient(90deg, transparent, rgba(126, 231, 255, 0.75), transparent);
  opacity: 0.55;
}
.ufo-craft {
  position: relative;
  width: min(300px, 74vw);
  height: 180px;
  display: grid;
  place-items: center;
  animation: ufo-hover 2.8s ease-in-out infinite;
}
.ufo-generated-preview-art {
  position: absolute;
  inset: -22px -8px -32px;
  z-index: 1;
  pointer-events: none;
}
.ufo-stage-piece {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  background-image: url("../data/generated-assets/ufo-builder/ufo-builder-parts-v2-atlas.png");
  background-repeat: no-repeat;
  background-size: 400% 300%;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.42));
  transform: translate(-50%, -50%);
}
.ufo-stage-piece.art-bronzeHull,
.ufo-stage-piece.art-orangeOrb,
.ufo-stage-piece.art-starCraft,
.ufo-stage-piece.art-blueWindows,
.ufo-stage-piece.art-smileWindows,
.ufo-stage-piece.art-radarWindows,
.ufo-stage-piece.art-orbPods,
.ufo-stage-piece.art-sparkTrail,
.ufo-stage-piece.art-quietBeam,
.ufo-stage-piece.art-starDrive,
.ufo-stage-piece.art-lightBurst,
.ufo-stage-piece.art-cometGlow {
  background-image: url("../data/generated-assets/ufo-builder/ufo-builder-parts-v2-atlas.png");
}
.ufo-stage-piece.art-bronzeHull {
  background-position: 0% 0%;
}
.ufo-stage-piece.art-orangeOrb {
  background-position: 33.333% 0%;
}
.ufo-stage-piece.art-starCraft {
  background-position: 66.667% 0%;
}
.ufo-stage-piece.art-blueWindows {
  background-position: 100% 0%;
}
.ufo-stage-piece.art-smileWindows {
  background-position: 0% 50%;
}
.ufo-stage-piece.art-radarWindows {
  background-position: 33.333% 50%;
}
.ufo-stage-piece.art-orbPods {
  background-position: 66.667% 50%;
}
.ufo-stage-piece.art-sparkTrail {
  background-position: 100% 50%;
}
.ufo-stage-piece.art-quietBeam {
  background-position: 0% 100%;
}
.ufo-stage-piece.art-starDrive {
  background-position: 33.333% 100%;
}
.ufo-stage-piece.art-lightBurst {
  background-position: 66.667% 100%;
}
.ufo-stage-piece.art-cometGlow {
  background-position: 100% 100%;
}
.ufo-stage-piece.stage-body {
  width: 270px;
  height: 202px;
  z-index: 1;
}
.ufo-craft.body-orangeOrb .stage-body {
  width: 216px;
  height: 216px;
}
.ufo-craft.body-starCraft .stage-body {
  width: 242px;
  height: 220px;
}
.ufo-stage-piece.stage-windows {
  width: 92px;
  height: 70px;
  z-index: 2;
  top: 50%;
}
.ufo-craft.windows-smileWindows .stage-windows {
  width: 122px;
  height: 78px;
}
.ufo-craft.windows-radarWindows .stage-windows {
  width: 82px;
  height: 82px;
}
.ufo-stage-piece.stage-launcher {
  z-index: 3;
  top: 78%;
}
.ufo-stage-piece.stage-launcher.art-orbPods {
  width: 98px;
  height: 76px;
}
.ufo-stage-piece.stage-launcher.art-sparkTrail {
  width: 116px;
  height: 66px;
  left: 61%;
  top: 78%;
}
.ufo-stage-piece.stage-launcher.art-quietBeam {
  width: 104px;
  height: 116px;
  top: 84%;
}
.ufo-stage-piece.stage-energy {
  z-index: 4;
  left: 68%;
  top: 28%;
}
.ufo-stage-piece.stage-energy.art-starDrive {
  width: 96px;
  height: 96px;
}
.ufo-stage-piece.stage-energy.art-lightBurst {
  width: 110px;
  height: 96px;
}
.ufo-stage-piece.stage-energy.art-cometGlow {
  width: 122px;
  height: 88px;
}
.ufo-stage-piece.stage-drop-ufos {
  width: 176px;
  height: 176px;
  z-index: 3;
  top: 82%;
  background-image: url("../data/generated-assets/ufo-builder/drop-ufos-v2-atlas.png");
  background-repeat: no-repeat;
  background-size: 300% 100%;
  background-position: 50% 0%;
  animation: ufo-drop-float 2.7s ease-in-out infinite;
}
.ufo-part-grid {
  display: grid;
  gap: 12px;
  padding: clamp(14px, 2vw, 20px);
  align-content: start;
  overflow: auto;
}
.ufo-part-group {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ufo-part-group h2 {
  margin: 0 0 8px;
  color: #9be8ff;
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
}
.ufo-part-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ufo-part-card {
  min-height: 98px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff7d8;
  display: grid;
  gap: 4px;
  justify-items: center;
  align-content: center;
  padding: 12px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}
.ufo-part-card strong {
  font-size: 14px;
}
.ufo-part-card small {
  font-size: 11px;
  line-height: 1.15;
}
.ufo-art-icon {
  width: 68px;
  height: 52px;
  display: block;
  background: url("../data/generated-assets/ufo-builder/ufo-builder-parts-v2-atlas.png") no-repeat;
  background-size: 400% 300%;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.38));
}
.ufo-art-icon.art-bronzeHull {
  background-position: 0% 0%;
}
.ufo-art-icon.art-orangeOrb {
  background-position: 33.333% 0%;
}
.ufo-art-icon.art-starCraft {
  background-position: 66.667% 0%;
}
.ufo-art-icon.art-blueWindows {
  background-position: 100% 0%;
}
.ufo-art-icon.art-smileWindows {
  background-position: 0% 50%;
}
.ufo-art-icon.art-radarWindows {
  background-position: 33.333% 50%;
}
.ufo-art-icon.art-orbPods {
  background-position: 66.667% 50%;
}
.ufo-art-icon.art-sparkTrail {
  background-position: 100% 50%;
}
.ufo-art-icon.art-quietBeam {
  background-position: 0% 100%;
}
.ufo-art-icon.art-starDrive {
  background-position: 33.333% 100%;
}
.ufo-art-icon.art-lightBurst {
  background-position: 66.667% 100%;
}
.ufo-art-icon.art-cometGlow {
  background-position: 100% 100%;
}
.ufo-art-icon.art-dropUfos {
  position: relative;
  width: 70px;
  height: 54px;
  background: url("../data/generated-assets/ufo-builder/drop-ufos-v2-atlas.png") no-repeat 50% 0%;
  background-size: 300% 100%;
}
.ufo-art-icon.art-dropUfos::before,
.ufo-art-icon.art-dropUfos::after {
  content: none;
}
.ufo-part-card.selected {
  transform: translateY(-3px);
  border-color: rgba(255, 214, 107, 0.82);
  background: rgba(255, 214, 107, 0.16);
}
.ufo-builder-stage {
  background: #061023;
  isolation: isolate;
}
.ufo-lab-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
}
.ufo-builder-stage::before {
  content: "";
  position: absolute;
  inset: auto 15% 42px;
  z-index: 1;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(126, 231, 255, 0.32), transparent 68%);
  filter: blur(12px);
}
.ufo-light-burst,
.ufo-spark-trail,
.ufo-craft {
  z-index: 2;
}
.ufo-craft {
  width: min(390px, 74vw);
  height: min(280px, 48vw);
  min-height: 210px;
}
.ufo-generated-preview-art {
  inset: 0;
}
.ufo-stage-piece {
  background: none !important;
  object-fit: contain;
  pointer-events: none;
}
.ufo-stage-piece.ufo-chassis {
  left: 50%;
  top: 54%;
  z-index: 3;
  width: 100%;
  height: auto;
  max-height: 100%;
}
.ufo-craft.body-tearDrop .ufo-chassis {
  top: 55%;
  width: 96%;
}
.ufo-craft.body-angelRings .ufo-chassis {
  top: 54%;
  width: 96%;
}
.ufo-angel-ring-sequence {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.ufo-angel-ring-frame {
  opacity: 1;
}
.ufo-angel-orbit {
  position: absolute;
  left: 50%;
  top: 54%;
  z-index: 4;
  width: 80%;
  height: 43%;
  border: 2px solid rgba(225, 244, 255, 0.66);
  border-radius: 50%;
  box-shadow:
    0 0 14px rgba(126, 231, 255, 0.26),
    inset 0 0 18px rgba(255, 214, 107, 0.12);
  filter: blur(0.1px);
  transform: translate(-50%, -50%) rotateX(64deg) rotateZ(0deg);
  transform-origin: 50% 50%;
  animation: ufo-angel-orbit-spin 2.15s linear infinite;
  will-change: transform;
}
.ufo-angel-orbit.orbit-two {
  width: 66%;
  height: 35%;
  border-color: rgba(255, 228, 151, 0.56);
  animation-duration: 1.72s;
  animation-direction: reverse;
}
.ufo-angel-orbit.orbit-three {
  width: 91%;
  height: 49%;
  border-color: rgba(255, 255, 255, 0.36);
  opacity: 0.72;
  animation-duration: 2.9s;
}
.ufo-stage-module {
  z-index: 4;
  opacity: 0.96;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transform: translate(-50%, -50%) scale(1);
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.ufo-stage-module:active {
  cursor: grabbing;
}
.ufo-stage-module.selected-module {
  opacity: 1;
  outline: 3px solid rgba(255, 214, 107, 0.92);
  outline-offset: 5px;
  filter:
    drop-shadow(0 0 16px rgba(255, 214, 107, 0.42))
    drop-shadow(0 16px 18px rgba(0, 0, 0, 0.42));
}
.ufo-builder-stage {
  touch-action: none;
}
.ufo-builder-stage.beaming .ufo-stage-module {
  animation: ufo-snap-pop 0.42s ease-out both;
}
.ufo-stage-module.stage-body {
  left: 50%;
  top: 22%;
  z-index: 5;
  width: 30%;
  height: auto;
}
.ufo-stage-module.stage-windows {
  left: 50%;
  top: 56%;
  z-index: 6;
  width: 21%;
  height: auto;
}
.ufo-craft.body-tearDrop .ufo-stage-module.stage-windows {
  top: 52%;
}
.ufo-craft.body-angelRings .ufo-stage-module.stage-windows {
  top: 54%;
  width: 18%;
}
.ufo-stage-module.stage-launcher {
  left: 50%;
  top: 78%;
  z-index: 2;
  width: 34%;
  height: auto;
}
.ufo-stage-module.stage-launcher.art-orbPods {
  top: 58%;
  z-index: 5;
  width: 82%;
  opacity: 1;
}
.ufo-stage-module.stage-launcher.art-sparkTrail {
  left: 76%;
  top: 57%;
  z-index: 4;
  width: 29%;
}
.ufo-stage-module.stage-launcher.art-quietBeam,
.ufo-stage-module.stage-launcher.art-dropUfos {
  top: 86%;
  z-index: 2;
  width: 30%;
}
.ufo-stage-module.stage-launcher.art-quietBeam {
  top: 89%;
  z-index: 1;
  width: 38%;
  opacity: 0.82;
  mix-blend-mode: screen;
}
.ufo-craft.body-angelRings .ufo-stage-module.stage-launcher.art-quietBeam,
.ufo-craft.body-angelRings .ufo-stage-module.stage-launcher.art-dropUfos {
  top: 83%;
}
.ufo-craft.body-bronzeHull .ufo-stage-module.stage-launcher.art-quietBeam {
  top: 91%;
}
.ufo-craft.body-tearDrop .ufo-stage-module.stage-launcher.art-quietBeam {
  top: 88%;
  width: 34%;
}
.ufo-craft.body-angelRings .ufo-stage-module.stage-launcher.art-quietBeam {
  top: 86%;
  width: 34%;
}
.ufo-stage-module.stage-energy {
  left: 72%;
  top: 34%;
  z-index: 5;
  width: 20%;
  height: auto;
}
.ufo-craft.body-angelRings .ufo-stage-module.stage-energy {
  left: 76%;
  top: 30%;
  width: 18%;
}
.ufo-stage-module.stage-energy.art-lightBurst {
  left: 70%;
  top: 39%;
  width: 22%;
}
.ufo-stage-module.stage-energy.art-cometGlow {
  left: 76%;
  top: 57%;
  z-index: 4;
  width: 30%;
}
.ufo-stage-module.art-redFire {
  width: 23%;
  height: auto;
  z-index: 5;
  mix-blend-mode: screen;
  filter:
    drop-shadow(0 0 16px rgba(255, 68, 28, 0.72))
    drop-shadow(0 16px 18px rgba(0, 0, 0, 0.34));
}
.ufo-art-icon {
  width: 74px;
  height: 58px;
  object-fit: contain;
  background: none !important;
}
.ufo-art-icon.art-bronzeHull,
.ufo-art-icon.art-tearDrop,
.ufo-art-icon.art-angelRings {
  width: 82px;
  height: 58px;
}
.ufo-art-icon.art-redFire {
  width: 62px;
  height: 72px;
}
.ufo-drag-preview {
  position: fixed;
  z-index: 80;
  left: 0;
  top: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
  transform: translate(-50%, -58%);
  pointer-events: none;
  color: #fff7d8;
  font-size: 12px;
  font-weight: 1000;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.72);
}
.ufo-drag-preview-art {
  width: 92px;
  height: 78px;
  object-fit: contain;
  filter:
    drop-shadow(0 18px 22px rgba(0, 0, 0, 0.42))
    drop-shadow(0 0 14px rgba(126, 231, 255, 0.3));
}
.ufo-drag-preview.over-pad .ufo-drag-preview-art {
  filter:
    drop-shadow(0 18px 22px rgba(0, 0, 0, 0.42))
    drop-shadow(0 0 22px rgba(255, 214, 107, 0.72));
  transform: scale(1.08);
}
.ufo-drag-preview span {
  border: 1px solid rgba(255, 214, 107, 0.28);
  border-radius: 999px;
  background: rgba(8, 12, 30, 0.82);
  padding: 5px 9px;
}
@keyframes ufo-snap-pop {
  0% {
    opacity: 0.25;
    transform: translate(-50%, -50%) scale(0.78);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
  100% {
    opacity: 0.96;
    transform: translate(-50%, -50%) scale(1);
  }
}
@keyframes ufo-angel-orbit-spin {
  to {
    transform: translate(-50%, -50%) rotateX(64deg) rotateZ(360deg);
  }
}
@keyframes ufo-angel-ring-frame-0 {
  0%, 24.99% {
    opacity: 1;
  }
  25%, 100% {
    opacity: 0;
  }
}
@keyframes ufo-angel-ring-frame-1 {
  0%, 24.99%, 50%, 100% {
    opacity: 0;
  }
  25%, 49.99% {
    opacity: 1;
  }
}
@keyframes ufo-angel-ring-frame-2 {
  0%, 49.99%, 75%, 100% {
    opacity: 0;
  }
  50%, 74.99% {
    opacity: 1;
  }
}
@keyframes ufo-angel-ring-frame-3 {
  0%, 74.99% {
    opacity: 0;
  }
  75%, 100% {
    opacity: 1;
  }
}
@keyframes ufo-hover {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}
@keyframes ufo-wheel-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes ufo-wheel-spin-reverse {
  to {
    transform: rotate(-360deg);
  }
}
@keyframes ufo-drop-float {
  0%, 100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -10px;
  }
}
@keyframes ufo-materialize {
  0% {
    opacity: 0;
    transform: scale(0.38);
  }
  38% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}
@media (max-width: 920px) {
  .ufo-builder-shell {
    grid-template-columns: 1fr;
  }
  .ufo-builder-copy h1 {
    max-width: 14ch;
  }
}
