:root {
  color-scheme: dark;
  --ink: #070a0e;
  --ink-soft: #0c1117;
  --panel: rgba(12, 17, 22, 0.9);
  --panel-solid: #0c1116;
  --line: rgba(218, 234, 223, 0.13);
  --line-bright: rgba(218, 234, 223, 0.3);
  --text: #e8ede8;
  --muted: #7f8b87;
  --acid: #d9ff72;
  --acid-soft: #a9c94f;
  --ember: #ff6c42;
  --ember-hot: #ffb15a;
  --cyan: #6ce5e8;
  --void: #a98dff;
  --danger: #ff5f64;
  --mono: "SFMono-Regular", "Roboto Mono", "Cascadia Code", "Liberation Mono", monospace;
  --display: "Arial Narrow", "Avenir Next Condensed", "Helvetica Neue", sans-serif;
  --body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.cosmos {
  position: fixed;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(47, 39, 25, 0.23), transparent 33%),
    linear-gradient(180deg, #070a0e 0%, #080c10 58%, #0c0f12 100%);
}

.cosmos::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 80px 80px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.nebula {
  position: absolute;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.08;
}

.nebula-one {
  top: -20%;
  left: -12%;
  background: var(--cyan);
}

.nebula-two {
  right: -18%;
  bottom: -24%;
  background: var(--ember);
}

.starfield,
.starfield span {
  position: absolute;
  inset: 0;
}

.starfield span {
  width: var(--size);
  height: var(--size);
  left: var(--x);
  top: var(--y);
  border-radius: 50%;
  background: rgba(235, 242, 237, var(--opacity));
  box-shadow: 0 0 calc(var(--size) * 3) rgba(235, 242, 237, 0.45);
  animation: twinkle var(--duration) ease-in-out infinite alternate;
  animation-delay: var(--delay);
}

.horizon-grid {
  position: absolute;
  right: -20%;
  bottom: -56%;
  left: -20%;
  height: 82%;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(217, 255, 114, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 255, 114, 0.25) 1px, transparent 1px);
  background-size: 54px 54px;
  transform: perspective(420px) rotateX(62deg);
  transform-origin: top;
  mask-image: linear-gradient(to bottom, black, transparent 74%);
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    #fff 3px,
    transparent 4px
  );
}

.command-bar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(270px, 1fr) minmax(400px, 1.35fr) minmax(230px, 1fr);
  min-height: 88px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 10, 14, 0.88);
  backdrop-filter: blur(18px);
}

.command-bar::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--acid) 48%, transparent 70%);
  opacity: 0.28;
  content: "";
}

.brand-block,
.top-readouts,
.header-actions {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 14px;
}

.brand-block h1 {
  margin: 3px 0 0;
  font-family: var(--display);
  font-size: clamp(1rem, 1.55vw, 1.45rem);
  font-stretch: condensed;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
}

.brand-block h1 em {
  color: var(--acid);
  font-style: normal;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.25;
}

.brand-sigil {
  position: relative;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid rgba(217, 255, 114, 0.35);
  border-radius: 50%;
  animation: sigil-pulse 4s ease-in-out infinite;
}

.brand-sigil::before,
.brand-sigil::after,
.brand-sigil span {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.brand-sigil::before {
  inset: 7px;
  border: 1px dashed rgba(217, 255, 114, 0.5);
}

.brand-sigil::after {
  inset: 15px;
  background: var(--acid);
  box-shadow: 0 0 12px var(--acid);
}

.brand-sigil span:nth-child(1) {
  width: 4px;
  height: 4px;
  top: 5px;
  left: 17px;
  background: var(--ember);
}

.brand-sigil span:nth-child(2) {
  width: 2px;
  height: 2px;
  right: 4px;
  bottom: 10px;
  background: var(--cyan);
}

.top-readouts {
  align-self: stretch;
  justify-content: center;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.top-readout {
  display: flex;
  min-width: 130px;
  height: 100%;
  padding: 0 22px;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}

.top-readout:last-child {
  border-right: 0;
}

.top-readout span {
  margin-bottom: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.top-readout strong {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-readout strong {
  color: var(--acid);
}

.stardust-readout strong {
  color: var(--void);
}

.header-actions {
  justify-content: flex-end;
  gap: 10px;
}

.save-state {
  display: flex;
  margin-right: 8px;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.save-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 7px var(--acid);
}

.save-state.saving .save-dot {
  animation: saving 0.55s ease infinite alternate;
}

.icon-button,
.text-button {
  height: 34px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: 160ms ease;
}

.icon-button:hover,
.text-button:hover {
  border-color: var(--line-bright);
  background: rgba(255, 255, 255, 0.06);
}

.icon-button {
  display: grid;
  width: 34px;
  padding: 8px;
  place-items: center;
}

.icon-button svg {
  width: 100%;
  fill: var(--muted);
}

.icon-button.muted .sound-wave {
  opacity: 0.15;
}

.text-button {
  padding: 0 13px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.danger-button:hover {
  border-color: rgba(255, 95, 100, 0.5);
  color: var(--danger);
}

.game-shell {
  display: grid;
  grid-template-columns: minmax(270px, 0.83fr) minmax(440px, 1.45fr) minmax(330px, 1fr);
  min-height: calc(100vh - 124px);
  padding: 18px;
  gap: 18px;
}

.panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.018), transparent 30%),
    var(--panel);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
}

.panel::before {
  position: absolute;
  top: 0;
  right: 58px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--acid), transparent 78%);
  opacity: 0.55;
  content: "";
}

