/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens ── */
:root {
  --cyan:      #00e5ff;
  --cyan-dim:  rgba(0,229,255,.15);
  --purple:    #b24bff;
  --purple-dim:rgba(178,75,255,.15);
  --green:     #39ff8a;
  --green-dim: rgba(57,255,138,.12);
  --amber:     #ffcf5a;
  --red:       #ff4f6d;
  --dark:      #020812;
  --panel:     #06111f;
  --panel2:    #0a1727;
  --border:    #12324f;
  --border2:   #18517d;
  --text:      #d7f4ff;
  --dim:       #6c89a2;
  --radius:    8px;
  --font-num:  'Orbitron', monospace;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --gc: 0 0 18px rgba(0,229,255,.7), 0 0 40px rgba(0,229,255,.3);
  --gp: 0 0 18px rgba(178,75,255,.7), 0 0 40px rgba(178,75,255,.3);
  --gg: 0 0 18px rgba(57,255,138,.7), 0 0 40px rgba(57,255,138,.3);
}

/* ── Base ── */
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 20% 18%, rgba(0,229,255,.12), transparent 28%),
    radial-gradient(circle at 74% 72%, rgba(178,75,255,.13), transparent 30%),
    var(--dark);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ── HUD ── */
#hud {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 28px;
  min-height: 78px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), transparent),
    rgba(6,17,31,.92);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 14px 50px rgba(0,0,0,.28);
}
#hud::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,229,255,.4) 30%, rgba(178,75,255,.4) 70%, transparent);
}

.stat-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 0 22px;
  min-width: 108px;
}
.main-stat { padding-left: 0; min-width: min(42vw, 360px); }
.stat-value {
  font-family: var(--font-num);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 900;
  color: var(--purple);
  text-shadow: var(--gp);
  letter-spacing: 0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-cyan  { color: var(--cyan);  text-shadow: var(--gc); }
.stat-green { color: var(--green); text-shadow: var(--gg); }
.stat-amber { color: var(--amber); text-shadow: 0 0 18px rgba(255,207,90,.62), 0 0 36px rgba(255,207,90,.22); }
.stat-label {
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  color: var(--dim);
}
.hud-divider {
  width: 1px;
  height: 36px;
  background: var(--border2);
  flex-shrink: 0;
}

/* ── Layout ── */
#layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Click zone ── */
#click-zone-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background:
    linear-gradient(115deg, rgba(255,255,255,.025), transparent 35%),
    var(--dark);
  overflow: hidden;
}
/* Radial spotlight */
#click-zone-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 58% 58% at 50% 50%,
    rgba(0,229,255,.16) 0%,
    rgba(178,75,255,.10) 35%,
    rgba(0,20,40,.24) 62%,
    transparent 100%);
  pointer-events: none;
}
/* Scan-line texture */
#click-zone-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,.08) 3px,
    rgba(0,0,0,.08) 4px
  );
  pointer-events: none;
  z-index: 0;
}

/* Canvas behind everything */
#bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

#click-zone {
  position: relative;
  width: clamp(230px, 32vw, 390px);
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  z-index: 2;
  background:
    radial-gradient(circle at 50% 42%, rgba(0,229,255,.16), transparent 31%),
    radial-gradient(circle at 50% 50%, rgba(57,255,138,.08), transparent 47%);
  transition: transform .08s ease, filter .15s ease;
  filter: drop-shadow(0 0 50px rgba(0,229,255,.12));
}
#click-zone:focus-visible { outline: 2px solid var(--cyan); outline-offset: 8px; }
#click-zone:active { transform: scale(.96); }
#click-zone.clicked { transform: scale(.95); filter: drop-shadow(0 0 60px rgba(0,229,255,.28)); }
#click-zone.critical-pulse { filter: drop-shadow(0 0 72px rgba(255,207,90,.46)); }
#click-zone.negative-pulse { filter: drop-shadow(0 0 72px rgba(255,79,109,.38)); }

