:root {
  --bg: #050812;
  --bg-2: #0a1022;
  --panel: rgba(15, 23, 45, 0.72);
  --panel-2: rgba(22, 32, 58, 0.8);
  --line: rgba(126, 160, 255, 0.16);
  --text: #eef3ff;
  --muted: #8b9ac2;
  --cyan: #58e6ff;
  --blue: #5b8cff;
  --violet: #a06bff;
  --gold: #ffd166;
  --green: #5ff2b6;
  --danger: #ff6b8a;
  --radius: 20px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1000px 700px at 18% -10%, rgba(88, 230, 255, 0.14), transparent 60%),
    radial-gradient(900px 600px at 92% 0%, rgba(160, 107, 255, 0.16), transparent 55%),
    radial-gradient(800px 700px at 50% 110%, rgba(91, 140, 255, 0.12), transparent 60%),
    var(--bg);
  font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 74% 12%, rgba(255,255,255,.4) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 42% 68%, rgba(255,255,255,.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 72%, rgba(255,255,255,.45) 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 86%, rgba(255,255,255,.3) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 62% 42%, rgba(255,255,255,.25) 50%, transparent 51%);
  opacity: .8;
  z-index: 0;
}
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite symbol path, .svg-sprite symbol circle, .svg-sprite symbol rect, .svg-sprite symbol ellipse { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#i-bolt path, #i-star path, #i-play path, #i-volume path, #i-mute path { fill: currentColor; stroke: none; }

.app {
  position: relative;
  z-index: 1;
  width: min(1420px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 34px) 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(18, 27, 52, .82), rgba(10, 16, 32, .68));
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 14px;
  color: #04121a;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 0 26px rgba(88,230,255,.35);
  flex: 0 0 auto;
}
.brand-mark .icon { width: 23px; height: 23px; }
.brand h1 {
  margin: 0;
  font-size: clamp(17px, 2vw, 22px);
  letter-spacing: .16em;
  line-height: 1;
  font-weight: 800;
}
.brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.top-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.stat-chip {
  min-width: 92px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 12, 26, .55);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-chip span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.stat-chip b { font-size: 14px; font-variant-numeric: tabular-nums; }
.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(7, 12, 26, .55);
  color: var(--text);
  cursor: pointer;
  transition: .2s;
}
.icon-btn:hover { border-color: rgba(88,230,255,.45); color: var(--cyan); }
.icon-btn .icon { width: 19px; height: 19px; }

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(300px, 1.05fr) minmax(320px, .95fr);
  gap: 16px;
  min-height: 0;
}

.reactor-panel, .side-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 26, 50, .78), rgba(8, 13, 28, .72));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.reactor-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px;
  position: relative;
  overflow: hidden;
  min-height: 540px;
}
.reactor-panel::before {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(88,230,255,.11), transparent 62%);
  top: 50%; left: 50%;
  transform: translate(-50%, -58%);
  pointer-events: none;
}
.reactor-wrap {
  position: relative;
  width: clamp(240px, 34vw, 330px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-top: 6px;
}
.orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(88,230,255,.18);
  pointer-events: none;
}
.orbit-1 { inset: 6%; border-style: dashed; animation: spin 28s linear infinite; }
.orbit-2 { inset: 16%; border-color: rgba(160,107,255,.22); animation: spin 18s linear infinite reverse; }
.orbit-3 { inset: 27%; border-color: rgba(255,209,102,.14); animation: spin 40s linear infinite; }
.orbit::after {
  content: "";
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
  top: -3px; left: 50%;
}
.orbit-2::after { background: var(--violet); box-shadow: 0 0 14px var(--violet); }
.orbit-3::after { background: var(--gold); box-shadow: 0 0 12px var(--gold); }

