/* Nova Core — idle clicker styles */
:root {
  --bg: #0b0e1a;
  --bg2: #121731;
  --panel: #171d38;
  --panel-hi: #1f2750;
  --line: #2a3358;
  --text: #eef1fb;
  --muted: #98a1c4;
  --accent: #6c8cff;
  --accent2: #ff6c9c;
  --gold: #ffd166;
  --good: #54e0a0;
  --core1: #7aa2ff;
  --core2: #b06cff;
  --core3: #ff6c9c;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 50% -15%, #232a52, transparent 60%),
    radial-gradient(900px 600px at 100% 0%, #2a1e4a, transparent 55%),
    var(--bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.app {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 28px);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.5vw, 22px);
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  filter: drop-shadow(0 0 14px rgba(108, 140, 255, .6));
}
.brand-text h1 {
  margin: 0;
  font-size: clamp(1.35rem, 4.5vw, 1.9rem);
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--core1), var(--core2), var(--core3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }

.topstats { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 6px 12px;
  min-width: 74px;
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stat-val { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; }

.icon-btn {
  width: 42px; height: 42px;
  font-size: 1.15rem;
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn:active { transform: scale(.94); }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(14px, 2.5vw, 22px);
  align-items: start;
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
}

/* ---------- Core panel ---------- */
.core-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: clamp(18px, 3vw, 26px);
  background: linear-gradient(180deg, var(--panel), var(--bg2) 90%);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.core {
  position: relative;
  width: clamp(180px, 46vw, 240px);
  height: clamp(180px, 46vw, 240px);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background:
    radial-gradient(circle at 35% 30%, var(--core1), var(--core2) 45%, var(--core3) 80%),
    var(--bg2);
  box-shadow:
    0 0 0 6px rgba(108, 140, 255, .12),
    0 0 60px rgba(140, 108, 255, .55),
    inset 0 0 40px rgba(255, 255, 255, .18);
  display: grid;
  place-items: center;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease, box-shadow .2s ease;
  animation: breathe 4.5s ease-in-out infinite;
}
.core:hover { box-shadow: 0 0 0 6px rgba(108,140,255,.18), 0 0 80px rgba(160,108,255,.7), inset 0 0 40px rgba(255,255,255,.22); }
.core:active { transform: scale(.96); }
.core.pulse { animation: pop .18s ease; }
.core-face {
  font-size: clamp(3rem, 13vw, 4.6rem);
  filter: drop-shadow(0 0 18px rgba(255,255,255,.75));
  pointer-events: none;
}
.core-glow {
  position: absolute; inset: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(176,108,255,.45), transparent 65%);
  pointer-events: none;
  animation: spin 12s linear infinite;
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 6px rgba(108,140,255,.12), 0 0 55px rgba(140,108,255,.45), inset 0 0 40px rgba(255,255,255,.18); }
  50% { box-shadow: 0 0 0 6px rgba(108,140,255,.16), 0 0 85px rgba(160,108,255,.75), inset 0 0 46px rgba(255,255,255,.24); }
}
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(.93); } 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Charge ---------- */
.charge { width: 100%; max-width: 340px; }
.charge-bar {
  height: 14px;
  border-radius: 999px;
  background: #0c1024;
  border: 1px solid var(--line);
  overflow: hidden;
}
.charge-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--core1), var(--core2), var(--gold));
  box-shadow: 0 0 16px rgba(255, 209, 102, .6);
  transition: width .08s linear;
}
.charge-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: .8rem;
  color: var(--muted);
}
.charge-meta b { color: var(--gold); font-variant-numeric: tabular-nums; }

.hint { margin: 0; max-width: 340px; text-align: center; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.hint b { color: var(--accent); }

/* ---------- Prestige ---------- */
.prestige {
  width: 100%;
  max-width: 340px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255, 209, 102, .05);
}
.prestige-head {
  display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  font-size: .82rem; margin-bottom: 10px;
}
.dust { color: var(--gold); font-weight: 600; }
.dust-bonus { color: var(--muted); }
.tiny { margin: 8px 0 0; font-size: .72rem; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  width: 100%;
  padding: 10px 14px;
  font-size: .95rem;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-hi), var(--bg2));
  color: var(--text);
  cursor: pointer;
  transition: transform .1s, border-color .15s, opacity .15s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.ghost { background: transparent; border-color: rgba(255, 209, 102, .5); color: var(--gold); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.link {
  background: none; border: none; color: var(--muted);
  font-size: .8rem; cursor: pointer; text-decoration: underline;
}
.link:hover { color: var(--accent2); }

/* ---------- Shop ---------- */
.shop {
  padding: clamp(14px, 3vw, 20px);
  background: linear-gradient(180deg, var(--panel), var(--bg2) 92%);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.shop-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 4px 0 10px;
}
.shop-head:not(:first-child) { margin-top: 22px; }
.shop-head h2 { margin: 0; font-size: 1.05rem; }
.shop-sub { color: var(--muted); font-size: .75rem; }

.modes { display: flex; gap: 4px; background: #0c1024; padding: 3px; border-radius: 10px; border: 1px solid var(--line); }
.mode {
  border: none; background: none; color: var(--muted);
  font-size: .78rem; font-weight: 700; padding: 5px 10px;
  border-radius: 7px; cursor: pointer;
}
.mode.active { background: var(--accent); color: #0b0e1a; }

.list { display: flex; flex-direction: column; gap: 9px; }

.item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #1b2242, #151a33);
  color: var(--text);
  cursor: pointer;
  transition: transform .1s, border-color .15s, background .15s, opacity .15s;
}
.item:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); background: linear-gradient(180deg, #202a52, #151a33); }
.item:active:not(:disabled) { transform: translateY(0) scale(.995); }
.item:disabled { opacity: .45; cursor: not-allowed; }

.item-emoji { font-size: 1.5rem; text-align: center; }
.item-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item-name { font-weight: 700; font-size: .95rem; }
.item-name .count { color: var(--accent); font-variant-numeric: tabular-nums; }
.item-sub { color: var(--muted); font-size: .78rem; }
.item-buy {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  text-align: right; white-space: nowrap;
}
.item-buy .qty { display: none; font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.item-buy .cost, .item-buy .state {
  font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums;
}
.item.gen .item-buy .qty { display: block; }

.item.up.owned { opacity: 1; border-color: rgba(84, 224, 160, .5); background: linear-gradient(180deg, #16342a, #12241f); }
.item.up.owned .item-buy .state { color: var(--good); }

/* ---------- FX ---------- */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.float {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 209, 102, .8);
  animation: floatUp .9s ease-out forwards;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.7); }
  20% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(1); }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translate(-50%, 20px);
  background: linear-gradient(180deg, var(--panel-hi), var(--bg2));
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 12px;
  font-size: .85rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Footer ---------- */
.foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; color: var(--muted); font-size: .78rem;
  padding: 0 4px;
}

@media (prefers-reduced-motion: reduce) {
  .core, .core-glow { animation: none; }
  .float { animation-duration: .5s; }
}