/* Orbit rings */
.helix-ring {
  position: absolute;
  border-radius: 50%;
  border-style: solid;
  animation: spin linear infinite;
  pointer-events: none;
}
.ring1 {
  inset: 0;
  border-width: 1px;
  border-color: rgba(0,229,255,.52);
  animation-duration: 14s;
  box-shadow: 0 0 22px rgba(0,229,255,.12) inset, 0 0 30px rgba(0,229,255,.08);
}
.ring2 {
  inset: 16px;
  border-width: 1px;
  border-color: rgba(178,75,255,.40);
  border-style: dashed;
  animation-duration: 10s;
  animation-direction: reverse;
}
.ring3 {
  inset: 32px;
  border-width: 1px;
  border-color: rgba(57,255,138,.36);
  animation-duration: 18s;
}
.ring4 {
  inset: -18px;
  border-width: 1px;
  border-color: rgba(255,207,90,.18);
  border-style: dashed;
  animation-duration: 30s;
  animation-direction: reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* DNA core */
#helix-core {
  width: 55%;
  display: flex;
  align-items: center;
  justify-content: center;
  filter:
    drop-shadow(0 0 8px rgba(0,229,255,.6))
    drop-shadow(0 0 22px rgba(0,229,255,.3))
    drop-shadow(0 0 6px rgba(178,75,255,.4));
  transition: filter .08s, transform .08s;
}
#dna-svg { width: 100%; height: auto; }

.strand-a { animation: strand-pulse 2.8s ease-in-out infinite; }
.strand-b { animation: strand-pulse 2.8s ease-in-out infinite; animation-delay: 1.4s; }
@keyframes strand-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .55; }
}

.rungs line {
  stroke: rgba(255,255,255,.25);
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* Click feedback */
#click-zone:active #helix-core,
#click-zone.clicked #helix-core {
  filter:
    drop-shadow(0 0 18px rgba(0,229,255,1))
    drop-shadow(0 0 50px rgba(0,229,255,.6))
    drop-shadow(0 0 30px rgba(178,75,255,.8));
  transform: scale(.92);
}

/* Pulse ring on click */
#click-zone::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(0,229,255,0);
  pointer-events: none;
}
#click-zone.pulse::after {
  animation: pulse-ring .45s ease-out forwards;
}
#click-zone.critical-pulse::after {
  animation: pulse-ring-critical .52s ease-out forwards;
}
#click-zone.negative-pulse::after {
  animation: pulse-ring-negative .52s ease-out forwards;
}
@keyframes pulse-ring {
  0%   { inset: 0px;   border-color: rgba(0,229,255,.8); }
  100% { inset: -28px; border-color: rgba(0,229,255,0);  }
}
@keyframes pulse-ring-critical {
  0%   { inset: 0px;   border-color: rgba(255,207,90,.92); }
  100% { inset: -34px; border-color: rgba(255,207,90,0);  }
}
@keyframes pulse-ring-negative {
  0%   { inset: 0px;   border-color: rgba(255,79,109,.82); }
  100% { inset: -34px; border-color: rgba(255,79,109,0);  }
}

/* Click label */
#click-label {
  margin-top: 10px;
  font-family: var(--font-num);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: rgba(215,244,255,.65);
  text-transform: uppercase;
  pointer-events: none;
  transition: color .1s;
  text-shadow: 0 0 16px rgba(0,229,255,.42);
}
#click-zone:hover #click-label { color: var(--cyan); }

/* Floating numbers */
#floating-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 3;
}
.float-num {
  position: absolute;
  font-family: var(--font-num);
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan);
  pointer-events: none;
  animation: float-up .65s cubic-bezier(.2,.8,.4,1) forwards;
  white-space: nowrap;
}
.float-passive {
  color: var(--green);
  text-shadow: 0 0 12px var(--green);
}
@keyframes float-up {
  0%   { opacity: 1; transform: translateY(0) scale(1.1); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-70px) scale(.7); }
}

/* ── Shop ── */
#shop {
  width: clamp(280px, 28vw, 360px);
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), transparent 28%),
    rgba(6,17,31,.96);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
#shop::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(178,75,255,.5), rgba(0,229,255,.5));
}

#shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 13px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#shop-title {
  font-family: var(--font-num);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--cyan);
}

/* Passive ticker */
#passive-ticker {
  font-family: var(--font-num);
  font-size: .7rem;
  color: var(--green);
  text-shadow: 0 0 8px rgba(57,255,138,.6);
  background: var(--green-dim);
  border: 1px solid rgba(57,255,138,.25);
  padding: 3px 8px;
  border-radius: 20px;
  animation: ticker-pulse 1.5s ease-in-out infinite;
}
#passive-ticker.hidden { display: none; }
@keyframes ticker-pulse {
  50% { box-shadow: 0 0 8px rgba(57,255,138,.3); }
}

/* Shop scroll */
#shop-scroll {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

.shop-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 6px;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(215,244,255,.48);
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
}
.section-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cyan-dot   { background: var(--cyan);   box-shadow: 0 0 5px var(--cyan); }
.purple-dot { background: var(--purple); box-shadow: 0 0 5px var(--purple); }
.amber-dot  { background: var(--amber);  box-shadow: 0 0 5px var(--amber); }
.green-dot  { background: var(--green);  box-shadow: 0 0 5px var(--green); }
.red-dot    { background: var(--red);    box-shadow: 0 0 5px var(--red); }