.reactor {
  position: relative;
  width: 68%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  outline: none;
  touch-action: manipulation;
  user-select: none;
}
.reactor:focus-visible { box-shadow: 0 0 0 4px rgba(88,230,255,.35); border-radius: 50%; }
.reactor-core {
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,.95), rgba(88,230,255,.85) 18%, rgba(91,140,255,.72) 45%, rgba(40,22,90,.95) 72%);
  box-shadow:
    0 0 34px rgba(88,230,255,.6),
    0 0 90px rgba(91,140,255,.4),
    inset 0 0 40px rgba(255,255,255,.3);
  animation: corePulse 3.2s ease-in-out infinite;
  transition: transform .08s ease-out;
}
.reactor-ring {
  position: absolute;
  inset: 11%;
  border-radius: 50%;
  border: 2px solid rgba(88,230,255,.6);
  box-shadow: 0 0 30px rgba(88,230,255,.25), inset 0 0 30px rgba(88,230,255,.2);
  animation: ringPulse 3.2s ease-in-out infinite;
}
.reactor-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, rgba(88,230,255,.55), transparent 32%, rgba(160,107,255,.5), transparent 64%, rgba(255,209,102,.35), transparent);
  animation: spin 9s linear infinite;
  filter: blur(1px);
  opacity: .85;
}
.reactor:active .reactor-core { transform: scale(.94); }
.reactor.bump .reactor-core { animation: bump .16s ease-out; }

.particles { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.particle {
  position: absolute;
  color: var(--cyan);
  font-weight: 800;
  font-size: 15px;
  text-shadow: 0 0 12px rgba(88,230,255,.8);
  animation: floatUp 1s ease-out forwards;
  pointer-events: none;
  white-space: nowrap;
}

.energy-block { text-align: center; margin-top: 8px; }
.energy-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  font-size: clamp(38px, 5.2vw, 62px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 30px rgba(88,230,255,.22);
}
.energy-value small { font-size: 16px; color: var(--muted); font-weight: 600; letter-spacing: .08em; }
.energy-sub { margin-top: 9px; color: var(--muted); font-size: 12.5px; display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }
.energy-sub .dot { opacity: .5; }

.boost-row { width: 100%; margin-top: 22px; display: flex; align-items: center; gap: 12px; }
.boost-btn {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,209,102,.35);
  background: linear-gradient(135deg, rgba(255,209,102,.16), rgba(255,107,138,.08));
  color: var(--text);
  cursor: pointer;
  transition: .2s;
}
.boost-btn:hover { border-color: rgba(255,209,102,.7); transform: translateY(-1px); }
.boost-btn:disabled { opacity: .45; cursor: default; transform: none; }
.boost-btn .icon { width: 16px; height: 16px; color: var(--gold); }
.boost-btn span { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.boost-btn b { font-size: 12px; }
.boost-btn small { color: var(--muted); font-size: 10.5px; }
.hint { color: var(--muted); font-size: 11.5px; line-height: 1.45; max-width: 260px; }

.side-panel { display: flex; flex-direction: column; min-height: 540px; overflow: hidden; }
.tabs { display: flex; gap: 4px; padding: 10px 10px 0; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1;
  padding: 10px 8px 11px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: .2s;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.tab-panel { display: none; flex: 1; min-height: 0; overflow: auto; padding: 12px; }
.tab-panel.active { display: block; }
.tab-panel::-webkit-scrollbar { width: 6px; }
.tab-panel::-webkit-scrollbar-thumb { background: rgba(126,160,255,.25); border-radius: 6px; }

.upgrades { display: flex; flex-direction: column; gap: 8px; }
.upgrade {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(23, 34, 62, .82), rgba(12, 19, 36, .8));
  transition: .2s;
}
.upgrade:hover { border-color: rgba(88,230,255,.28); transform: translateY(-1px); }
.upgrade.locked { opacity: .55; }
.upgrade-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(88,230,255,.08);
  border: 1px solid rgba(88,230,255,.16);
  color: var(--cyan);
  font-size: 22px;
}
.upgrade[data-id="wind"] .upgrade-icon { color: var(--green); background: rgba(95,242,182,.08); border-color: rgba(95,242,182,.16); }
.upgrade[data-id="battery"] .upgrade-icon { color: var(--gold); background: rgba(255,209,102,.08); border-color: rgba(255,209,102,.16); }
.upgrade[data-id="drone"] .upgrade-icon { color: #9db4ff; background: rgba(91,140,255,.1); border-color: rgba(91,140,255,.2); }
.upgrade[data-id="reactor"] .upgrade-icon { color: var(--violet); background: rgba(160,107,255,.1); border-color: rgba(160,107,255,.2); }
.upgrade[data-id="station"] .upgrade-icon { color: #ff9ec4; background: rgba(255,107,138,.09); border-color: rgba(255,107,138,.18); }
.upgrade[data-id="dyson"] .upgrade-icon { color: var(--gold); background: rgba(255,209,102,.1); border-color: rgba(255,209,102,.2); }
.upgrade[data-id="click"] .upgrade-icon { color: var(--cyan); background: rgba(88,230,255,.1); }
.upgrade-icon .icon { width: 24px; height: 24px; }
.upgrade-info { min-width: 0; }
.upgrade-name { font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.upgrade-name .lvl { color: var(--muted); font-size: 10.5px; font-weight: 500; }
.upgrade-desc { color: var(--muted); font-size: 10.8px; margin-top: 3px; line-height: 1.35; }
.upgrade-meta { display: flex; gap: 8px; margin-top: 4px; color: rgba(139,154,194,.85); font-size: 10px; }
.upgrade-meta b { color: var(--text); font-weight: 600; }
.buy-btn {
  min-width: 78px;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid rgba(88,230,255,.3);
  background: rgba(88,230,255,.1);
  color: var(--cyan);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  transition: .2s;
}
.buy-btn small { font-size: 9px; color: var(--muted); font-weight: 500; }
.buy-btn:hover:not(:disabled) { background: rgba(88,230,255,.2); border-color: rgba(88,230,255,.6); }
.buy-btn:disabled { opacity: .4; cursor: default; border-color: var(--line); color: var(--muted); background: rgba(255,255,255,.03); }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(12, 19, 36, .6);
}
.stat-card span { display: block; color: var(--muted); font-size: 10.5px; margin-bottom: 5px; }
.stat-card b { font-size: 17px; font-variant-numeric: tabular-nums; }
.stat-card.wide { grid-column: 1 / -1; }

.achievements { display: flex; flex-direction: column; gap: 8px; }
.achievement {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(12, 19, 36, .55);
  opacity: .55;
}
.achievement.done { opacity: 1; border-color: rgba(95,242,182,.25); background: rgba(95,242,182,.06); }
.achievement-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.04); color: var(--muted); flex: 0 0 auto; }
.achievement.done .achievement-icon { color: var(--green); background: rgba(95,242,182,.1); }
.achievement-icon .icon { width: 19px; height: 19px; }
.achievement-name { font-size: 12.5px; font-weight: 600; }
.achievement-desc { color: var(--muted); font-size: 10.5px; margin-top: 2px; }

