@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #07080d;
  --panel: rgba(16, 18, 26, 0.78);
  --panel-solid: #10121a;
  --line: rgba(255, 255, 255, 0.105);
  --line-bright: rgba(255, 255, 255, 0.2);
  --text: #f5f4ef;
  --muted: #8e909b;
  --faint: #5e606c;
  --acid: #c7ff4a;
  --acid-soft: rgba(199, 255, 74, 0.15);
  --violet: #9f86ff;
  --cyan: #67e8f9;
  --danger: #ff6b76;
  --mono: "DM Mono", monospace;
  --sans: "Manrope", sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 42%, rgba(88, 73, 160, 0.12), transparent 34%),
    var(--bg);
  font-family: var(--sans);
  overflow-x: hidden;
}

button, input { font: inherit; }
button { color: inherit; }

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.7;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }
.is-hidden { opacity: 0; pointer-events: none; }

.eyebrow {
  margin: 0;
  color: var(--acid);
  font: 500 0.68rem/1.2 var(--mono);
  letter-spacing: 0.18em;
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 54%, rgba(151, 121, 255, .16), transparent 24%);
  transition: opacity .9s ease, visibility .9s;
}

.intro::before,
.intro::after {
  content: "";
  position: absolute;
  width: min(54vw, 700px);
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 50%;
  animation: intro-orbit 20s linear infinite;
}

.intro::after { width: min(38vw, 490px); animation-direction: reverse; animation-duration: 14s; }
.intro.is-exiting { opacity: 0; visibility: hidden; }

.intro__flare {
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 40px 20px rgba(199,255,74,.13), 0 0 160px 70px rgba(159,134,255,.1);
  animation: breathe 3.5s ease-in-out infinite;
}

.intro h1 {
  z-index: 1;
  margin: 22px 0 20px;
  font-size: clamp(3rem, 7vw, 6.7rem);
  line-height: .92;
  letter-spacing: -.065em;
  font-weight: 600;
}

.intro__copy {
  z-index: 1;
  color: #aaaab3;
  font-size: clamp(.9rem, 1.4vw, 1.08rem);
  line-height: 1.75;
  margin: 0 0 38px;
}

.primary-button, .secondary-button, .danger-button {
  border: 0;
  cursor: pointer;
  font: 600 .7rem var(--mono);
  letter-spacing: .12em;
  transition: transform .2s ease, filter .2s ease, border-color .2s ease;
}

.primary-button {
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
  min-width: 245px;
  padding: 17px 19px;
  background: var(--acid);
  color: #10130b;
  box-shadow: 0 12px 40px rgba(199, 255, 74, .12);
}

.primary-button:hover, .secondary-button:hover, .danger-button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.primary-button:active, .secondary-button:active, .danger-button:active { transform: translateY(0); }

.text-button {
  z-index: 1;
  margin-top: 20px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font: .62rem var(--mono);
  letter-spacing: .12em;
}
.text-button:hover { color: var(--text); }

.game-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: opacity .8s ease .2s;
}

.topbar {
  height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(7,8,13,.68);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: .16em;
}

.brand small { color: var(--faint); font: .54rem var(--mono); letter-spacing: .11em; margin-left: 5px; }
.brand__mark { width: 24px; height: 24px; border: 1px solid var(--acid); border-radius: 50%; display: grid; place-items: center; }
.brand__mark i { width: 6px; height: 6px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 10px var(--acid); }

.resource-readout { display: flex; align-items: center; gap: 12px; }
.resource-readout__icon { color: var(--acid); font-size: 1.3rem; filter: drop-shadow(0 0 8px rgba(199,255,74,.65)); }
.resource-readout > div:not(.rate-pill) { display: flex; flex-direction: column; min-width: 96px; }
.resource-readout #dustValue { font: 500 1.25rem var(--mono); letter-spacing: -.04em; }
.resource-readout small { color: var(--faint); font: .55rem var(--mono); letter-spacing: .16em; }
.rate-pill { padding: 7px 9px; border: 1px solid rgba(199,255,74,.2); background: rgba(199,255,74,.06); color: var(--muted); font: .56rem var(--mono); }
.rate-pill span { color: var(--acid); }