/* Prestige and synergies */
#prestige-panel,
#synergy-panel {
  border-bottom: 1px solid rgba(18,50,79,.86);
  background:
    linear-gradient(135deg, rgba(255,207,90,.08), transparent 46%),
    rgba(0,0,0,.10);
}

#prestige-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.prestige-eyebrow {
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(255,207,90,.78);
}

.prestige-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
  font-family: var(--font-num);
  color: var(--amber);
  text-shadow: 0 0 12px rgba(255,207,90,.36);
}

.prestige-value span:first-child {
  font-size: 1.1rem;
  font-weight: 900;
}

.prestige-value span:last-child {
  font-size: .58rem;
  color: rgba(215,244,255,.58);
}

.prestige-copy {
  margin-top: 6px;
  font-size: .68rem;
  line-height: 1.35;
  color: rgba(215,244,255,.58);
}

#prestige-btn {
  border: 1px solid rgba(255,207,90,.56);
  border-radius: var(--radius);
  background: rgba(255,207,90,.10);
  color: var(--amber);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .7px;
  padding: 9px 12px;
  text-transform: uppercase;
  transition: background .15s, box-shadow .15s, color .15s;
}

#prestige-btn:hover:not(:disabled) {
  background: rgba(255,207,90,.18);
  box-shadow: 0 0 18px rgba(255,207,90,.22);
}

#prestige-btn:disabled {
  border-color: rgba(18,50,79,.95);
  background: rgba(255,255,255,.015);
  color: var(--dim);
  cursor: not-allowed;
}

#synergy-panel {
  padding-bottom: 10px;
}

.inline-label {
  position: static;
  background: transparent;
}

#synergy-list {
  display: grid;
  gap: 6px;
  padding: 0 14px;
}

.synergy-row {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid rgba(18,50,79,.62);
  border-radius: var(--radius);
  background: rgba(255,255,255,.025);
}

.synergy-row span {
  font-size: .68rem;
  color: rgba(215,244,255,.55);
}

.synergy-row strong {
  justify-self: end;
  text-align: right;
  font-size: .68rem;
  color: var(--amber);
  font-weight: 800;
}

/* Genome, events and achievements */
#gene-list,
#achievement-list,
#event-panel,
#research-list,
#automation-list,
#endgame-panel {
  display: grid;
  gap: 8px;
  padding: 0 14px 12px;
}

.gene-card,
.achievement-card,
.research-card,
.automation-card,
.event-log-row,
.effect-pill,
.event-empty,
#endgame-panel {
  border: 1px solid rgba(18,50,79,.72);
  border-radius: var(--radius);
  background: rgba(255,255,255,.024);
}

.research-card,
.automation-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.research-card {
  border-left: 2px solid rgba(0,229,255,.38);
}

.automation-card {
  border-left: 2px solid rgba(178,75,255,.38);
}

.research-card.research-owned,
.automation-card.automation-owned {
  background: rgba(57,255,138,.055);
  border-color: rgba(57,255,138,.28);
}

.automation-card.automation-locked {
  opacity: .58;
}

.research-branch {
  font-size: .56rem;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(0,229,255,.68);
}

.research-name,
.automation-name,
.endgame-title {
  margin-top: 2px;
  font-size: .78rem;
  font-weight: 800;
  color: var(--text);
}

.research-desc,
.automation-desc,
.endgame-copy {
  margin-top: 3px;
  font-size: .66rem;
  line-height: 1.28;
  color: rgba(215,244,255,.54);
}

.research-buy,
.automation-buy,
#ascend-btn {
  border-radius: 6px;
  cursor: pointer;
  font-size: .66rem;
  font-weight: 800;
  padding: 6px 8px;
  white-space: nowrap;
}

.research-buy {
  border: 1px solid rgba(0,229,255,.45);
  background: rgba(0,229,255,.08);
  color: var(--cyan);
}

.automation-buy {
  border: 1px solid rgba(178,75,255,.45);
  background: rgba(178,75,255,.08);
  color: var(--purple);
}

.research-buy:disabled,
.automation-buy:disabled,
#ascend-btn:disabled {
  border-color: rgba(18,50,79,.95);
  background: rgba(255,255,255,.015);
  color: var(--dim);
  cursor: not-allowed;
}

#endgame-panel {
  background:
    linear-gradient(135deg, rgba(255,207,90,.08), transparent 48%),
    rgba(255,255,255,.024);
  border-left: 2px solid rgba(255,207,90,.44);
  padding: 11px;
}