.footer { display: flex; justify-content: space-between; color: rgba(139,154,194,.7); font-size: 10.5px; padding: 0 4px; }
#save-state { color: var(--green); }

.modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(3, 7, 16, .72);
  backdrop-filter: blur(8px);
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(360px, 100%);
  text-align: center;
  padding: 26px 22px 22px;
  border-radius: 22px;
  border: 1px solid rgba(88,230,255,.22);
  background: linear-gradient(180deg, #101a32, #0a1122);
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  animation: modalIn .25s ease-out;
}
.modal-icon { width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center; color: var(--gold); background: rgba(255,209,102,.1); }
.modal-icon .icon { width: 28px; height: 28px; }
.modal-card h2 { margin: 0 0 6px; font-size: 20px; }
.modal-card p { margin: 0; color: var(--muted); font-size: 12.5px; }
.modal-energy { margin: 16px 0; font-size: 30px; font-weight: 800; color: var(--cyan); text-shadow: 0 0 24px rgba(88,230,255,.35); }
.primary-btn {
  width: 100%;
  padding: 12px;
  border: 0; border-radius: 13px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #04121a;
  font: inherit; font-weight: 800; font-size: 13px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(88,230,255,.25);
}
.primary-btn:hover { filter: brightness(1.08); }

.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translate(-50%, 20px);
  z-index: 60;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(88,230,255,.3);
  background: rgba(10, 18, 38, .95);
  color: var(--text);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  max-width: min(90vw, 420px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes corePulse {
  0%, 100% { box-shadow: 0 0 34px rgba(88,230,255,.55), 0 0 90px rgba(91,140,255,.35), inset 0 0 40px rgba(255,255,255,.3); }
  50% { box-shadow: 0 0 52px rgba(88,230,255,.8), 0 0 120px rgba(91,140,255,.5), inset 0 0 50px rgba(255,255,255,.38); }
}
@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: .75; }
  50% { transform: scale(1.035); opacity: 1; }
}
@keyframes bump { 0% { transform: scale(.94); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.85); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -74px) scale(1.05); }
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  .app { padding: 12px; gap: 12px; }
  .layout { grid-template-columns: 1fr; }
  .reactor-panel { min-height: 0; padding: 16px 14px 18px; }
  .reactor-wrap { width: min(58vw, 270px); }
  .side-panel { min-height: 0; max-height: min(52dvh, 520px); }
  .topbar { padding: 8px 10px; }
  .brand p { display: none; }
  .top-stats .stat-chip { min-width: 76px; padding: 6px 9px; }
  .top-stats .stat-chip b { font-size: 12.5px; }
  .boost-row { flex-direction: column; align-items: stretch; }
  .hint { max-width: none; text-align: center; }
  .boost-btn { justify-content: center; }
}
@media (max-width: 520px) {
  .brand h1 { font-size: 16px; letter-spacing: .12em; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .top-stats { gap: 5px; }
  .stat-chip span { font-size: 9px; }
  .stat-chip b { font-size: 12px; }
  .icon-btn { width: 36px; height: 36px; }
  .energy-value { font-size: 42px; }
  .upgrade { grid-template-columns: 40px 1fr auto; padding: 8px; gap: 8px; }
  .upgrade-icon { width: 40px; height: 40px; }
  .upgrade-name { font-size: 12px; }
  .buy-btn { min-width: 70px; font-size: 10.5px; padding: 7px 6px; }
  .tabs { padding: 8px 6px 0; }
  .tab { font-size: 11px; }
}

.goal { width: 100%; max-width: 360px; margin-top: 14px; }
.goal-head { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10.5px; }
.goal-head b { color: var(--text); font-weight: 650; }
.goal-bar { height: 6px; margin-top: 6px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.06); }
.goal-bar span { display: block; width: 0; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--cyan), var(--violet)); box-shadow: 0 0 14px rgba(88,230,255,.45); transition: width .35s ease; }
.win-btn {
  margin-top: 18px;
  padding: 12px 22px;
  border-radius: 14px;
  border: 1px solid rgba(255,209,102,.5);
  background: linear-gradient(135deg, rgba(255,209,102,.2), rgba(255,107,138,.12));
  color: var(--gold);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 0 28px rgba(255,209,102,.18);
  transition: .2s;
}
.win-btn:hover { transform: translateY(-1px); border-color: var(--gold); box-shadow: 0 0 36px rgba(255,209,102,.3); }
.win-card { border-color: rgba(255,209,102,.28); }
.win-icon { color: var(--gold); background: rgba(255,209,102,.12); }
.win-reward { margin: 16px 0 6px; font-size: 30px; font-weight: 800; color: var(--gold); display: flex; align-items: center; justify-content: center; gap: 6px; text-shadow: 0 0 24px rgba(255,209,102,.35); }
.win-reward .icon { width: 28px; height: 28px; }
.win-note { margin: 0 0 18px !important; font-size: 11.5px !important; color: var(--muted); }
.ghost-btn {
  width: 100%;
  margin-top: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ghost-btn:hover { border-color: rgba(88,230,255,.35); color: var(--cyan); }

#i-cat .eye { fill: currentColor; stroke: none; }
.combo {
  position: absolute;
  top: 11%;
  right: 6%;
  padding: 5px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,209,102,.35);
  background: rgba(255,209,102,.1);
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-shadow: 0 0 12px rgba(255,209,102,.4);
  animation: comboPop .18s ease-out;
}
.companion {
  position: absolute;
  left: 0;
  bottom: 5%;
  width: 78px;
  height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  animation: companionFloat 4.5s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(255,209,102,.18));
}
.companion .icon { width: 46px; height: 46px; color: var(--gold); }
.companion span {
  padding: 1px 7px;
  border-radius: 7px;
  background: rgba(255,209,102,.12);
  border: 1px solid rgba(255,209,102,.25);
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
}
.particle.crit { color: var(--gold); font-size: 21px; text-shadow: 0 0 18px rgba(255,209,102,.9); }