.panel-corner {
  position: absolute;
  top: 0;
  right: 0;
  width: 38px;
  height: 38px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background:
    linear-gradient(135deg, transparent 47%, var(--line) 48%, var(--line) 50%, transparent 51%);
}

.mission-panel {
  max-height: calc(100vh - 124px);
  overflow-y: auto;
  scrollbar-color: rgba(217, 255, 114, 0.25) transparent;
  scrollbar-width: thin;
}

.panel-heading {
  display: flex;
  min-height: 84px;
  padding: 20px 20px 16px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.live-badge i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 8px var(--acid);
  animation: live-pulse 1.5s ease infinite;
}

.transmission-card {
  position: relative;
  min-height: 114px;
  padding: 18px 20px 24px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: rgba(217, 255, 114, 0.025);
}

.transmission-label {
  margin: 0 0 11px;
  color: var(--acid-soft);
  font-family: var(--mono);
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

#transmission-text {
  max-width: 95%;
  margin: 0;
  color: #bbc4be;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.65;
}

.signal-bars {
  position: absolute;
  right: 17px;
  bottom: 12px;
  left: 20px;
  display: flex;
  height: 10px;
  align-items: end;
  gap: 3px;
  opacity: 0.24;
}

.signal-bars i {
  width: 3px;
  height: 35%;
  background: var(--acid);
  animation: signal 1.7s ease-in-out infinite alternate;
}

.signal-bars i:nth-child(2n) { height: 80%; animation-delay: -0.4s; }
.signal-bars i:nth-child(3n) { height: 50%; animation-delay: -0.9s; }
.signal-bars i:nth-child(4n) { height: 100%; animation-delay: -1.2s; }

.mission-section {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.section-title-row {
  display: flex;
  margin-bottom: 12px;
  align-items: center;
  justify-content: space-between;
}

.section-title-row h3,
.section-title-row span {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.57rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.milestone-list {
  display: grid;
  gap: 7px;
}

.milestone {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  min-height: 42px;
  padding: 8px 9px;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.milestone::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.07);
  content: "";
}

.milestone::before {
  position: absolute;
  z-index: 1;
  bottom: 0;
  left: 0;
  width: var(--progress);
  height: 2px;
  background: var(--acid);
  box-shadow: 0 0 8px var(--acid);
  content: "";
  transition: width 250ms ease;
}

.milestone.complete {
  border-color: rgba(217, 255, 114, 0.2);
  background: rgba(217, 255, 114, 0.035);
}

.milestone-index {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.5rem;
}

.milestone.complete .milestone-index {
  border-color: var(--acid-soft);
  color: var(--acid);
}

.milestone-copy {
  min-width: 0;
}

.milestone-copy strong,
.milestone-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.milestone-copy strong {
  color: #cbd2cd;
  font-size: 0.64rem;
  font-weight: 650;
}

.milestone-copy span {
  margin-top: 2px;
  color: #5e6965;
  font-family: var(--mono);
  font-size: 0.49rem;
}

.milestone-value {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.5rem;
}

.milestone.complete .milestone-value {
  color: var(--acid-soft);
}

.achievement-section {
  padding-bottom: 18px;
}

.achievement-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.achievement-chip {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  color: #47514e;
  cursor: help;
  font-family: var(--mono);
  font-size: 0.65rem;
  transition: 180ms ease;
}

.achievement-chip.earned {
  border-color: rgba(108, 229, 232, 0.35);
  background: rgba(108, 229, 232, 0.06);
  color: var(--cyan);
  box-shadow: inset 0 0 12px rgba(108, 229, 232, 0.04);
}

.record-boost {
  margin: 9px 0 0;
  color: #5f6a66;
  font-family: var(--mono);
  font-size: 0.49rem;
}

.record-boost strong {
  color: var(--cyan);
}

.collapse-card {
  position: relative;
  margin: 16px 20px 20px;
  padding: 17px;
  overflow: hidden;
  border: 1px solid rgba(169, 141, 255, 0.32);
  background:
    radial-gradient(circle at 100% 0%, rgba(169, 141, 255, 0.15), transparent 45%),
    rgba(169, 141, 255, 0.035);
}

.collapse-card.locked {
  filter: saturate(0.3);
  opacity: 0.64;
}

.collapse-card h3 {
  position: relative;
  margin: 5px 0 6px;
  font-family: var(--display);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.collapse-card p:not(.eyebrow) {
  position: relative;
  margin: 0;
  color: #7d758f;
  font-size: 0.58rem;
  line-height: 1.45;
}

.collapse-orbit {
  position: absolute;
  width: 100px;
  height: 100px;
  top: -53px;
  right: -35px;
  border: 1px solid rgba(169, 141, 255, 0.24);
  border-radius: 50%;
  box-shadow: inset 0 0 20px rgba(169, 141, 255, 0.08);
}

.collapse-progress {
  height: 3px;
  margin: 14px 0 11px;
  overflow: hidden;
  background: rgba(169, 141, 255, 0.12);
}

.collapse-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--void);
  box-shadow: 0 0 10px var(--void);
  transition: width 300ms ease;
}