#ascend-btn {
  margin-top: 8px;
  width: 100%;
  border: 1px solid rgba(255,207,90,.55);
  background: rgba(255,207,90,.10);
  color: var(--amber);
  text-transform: uppercase;
}

#ascend-btn:hover:not(:disabled) {
  background: rgba(255,207,90,.18);
  box-shadow: 0 0 18px rgba(255,207,90,.18);
}

.gene-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-left: 2px solid rgba(57,255,138,.32);
}

.gene-card.gene-active {
  background: rgba(57,255,138,.06);
  border-color: rgba(57,255,138,.35);
  box-shadow: inset 0 0 0 1px rgba(57,255,138,.08);
}

.gene-card.gene-locked {
  opacity: .58;
  border-left-color: rgba(108,137,162,.32);
}

.gene-name,
.achievement-name {
  font-size: .78rem;
  font-weight: 800;
  color: var(--text);
}

.gene-desc,
.achievement-desc,
.achievement-reward {
  margin-top: 3px;
  font-size: .66rem;
  line-height: 1.28;
  color: rgba(215,244,255,.54);
}

.gene-toggle {
  border: 1px solid rgba(57,255,138,.45);
  border-radius: 6px;
  background: rgba(57,255,138,.08);
  color: var(--green);
  cursor: pointer;
  font-size: .66rem;
  font-weight: 800;
  padding: 6px 8px;
}

.gene-toggle:disabled {
  border-color: rgba(18,50,79,.95);
  background: rgba(255,255,255,.015);
  color: var(--dim);
  cursor: not-allowed;
}

#active-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.effect-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  font-size: .66rem;
  font-weight: 800;
}

.effect-pill span {
  font-family: var(--font-num);
  font-size: .6rem;
  opacity: .78;
}

.effect-positive {
  color: var(--green);
  border-color: rgba(57,255,138,.32);
  background: rgba(57,255,138,.055);
}

.effect-negative {
  color: var(--red);
  border-color: rgba(255,79,109,.32);
  background: rgba(255,79,109,.055);
}

.effect-mixed {
  color: var(--amber);
  border-color: rgba(255,207,90,.32);
  background: rgba(255,207,90,.055);
}

#event-log {
  display: grid;
  gap: 6px;
}

.event-log-row {
  padding: 8px;
  font-size: .7rem;
  font-weight: 800;
  color: var(--text);
}

.event-log-row span {
  display: block;
  margin-top: 2px;
  font-size: .64rem;
  font-weight: 600;
  color: rgba(215,244,255,.52);
}

.event-positive { border-left: 2px solid rgba(57,255,138,.55); }
.event-negative { border-left: 2px solid rgba(255,79,109,.55); }
.event-mixed    { border-left: 2px solid rgba(255,207,90,.55); }

.event-empty {
  padding: 8px;
  font-size: .66rem;
  color: rgba(215,244,255,.46);
}

.achievement-card {
  padding: 9px 10px;
  border-left: 2px solid rgba(108,137,162,.34);
  opacity: .68;
}

.achievement-card.achievement-unlocked {
  opacity: 1;
  border-color: rgba(255,207,90,.32);
  border-left-color: rgba(255,207,90,.68);
  background: rgba(255,207,90,.045);
}

.achievement-card.achievement-unlocked .achievement-reward {
  color: var(--amber);
  font-weight: 800;
}

/* Shop items */
.shop-item {
  padding: 12px 14px 13px;
  border-bottom: 1px solid rgba(13,42,68,.8);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto auto;
  gap: 1px 8px;
  transition: background .12s, box-shadow .12s, border-color .12s;
  cursor: default;
  position: relative;
  overflow: hidden;
}
.shop-item::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: transparent;
}
.shop-item-modifier::before { background: rgba(0,229,255,.32); }
.shop-item-generator::before { background: rgba(178,75,255,.32); }
.shop-item.can-afford {
  background: rgba(57,255,138,.035);
}
.shop-item:hover:not(.item-disabled) {
  background: rgba(0,229,255,.06);
  box-shadow: inset 0 0 0 1px rgba(0,229,255,.05);
}