.prestige-head { display: flex; gap: 8px; margin-bottom: 10px; }
.prestige-head > div {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(12,19,36,.6);
}
.prestige-head span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 3px; }
.prestige-head b { font-size: 20px; color: var(--gold); }
.prestige-hint { color: var(--muted); font-size: 11px; line-height: 1.45; margin: 0 0 10px; }
#prestige-btn { margin-bottom: 12px; }
#prestige-btn:disabled { opacity: .4; cursor: default; }
.perks { display: flex; flex-direction: column; gap: 8px; }
.perk {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(12,19,36,.55);
}
.perk-icon {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: rgba(255,209,102,.08);
  border: 1px solid rgba(255,209,102,.16);
  color: var(--gold);
}
.perk-icon .icon { width: 22px; height: 22px; }
.perk-name { font-size: 12.5px; font-weight: 650; }
.perk-desc { color: var(--muted); font-size: 10.5px; margin-top: 2px; line-height: 1.35; }
.perk-btn {
  min-width: 58px;
  padding: 7px 8px;
  border-radius: 9px;
  border: 1px solid rgba(255,209,102,.3);
  background: rgba(255,209,102,.08);
  color: var(--gold);
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.perk-btn small { font-size: 9px; color: var(--muted); font-weight: 500; }
.perk-btn:hover:not(:disabled) { background: rgba(255,209,102,.18); border-color: rgba(255,209,102,.6); }
.perk-btn:disabled { opacity: .35; cursor: default; }

@keyframes companionFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}
@keyframes comboPop { from { transform: scale(.85); } to { transform: scale(1); } }