.collapse-button {
  display: flex;
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(169, 141, 255, 0.35);
  background: rgba(169, 141, 255, 0.09);
  color: #d5c9ff;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.collapse-button small {
  color: var(--void);
  font-size: 0.47rem;
}

.collapse-button:disabled {
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.collapse-button:not(:disabled):hover {
  background: rgba(169, 141, 255, 0.18);
  box-shadow: 0 0 20px rgba(169, 141, 255, 0.12);
}

.reactor-stage {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 21px 32px 16px;
  overflow: hidden;
  align-items: center;
  flex-direction: column;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 108, 66, 0.075), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 60%);
}

.reactor-stage::before,
.reactor-stage::after {
  position: absolute;
  width: 90px;
  height: 90px;
  content: "";
}

.reactor-stage::before {
  top: 0;
  left: 0;
  border-top: 1px solid var(--line-bright);
  border-left: 1px solid var(--line-bright);
}

.reactor-stage::after {
  right: 0;
  bottom: 0;
  border-right: 1px solid var(--line-bright);
  border-bottom: 1px solid var(--line-bright);
}

.stage-meta {
  position: absolute;
  top: 19px;
  display: flex;
  flex-direction: column;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.47rem;
  letter-spacing: 0.11em;
  line-height: 1.55;
}

.stage-meta strong {
  color: #adb7b1;
  font-size: 0.55rem;
}

.stage-meta-left { left: 22px; }
.stage-meta-right { right: 22px; text-align: right; }

.reactor-title-block {
  position: relative;
  z-index: 2;
  text-align: center;
}

.reactor-title-block h2 {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  font-weight: 500;
  letter-spacing: 0.025em;
}

.reactor-wrap {
  --core-scale: 1;
  position: relative;
  width: min(41vh, 380px);
  min-width: 270px;
  aspect-ratio: 1;
  margin: 4px 0 -6px;
  flex: none;
  isolation: isolate;
}

.reactor-halo,
.orbit,
.reactor-reticle,
.core-button {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.reactor-halo {
  pointer-events: none;
}

.halo-outer {
  width: 91%;
  height: 91%;
  border: 1px solid rgba(255, 255, 255, 0.045);
  box-shadow:
    inset 0 0 40px rgba(255, 108, 66, 0.02),
    0 0 45px rgba(255, 108, 66, 0.025);
  animation: breathe 4s ease-in-out infinite;
}

.halo-outer::before,
.halo-outer::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.halo-outer::before {
  inset: 12%;
  border: 1px dashed rgba(255, 177, 90, 0.13);
  animation: spin 32s linear infinite;
}

.halo-outer::after {
  inset: 25%;
  background: radial-gradient(circle, rgba(255, 108, 66, 0.13), transparent 67%);
  filter: blur(11px);
}

.halo-mid {
  width: 71%;
  height: 71%;
  border: 1px solid rgba(255, 177, 90, 0.1);
  box-shadow: 0 0 35px rgba(255, 108, 66, 0.06);
  animation: spin-reverse 20s linear infinite;
}

.halo-mid::before,
.halo-mid::after {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ember-hot);
  box-shadow: 0 0 8px var(--ember-hot);
  content: "";
}

.halo-mid::before { top: -3px; left: 50%; }
.halo-mid::after { right: 8%; bottom: 14%; width: 3px; height: 3px; }

.orbit {
  z-index: 3;
  border: 1px solid rgba(232, 237, 232, 0.13);
  pointer-events: none;
}

.orbit-one {
  width: 76%;
  height: 43%;
  transform: translate(-50%, -50%) rotate(-16deg);
  animation: orbit-wobble 10s ease-in-out infinite alternate;
}

.orbit-two {
  width: 54%;
  height: 83%;
  transform: translate(-50%, -50%) rotate(60deg);
  opacity: 0.7;
}

.orbit i {
  position: absolute;
  width: 6px;
  height: 6px;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 9px var(--cyan);
}

