/* ==========================================================================
   AETHERIA: THE PHILOSOPHER'S CRUCIBLE - ARCANE ALCHEMY THEME
   Obsidian, Royal Violet, Arcane Cyan, and Liquid Gold
   ========================================================================== */

:root {
  --bg-primary: #07090e;
  --bg-panel: rgba(13, 17, 28, 0.9);
  --bg-card: rgba(22, 29, 48, 0.85);
  --bg-card-hover: rgba(35, 46, 75, 0.95);
  
  --border-subtle: rgba(168, 85, 247, 0.2);
  --border-glow: #a855f7;
  --border-cyan: #06b6d4;

  --mana-cyan: #00f0ff;
  --aether-violet: #a855f7;
  --elixir-gold: #facc15;
  --elixir-rose: #f43f5e;
  
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  --text-gold: #fde047;
  --text-cyan: #38bdf8;
  --text-violet: #c084fc;
  --text-green: #34d399;
  --text-red: #f87171;

  --font-serif: "Cinzel", "Kavoon", Georgia, Cambria, serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  max-width: 100vw;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 50% 25%, rgba(168, 85, 247, 0.15) 0%, transparent 60%),
    radial-gradient(circle at 10% 80%, rgba(6, 182, 212, 0.12) 0%, transparent 55%),
    linear-gradient(rgba(13, 17, 28, 0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 17, 28, 0.7) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
  color: var(--text-main);
  font-family: var(--font-sans);
  height: 100vh;
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ================= TOP NAVIGATION ================= */
#top-bar {
  height: 48px;
  background: rgba(9, 12, 20, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 100;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-cookie-icon {
  font-size: 24px;
  animation: logoWobble 4s infinite ease-in-out;
  cursor: pointer;
  filter: drop-shadow(0 0 8px var(--aether-violet));
}

@keyframes logoWobble {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(10deg) scale(1.1); }
}

.logo-title {
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 2px;
  color: #f1f5f9;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8), 0 0 12px rgba(168, 85, 247, 0.5);
}

.logo-title span {
  color: var(--mana-cyan);
}

.top-bar-center {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-ascend {
  background: linear-gradient(135deg, #2e1065, #4c1d95);
  border: 1.5px solid #a855f7;
  color: #f3e8ff;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12px;
  padding: 6px 16px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.btn-ascend:hover {
  background: linear-gradient(135deg, #4c1d95, #6d28d9);
  border-color: #d8b4fe;
  transform: translateY(-1px);
}

.btn-ascend.glow-ascend {
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  border-color: #a5f3fc;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.7);
  animation: pulseAscend 1.8s infinite ease-in-out;
}

@keyframes pulseAscend {
  0%, 100% { transform: scale(1); box-shadow: 0 0 14px rgba(6, 182, 212, 0.5); }
  50% { transform: scale(1.04); box-shadow: 0 0 24px rgba(168, 85, 247, 0.9); }
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-nav-action {
  background: rgba(22, 29, 48, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: normal;
  font-family: inherit;
}

.btn-nav-action:hover {
  background: var(--bg-card-hover);
  color: #fff;
  border-color: var(--border-glow);
}

/* ================= 3-COLUMN WORKSPACE ================= */
#main-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 360px 1fr 390px;
  height: calc(100vh - 48px);
  position: relative;
  overflow: hidden;
}

.game-column {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  border-right: 2px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ================= LEFT COLUMN: CRUCIBLE & ELIXIR ================= */
#col-cookie {
  align-items: center;
  padding: 20px 16px 0 16px;
  background: radial-gradient(circle at 50% 45%, rgba(168, 85, 247, 0.1) 0%, rgba(10, 13, 22, 0.98) 75%);
}

.bakery-name-box {
  background: rgba(14, 18, 30, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  max-width: 320px;
}

.bakery-name-box:hover {
  border-color: var(--border-glow);
  background: rgba(26, 34, 56, 0.8);
}

.bakery-title {
  font-family: var(--font-serif);
  font-size: 14px;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: 0.5px;
}

.bakery-title span {
  font-size: 11px;
  color: var(--mana-cyan);
}

.cookie-counter-wrap {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cookie-count-huge {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.9), 0 0 22px rgba(168, 85, 247, 0.7);
  line-height: 1.1;
  letter-spacing: 0.5px;
}

.cps-rate-label {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--mana-cyan);
  margin-top: 4px;
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* INTERACTIVE CRUCIBLE ORB */
#big-cookie-container {
  position: relative;
  width: 250px;
  height: 250px;
  margin: auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  cursor: pointer;
}

.cookie-sunburst-halo {
  position: absolute;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(168, 85, 247, 0.2) 0deg 20deg,
    transparent 20deg 40deg,
    rgba(6, 182, 212, 0.2) 40deg 60deg,
    transparent 60deg 80deg,
    rgba(168, 85, 247, 0.2) 80deg 100deg,
    transparent 100deg 120deg,
    rgba(6, 182, 212, 0.2) 120deg 140deg,
    transparent 140deg 160deg,
    rgba(168, 85, 247, 0.2) 160deg 180deg,
    transparent 180deg 200deg,
    rgba(6, 182, 212, 0.2) 200deg 220deg,
    transparent 220deg 240deg,
    rgba(168, 85, 247, 0.2) 240deg 260deg,
    transparent 260deg 280deg,
    rgba(6, 182, 212, 0.2) 280deg 300deg,
    transparent 300deg 320deg,
    rgba(168, 85, 247, 0.2) 320deg 340deg,
    transparent 340deg 360deg
  );
  animation: haloSpin 32s linear infinite;
  pointer-events: none;
}

@keyframes haloSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#big-cookie {
  width: 200px;
  height: 200px;
  cursor: pointer;
  position: relative;
  z-index: 10;
  transition: transform 0.08s ease, filter 0.1s ease;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 16px rgba(168, 85, 247, 0.4));
}

#big-cookie:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 16px 32px rgba(6, 182, 212, 0.4)) drop-shadow(0 0 24px rgba(168, 85, 247, 0.8));
}

#big-cookie:active {
  transform: scale(0.92) !important;
}

#big-cookie.crucible-squish {
  transform: scale(0.92);
}

