#galactic-rocket-3d {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  color: var(--foreground);
}
#galactic-rocket-3d .gr3-head {
  flex: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
#galactic-rocket-3d h2,
#galactic-rocket-3d h3,
#galactic-rocket-3d p {
  margin: 0;
}
#galactic-rocket-3d h2 {
  margin-bottom: 3px;
}
#galactic-rocket-3d .gr3-stage {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  /* aspect-ratio sizes the stage when the page is free to grow (embedded in a
     scrolling host); when the widget has a bounded height the flex line wins
     and the stage shrinks to fit instead of pushing the page into a scroll. */
  aspect-ratio: 16/9;
  min-height: 160px;
  overflow: hidden;
  background: light-dark(#050817, #01030a);
}
#galactic-rocket-3d #gr3-world,
#galactic-rocket-3d canvas {
  display: block;
  width: 100%;
  height: 100%;
}
#galactic-rocket-3d #gr3-world {
  /* The drag stick owns every gesture here; without this the browser would
     scroll or pinch-zoom the page instead of steering. */
  touch-action: none;
}
#galactic-rocket-3d .gr3-stick {
  position: absolute;
  z-index: 3;
  width: 104px;
  height: 104px;
  margin: -52px;
  border: 2px solid color-mix(in srgb, var(--blue) 55%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, #04070a 30%, transparent);
  pointer-events: none;
}
#galactic-rocket-3d .gr3-stick[hidden] {
  display: none;
}
#galactic-rocket-3d .gr3-stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--blue) 78%, transparent);
  box-shadow: 0 2px 12px color-mix(in srgb, var(--blue) 45%, transparent);
}
#galactic-rocket-3d .gr3-fire {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 18px;
  width: 84px;
  height: 84px;
  border: 2px solid color-mix(in srgb, #ffd43b 70%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, #ffd43b 22%, transparent);
  color: #ffe89a;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.08em;
  touch-action: none;
  cursor: pointer;
}
#galactic-rocket-3d .gr3-fire[hidden] {
  display: none;
}
#galactic-rocket-3d .gr3-fire:active {
  background: color-mix(in srgb, #ffd43b 45%, transparent);
}
#galactic-rocket-3d .gr3-hud {
  position: absolute;
  inset: 12px 14px auto;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #f8fbff;
  text-shadow: 0 1px 8px #000;
  pointer-events: none;
}
#galactic-rocket-3d .gr3-hud span {
  white-space: nowrap;
}
#galactic-rocket-3d .gr3-hud i {
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
#galactic-rocket-3d .gr3-reticle {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 45%;
  width: 28px;
  height: 28px;
  margin: -14px;
  border: 1px solid color-mix(in srgb, var(--blue) 70%, transparent);
  border-radius: 50%;
  pointer-events: none;
}
#galactic-rocket-3d .gr3-reticle span::before,
#galactic-rocket-3d .gr3-reticle span::after {
  content: "";
  position: absolute;
  background: color-mix(in srgb, var(--blue) 75%, transparent);
}
#galactic-rocket-3d .gr3-reticle span::before {
  width: 8px;
  height: 1px;
  left: 9px;
  top: 13px;
}
#galactic-rocket-3d .gr3-reticle span::after {
  width: 1px;
  height: 8px;
  left: 13px;
  top: 9px;
}
#galactic-rocket-3d .gr3-cockpit {
  position: absolute;
  z-index: 2;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 18%;
  border-top: 3px solid color-mix(in srgb, var(--blue) 68%, transparent);
  border-radius: 50% 50% 0 0;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #071125 45%, transparent),
    #030611 64%
  );
  box-shadow: 0 -8px 28px color-mix(in srgb, var(--blue) 18%, transparent);
  color: #9ee7ff;
  text-align: center;
  pointer-events: none;
}
#galactic-rocket-3d .gr3-cockpit[hidden] {
  display: none;
}
#galactic-rocket-3d .gr3-cockpit span {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: 0.12em;
}
#galactic-rocket-3d .gr3-overlay {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: #f8fbff;
  background: color-mix(in srgb, #01030a 62%, transparent);
}
#galactic-rocket-3d .gr3-overlay[hidden] {
  display: none;
}
#galactic-rocket-3d .gr3-overlay > div {
  max-width: 620px;
}
#galactic-rocket-3d .gr3-overlay h3 {
  margin-bottom: 8px;
}
#galactic-rocket-3d .gr3-overlay p + p {
  margin-top: 8px;
}
#galactic-rocket-3d .gr3-track {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
#galactic-rocket-3d .gr3-track span {
  padding: 8px 10px;
  text-align: center;
  color: var(--muted-foreground);
  border-bottom: 3px solid var(--border);
}
#galactic-rocket-3d .gr3-track span.active {
  color: var(--foreground);
  border-color: var(--blue);
}
#galactic-rocket-3d:fullscreen {
  box-sizing: border-box;
  height: 100%;
  padding: 16px;
  /* Fullscreen paints over the host page, so this rule supplies the ground the
     host normally would — theme-aware, like the rest of the sheet. */
  background: light-dark(#f4f6fb, #05070d);
  color: var(--foreground);
}

@media (max-width: 560px) {
  #galactic-rocket-3d .gr3-head {
    align-items: flex-start;
    flex-direction: column;
  }
  #galactic-rocket-3d .gr3-hud {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  #galactic-rocket-3d .gr3-track {
    grid-template-columns: 1fr;
  }
}
@media (max-height: 480px) {
  #galactic-rocket-3d .gr3-track {
    display: none;
  }
  #galactic-rocket-3d .gr3-head {
    margin-bottom: 6px;
  }
  #galactic-rocket-3d h2 {
    font-size: 1.1rem;
  }
}