.orbit-one i:first-child { top: 11%; left: 10%; }
.orbit-one i:last-child { right: 8%; bottom: 12%; width: 3px; height: 3px; }
.orbit-two i { right: 3%; bottom: 20%; width: 4px; height: 4px; border-color: var(--acid); box-shadow: 0 0 8px var(--acid); }

.core-button {
  z-index: 5;
  display: block;
  width: 46%;
  height: 46%;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%) scale(var(--core-scale));
  transition: transform 80ms ease, filter 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.core-button:hover {
  --core-scale: 1.035;
  filter: brightness(1.08);
}

.core-button:active,
.core-button.pressed {
  --core-scale: 0.965;
}

.core-button:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 12px;
}

.core-corona,
.core-surface,
.core-glint {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.core-corona {
  inset: -38%;
  background:
    conic-gradient(
      from 20deg,
      transparent 0 8%,
      rgba(255, 108, 66, 0.28) 10%,
      transparent 14% 30%,
      rgba(255, 177, 90, 0.2) 34%,
      transparent 41% 67%,
      rgba(255, 108, 66, 0.24) 70%,
      transparent 76%
    );
  filter: blur(10px);
  opacity: 0.67;
  animation: spin 15s linear infinite;
}

.core-corona::before {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: rgba(255, 108, 66, 0.42);
  filter: blur(19px);
  content: "";
  animation: core-pulse 2.2s ease-in-out infinite alternate;
}

.core-surface {
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 229, 177, 0.8);
  background:
    radial-gradient(circle at 38% 31%, #fff8c6 0 3%, transparent 12%),
    radial-gradient(circle at 68% 67%, rgba(169, 41, 13, 0.42), transparent 18%),
    radial-gradient(circle at 38% 72%, rgba(255, 210, 95, 0.65), transparent 22%),
    radial-gradient(circle at 50% 50%, #ffda72 0, #ff963e 38%, #ed4d21 68%, #8d1a12 100%);
  box-shadow:
    inset -18px -21px 30px rgba(112, 13, 5, 0.6),
    inset 13px 12px 25px rgba(255, 244, 174, 0.46),
    0 0 12px #ffbf55,
    0 0 34px rgba(255, 104, 45, 0.8),
    0 0 78px rgba(255, 88, 38, 0.35);
}

.core-surface::before {
  position: absolute;
  inset: -30%;
  border-radius: 44%;
  background:
    repeating-radial-gradient(ellipse at 30% 40%, transparent 0 7px, rgba(255, 244, 194, 0.11) 8px 9px),
    conic-gradient(transparent, rgba(255, 232, 160, 0.32), transparent 30%);
  mix-blend-mode: screen;
  content: "";
  animation: spin-reverse 19s linear infinite;
}

.core-glint {
  width: 22%;
  height: 9%;
  top: 16%;
  left: 24%;
  background: rgba(255, 255, 222, 0.8);
  filter: blur(5px);
  transform: rotate(-29deg);
}

.core-label {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-radius: 50%;
  color: #270c07;
  text-align: center;
  text-shadow: 0 1px rgba(255, 233, 172, 0.3);
}

.core-label small {
  font-family: var(--mono);
  font-size: clamp(0.38rem, 0.6vw, 0.52rem);
  font-weight: 900;
  letter-spacing: 0.16em;
}

.core-label strong {
  margin: 2px 0;
  font-family: var(--display);
  font-size: clamp(1rem, 2.2vw, 1.6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.core-label em {
  padding: 3px 6px;
  border: 1px solid rgba(64, 16, 5, 0.22);
  font-family: var(--mono);
  font-size: clamp(0.36rem, 0.55vw, 0.48rem);
  font-style: normal;
  font-weight: 900;
}

.reactor-reticle {
  z-index: 6;
  width: 57%;
  height: 57%;
  border: 1px dashed rgba(255, 222, 150, 0.23);
  pointer-events: none;
  animation: spin 44s linear infinite;
}

.reactor-reticle i {
  position: absolute;
  width: 15px;
  height: 1px;
  background: rgba(255, 232, 177, 0.4);
}

.reactor-reticle i:nth-child(1) { top: -1px; left: 50%; transform: translateX(-50%) rotate(90deg); }
.reactor-reticle i:nth-child(2) { top: 50%; right: -8px; }
.reactor-reticle i:nth-child(3) { bottom: -1px; left: 50%; transform: translateX(-50%) rotate(90deg); }
.reactor-reticle i:nth-child(4) { top: 50%; left: -8px; }

.reactor-wrap.overdrive .core-surface {
  background:
    radial-gradient(circle at 35% 30%, #fff 0 4%, transparent 13%),
    radial-gradient(circle at 50% 50%, #e7fbff 0, #78edf0 35%, #4ca7ff 65%, #4051c9 100%);
  box-shadow:
    inset -15px -20px 32px rgba(35, 33, 126, 0.65),
    0 0 15px #d7ffff,
    0 0 46px rgba(108, 229, 232, 0.92),
    0 0 105px rgba(80, 130, 255, 0.46);
}

.reactor-wrap.overdrive .core-corona {
  filter: hue-rotate(115deg) blur(9px);
  animation-duration: 2.5s;
}

.reactor-wrap.overdrive .reactor-reticle,
.reactor-wrap.overdrive .halo-mid {
  border-color: rgba(108, 229, 232, 0.55);
  animation-duration: 5s;
}

.reactor-wrap.stage-hot .core-button { --core-scale: 1.04; }
.reactor-wrap.stage-critical .halo-outer { border-color: rgba(169, 141, 255, 0.25); }

.particle-layer {
  position: absolute;
  z-index: 20;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.click-particle {
  position: absolute;
  width: var(--particle-size);
  height: var(--particle-size);
  left: var(--particle-x);
  top: var(--particle-y);
  border-radius: 50%;
  background: var(--particle-color);
  box-shadow: 0 0 7px var(--particle-color);
  animation: particle-fly 700ms cubic-bezier(0.15, 0.7, 0.35, 1) forwards;
}

.float-number {
  position: absolute;
  z-index: 21;
  left: var(--float-x);
  top: var(--float-y);
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(217, 255, 114, 0.6);
  white-space: nowrap;
  animation: float-away 850ms ease-out forwards;
}

.float-number.critical {
  color: var(--cyan);
  font-size: 0.85rem;
  text-shadow: 0 0 12px var(--cyan);
}

.anomaly {
  position: absolute;
  z-index: 30;
  top: 12%;
  right: 7%;
  display: flex;
  padding: 8px 10px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--cyan);
  background: rgba(6, 20, 24, 0.9);
  color: var(--cyan);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  box-shadow: 0 0 25px rgba(108, 229, 232, 0.18);
  animation: anomaly-float 2s ease-in-out infinite alternate;
}

.anomaly span {
  font-size: 1rem;
  animation: spin 2s linear infinite;
}

.main-counter {
  position: relative;
  z-index: 2;
  display: flex;
  margin-top: -4px;
  align-items: center;
  flex-direction: column;
}

.main-counter strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--acid);
  font-family: var(--mono);
  font-size: clamp(2.1rem, 4vw, 3.25rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.065em;
  line-height: 1;
  text-overflow: ellipsis;
  text-shadow: 0 0 26px rgba(217, 255, 114, 0.12);
}

.main-counter span {
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.resonance-row {
  display: flex;
  width: min(100%, 450px);
  margin: 13px 0 12px;
  align-items: center;
  justify-content: center;
}

.resonance-stat {
  display: flex;
  min-width: 128px;
  align-items: center;
  flex-direction: column;
}

.resonance-stat span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.48rem;
  letter-spacing: 0.12em;
}

.resonance-stat strong {
  margin-top: 3px;
  color: #d3dad5;
  font-family: var(--mono);
  font-size: 0.63rem;
  font-variant-numeric: tabular-nums;
}

.mini-divider {
  width: 1px;
  height: 22px;
  margin: 0 20px;
  background: var(--line);
}

.overdrive-module {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  width: min(100%, 580px);
  min-height: 62px;
  padding: 10px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.022);
}

.overdrive-module.active {
  border-color: rgba(108, 229, 232, 0.5);
  background: rgba(108, 229, 232, 0.06);
  box-shadow: 0 0 26px rgba(108, 229, 232, 0.07);
}

.overdrive-copy {
  display: flex;
  align-items: center;
  gap: 9px;
}

.overdrive-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(255, 177, 90, 0.35);
  color: var(--ember-hot);
  font-size: 1rem;
}

.overdrive-copy span,
.overdrive-copy strong {
  display: block;
  font-family: var(--mono);
}

.overdrive-copy span {
  color: #b5bdb8;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.overdrive-copy strong {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.43rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.overdrive-track {
  position: relative;
  height: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #080b0e;
}

.overdrive-track > span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--ember), var(--ember-hot));
  box-shadow: 0 0 10px rgba(255, 108, 66, 0.6);
  transition: width 100ms linear;
}