.click-hint-badge {
  position: absolute;
  top: 10px;
  background: rgba(168, 85, 247, 0.95);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 4px 14px;
  border-radius: 99px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7), 0 0 16px rgba(168, 85, 247, 0.8);
  pointer-events: none;
  z-index: 30;
  animation: pulseHint 1.4s infinite ease-in-out;
}

@keyframes pulseHint {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.08); }
}

/* PARASITES ATTACHED TO CRUCIBLE */
#wrinkler-container {
  position: absolute;
  width: 250px;
  height: 250px;
  pointer-events: none;
  z-index: 20;
}

.wrinkler-entity {
  position: absolute;
  font-size: 28px;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.1s ease;
  animation: wrinklerWiggle 3s infinite ease-in-out;
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.9));
}

.wrinkler-entity.wrinkler-hit {
  transform: scale(1.3) !important;
}

@keyframes wrinklerWiggle {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
  50% { transform: translate(-50%, -50%) rotate(10deg); }
}

/* ELIXIR RESERVOIR & FAMILIAR */
.milk-container {
  width: 100%;
  height: 110px;
  margin-top: auto;
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border-subtle);
}

#milk-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.milk-kitten {
  position: absolute;
  bottom: 38px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 30px;
  animation: kittenBob 3s infinite ease-in-out;
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 0 6px var(--mana-cyan));
}

@keyframes kittenBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-7px); }
}

.milk-info-badge {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 13, 22, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 99px;
  padding: 2px 12px;
  font-size: 10px;
  font-weight: 700;
  color: var(--mana-cyan);
  white-space: nowrap;
  z-index: 6;
  letter-spacing: 0.5px;
}

/* ================= CENTER COLUMN: TABS, VISUALS, ARCANUM, PANTHEON ================= */
#col-center {
  display: flex;
  flex-direction: column;
  border-right: 2px solid var(--border-subtle);
  background: rgba(11, 14, 24, 0.96);
}

/* NEWS TICKER */
#news-ticker-bar {
  height: 38px;
  background: rgba(7, 9, 16, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 12px;
  color: #cbd5e1;
  cursor: pointer;
  overflow: hidden;
}