@media (max-width: 560px) {
  .companion { width: 64px; height: 64px; left: -2%; bottom: 2%; }
  .companion .icon { width: 38px; height: 38px; }
  .combo { top: 8%; right: 3%; }
  .prestige-head b { font-size: 17px; }
}

.auth-btn {
  padding: 8px 12px;
  border-radius: 11px;
  border: 1px solid rgba(88,230,255,.3);
  background: rgba(88,230,255,.08);
  color: var(--cyan);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.auth-btn:hover { background: rgba(88,230,255,.16); border-color: rgba(88,230,255,.6); }

.section-label {
  margin: 2px 4px 6px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.section-label:not(:first-child) { margin-top: 14px; }
.team {
  position: absolute;
  left: 0;
  bottom: 4%;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  z-index: 2;
}
.team[hidden] { display: none; }
.team-member {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid rgba(255,209,102,.28);
  background: rgba(255,209,102,.08);
  color: var(--gold);
  cursor: pointer;
  animation: companionFloat 4.5s ease-in-out infinite;
}
.team-member:nth-child(2n) { animation-delay: -1.2s; }
.team-member:nth-child(3n) { animation-delay: -2.3s; }
.team-member .icon { width: 27px; height: 27px; }
.team-member span {
  position: absolute;
  right: -4px;
  bottom: -5px;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 6px;
  background: #101a32;
  border: 1px solid rgba(255,209,102,.3);
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}
@media (max-width: 560px) {
  .team-member { width: 36px; height: 36px; border-radius: 11px; }
  .team-member .icon { width: 23px; height: 23px; }
}

.milestones { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.ms {
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.4;
}
.ms.done { color: var(--green); border-color: rgba(95,242,182,.3); background: rgba(95,242,182,.08); }
.ms.next { color: var(--gold); border-color: rgba(255,209,102,.3); background: rgba(255,209,102,.06); }

.ms-hint { margin-top: 4px; color: rgba(139,154,194,.8); font-size: 9.5px; line-height: 1.35; }

.ms.ready { color: var(--gold); border-color: rgba(255,209,102,.55); background: rgba(255,209,102,.1); box-shadow: 0 0 12px rgba(255,209,102,.15); }
.ms.locked { opacity: .5; }
.ms-buy {
  margin-top: 5px;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid rgba(255,209,102,.35);
  background: rgba(255,209,102,.08);
  color: var(--gold);
  font: inherit;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
}
.ms-buy:hover:not(:disabled) { background: rgba(255,209,102,.18); }
.ms-buy:disabled { opacity: .4; cursor: default; }

@media (min-width: 561px) {
  .app {
    height: 100dvh;
    overflow: hidden;
  }
  .reactor-panel {
    position: static;
    height: auto;
    min-height: 0;
    align-self: stretch;
  }
  .side-panel {
    min-height: 0;
  }
}

@media (min-width: 561px) and (max-height: 780px) {
  .reactor-wrap { width: clamp(210px, 27vw, 280px); }
  .energy-value { font-size: 46px; }
  .boost-row { margin-top: 10px; }
}

.shop-head { margin-bottom: 10px; }
.shop-head > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.shop-head span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.shop-head b { color: var(--gold); font-size: 11px; font-weight: 650; }
.shop-hint { margin: 5px 0 0; color: rgba(139,154,194,.85); font-size: 10.5px; line-height: 1.4; }
.shop { display: flex; flex-direction: column; gap: 8px; }
.shop-card {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(23, 34, 62, .82), rgba(12, 19, 36, .8));
}
.shop-card.owned { opacity: .68; }
.shop-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255,209,102,.08);
  border: 1px solid rgba(255,209,102,.18);
  color: var(--gold);
}
.shop-icon .icon { width: 24px; height: 24px; }
.shop-info { min-width: 0; }
.shop-name { font-size: 13px; font-weight: 650; }
.shop-desc { color: var(--muted); font-size: 10.8px; margin-top: 3px; line-height: 1.35; }
.shop-buy {
  min-width: 92px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,209,102,.35);
  background: rgba(255,209,102,.1);
  color: var(--gold);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}