.active .overdrive-track > span {
  background: linear-gradient(90deg, #478db4, var(--cyan));
}

.track-segments {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-evenly;
}

.track-segments i {
  width: 1px;
  height: 100%;
  background: rgba(7, 10, 14, 0.68);
}

.overdrive-button {
  min-width: 84px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--ember);
  background: rgba(255, 108, 66, 0.09);
  color: var(--ember-hot);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.53rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.overdrive-button:disabled {
  border-color: var(--line);
  color: #4d5653;
  cursor: not-allowed;
}

.overdrive-button:not(:disabled):hover {
  background: var(--ember);
  color: #160804;
  box-shadow: 0 0 16px rgba(255, 108, 66, 0.28);
}

.ticker {
  display: flex;
  width: min(100%, 580px);
  min-height: 28px;
  margin-top: 10px;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ticker span {
  align-self: stretch;
  display: flex;
  padding: 0 8px;
  align-items: center;
  flex: none;
  background: var(--acid);
  color: #11150b;
  font-family: var(--mono);
  font-size: 0.48rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.ticker p {
  margin: 0;
  overflow: hidden;
  color: #707b77;
  font-family: var(--mono);
  font-size: 0.49rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fabricator-panel {
  display: flex;
  max-height: calc(100vh - 124px);
  flex-direction: column;
}

.fabrication-heading {
  flex: none;
}

.fabricator-index {
  margin-right: 22px;
  color: #222a27;
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 900;
}

.tab-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: none;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  position: relative;
  height: 44px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.tab-button:last-child {
  border-right: 0;
}

.tab-button.active {
  background: rgba(217, 255, 114, 0.035);
  color: var(--acid);
}

.tab-button.active::after {
  position: absolute;
  right: 18%;
  bottom: -1px;
  left: 18%;
  height: 2px;
  background: var(--acid);
  box-shadow: 0 0 7px var(--acid);
  content: "";
}

.tab-button span {
  display: inline-grid;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  place-items: center;
  border-radius: 50%;
  background: var(--ember);
  color: #170904;
  font-size: 0.46rem;
}

.buy-controls {
  display: flex;
  min-height: 44px;
  padding: 6px 14px;
  flex: none;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.013);
}

.buy-controls > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.buy-controls > div {
  display: flex;
  gap: 4px;
}

.buy-mode {
  min-width: 40px;
  height: 25px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 800;
}

.buy-mode:hover,
.buy-mode.active {
  border-color: rgba(217, 255, 114, 0.3);
  background: rgba(217, 255, 114, 0.06);
  color: var(--acid);
}

.shop-panel {
  min-height: 0;
  overflow-y: auto;
  scrollbar-color: rgba(217, 255, 114, 0.25) transparent;
  scrollbar-width: thin;
}

.shop-panel.active {
  flex: 1;
}

.generator-list,
.research-list {
  padding: 10px;
}

.generator-card {
  --generator-color: var(--acid);
  position: relative;
  display: grid;
  grid-template-columns: 47px minmax(0, 1fr) auto;
  min-height: 86px;
  margin-bottom: 7px;
  padding: 11px 10px;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.016);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.generator-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--generator-color);
  opacity: 0.6;
  content: "";
}

.generator-card:hover:not(.locked) {
  border-color: color-mix(in srgb, var(--generator-color) 33%, transparent);
  background: rgba(255, 255, 255, 0.035);
  transform: translateX(-2px);
}

.generator-card.affordable {
  border-color: color-mix(in srgb, var(--generator-color) 25%, transparent);
}

.generator-card.locked {
  min-height: 63px;
  filter: saturate(0);
  opacity: 0.42;
  cursor: not-allowed;
}

.generator-glyph {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--generator-color) 40%, transparent);
  background: color-mix(in srgb, var(--generator-color) 6%, transparent);
  color: var(--generator-color);
  font-family: var(--mono);
  font-size: 1.05rem;
}