.news-badge {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: var(--text-violet);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

#news-ticker-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  transition: opacity 0.3s ease;
}

/* ACTIVE BUFFS CONTAINER */
#active-buffs-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(14, 18, 30, 0.7);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 48px;
  align-items: center;
}

.buff-pill {
  background: rgba(26, 32, 54, 0.9);
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  animation: buffPopIn 0.2s ease;
}

@keyframes buffPopIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.buff-icon {
  font-size: 18px;
}

.buff-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 85px;
}

.buff-title-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
}

.buff-name {
  color: var(--text-violet);
}

.buff-timer {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
}

.buff-track {
  width: 100%;
  height: 4px;
  background: #0b0f19;
  border-radius: 99px;
  overflow: hidden;
}

.buff-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--border-glow), var(--mana-cyan));
  border-radius: 99px;
  transition: width 0.1s linear;
}

/* CENTER TABS */
.center-tabs-strip {
  display: flex;
  background: rgba(9, 12, 20, 0.98);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 16px;
  overflow-x: auto;
}

.center-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.center-tab-btn:hover {
  color: var(--text-main);
}

.center-tab-btn.active {
  color: var(--mana-cyan);
  border-bottom-color: var(--mana-cyan);
  text-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

.tab-pane {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

/* SANCTUM VISUAL VIEW */
#bakery-visuals-strip {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.visual-building-row {
  background: rgba(18, 23, 38, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.visual-row-label {
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.visual-icons-box {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.visual-sprite {
  font-size: 18px;
  transition: transform 0.15s ease;
}

.visual-sprite:hover {
  transform: scale(1.3);
}

.empty-bakery-splash {
  text-align: center;
  margin: auto;
  padding: 40px 20px;
  color: var(--text-dim);
}

.empty-bakery-splash h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  color: #fff;
  margin-bottom: 8px;
}

/* THE ARCANUM VIEW (GRIMOIRE) */
.grimoire-header {
  background: rgba(30, 20, 50, 0.55);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.grimoire-title {
  font-family: var(--font-serif);
  font-size: 16px;
  color: #f3e8ff;
  margin-bottom: 8px;
}

.mana-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-violet);
}

.mana-track {
  flex: 1;
  height: 8px;
  background: #110e20;
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.mana-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #9333ea, #06b6d4);
  box-shadow: 0 0 10px #a855f7;
  transition: width 0.15s linear;
}

.spells-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.spell-card {
  background: rgba(24, 20, 38, 0.7);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: all 0.15s ease;
}

.spell-card.affordable:hover {
  border-color: #c084fc;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.35);
}

.spell-card.unaffordable {
  opacity: 0.5;
}

.spell-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.spell-info {
  flex: 1;
}

.spell-name {
  font-weight: 700;
  font-size: 13px;
  color: #f8fafc;
}

.spell-cost {
  font-size: 11px;
  font-weight: 700;
  color: var(--mana-cyan);
  margin: 2px 0 4px 0;
}

.spell-desc {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.4;
}

.spell-cast-btn {
  background: linear-gradient(135deg, #7e22ce, #9333ea);
  border: 1px solid #c084fc;
  color: #fff;
  font-weight: 800;
  font-size: 10px;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  align-self: center;
}

.spell-cast-btn:disabled {
  background: #334155;
  border-color: #475569;
  color: #94a3b8;
  cursor: not-allowed;
}

/* ================= PANTHEON SPIRITS VIEW ================= */
.pantheon-header {
  background: rgba(20, 26, 44, 0.6);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.pantheon-title {
  font-family: var(--font-serif);
  font-size: 16px;
  color: #e0f2fe;
  margin-bottom: 4px;
}

.pantheon-subtitle {
  font-size: 11px;
  color: var(--text-dim);
}

.pantheon-altars-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.pantheon-altar {
  background: rgba(17, 22, 38, 0.85);
  border: 1.5px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.altar-diamond { border-color: rgba(103, 232, 249, 0.4); }
.altar-ruby { border-color: rgba(248, 113, 113, 0.4); }
.altar-jade { border-color: rgba(52, 211, 153, 0.4); }

.altar-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.altar-slot-box {
  min-height: 100px;
  background: rgba(10, 13, 22, 0.6);
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.slotted-spirit-icon {
  font-size: 30px;
  margin-bottom: 4px;
}

.slotted-spirit-name {
  font-weight: 800;
  font-size: 13px;
  color: #fff;
}

.slotted-spirit-bonus {
  font-size: 10px;
  color: var(--mana-cyan);
  margin: 4px 0 8px 0;
}

.btn-unslot-spirit {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #fca5a5;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-unslot-spirit:hover {
  background: #ef4444;
  color: #fff;
}

.empty-slot-msg {
  color: var(--text-dim);
  font-weight: 700;
  font-size: 12px;
}

.empty-slot-sub {
  color: #64748b;
  font-size: 10px;
  margin-top: 4px;
}

.pantheon-bench-title {
  font-family: var(--font-serif);
  font-size: 14px;
  color: #e2e8f0;
  margin-bottom: 10px;
}

.pantheon-spirits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.spirit-card {
  background: rgba(20, 26, 44, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spirit-card.slotted {
  border-color: var(--mana-cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

.spirit-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spirit-card-icon {
  font-size: 26px;
}

.spirit-card-name {
  font-weight: 800;
  font-size: 13px;
  color: #fff;
}

.spirit-card-title {
  font-size: 10px;
  color: var(--text-violet);
}

.slotted-tag {
  margin-left: auto;
  background: rgba(6, 182, 212, 0.2);
  border: 1px solid var(--mana-cyan);
  color: var(--mana-cyan);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.spirit-card-lore {
  font-size: 10px;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.3;
}

.spirit-powers-list {
  background: rgba(10, 13, 22, 0.5);
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10px;
}

.power-line.diamond { color: #67e8f9; }
.power-line.ruby { color: #f87171; }
.power-line.jade { color: #34d399; }

.spirit-slot-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.btn-slot-altar {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  font-size: 9px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-slot-altar:hover {
  background: var(--bg-card-hover);
  color: #fff;
  border-color: #fff;
}

/* PHILOSOPHER'S STONES (LUMPS) VIEW */
.lumps-header {
  background: rgba(20, 30, 45, 0.6);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.lumps-title {
  font-family: var(--font-serif);
  font-size: 16px;
  color: #bae6fd;
  margin-bottom: 6px;
}

.lumps-count-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.gold-text {
  color: var(--mana-cyan);
}

.harvest-lump-btn {
  background: rgba(6, 182, 212, 0.2);
  border: 1px solid var(--mana-cyan);
  color: #e0f2fe;
  font-weight: 700;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.harvest-lump-btn:hover {
  background: var(--mana-cyan);
  color: #0c4a6e;
}

.lump-progress-box {
  margin-top: 10px;
}

.lump-progress-label {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.lump-track {
  height: 6px;
  background: #082f49;
  border-radius: 99px;
  overflow: hidden;
}

.lump-bar {
  height: 100%;
  background: var(--mana-cyan);
}

.lumps-building-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lump-building-item {
  background: rgba(20, 26, 44, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lump-bld-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lump-bld-icon {
  font-size: 22px;
}

.lump-bld-name {
  font-weight: 700;
  font-size: 12px;
}

.badge-level {
  background: rgba(6, 182, 212, 0.2);
  color: var(--mana-cyan);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
}

.lump-bld-bonus {
  font-size: 10px;
  color: var(--text-green);
}

.btn-upgrade-lump {
  background: #1e293b;
  border: 1px solid #334155;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: not-allowed;
}

.btn-upgrade-lump.active {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  border-color: #7dd3fc;
  color: #fff;
  cursor: pointer;
}

/* SANCTUM STATS VIEW */
.stats-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-box {
  background: rgba(20, 26, 44, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px 14px;
}

.stat-box-title {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--mana-cyan);
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 4px;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 5px;
}

.stat-line span {
  color: var(--text-dim);
}

.stat-line b {
  color: #f8fafc;
  font-family: var(--font-mono);
}

.stat-table-title {
  font-family: var(--font-serif);
  font-size: 14px;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.stat-table th, .stat-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-table th {
  color: var(--text-dim);
  font-weight: 600;
}

.stat-table td {
  font-family: var(--font-mono);
}

/* MYSTERIES & BADGES (ACHIEVEMENTS) VIEW */
.achievements-header-bar {
  display: flex;
  justify-content: space-between;
  background: rgba(20, 26, 44, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 12px;
  margin-bottom: 14px;
}

.achievements-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.achievement-badge {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.achievement-badge.unlocked {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.3) 0%, rgba(26, 32, 54, 0.9) 100%);
  border: 1.5px solid var(--border-glow);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.achievement-badge.unlocked:hover {
  transform: scale(1.1);
  border-color: #fff;
}

.achievement-badge.locked {
  background: #0f1322;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  opacity: 0.4;
  cursor: help;
}

/* ================= RIGHT COLUMN: STORE & TRANSMUTATIONS ================= */
#col-store {
  display: flex;
  flex-direction: column;
  background: rgba(11, 14, 24, 0.96);
}

.store-header-bar {
  background: rgba(9, 12, 20, 0.98);
  border-bottom: 2px solid var(--border-subtle);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.store-mode-switch {
  display: flex;
  background: #090c16;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.store-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.store-mode-btn.active {
  background: var(--border-glow);
  color: #fff;
}

.bulk-qty-switch {
  display: flex;
  background: #090c16;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.bulk-qty-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bulk-qty-btn.active {
  background: rgba(168, 85, 247, 0.25);
  color: var(--text-violet);
  border: 1px solid var(--border-glow);
}

/* TRANSMUTATION RACK */
.upgrades-shelf-wrap {
  background: rgba(10, 13, 22, 0.9);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 14px;
}

.upgrades-shelf-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}

#upgrades-rack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 48px;
}

.empty-upgrades-note {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  margin: auto 0;
}

.upgrade-badge {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.upgrade-badge.affordable {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.25) 0%, rgba(20, 26, 44, 0.9) 100%);
  border: 1.5px solid var(--border-glow);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.35);
}

.upgrade-badge.affordable:hover {
  transform: translateY(-2px) scale(1.08);
  border-color: #fff;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.6);
}

.upgrade-badge.unaffordable {
  background: #0a0d16;
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0.4;
  cursor: not-allowed;
}

.upgrade-badge.synergy-badge {
  border-color: #38bdf8 !important;
}

/* APPARATUS LIST */
#buildings-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.building-card {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.building-card.affordable {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.12) 0%, rgba(20, 26, 44, 0.75) 100%);
  border: 1.5px solid rgba(168, 85, 247, 0.5);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.building-card.affordable:hover {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.22) 0%, rgba(30, 40, 68, 0.9) 100%);
  border-color: var(--mana-cyan);
  transform: translateX(-2px);
}

.building-card.unaffordable {
  background: rgba(14, 18, 30, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 0.45;
  filter: grayscale(60%);
  cursor: not-allowed;
}

.building-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #0c101c;
  border: 1px solid rgba(168, 85, 247, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-right: 10px;
  flex-shrink: 0;
}

.building-details {
  flex: 1;
  min-width: 0;
}

.building-name {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.building-cost {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--mana-cyan);
  margin-top: 2px;
}

.building-card.unaffordable .building-cost {
  color: #64748b;
}

.building-count {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 900;
  color: var(--text-violet);
  margin-left: 8px;
  min-width: 36px;
  text-align: right;
}

/* ================= WILD MANA ANOMALIES ================= */
.golden-cookie {
  position: fixed;
  font-size: 42px;
  cursor: pointer;
  z-index: 2000;
  animation: goldenFloat 3s infinite ease-in-out;
  filter: drop-shadow(0 0 16px rgba(168, 85, 247, 0.8));
  user-select: none;
}

@keyframes goldenFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(12deg); }
}

.golden-cookie.wrath-cookie {
  filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.9));
}

/* ================= FLOATING PARTICLES & TEXT ================= */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 500;
}

.floating-click-num {
  position: fixed;
  pointer-events: none;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 8px rgba(0,0,0,0.9), 0 0 14px var(--mana-cyan);
  animation: floatUpFade 0.9s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
  z-index: 1000;
}

@keyframes floatUpFade {
  0% { opacity: 1; transform: translate(-50%, 0) scale(0.9); }
  70% { opacity: 0.9; transform: translate(-50%, -45px) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -75px) scale(1.2); }
}

/* ================= TOOLTIP ================= */
#game-tooltip {
  position: fixed;
  display: none;
  pointer-events: none;
  background: rgba(9, 12, 22, 0.96);
  border: 1.5px solid var(--border-glow);
  border-radius: 8px;
  padding: 10px 14px;
  width: 280px;
  font-size: 11px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.85), 0 0 16px rgba(168, 85, 247, 0.35);
  z-index: 3000;
  backdrop-filter: blur(14px);
}

.tooltip-title-text {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}

.tooltip-cost-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--mana-cyan);
  margin-bottom: 6px;
}

.tooltip-desc-text {
  color: #cbd5e1;
  line-height: 1.4;
  font-size: 11px;
}

/* ================= TOASTS ================= */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 4000;
  pointer-events: none;
}

.game-toast {
  background: rgba(14, 18, 30, 0.96);
  border: 1px solid var(--border-glow);
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.8), 0 0 12px rgba(168, 85, 247, 0.3);
  transition: opacity 0.3s ease;
  pointer-events: auto;
}

.game-toast.toast-success {
  border-color: #34d399;
}

.game-toast.toast-warning {
  border-color: #f87171;
}

.game-toast.toast-achievement {
  border-color: #c084fc;
  box-shadow: 0 0 16px rgba(192, 132, 252, 0.5);
}

/* ================= ASTRAL TRANSCENDENCE MODAL ================= */
#ascension-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 12, 0.94);
  backdrop-filter: blur(20px);
  z-index: 5000;
  align-items: center;
  justify-content: center;
}

.ascension-window {
  width: 90vw;
  max-width: 900px;
  height: 85vh;
  background: radial-gradient(circle at 50% 20%, rgba(124, 58, 237, 0.25) 0%, rgba(10, 13, 22, 0.98) 75%);
  border: 2px solid #8b5cf6;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ascension-header {
  height: 54px;
  background: rgba(18, 14, 34, 0.9);
  border-bottom: 1px solid rgba(139, 92, 246, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.ascension-title {
  font-family: var(--font-serif);
  font-size: 18px;
  color: #e0e7ff;
}

.asc-close-x {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
}

.ascension-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ascension-stats-strip {
  display: flex;
  justify-content: space-around;
  background: rgba(30, 20, 50, 0.5);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 8px;
  padding: 12px;
}

.asc-stat-item {
  text-align: center;
}

.asc-stat-label {
  font-size: 11px;
  color: #c4b5fd;
}

.asc-stat-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-top: 2px;
}

#ascension-tree-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.asc-card {
  background: rgba(30, 20, 50, 0.45);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.asc-card.affordable {
  border-color: #8b5cf6;
  background: rgba(76, 29, 149, 0.5);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.3);
}

.asc-card.affordable:hover {
  transform: translateY(-2px);
  border-color: #ddd6fe;
}

.asc-card.owned {
  border-color: #34d399;
  background: rgba(6, 78, 59, 0.3);
  cursor: default;
}

.asc-card.unaffordable {
  opacity: 0.45;
  cursor: not-allowed;
}

.asc-card-icon {
  font-size: 28px;
}

.asc-card-meta {
  flex: 1;
}

.asc-card-name {
  font-weight: 700;
  font-size: 13px;
  color: #f8fafc;
}

.asc-card-cost {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #c4b5fd;
  margin: 2px 0 4px 0;
}

.asc-card-desc {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.4;
}

.ascension-footer {
  height: 60px;
  background: rgba(18, 14, 34, 0.9);
  border-top: 1px solid rgba(139, 92, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 20px;
  gap: 12px;
}

.btn-reincarnate {
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  border: 1px solid #c084fc;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 24px;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.5);
  transition: all 0.2s ease;
}

.btn-reincarnate:hover {
  transform: scale(1.04);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.8);
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.25); }
::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.35); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--mana-cyan); }