.item-name {
  grid-column: 1;
  grid-row: 1;
  font-size: .86rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.item-owned {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  font-family: var(--font-num);
  font-size: .65rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
  text-align: center;
  white-space: nowrap;
}
.item-owned.owned-modifier {
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid rgba(0,229,255,.3);
}
.item-owned.owned-generator {
  color: var(--purple);
  background: var(--purple-dim);
  border: 1px solid rgba(178,75,255,.3);
}

.item-effect {
  grid-column: 1;
  grid-row: 2;
  font-size: .7rem;
  color: rgba(215,244,255,.54);
  margin-bottom: 4px;
}

/* Progress bar */
.item-progress {
  grid-column: 1 / 3;
  grid-row: 3;
  height: 3px;
  background: rgba(255,255,255,.06);
  border-radius: 2px;
  overflow: hidden;
  margin: 3px 0 6px;
}
.item-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .2s ease;
}
.fill-modifier { background: linear-gradient(90deg, rgba(0,229,255,.4), rgba(0,229,255,.8)); }
.fill-generator { background: linear-gradient(90deg, rgba(178,75,255,.4), rgba(178,75,255,.8)); }

.item-cost {
  grid-column: 1;
  grid-row: 4;
  font-family: var(--font-num);
  font-size: .72rem;
  font-weight: 700;
  align-self: center;
  transition: color .15s;
}
.cost-affordable { color: var(--green); text-shadow: 0 0 6px rgba(57,255,138,.4); }
.cost-locked     { color: var(--dim); }

.item-buy-btn {
  grid-column: 2;
  grid-row: 4;
  align-self: end;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .5px;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s, box-shadow .12s, color .12s;
}
.btn-modifier {
  border: 1px solid rgba(0,229,255,.5);
  color: var(--cyan);
}
.btn-modifier:hover:not(:disabled) {
  background: rgba(0,229,255,.12);
  box-shadow: 0 0 10px rgba(0,229,255,.3);
}
.btn-generator {
  border: 1px solid rgba(178,75,255,.5);
  color: var(--purple);
}
.btn-generator:hover:not(:disabled) {
  background: rgba(178,75,255,.12);
  box-shadow: 0 0 10px rgba(178,75,255,.3);
}
.item-buy-btn:disabled {
  border-color: var(--border);
  color: var(--dim);
  cursor: not-allowed;
  background: rgba(255,255,255,.015);
}
.item-buy-btn.just-bought {
  animation: flash-buy .34s ease-out;
}
@keyframes flash-buy {
  0%   { background: rgba(57,255,138,.30); transform: translateY(-1px); }
  100% { background: transparent; }
}

/* Disabled items */
.item-disabled { opacity: .32; pointer-events: none; }

/* Shop footer */
#shop-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
#reset-btn {
  width: 100%;
  padding: 8px;
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid rgba(255,60,60,.25);
  color: rgba(255,100,100,.55);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  letter-spacing: .5px;
}
#reset-btn:hover {
  background: rgba(255,60,60,.08);
  color: #ff6464;
  border-color: rgba(255,60,60,.45);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--panel2);
  border: 1px solid rgba(255,60,60,.35);
  border-radius: var(--radius);
  padding: 32px 36px;
  text-align: center;
  max-width: 300px;
  box-shadow: 0 0 40px rgba(255,30,30,.15);
}
.modal-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 8px rgba(255,60,60,.5));
}
.modal-box p {
  margin-bottom: 24px;
  font-size: .95rem;
  color: var(--text);
}
.modal-actions { display: flex; gap: 12px; justify-content: center; }
.modal-actions button {
  padding: 9px 22px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity .15s;
}
.modal-actions button:hover { opacity: .85; }
#reset-confirm { background: #c0392b; color: #fff; }
#reset-cancel  { background: var(--border2); color: var(--text); }

.prestige-modal-box {
  border-color: rgba(255,207,90,.42);
  box-shadow: 0 0 42px rgba(255,207,90,.14);
}

.prestige-modal-box .modal-icon {
  color: var(--amber);
  font-family: var(--font-num);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 1px;
  filter: drop-shadow(0 0 8px rgba(255,207,90,.55));
}

#prestige-confirm {
  background: var(--amber);
  color: #1f1600;
}

@media (max-width: 860px) {
  html, body { overflow: auto; }
  body { min-height: 100%; }

  #hud {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .hud-divider { display: none; }
  .stat-block,
  .main-stat {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(18,50,79,.7);
    border-radius: var(--radius);
    background: rgba(0,0,0,.16);
  }
  .stat-value { font-size: 1rem; }
  .stat-label { font-size: .52rem; letter-spacing: 1px; }

  #layout {
    flex-direction: column;
    overflow: visible;
  }

  #click-zone-wrapper {
    min-height: 54vh;
    flex: none;
  }

  #click-zone {
    width: min(72vw, 330px);
  }

  #shop {
    width: 100%;
    max-height: none;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 520px) {
  #hud {
    grid-template-columns: 1fr;
  }

  .stat-block {
    align-items: center;
  }

  #click-zone-wrapper {
    min-height: 48vh;
  }

  #shop-scroll {
    overflow: visible;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