.generator-glyph::after {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--generator-color);
  box-shadow: 0 0 6px var(--generator-color);
  content: "";
}

.generator-info {
  min-width: 0;
}

.generator-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.generator-name-row strong {
  overflow: hidden;
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owned-pill {
  display: inline-grid;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--generator-color);
  font-family: var(--mono);
  font-size: 0.48rem;
}

.generator-info p {
  margin: 4px 0 7px;
  overflow: hidden;
  color: #66716d;
  font-size: 0.52rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generator-output {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.48rem;
}

.generator-output b {
  color: #abb5af;
  font-weight: 700;
}

.generator-purchase {
  min-width: 73px;
  text-align: right;
}

.generator-purchase small,
.generator-purchase strong {
  display: block;
  font-family: var(--mono);
}

.generator-purchase small {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.43rem;
  letter-spacing: 0.08em;
}

.generator-purchase strong {
  color: var(--generator-color);
  font-size: 0.6rem;
  font-variant-numeric: tabular-nums;
}

.generator-card:not(.affordable) .generator-purchase strong {
  color: #59615e;
}

.generator-card.locked .generator-purchase strong {
  font-size: 0.46rem;
}

.research-intro {
  padding: 13px 14px 3px;
}

.research-intro span {
  color: var(--acid-soft);
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.research-intro p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.56rem;
}

.research-card {
  position: relative;
  min-height: 92px;
  margin-bottom: 7px;
  padding: 12px 12px 11px 48px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.017);
  cursor: pointer;
  transition: 150ms ease;
}

.research-card:hover:not(.locked):not(.purchased),
.research-card.affordable {
  border-color: rgba(108, 229, 232, 0.27);
  background: rgba(108, 229, 232, 0.032);
}

.research-card.locked {
  filter: saturate(0);
  opacity: 0.38;
  cursor: not-allowed;
}