.topbar__actions { justify-self: end; display: flex; gap: 8px; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); background: rgba(255,255,255,.025); cursor: pointer; color: var(--muted); }
.icon-button:hover { border-color: var(--line-bright); color: var(--text); }
.sound-on, .sound-off { font: .7rem var(--mono); }

.game-grid {
  flex: 1;
  min-height: 700px;
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(410px, 1fr) minmax(310px, 375px);
}

.panel {
  position: relative;
  z-index: 4;
  background: var(--panel);
  backdrop-filter: blur(18px);
  padding: 24px;
}
.mission-panel { border-right: 1px solid var(--line); }
.upgrades-panel { border-left: 1px solid var(--line); overflow-y: auto; max-height: calc(100vh - 112px); }

.panel__heading, .section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font: 500 .59rem var(--mono);
  letter-spacing: .14em;
}

.status-dot { color: var(--acid); }
.status-dot::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 8px var(--acid); vertical-align: 1px; animation: blink 1.5s infinite; }

.mission-card { position: relative; margin-top: 23px; padding: 23px 0 25px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mission-card__number { position: absolute; top: 18px; right: 0; color: rgba(255,255,255,.05); font: 300 3.9rem var(--mono); }
.mission-card h2 { margin: 9px 0 10px; font-size: 1.5rem; letter-spacing: -.04em; }
.mission-card > p:not(.eyebrow) { max-width: 240px; margin: 0 0 22px; color: var(--muted); font-size: .76rem; line-height: 1.65; }
.progress-track { height: 3px; background: rgba(255,255,255,.07); overflow: hidden; }
.progress-track i { display: block; width: 0; height: 100%; background: var(--acid); box-shadow: 0 0 8px var(--acid); transition: width .4s ease; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 8px; color: var(--faint); font: .52rem var(--mono); }

.stat-list { padding: 16px 0; border-bottom: 1px solid var(--line); }
.stat-list div { display: flex; justify-content: space-between; padding: 7px 0; }
.stat-list span { color: var(--faint); font: .54rem var(--mono); letter-spacing: .08em; }
.stat-list strong { font: 500 .64rem var(--mono); }

.milestones { padding-top: 19px; }
.milestone-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-top: 12px; }
.milestone {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--faint);
  font: .66rem var(--mono);
  cursor: help;
  position: relative;
}
.milestone.earned { color: #0d1107; border-color: var(--acid); background: var(--acid); box-shadow: 0 0 18px rgba(199,255,74,.1); }
.milestone::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; width: max-content; max-width: 180px; transform: translate(-50%, 4px); padding: 7px 9px; background: #22242e; color: var(--text); font: .54rem/1.4 var(--mono); opacity: 0; pointer-events: none; transition: .2s; z-index: 20; }
.milestone:hover::after { opacity: 1; transform: translate(-50%, 0); }
.field-note { margin: 20px 0 0; padding: 0 0 0 13px; border-left: 1px solid var(--violet); color: #737581; font: italic .68rem/1.65 var(--sans); }

.reactor-stage {
  position: relative;
  min-height: 640px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 72px 72px;
}

.reactor-stage::before {
  content: "";
  position: absolute;
  width: min(68vw, 780px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(151,122,255,.14), rgba(67,50,130,.035) 35%, transparent 67%);
  animation: breathe 4s ease-in-out infinite;
}

.stage-label { position: absolute; top: 24px; left: 28px; right: 28px; display: flex; justify-content: space-between; color: var(--faint); font: .54rem var(--mono); letter-spacing: .12em; }
.stage-label span:last-child { color: var(--acid); }

.orbit { position: absolute; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; pointer-events: none; animation: spin 24s linear infinite; }
.orbit--outer { width: min(40vw, 530px); aspect-ratio: 1; border-style: dashed; }
.orbit--inner { width: min(30vw, 390px); aspect-ratio: 1; animation-direction: reverse; animation-duration: 15s; }
.orbit i { position: absolute; top: 50%; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 12px var(--acid); }
.orbit i:nth-child(2) { top: 12%; left: 75%; background: var(--violet); box-shadow: 0 0 12px var(--violet); }
.orbit i:nth-child(3) { top: 82%; left: 73%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }

.pulse-ring { position: absolute; width: min(22vw, 275px); aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(199,255,74,.2); opacity: 0; pointer-events: none; }
.pulse-ring.fire { animation: ring-out .55s ease-out; }

.core {
  position: relative;
  width: min(20vw, 240px);
  min-width: 180px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 30px 45px rgba(0,0,0,.5));
}
.core__halo { position: absolute; inset: -18%; border-radius: 50%; background: radial-gradient(circle, rgba(199,255,74,.1), transparent 65%); animation: breathe 2.8s ease-in-out infinite; }
.core__surface { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 35% 28%, #e9ffae 0, #b7e83e 10%, #829e30 35%, #303718 67%, #0f120c 100%); box-shadow: inset -25px -30px 40px rgba(0,0,0,.62), inset 15px 10px 35px rgba(255,255,255,.15), 0 0 0 1px rgba(199,255,74,.35), 0 0 50px rgba(199,255,74,.14); transition: transform .12s ease; }
.core__surface::before, .core__surface::after { content:""; position:absolute; inset: -35%; border-radius: 42%; background: repeating-radial-gradient(ellipse at 40% 50%, transparent 0 13px, rgba(8,10,6,.22) 14px 17px); animation: spin 17s linear infinite; mix-blend-mode: soft-light; }
.core__surface::after { inset: -10%; background: radial-gradient(ellipse at 70% 25%, rgba(255,255,255,.25), transparent 20%), radial-gradient(ellipse at 28% 71%, rgba(0,0,0,.4), transparent 25%); animation-direction: reverse; animation-duration: 12s; }
.core__shine { position: absolute; inset: 3%; border-radius: 50%; box-shadow: inset 7px 7px 12px rgba(255,255,255,.17); }
.core__content { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-shadow: 0 2px 12px rgba(0,0,0,.7); }
.core__content small { font: 500 .56rem var(--mono); letter-spacing: .2em; }
.core__content strong { margin: 4px; font-size: 2.15rem; line-height: 1; }
.core__content em { padding: 4px 8px; border-radius: 20px; background: rgba(0,0,0,.3); font: normal 500 .65rem var(--mono); }
.core:hover .core__surface { transform: scale(1.035); filter: brightness(1.1); }
.core:active .core__surface, .core.is-tapped .core__surface { transform: scale(.94); filter: brightness(1.3); }
.core:focus-visible { outline: 2px solid white; outline-offset: 12px; }

.float-number { position: absolute; z-index: 6; color: var(--acid); font: 600 .75rem var(--mono); pointer-events: none; text-shadow: 0 0 10px rgba(199,255,74,.7); animation: float-away .9s ease-out forwards; }
.spark { position: absolute; z-index: 5; width: 3px; height: 3px; border-radius: 50%; background: var(--acid); pointer-events: none; animation: spark-away .6s ease-out forwards; }

.core-instruction { position: absolute; top: calc(50% + min(15vw, 175px)); display: flex; align-items: center; gap: 10px; color: var(--muted); }
.core-instruction div { display: flex; flex-direction: column; }
.core-instruction strong { font: 500 .59rem var(--mono); letter-spacing: .11em; }
.core-instruction small { margin-top: 3px; color: var(--faint); font: .54rem var(--mono); }
.mouse-icon { width: 19px; height: 27px; border: 1px solid var(--muted); border-radius: 10px; position: relative; }
.mouse-icon i { position: absolute; width: 2px; height: 6px; top: 4px; left: 8px; background: var(--acid); animation: mouse-scroll 1.5s infinite; }

.event-ticker { position: absolute; bottom: 25px; left: 28px; right: 28px; display: flex; align-items: center; gap: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.event-ticker__label { flex: 0 0 auto; padding: 5px 7px; color: #0e100a; background: var(--acid); font: 600 .5rem var(--mono); }
.event-ticker p { margin: 0; color: var(--muted); font: .58rem/1.5 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.buy-modes { display: flex; gap: 3px; }
.buy-modes button { border: 1px solid var(--line); padding: 3px 7px; background: none; color: var(--faint); cursor: pointer; font: .5rem var(--mono); }
.buy-modes button.active { color: #0d1107; background: var(--acid); border-color: var(--acid); }

.generator-list { margin: 16px 0 26px; display: grid; gap: 8px; }
.generator {
  position: relative;
  width: 100%;
  min-height: 77px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.018);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.generator::after { content:""; position:absolute; inset: auto 0 0; height: 2px; transform-origin: left; transform: scaleX(var(--afford, 0)); background: rgba(199,255,74,.35); }
.generator:hover:not(:disabled) { border-color: rgba(199,255,74,.4); background: rgba(199,255,74,.04); transform: translateX(-2px); }
.generator:disabled { cursor: not-allowed; opacity: .5; }
.generator.is-locked { opacity: .28; filter: grayscale(1); }
.generator__icon { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--acid); font-size: 1rem; }
.generator__main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.generator__main strong { font-size: .73rem; }
.generator__main small { color: var(--faint); font: .52rem var(--mono); }
.generator__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.generator__level { color: var(--muted); font: .55rem var(--mono); }
.generator__cost { color: var(--acid); font: .58rem var(--mono); }

.upgrade-heading { padding-top: 20px; border-top: 1px solid var(--line); }
.upgrade-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 15px; }
.upgrade {
  min-height: 90px;
  padding: 11px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.018);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.upgrade:hover:not(:disabled) { border-color: rgba(159,134,255,.5); background: rgba(159,134,255,.05); }
.upgrade:disabled { opacity: .35; cursor: not-allowed; }
.upgrade.is-bought { opacity: .45; border-color: rgba(199,255,74,.25); }
.upgrade strong { font-size: .64rem; }
.upgrade small { color: var(--faint); font: .48rem/1.35 var(--mono); }
.upgrade span { color: var(--violet); font: .55rem var(--mono); }

.prestige-card { width: 100%; margin-top: 18px; padding: 13px; border: 1px solid rgba(159,134,255,.3); background: linear-gradient(100deg, rgba(159,134,255,.12), rgba(159,134,255,.025)); display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left; cursor: pointer; }
.prestige-card.locked { opacity: .42; cursor: not-allowed; filter: grayscale(.4); }
.prestige-card__icon { font-size: 1.3rem; color: var(--violet); }
.prestige-card span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; }
.prestige-card small { color: var(--violet); font: .51rem var(--mono); letter-spacing: .06em; }
.prestige-card strong { color: var(--muted); font: 500 .5rem var(--mono); }
.prestige-card i { font-style: normal; }

.footer { height: 36px; flex: 0 0 36px; padding: 0 28px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); color: var(--faint); font: .5rem var(--mono); letter-spacing: .1em; }
.footer strong { color: var(--muted); font-weight: 400; }

.drawer { position: fixed; inset: 0; z-index: 40; display: none; visibility: hidden; overflow: hidden; pointer-events: none; }
.drawer.is-open { display: block; visibility: visible; pointer-events: auto; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.58); opacity: 0; transition: opacity .3s; }
.drawer__panel { position: absolute; top: 0; right: 0; height: 100%; width: min(92vw, 390px); padding: 30px; background: #11131b; border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__backdrop { animation: backdrop-in .3s ease both; }
.drawer.is-open .drawer__panel { transform: translateX(0); animation: drawer-in .35s cubic-bezier(.2,.8,.2,1) both; }
.drawer__header { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.drawer__header h2 { margin: 7px 0 0; font-size: 1.6rem; }
.control-row { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; border-bottom: 1px solid var(--line); }
.control-row div { display: flex; flex-direction: column; gap: 5px; }
.control-row strong { font-size: .76rem; }
.control-row small { color: var(--faint); font: .52rem var(--mono); }
.toggle { width: 38px; height: 21px; padding: 2px; border: 1px solid var(--line); border-radius: 20px; background: #252832; cursor: pointer; }
.toggle i { display: block; width: 15px; height: 15px; border-radius: 50%; background: var(--muted); transition: .2s; }
.toggle.is-on { background: var(--acid-soft); border-color: rgba(199,255,74,.4); }
.toggle.is-on i { transform: translateX(17px); background: var(--acid); }
.drawer__actions { margin-top: 30px; display: grid; gap: 9px; }
.secondary-button, .danger-button { padding: 13px 15px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.danger-button { color: var(--danger); border-color: rgba(255,107,118,.2); }
.drawer__version { position: absolute; bottom: 20px; color: var(--faint); font: .48rem var(--mono); }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; visibility: hidden; }
.modal.is-open { visibility: visible; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(3,3,7,.84); backdrop-filter: blur(8px); opacity: 0; transition: opacity .25s; }
.modal.is-open .modal__backdrop { opacity: 1; }
.modal__card { position: relative; width: min(90vw, 470px); padding: 38px; border: 1px solid var(--line-bright); background: radial-gradient(circle at 50% 0, rgba(159,134,255,.14), transparent 42%), #10121a; text-align: center; transform: scale(.94); opacity: 0; transition: .25s; }
.modal.is-open .modal__card { opacity: 1; transform: scale(1); }
.modal__icon { margin-bottom: 18px; color: var(--violet); font-size: 2.5rem; text-shadow: 0 0 30px var(--violet); }
.modal__card h2 { margin: 9px 0 13px; font-size: 1.8rem; }
.modal__card > p:not(.eyebrow) { color: var(--muted); font-size: .78rem; line-height: 1.7; }
.modal__actions { margin-top: 27px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.modal__actions .primary-button { min-width: 0; justify-content: center; padding: 13px; }

.toast-stack { position: fixed; z-index: 60; right: 20px; bottom: 51px; display: grid; gap: 8px; pointer-events: none; }
.toast { width: min(360px, calc(100vw - 40px)); display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px; background: #181a23; border: 1px solid var(--line-bright); box-shadow: 0 10px 40px rgba(0,0,0,.4); animation: toast-in .35s ease both; }
.toast.is-leaving { animation: toast-out .3s ease both; }
.toast__icon { width: 30px; height: 30px; display: grid; place-items: center; background: var(--acid); color: #0b0e07; }
.toast strong { display: block; font-size: .68rem; }
.toast p { margin: 3px 0 0; color: var(--muted); font: .52rem/1.5 var(--mono); }

body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .75; } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes intro-orbit { to { transform: rotate(360deg); } }
@keyframes ring-out { from { transform: scale(.65); opacity: 1; } to { transform: scale(1.65); opacity: 0; } }
@keyframes float-away { from { transform: translate(-50%, 0) scale(.85); opacity: 0; } 20% { opacity: 1; } to { transform: translate(-50%, -80px) scale(1.1); opacity: 0; } }
@keyframes spark-away { to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }
@keyframes mouse-scroll { 50% { transform: translateY(5px); opacity: .2; } }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }

@media (max-width: 1080px) {
  .game-grid { grid-template-columns: 235px minmax(370px, 1fr) 310px; }
  .panel { padding: 18px; }
  .brand small, .footer__hint { display: none; }
  .upgrade-list { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .topbar { grid-template-columns: auto 1fr auto; padding: 0 15px; }
  .brand > span:not(.brand__mark), .brand small { display: none; }
  .resource-readout { justify-self: center; }
  .game-grid { display: flex; flex-direction: column; }
  .reactor-stage { order: 1; min-height: 570px; }
  .mission-panel { order: 2; border: 0; border-top: 1px solid var(--line); }
  .upgrades-panel { order: 3; border-left: 0; border-top: 1px solid var(--line); max-height: none; }
  .orbit--outer { width: min(85vw, 480px); }
  .orbit--inner { width: min(64vw, 350px); }
  .core { width: min(45vw, 220px); }
  .core-instruction { top: calc(50% + 145px); }
  .upgrade-list { grid-template-columns: 1fr 1fr; }
  .mission-card > p:not(.eyebrow) { max-width: 80%; }
  .milestones { overflow: hidden; }
  .footer { padding: 0 15px; }
}

@media (max-width: 500px) {
  .topbar { height: 68px; }
  .resource-readout__icon { display: none; }
  .resource-readout > div:not(.rate-pill) { min-width: 78px; }
  .resource-readout #dustValue { font-size: 1rem; }
  .rate-pill { padding: 6px; }
  .reactor-stage { min-height: 520px; }
  .stage-label { left: 16px; right: 16px; }
  .event-ticker { left: 16px; right: 16px; }
  .core-instruction { top: calc(50% + 128px); }
  .upgrade-list { grid-template-columns: 1fr; }
  .intro { padding: 25px; }
  .intro h1 { font-size: 3.15rem; }
  .intro::before { width: 125vw; }
  .intro::after { width: 85vw; }
}

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