.shop-buy:hover:not(:disabled) { background: rgba(255,209,102,.2); border-color: rgba(255,209,102,.65); }
.shop-buy:disabled { opacity: .45; cursor: default; border-color: var(--line); color: var(--muted); background: rgba(255,255,255,.03); }
@media (max-width: 520px) {
  .shop-card { grid-template-columns: 40px 1fr; }
  .shop-icon { width: 40px; height: 40px; }
  .shop-buy { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 720px) and (min-width: 561px) {
  .app { padding: 10px 12px; gap: 10px; }
  .topbar { padding: 6px 10px; }
  .brand { gap: 8px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .brand-mark .icon { width: 20px; height: 20px; }
  .brand h1 { font-size: 20px; }
  .brand p { display: none; }
  .top-stats { gap: 5px; }
  .stat-chip { min-width: 64px; padding: 4px 7px; border-radius: 10px; }
  .stat-chip span { font-size: 8px; }
  .stat-chip b { font-size: 12px; }
  .icon-btn { width: 34px; height: 34px; }
  .layout { grid-template-columns: minmax(250px, 1fr) minmax(270px, 1fr); gap: 10px; }
  .reactor-panel { padding: 12px; }
  .reactor-wrap { width: clamp(160px, 28vw, 190px); }
  .energy-value { font-size: 36px; }
  .energy-value small { font-size: 12px; }
  .energy-sub { font-size: 10px; margin-top: 5px; }
  .goal { margin-top: 8px; }
  .goal-head { font-size: 9px; }
  .boost-row { margin-top: 8px; gap: 8px; }
  .boost-btn { padding: 6px 8px; }
  .boost-btn b { font-size: 10.5px; }
  .boost-btn small { font-size: 8.5px; }
  .boost-row .hint { display: none; }
  .side-panel { min-height: 0; }
  .tabs { gap: 2px; padding: 8px 6px 0; overflow-x: auto; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { font-size: 10px; padding: 8px 4px; }
  .tab-panel { padding: 8px; }
  .upgrade { grid-template-columns: 34px 1fr auto; gap: 6px; padding: 7px; border-radius: 11px; }
  .upgrade-icon { width: 34px; height: 34px; border-radius: 9px; }
  .upgrade-icon .icon { width: 19px; height: 19px; }
  .upgrade-name { font-size: 11.5px; }
  .upgrade-desc { font-size: 9.5px; }
  .upgrade-meta { font-size: 9px; gap: 5px; }
  .buy-btn { min-width: 60px; font-size: 9px; padding: 6px 5px; }
  .buy-btn small { font-size: 7.5px; }
  .section-label { font-size: 8.5px; }
}