.research-card.purchased {
  border-color: rgba(217, 255, 114, 0.2);
  background: rgba(217, 255, 114, 0.028);
  cursor: default;
}

.research-number {
  position: absolute;
  top: 12px;
  left: 11px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(108, 229, 232, 0.3);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.5rem;
}

.research-card.purchased .research-number {
  border-color: rgba(217, 255, 114, 0.4);
  color: var(--acid);
}

.research-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 0.73rem;
  letter-spacing: 0.03em;
}

.research-card p {
  margin: 4px 0 8px;
  color: #68736f;
  font-size: 0.52rem;
  line-height: 1.35;
}

.research-cost {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.49rem;
  font-weight: 800;
}

.research-cost span:last-child {
  color: var(--muted);
  font-size: 0.43rem;
}

.research-card.purchased .research-cost {
  color: var(--acid);
}

.fabricator-footer {
  display: grid;
  grid-template-columns: auto auto 1px auto auto;
  min-height: 47px;
  padding: 0 14px;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.15);
  font-family: var(--mono);
  font-size: 0.46rem;
}

.fabricator-footer span {
  color: var(--muted);
}

.fabricator-footer strong {
  color: var(--acid);
  font-size: 0.55rem;
}

.footer-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
}

.status-footer {
  display: flex;
  min-height: 36px;
  padding: 0 28px;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: rgba(7, 10, 14, 0.9);
  color: #4d5753;
  font-family: var(--mono);
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.status-footer strong {
  color: var(--muted);
}

.footer-line {
  width: 24px;
  height: 1px;
  background: var(--line);
}

.footer-coordinate {
  margin-left: auto;
}

.toast-stack {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 52px;
  display: flex;
  width: min(340px, calc(100vw - 40px));
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  min-height: 67px;
  padding: 12px;
  align-items: center;
  gap: 11px;
  overflow: hidden;
  border: 1px solid rgba(217, 255, 114, 0.32);
  background: rgba(12, 17, 22, 0.96);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(15px);
  animation: toast-in 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--acid);
  animation: toast-timer 4s linear forwards;
  content: "";
}

.toast.exit {
  animation: toast-out 230ms ease forwards;
}

.toast-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(217, 255, 114, 0.4);
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.toast-copy strong,
.toast-copy span {
  display: block;
}

.toast-copy strong {
  margin-bottom: 3px;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.toast-copy span {
  color: var(--muted);
  font-size: 0.55rem;
  line-height: 1.35;
}

.modal-backdrop {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(3, 5, 7, 0.83);
  backdrop-filter: blur(10px);
}

.modal {
  position: relative;
  width: min(430px, 100%);
  padding: 32px;
  overflow: hidden;
  border: 1px solid rgba(169, 141, 255, 0.4);
  background:
    radial-gradient(circle at 100% 0%, rgba(169, 141, 255, 0.16), transparent 45%),
    #0b0f14;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
  animation: modal-in 220ms ease-out;
}

.modal::before {
  position: absolute;
  top: 0;
  right: 25%;
  left: 0;
  height: 2px;
  background: var(--void);
  content: "";
}

.modal-symbol {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 22px;
  place-items: center;
  border: 1px solid rgba(169, 141, 255, 0.45);
  border-radius: 50%;
  color: var(--void);
  font-family: var(--mono);
  font-size: 1.3rem;
  box-shadow: inset 0 0 20px rgba(169, 141, 255, 0.09);
}

.modal h2 {
  margin: 7px 0 10px;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
}

.modal > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.modal-reward {
  margin: 19px 0;
  padding: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--void);
  font-family: var(--mono);
  font-size: 0.65rem;
  text-align: center;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 8px;
}

.confirm-button {
  min-height: 42px;
  border: 1px solid var(--void);
  background: rgba(169, 141, 255, 0.14);
  color: #ded5ff;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.confirm-button:hover {
  background: var(--void);
  color: #100b1c;
}

body.collapse-flash::after {
  position: fixed;
  z-index: 300;
  inset: 0;
  background: #fff;
  pointer-events: none;
  content: "";
  animation: collapse-flash 1.1s ease-out forwards;
}

body.screen-shake {
  animation: screen-shake 180ms linear;
}

@keyframes twinkle { to { opacity: 0.2; transform: scale(0.65); } }
@keyframes sigil-pulse { 50% { box-shadow: 0 0 15px rgba(217, 255, 114, 0.13); } }
@keyframes live-pulse { 50% { opacity: 0.3; } }
@keyframes saving { to { opacity: 0.2; } }
@keyframes signal { to { transform: scaleY(0.25); opacity: 0.35; } }
@keyframes breathe { 50% { opacity: 0.65; transform: translate(-50%, -50%) scale(1.03); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-reverse { to { transform: rotate(-360deg); } }
@keyframes core-pulse { to { opacity: 0.5; transform: scale(1.14); } }
@keyframes orbit-wobble { to { transform: translate(-50%, -50%) rotate(-11deg) scale(1.04); } }
@keyframes particle-fly {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(calc(-50% + var(--particle-dx)), calc(-50% + var(--particle-dy))) scale(0.1); }
}
@keyframes float-away {
  from { opacity: 0; transform: translate(-50%, 0) scale(0.75); }
  15% { opacity: 1; }
  to { opacity: 0; transform: translate(-50%, -55px) scale(1.06); }
}
@keyframes anomaly-float { to { transform: translateY(-8px); box-shadow: 0 0 35px rgba(108, 229, 232, 0.3); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(35px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(35px); } }
@keyframes toast-timer { to { transform: translateX(100%); } }
@keyframes modal-in { from { opacity: 0; transform: scale(0.96) translateY(8px); } }
@keyframes collapse-flash { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes screen-shake {
  0%, 100% { transform: translate(0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, -1px); }
}

@media (max-width: 1220px) {
  .command-bar {
    grid-template-columns: minmax(260px, 1fr) 1.2fr auto;
  }

  .top-readout {
    min-width: 105px;
    padding: 0 13px;
  }

  .save-state {
    display: none;
  }

  .game-shell {
    grid-template-columns: minmax(235px, 0.78fr) minmax(390px, 1.3fr) minmax(300px, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .reactor-stage {
    padding-right: 20px;
    padding-left: 20px;
  }

  .panel-heading,
  .mission-section {
    padding-right: 14px;
    padding-left: 14px;
  }

  .transmission-card {
    padding-right: 14px;
    padding-left: 14px;
  }

  .collapse-card {
    margin-right: 14px;
    margin-left: 14px;
  }
}

@media (max-width: 960px) {
  .command-bar {
    grid-template-columns: 1fr auto;
    padding: 0 18px;
    backdrop-filter: none;
  }

  .top-readouts {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    height: 54px;
    border-top: 1px solid var(--line);
    border-right: 0;
    border-left: 0;
    background: rgba(7, 10, 14, 0.96);
    backdrop-filter: blur(16px);
  }

  .top-readout {
    width: 33.333%;
    height: 100%;
    min-width: 0;
    padding: 0 14px;
  }

  .top-readout span { font-size: 0.48rem; }
  .top-readout strong { font-size: 0.8rem; }

  .game-shell {
    grid-template-columns: 1fr 1fr;
    min-height: 0;
    padding: 12px 12px 70px;
  }

  .reactor-stage {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 700px;
  }

  .mission-panel,
  .fabricator-panel {
    max-height: none;
  }

  .shop-panel.active {
    max-height: 650px;
  }

  .status-footer {
    display: none;
  }
}

@media (max-width: 640px) {
  .command-bar {
    min-height: 70px;
    padding: 0 12px;
  }

  .brand-sigil {
    width: 34px;
    height: 34px;
  }

  .brand-block h1 { font-size: 0.95rem; }
  .brand-block .eyebrow { font-size: 0.46rem; }
  .header-actions { gap: 5px; }
  .header-actions .danger-button {
    display: block;
    padding: 0 8px;
    font-size: 0.48rem;
  }

  .game-shell {
    display: flex;
    padding: 8px 8px 66px;
    flex-direction: column;
  }

  .reactor-stage {
    min-height: 650px;
    padding: 18px 12px 14px;
    order: 1;
  }

  .fabricator-panel { order: 2; }
  .mission-panel { order: 3; }

  .stage-meta { display: none; }

  .reactor-wrap {
    width: min(88vw, 350px);
    min-width: 0;
    margin-top: 7px;
  }

  .main-counter strong {
    font-size: 2.45rem;
  }

  .overdrive-module {
    grid-template-columns: 1fr auto;
  }

  .overdrive-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .overdrive-copy strong { max-width: 180px; }

  .generator-list,
  .research-list { padding: 8px; }
  .generator-card { min-height: 82px; }

  .footer-coordinate { display: none; }
}

@media (max-width: 360px) {
  .brand-block { gap: 8px; }
  .brand-block .eyebrow { display: none; }
  .brand-block h1 { font-size: 0.82rem; }
  .brand-sigil { width: 31px; height: 31px; }
}

@media (max-height: 760px) and (min-width: 961px) {
  .command-bar { min-height: 76px; }
  .game-shell { min-height: calc(100vh - 112px); }
  .fabricator-panel { max-height: calc(100vh - 112px); }
  .mission-panel { max-height: calc(100vh - 112px); }
  .reactor-stage { padding-top: 14px; }
  .reactor-wrap { width: min(36vh, 315px); }
  .transmission-card { min-height: 98px; padding-top: 13px; }
  .mission-section { padding-top: 12px; padding-bottom: 10px; }
  .milestone { min-height: 36px; padding-top: 5px; padding-bottom: 5px; }
  .collapse-card { margin-top: 10px; padding: 12px; }
}

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