/* ==========================================================================
   THE ALCHEMIST'S CRUCIBLE: MAGNUM OPUS
   Style System • Option 1 "Abyssal Nexus" (Neo-Dark Cyber-Fantasy UI)
   ========================================================================== */

:root {
  /* Surface & Elevation Palette */
  --bg-canvas: #0e1015;
  --bg-app: #13161c;
  --bg-rail: #0b0d12;
  --bg-sidebar: #101217;
  --bg-surface-1: #171a22;
  --bg-surface-2: #1c212b;
  --bg-surface-sel: #182338;
  --bg-surface-frenzy: #2d1216;

  /* Borders & Dividers */
  --border-subtle: #1f242e;
  --border-muted: #262b37;
  --border-active: #0ea5e9;
  --border-crimson: #ef4444;
  --border-gold: #f59e0b;
  --border-emerald: #22c55e;
  --border-purple: #a855f7;

  /* High-Chroma Semantic Accents */
  --accent-primary: #0ea5e9;
  --accent-cyan: #38bdf8;
  --accent-crimson: #ef4444;
  --accent-emerald: #22c55e;
  --accent-purple: #a855f7;
  --accent-amber: #f59e0b;
  --accent-gold: #fbbf24;

  /* Text & Typography Colors */
  --text-bright: #f9f9f9;
  --text-body: #d1d5db;
  --text-muted: #9ba2ae;
  --text-dim: #6c7482;
  --text-dark: #4a5160;

  /* Typography Families */
  --font-display: 'Cinzel', serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --trans-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --trans-bounce: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Base Reset & Touch Optimizations */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

*:focus {
  outline: none;
}

*:focus-visible {
  outline: 1.5px solid var(--accent-primary);
  outline-offset: 1px;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-app);
  color: var(--text-body);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg-sidebar);
}
::-webkit-scrollbar-thumb {
  background: var(--border-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Presentation Canvas Wrapper */
#presentation-canvas {
  width: 100vw;
  height: 100vh;
  display: flex;
}

/* Main App Window (Full Viewport Density) */
.app-window {
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-app);
  display: grid;
  grid-template-columns: 56px 220px 1fr 280px;
  overflow: hidden;
  position: relative;
}

/* --------------------------------------------------------------------------
   1. SLIM MACRO NAVIGATION RAIL (56px)
   -------------------------------------------------------------------------- */
.macro-rail {
  background-color: var(--bg-rail);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  z-index: 10;
}

.rail-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.rail-logo {
  width: 36px;
  height: 36px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
  cursor: pointer;
  transition: var(--trans-fast);
}
.rail-logo:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.3);
}

.rail-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.svg-icon {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: transform var(--trans-fast), stroke var(--trans-fast);
}

.rail-btn .svg-icon {
  width: 17px;
  height: 17px;
}

.rail-logo .logo-glyph .svg-icon {
  width: 22px;
  height: 22px;
  stroke: var(--accent-cyan);
}

.reagent-glyph .svg-icon {
  width: 15px;
  height: 15px;
}

.apparatus-glyph-box .svg-icon {
  width: 20px;
  height: 20px;
  stroke: var(--accent-cyan);
}

.metal-step .svg-icon {
  width: 13px;
  height: 13px;
  display: inline-block;
  vertical-align: middle;
  margin: 0 2px;
}

.rail-btn {
  width: 40px;
  height: 34px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 15px;
  cursor: pointer;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--trans-fast);
}

.rail-btn:hover {
  background-color: var(--bg-surface-1);
  color: var(--text-bright);
}

.rail-btn:hover .svg-icon {
  transform: scale(1.1);
  stroke: var(--text-bright);
}

.rail-btn.active {
  background-color: var(--bg-surface-2);
  color: var(--accent-cyan);
}

.rail-btn.active .svg-icon {
  stroke: var(--accent-cyan);
}

.rail-btn.active .active-indicator {
  position: absolute;
  left: 2px;
  width: 3px;
  height: 18px;
  background-color: var(--accent-primary);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-cyan);
}

.rail-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-family: var(--font-ui);
  font-size: 7px;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 5px;
  color: #ffffff;
}
.rail-badge.red { background-color: var(--accent-crimson); }
.rail-badge.blue { background-color: var(--accent-primary); }
.rail-badge.green { background-color: var(--accent-emerald); }
.rail-badge.purple { background-color: var(--accent-purple); }

.rail-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.rail-icon-btn {
  background: transparent;
  border: none;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.7;
  transition: var(--trans-fast);
  border-radius: 6px;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
}
.rail-icon-btn:hover { opacity: 1; transform: scale(1.1); }
.rail-icon-btn.playing {
  opacity: 1;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
  animation: pulseAmbient 2.5s infinite ease-in-out;
}
@keyframes pulseAmbient {
  0%, 100% { transform: scale(1); box-shadow: 0 0 8px rgba(34, 197, 94, 0.25); }
  50% { transform: scale(1.08); box-shadow: 0 0 14px rgba(34, 197, 94, 0.5); }
}

.language-flags {
  font-size: 13px;
  opacity: 0.7;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   2. PROGRESSION & REAGENTS SIDEBAR (220px)
   -------------------------------------------------------------------------- */
.sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.sidebar-card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-subtitle {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.btn-micro {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-muted);
  color: var(--accent-cyan);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--trans-fast);
}
.btn-micro:hover {
  background: var(--accent-primary);
  color: #fff;
}

.badge {
  font-size: 8px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}

.stage-badge {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Theme Affinity Card */
.theme-affinity-card {
  border-color: rgba(56, 189, 248, 0.3);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(23, 26, 34, 0.95) 100%);
  transition: var(--trans-fast);
}
.theme-affinity-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

.theme-icon-orb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid var(--accent-cyan);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.theme-tag {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Stage Card */
.stage-card {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(180deg, rgba(26, 21, 36, 0.8) 0%, rgba(23, 26, 34, 0.9) 100%);
}

.stage-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stage-title-row h3 {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-bright);
}
.stage-pct {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-amber);
}

.progress-bar-track {
  width: 100%;
  height: 5px;
  background: #282132;
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  transition: width 0.4s ease;
}

.stage-goal-row {
  font-size: 8px;
  color: var(--text-muted);
}

/* Reagents List */
.reagent-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.reagent-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  transition: var(--trans-fast);
}
.reagent-row:hover {
  border-color: var(--border-muted);
}

.reagent-left {
  display: flex;
  align-items: center;
  gap: 5px;
}
.reagent-glyph { font-size: 11px; }
.reagent-glyph.sulfur { color: var(--accent-amber); }
.reagent-glyph.salt { color: #f8fafc; }
.reagent-glyph.mercury { color: var(--accent-cyan); }
.reagent-glyph.vitriol { color: var(--accent-emerald); }

.reagent-name {
  font-size: 8.5px;
  color: var(--text-body);
}

.reagent-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.reagent-val {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  color: var(--text-bright);
}
.reagent-boost {
  font-size: 7.5px;
  color: var(--text-muted);
}

/* Metals List */
.metals-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 165px;
  overflow-y: auto;
  padding-right: 2px;
}
.metal-step {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  background: var(--bg-surface-2);
  border-radius: 5px;
  font-size: 8px;
  cursor: pointer;
  transition: var(--trans-fast);
}
.metal-step:hover {
  background: var(--bg-surface-3);
  border-color: var(--border-muted);
}
.metal-step.active {
  background: var(--bg-surface-sel);
  border: 1px solid var(--accent-primary);
}
.metal-step.mastered {
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: var(--accent-emerald);
}
.metal-label { color: var(--text-muted); }
.metal-step.active .metal-label { color: var(--accent-cyan); font-weight: 600; }
.metal-pct { font-family: var(--font-mono); color: var(--text-dim); }
.metal-pct.active { color: var(--accent-cyan); font-weight: 700; }
.metal-pct.gold { color: var(--accent-gold); }

/* Prestige Box */
.prestige-box {
  background: var(--bg-surface-frenzy);
  border-color: rgba(239, 68, 68, 0.3);
}
.prestige-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.prestige-title {
  font-size: 8px;
  font-weight: 700;
  color: #fca5a5;
}
.prestige-shards {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  color: var(--accent-crimson);
}
.prestige-desc {
  font-size: 7.5px;
  line-height: 1.25;
  color: #fca5a5;
  opacity: 0.8;
}
.btn-prestige {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--accent-crimson);
  color: #fca5a5;
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--trans-fast);
}
.btn-prestige:hover:not(:disabled) {
  background: var(--accent-crimson);
  color: #ffffff;
}
.btn-prestige:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   3. MAIN CENTER STAGE: CRUCIBLE & EVENT ARENA
   -------------------------------------------------------------------------- */
.center-arena {
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 18px;
  position: relative;
  overflow: hidden;
}

/* Top Currency Ribbon */
.top-ribbon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.essence-bank {
  display: flex;
  align-items: center;
  gap: 12px;
}

.essence-glyph-box {
  width: 40px;
  height: 40px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-muted);
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.15);
}

.essence-text-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.essence-amount-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.essence-count {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}

.essence-unit {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-primary);
  letter-spacing: 0.05em;
}

.essence-rates-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
}
.rate-eps { color: var(--accent-emerald); font-weight: 600; }
.rate-divider { color: var(--text-dim); }
.rate-epc { color: var(--accent-cyan); font-weight: 600; }
.rate-siphon { color: var(--text-dim); font-size: 9px; }

.ribbon-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.frenzy-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--bg-surface-frenzy);
  border: 1px solid var(--accent-crimson);
  border-radius: 6px;
  animation: pulseFrenzy 1.5s infinite alternate;
}
.frenzy-fire { font-size: 12px; }
.frenzy-label { font-size: 10px; font-weight: 700; color: #fca5a5; }
.frenzy-timer { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--accent-crimson); }

@keyframes pulseFrenzy {
  0% { box-shadow: 0 0 4px rgba(239, 68, 68, 0.3); }
  100% { box-shadow: 0 0 14px rgba(239, 68, 68, 0.7); }
}

.stats-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--trans-fast);
}
.stats-pill:hover { border-color: var(--border-muted); color: var(--text-bright); }

.notif-btn {
  width: 32px;
  height: 32px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: var(--trans-fast);
}
.notif-btn:hover { border-color: var(--border-muted); }
.bell-icon { font-size: 13px; opacity: 0.8; }
.notif-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  font-size: 7px;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 5px;
  background: var(--accent-primary);
  color: #ffffff;
}

/* Crucible Stage Component & Visual Themes */
.crucible-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  margin: 10px 0;
  background: radial-gradient(circle at center, rgba(23, 26, 34, 0.7) 0%, rgba(16, 18, 23, 0.95) 70%);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  transition: background 1.5s ease, border-color 0.8s ease;
}

/* Theme Skins & Atmospheric Overhauls */
.crucible-stage.theme-obsidian {
  background: radial-gradient(circle at center, #182338 0%, #0e1015 80%);
  border-color: rgba(14, 165, 233, 0.3);
}
.crucible-stage.theme-obsidian .cauldron-body {
  border-color: var(--accent-primary);
  box-shadow: 0 0 35px rgba(14, 165, 233, 0.35), inset 0 0 20px rgba(0, 0, 0, 0.8);
}
.crucible-stage.theme-obsidian .rune {
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(14, 165, 233, 0.8);
}
.crucible-stage.theme-obsidian .core-glyph {
  color: var(--accent-gold);
  text-shadow: 0 0 18px rgba(245, 158, 11, 0.8);
}

.crucible-stage.theme-amethyst {
  background: radial-gradient(circle at center, #2e1065 0%, #0d061a 80%);
  border-color: rgba(168, 85, 247, 0.5);
}
.crucible-stage.theme-amethyst .cauldron-body {
  border-color: #a855f7;
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.45), inset 0 0 25px rgba(0, 0, 0, 0.9);
}
.crucible-stage.theme-amethyst .rune {
  color: #c084fc;
  text-shadow: 0 0 12px rgba(192, 132, 252, 0.9);
}
.crucible-stage.theme-amethyst .core-glyph {
  color: #e879f9;
  text-shadow: 0 0 22px rgba(232, 121, 249, 0.9);
}

.crucible-stage.theme-emerald {
  background: radial-gradient(circle at center, #064e3b 0%, #041a14 80%);
  border-color: rgba(34, 197, 94, 0.5);
}
.crucible-stage.theme-emerald .cauldron-body {
  border-color: #22c55e;
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.45), inset 0 0 25px rgba(0, 0, 0, 0.9);
}
.crucible-stage.theme-emerald .rune {
  color: #4ade80;
  text-shadow: 0 0 12px rgba(74, 222, 128, 0.9);
}
.crucible-stage.theme-emerald .core-glyph {
  color: #86efac;
  text-shadow: 0 0 22px rgba(134, 239, 172, 0.9);
}

.crucible-stage.theme-glacial {
  background: radial-gradient(circle at center, #0c4a6e 0%, #031c2b 80%);
  border-color: rgba(56, 189, 248, 0.5);
}
.crucible-stage.theme-glacial .cauldron-body {
  border-color: #38bdf8;
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.45), inset 0 0 25px rgba(0, 0, 0, 0.9);
}
.crucible-stage.theme-glacial .rune {
  color: #7dd3fc;
  text-shadow: 0 0 12px rgba(125, 211, 252, 0.9);
}
.crucible-stage.theme-glacial .core-glyph {
  color: #bae6fd;
  text-shadow: 0 0 22px rgba(186, 230, 253, 0.9);
}

.crucible-stage.theme-solar {
  background: radial-gradient(circle at center, #451a03 0%, #1c0a02 80%);
  border-color: rgba(245, 158, 11, 0.5);
}
.crucible-stage.theme-solar .cauldron-body {
  border-color: #f59e0b;
  box-shadow: 0 0 45px rgba(245, 158, 11, 0.55), inset 0 0 25px rgba(0, 0, 0, 0.9);
}
.crucible-stage.theme-solar .rune {
  color: #fbbf24;
  text-shadow: 0 0 14px rgba(251, 191, 36, 0.95);
}
.crucible-stage.theme-solar .core-glyph {
  color: #fef08a;
  text-shadow: 0 0 25px rgba(254, 240, 138, 1);
}

/* Eclipse Dark Sky Effect */
.crucible-stage.eclipse-mode {
  background: radial-gradient(circle at center, #050608 0%, #000000 90%) !important;
  box-shadow: inset 0 0 50px rgba(251, 191, 36, 0.25);
}

/* Heat Gauge */
.heat-gauge {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  background: rgba(23, 26, 34, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-muted);
  border-radius: 16px;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}
.heat-icon { font-size: 11px; color: var(--accent-amber); }
.heat-text { font-size: 10px; font-weight: 700; color: var(--text-bright); }
.heat-strikes { font-family: var(--font-mono); font-size: 9px; color: var(--accent-cyan); }
.heat-meter-bar {
  width: 50px;
  height: 4px;
  background: #262b37;
  border-radius: 2px;
  overflow: hidden;
}
.heat-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #ef4444);
  transition: width 0.1s ease-out;
}

/* The Grand Crucible Cauldron */
.grand-crucible {
  width: 220px;
  height: 220px;
  position: relative;
  cursor: pointer;
  outline: none;
  margin: auto;
  align-self: center;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.06s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.06s ease;
}

.grand-crucible,
.grand-crucible * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.grand-crucible:active {
  transform: scale(0.965);
  filter: brightness(1.15) drop-shadow(0 0 12px rgba(14, 165, 233, 0.4));
}

.grand-crucible.rebound {
  animation: springRebound 0.25s var(--trans-bounce);
}

@keyframes springRebound {
  0% { transform: scale(0.965); }
  50% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

/* Tactile Subtle On-Pressed States */
.btn:active,
.rail-btn:active,
.rail-icon-btn:active,
.mobile-nav-btn:active {
  transform: scale(0.96);
  opacity: 0.92;
}

.upgrade-card:active,
.apparatus-card:active {
  transform: scale(0.985);
  filter: brightness(1.08);
}

/* Long Press / Hold Auto-Channeling Mode */
.grand-crucible.channeling {
  animation: crucibleChannelPulse 0.35s infinite alternate ease-in-out;
}
.grand-crucible.channeling .runic-ring {
  animation: rotateRunesFast 5s linear infinite;
  box-shadow: 0 0 25px var(--accent-cyan);
}
.grand-crucible.channeling .cauldron-body {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 35px var(--accent-primary), inset 0 0 25px rgba(14, 165, 233, 0.4);
}
.grand-crucible.channeling .core-glyph {
  transform: scale(1.15);
  text-shadow: 0 0 24px var(--accent-gold), 0 0 35px var(--accent-primary);
}

@keyframes crucibleChannelPulse {
  0% { transform: scale(0.97); }
  100% { transform: scale(1.02); }
}

@keyframes rotateRunesFast {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Runic Ring */
.runic-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  pointer-events: none;
  animation: rotateRunes 40s linear infinite;
}

@keyframes rotateRunes {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.runic-svg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.runic-symbols {
  position: absolute;
  width: 100%;
  height: 100%;
}
.rune {
  position: absolute;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  opacity: 0.6;
  text-shadow: 0 0 8px rgba(14, 165, 233, 0.6);
}
.rune.r1 { top: 4px; left: 50%; transform: translateX(-50%); }
.rune.r2 { top: 25%; right: 8px; }
.rune.r3 { bottom: 25%; right: 8px; }
.rune.r4 { bottom: 4px; left: 50%; transform: translateX(-50%); }
.rune.r5 { bottom: 25%; left: 8px; }
.rune.r6 { top: 25%; left: 8px; }

/* Cauldron Body & Liquid Pool */
.cauldron-body {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #252a36 0%, #12141a 70%);
  border: 3.5px solid var(--accent-primary);
  box-shadow: 0 0 30px rgba(14, 165, 233, 0.25), inset 0 0 20px rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.molten-pool {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.9);
  transition: background 0.8s ease;
}

/* Liquid Stage Colors */
.molten-pool.stage-nigredo {
  background: radial-gradient(circle at 50% 50%, #2a2530 0%, #121015 80%);
  border: 2px solid #4a4049;
}
.molten-pool.stage-albedo {
  background: radial-gradient(circle at 50% 50%, #3b82f6 0%, #172554 80%);
  border: 2px solid #93c5fd;
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.4), inset 0 0 20px rgba(0, 0, 0, 0.8);
}
.molten-pool.stage-citrinitas {
  background: radial-gradient(circle at 50% 50%, #b45309 0%, #451a03 80%);
  border: 2px solid #fbbf24;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.4), inset 0 0 20px rgba(0, 0, 0, 0.8);
}
.molten-pool.stage-rubedo {
  background: radial-gradient(circle at 50% 50%, #b91c1c 0%, #450a0a 80%);
  border: 2px solid #f87171;
  box-shadow: 0 0 45px rgba(239, 68, 68, 0.6), inset 0 0 20px rgba(0, 0, 0, 0.8);
}
.molten-pool.stage-azoth {
  background: radial-gradient(circle at 50% 50%, #7e22ce 0%, #2e1065 80%);
  border: 2px solid #d8b4fe;
  box-shadow: 0 0 50px rgba(168, 85, 247, 0.7), inset 0 0 20px rgba(0, 0, 0, 0.8);
}
.molten-pool.stage-ouroboros {
  background: radial-gradient(circle at 50% 50%, #047857 0%, #064e3b 80%);
  border: 2px solid #6ee7b7;
  box-shadow: 0 0 60px rgba(16, 185, 129, 0.8), inset 0 0 20px rgba(0, 0, 0, 0.8);
}

/* Liquid Bubbles & Ambient Steam */
.liquid-bubble {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.15);
  animation: bubbleRise 3s infinite ease-in-out;
}
.liquid-bubble.b1 { width: 8px; height: 8px; left: 25%; bottom: 20%; animation-delay: 0s; }
.liquid-bubble.b2 { width: 12px; height: 12px; right: 28%; bottom: 15%; animation-delay: 1.2s; }
.liquid-bubble.b3 { width: 6px; height: 6px; left: 48%; bottom: 10%; animation-delay: 2.1s; }
.liquid-steam {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@keyframes bubbleRise {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  50% { opacity: 0.6; }
  100% { transform: translateY(-35px) scale(1.2); opacity: 0; }
}

.crucible-core-symbol {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  text-align: center;
  z-index: 2;
}

.core-glyph {
  font-size: 38px;
  color: var(--accent-gold);
  text-shadow: 0 0 18px rgba(245, 158, 11, 0.8);
  transition: transform 0.2s ease;
  line-height: 1;
  text-align: center;
  display: block;
}
.grand-crucible:hover .core-glyph {
  transform: scale(1.1);
}

.click-hint {
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
  text-align: center;
  max-width: 78%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
  white-space: normal;
  line-height: 1.2;
}

.desktop-text {
  display: inline;
}
.mobile-text {
  display: none;
}

/* Floating Particles & Numbers Layer */
.particle-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

.floating-number {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(14, 165, 233, 0.8);
  animation: floatUp 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.floating-number.crit {
  font-size: 16px;
  color: var(--accent-crimson);
  text-shadow: 0 0 14px rgba(239, 68, 68, 0.9);
}

.floating-particle {
  position: absolute;
  font-size: 13px;
  animation: explodeParticle 0.7s ease-out forwards;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translate(-50%, 0) scale(0.8); }
  30% { transform: translate(-50%, -20px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -50px) scale(1); }
}

@keyframes explodeParticle {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.3); }
}

/* Magma Vent Node */
.magma-vent-btn {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: radial-gradient(circle, #f97316 0%, #7f1d1d 80%);
  border: 1.5px solid #fbbf24;
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  pointer-events: auto;
  z-index: 25;
  animation: pulseVent 1s infinite alternate;
}
@keyframes pulseVent {
  0% { transform: scale(0.9); }
  100% { transform: scale(1.15); box-shadow: 0 0 25px #f97316; }
}

/* Floating Philosopher's Wisp Target */
.wisp-container {
  position: absolute;
  z-index: 30;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.philosopher-wisp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  animation: floatWisp 2s infinite ease-in-out;
}
.wisp-core {
  font-size: 28px;
  filter: drop-shadow(0 0 15px #ffd700);
}
.wisp-tag {
  font-family: var(--font-ui);
  font-size: 7.5px;
  font-weight: 800;
  background: #f59e0b;
  color: #000000;
  padding: 1px 5px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
}
@keyframes floatWisp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Upgrades Catalysts Strip (Bottom) */
.upgrades-strip-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.strip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.strip-title-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.strip-icon { font-size: 11px; }
.strip-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.upgrade-count-badge {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.btn-link {
  background: none;
  border: none;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 600;
  color: var(--accent-primary);
  cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }

.upgrade-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  min-height: 46px;
}

.empty-upgrades-msg {
  grid-column: 1 / -1;
  font-size: 9px;
  color: var(--text-dim);
  text-align: center;
  padding: 10px;
}

.upgrade-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--trans-fast);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.upgrade-card:hover {
  border-color: var(--border-muted);
  background: var(--bg-surface-2);
}

.upgrade-card.affordable {
  border-color: var(--accent-primary);
  background: linear-gradient(135deg, var(--bg-surface-sel) 0%, var(--bg-surface-1) 100%);
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.2);
}
.upgrade-card.affordable:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.4);
}

.upgrade-card.locked {
  opacity: 0.65;
  cursor: pointer;
}

.upgrade-card.teaser {
  border: 1px dashed rgba(244, 63, 94, 0.4);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.05) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.upgrade-card.teaser:hover {
  border-color: rgba(244, 63, 94, 0.8);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.25);
}

.upgrade-card-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.upgrade-card-icon {
  font-size: 15px;
  flex-shrink: 0;
}
.upgrade-card-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.upgrade-card-title-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.upgrade-card-name {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}
.upgrade-card-lvl-pill {
  font-size: 7.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-rail);
  border: 1px solid var(--border-subtle);
  padding: 0 4px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.upgrade-card-desc {
  font-size: 8px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.upgrade-card-cost {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  color: var(--accent-emerald);
  flex-shrink: 0;
  white-space: nowrap;
}
.upgrade-card.locked .upgrade-card-cost {
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   4. 16-TIER APPARATUS STORE SIDEBAR (280px)
   -------------------------------------------------------------------------- */
.store-sidebar {
  border-right: none;
  background-color: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 8px;
}

.store-header {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.store-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.store-title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-bright);
}

.multiplier-control {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 2px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
}

.mult-btn {
  background: transparent;
  border: none;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  color: var(--text-dim);
  padding: 3px 0;
  cursor: pointer;
  transition: var(--trans-fast);
}
.mult-btn:hover {
  color: var(--text-bright);
  background: var(--bg-surface-2);
}
.mult-btn.active {
  background-color: var(--accent-primary);
  color: #ffffff;
}

.store-tabs {
  display: flex;
  gap: 3px;
}
.store-tab {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  padding: 3px 0;
  font-size: 8px;
  font-weight: 700;
  color: var(--text-dim);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--trans-fast);
}
.store-tab:hover {
  color: var(--text-muted);
  background: var(--bg-surface-2);
}
.store-tab.active {
  background: var(--bg-surface-1);
  border-color: var(--border-muted);
  color: var(--accent-cyan);
}

/* Apparatus List */
.apparatus-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  padding-right: 3px;
}

.apparatus-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.apparatus-card:hover {
  background: var(--bg-surface-2);
  border-color: var(--border-muted);
}

.apparatus-card.affordable {
  border-color: rgba(14, 165, 233, 0.4);
}
.apparatus-card.affordable:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-surface-sel);
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.25);
}

.apparatus-card.unaffordable {
  opacity: 0.55;
}

.apparatus-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.apparatus-glyph-box {
  width: 28px;
  height: 28px;
  background: var(--bg-surface-2);
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 13px;
}
.apparatus-card.affordable .apparatus-glyph-box {
  background: var(--bg-surface-sel);
  color: var(--accent-cyan);
}

.apparatus-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.apparatus-name-row {
  display: flex;
  align-items: center;
  gap: 3px;
}
.apparatus-name {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-bright);
}
.apparatus-count {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  color: var(--accent-primary);
}

.apparatus-eps {
  font-family: var(--font-mono);
  font-size: 7.5px;
  color: var(--accent-emerald);
}
.apparatus-card.unaffordable .apparatus-eps {
  color: var(--text-dim);
}

.apparatus-buy-pill {
  padding: 3px 6px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-muted);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  color: var(--text-dim);
  transition: var(--trans-fast);
}

.apparatus-card.affordable .apparatus-buy-pill {
  background: var(--bg-surface-sel);
  border-color: var(--accent-primary);
  color: var(--accent-cyan);
}

.apparatus-card.affordable:hover .apparatus-buy-pill {
  background: var(--accent-primary);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.4);
}

.store-footer {
  padding-top: 5px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.store-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
}
.store-stat-label { color: var(--text-dim); }
.store-stat-val { font-family: var(--font-mono); font-weight: 700; color: var(--accent-emerald); }

/* --------------------------------------------------------------------------
   5. MODAL & TOAST NOTIFICATIONS
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.modal-container {
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-active);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 14px 18px;
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-icon { font-size: 18px; }
.modal-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold);
}
.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  cursor: pointer;
}
.modal-close-btn:hover { color: var(--text-bright); }

.modal-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   6. MILESTONE AWAKENING MODAL STYLING
   -------------------------------------------------------------------------- */
.milestone-awakening-container {
  max-width: 560px;
  border: 2px solid var(--accent-gold);
  box-shadow: 0 0 60px rgba(245, 158, 11, 0.4), 0 25px 50px rgba(0, 0, 0, 0.95);
  background: radial-gradient(circle at top, #261f12 0%, #13161c 70%);
  animation: zoomAwakening 0.45s var(--trans-bounce);
}

@keyframes zoomAwakening {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.milestone-awakening-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 20px;
  gap: 14px;
}

.milestone-glyph-circle {
  width: 72px;
  height: 72px;
  border-radius: 36px;
  background: radial-gradient(circle, #f59e0b 0%, #78350f 80%);
  border: 2px solid #fbbf24;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 36px;
  animation: pulseGlyph 2s infinite ease-in-out;
}

@keyframes pulseGlyph {
  0%, 100% { transform: scale(1); box-shadow: 0 0 25px rgba(245, 158, 11, 0.6); }
  50% { transform: scale(1.08); box-shadow: 0 0 45px rgba(251, 191, 36, 0.9); }
}

.milestone-eyebrow {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.milestone-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.04em;
  text-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
}

.milestone-parchment {
  background: rgba(23, 26, 34, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 10.5px;
  line-height: 1.5;
  color: #e2e8f0;
  font-style: italic;
}

.milestone-unlocks-box {
  width: 100%;
  background: var(--bg-surface-sel);
  border: 1px solid var(--accent-primary);
  border-radius: 8px;
  padding: 10px 14px;
  text-align: left;
}

.milestone-unlocks-header {
  font-size: 9px;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 6px;
}

.milestone-unlocks-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 9.5px;
  color: var(--text-bright);
}

.milestone-quote {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold);
}

.milestone-btn {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
  color: #000;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
  transition: var(--trans-fast);
}
.milestone-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.8);
}

/* Toast Banner (Inside Clickable Area, at the Bottom) */
.toast-banner {
  position: absolute;
  bottom: 12px;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(23, 26, 34, 0.95);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--accent-primary);
  border-radius: 10px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(14, 165, 233, 0.35);
  z-index: 50;
  pointer-events: none;
  animation: slideUpToast 0.35s var(--trans-bounce);
  max-width: 90%;
  white-space: nowrap;
}
.toast-icon { font-size: 18px; }
.toast-text-col { display: flex; flex-direction: column; gap: 1px; }
.toast-title { font-size: 10px; font-weight: 700; color: var(--accent-cyan); }
.toast-desc { font-size: 8.5px; color: var(--text-body); }

@keyframes slideUpToast {
  0% { transform: translate(-50%, 25px); opacity: 0; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   7. COMPREHENSIVE RESPONSIVE & MOBILE DESIGN SYSTEM (<= 1024px)
   ========================================================================== */

.mobile-view-nav {
  display: none;
}

@media (max-width: 1024px) {
  /* Mobile Segmented Control Bar */
  .mobile-view-nav {
    display: flex;
    width: 100%;
    background: var(--bg-surface-1);
    border-bottom: 1px solid var(--border-subtle);
    padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 10px 10px;
    gap: 8px;
    z-index: 40;
    flex-shrink: 0;
    box-sizing: border-box;
  }
  .mobile-nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    min-height: 40px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--trans-fast);
    touch-action: manipulation;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-nav-btn.active {
    background: var(--bg-surface-sel);
    border-color: var(--accent-primary);
    color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.25);
  }
  .mobile-nav-icon {
    font-size: 14px;
  }

  /* Main Shell Adjustments */
  /* Main Shell Adjustments */
  #presentation-canvas {
    width: 100vw;
    height: 100dvh;
    height: 100vh;
  }

  .app-window {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100dvh;
    height: 100vh;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
  }

  /* Bottom Macro Action Rail */
  .macro-rail {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: calc(54px + env(safe-area-inset-bottom, 0px));
    flex-direction: row;
    justify-content: flex-start;
    padding: 4px 10px calc(4px + env(safe-area-inset-bottom, 0px)) 10px;
    border-right: none;
    border-top: 1px solid var(--border-subtle);
    background: rgba(13, 15, 20, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 100;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }
  .macro-rail::-webkit-scrollbar {
    display: none;
  }
  .rail-top {
    flex-direction: row;
    width: auto;
    gap: 4px;
  }
  .rail-logo {
    display: none;
  }
  .rail-nav {
    flex-direction: row;
    width: auto;
    gap: 4px;
  }
  .rail-bottom {
    flex-direction: row;
    width: auto;
    gap: 4px;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--border-subtle);
  }
  .rail-btn {
    width: 42px;
    height: 42px;
    font-size: 17px;
    flex-shrink: 0;
  }
  .rail-icon-btn {
    width: 42px;
    height: 42px;
    font-size: 17px;
    flex-shrink: 0;
  }
  .language-flags {
    display: none;
  }

  /* View Switching Logic */
  .app-window[data-mobile-view="crucible"] #center-arena {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
  }
  .app-window[data-mobile-view="crucible"] #store-sidebar,
  .app-window[data-mobile-view="crucible"] #progression-sidebar {
    display: none !important;
  }

  .app-window[data-mobile-view="store"] #store-sidebar {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    border: none;
  }
  .app-window[data-mobile-view="store"] #center-arena,
  .app-window[data-mobile-view="store"] #progression-sidebar {
    display: none !important;
  }

  .app-window[data-mobile-view="progression"] #progression-sidebar {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    border: none;
    overflow-y: auto;
  }
  .app-window[data-mobile-view="progression"] #center-arena,
  .app-window[data-mobile-view="progression"] #store-sidebar {
    display: none !important;
  }

  /* Center Arena Scaling & Scrolling */
  .center-arena {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    flex: 1;
    min-height: 0;
    padding: 6px 10px;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .top-ribbon {
    width: 100%;
    padding: 4px 4px 6px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
  }
  .essence-count {
    font-size: 17px;
  }
  .rate-eps, .rate-epc {
    font-size: 9.5px;
  }
  .frenzy-pill {
    padding: 2px 7px;
    font-size: 8px;
  }

  /* Responsive Centered Crucible Stage */
  .crucible-stage {
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 4px 0;
    padding: 0;
  }
  .grand-crucible {
    width: min(44vw, 175px);
    height: min(44vw, 175px);
    max-height: 25vh;
    margin: auto;
    align-self: center;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .runic-ring {
    width: 100%;
    height: 100%;
  }
  .cauldron-body {
    width: 100%;
    height: 100%;
  }
  .core-glyph {
    font-size: 36px;
  }

  /* Upgrades Catalysts Strip - Fully Visible on Mobile */
  .upgrades-strip-section {
    width: 100%;
    max-width: 100%;
    padding: 4px 0 6px 0;
    flex-shrink: 0;
    box-sizing: border-box;
    z-index: 10;
  }
  .upgrade-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    width: 100%;
    min-height: 40px;
  }
  .upgrade-card {
    padding: 5px 8px;
    min-height: 36px;
  }

  /* Mobile Text Variants & Sizing */
  .desktop-text {
    display: none !important;
  }
  .mobile-text {
    display: inline !important;
  }
  .click-hint {
    font-size: 7.5px;
    letter-spacing: 0.06em;
    max-width: 75%;
    margin-top: 2px;
    line-height: 1.15;
  }

  /* Modals - Mobile Sheet Mode */
  .modal-backdrop {
    padding: 8px;
    align-items: flex-end;
  }
  .modal-container {
    width: 100%;
    max-width: 100%;
    max-height: 86dvh;
    max-height: 86vh;
    border-radius: 16px 16px 8px 8px;
  }
  .modal-body {
    padding: 12px;
  }
  .modal-body > div[style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
  .modal-body > div[style*="display: flex; gap: 16px"] {
    flex-direction: column !important;
  }

  /* Toast Banner Position */
  .toast-banner {
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 94%;
    padding: 5px 12px;
    font-size: 8.5px;
  }
}

@media (max-width: 480px) {
  .essence-count {
    font-size: 15px;
  }
  .crucible-stage {
    min-height: 120px;
    margin: 2px 0;
  }
  .grand-crucible {
    width: min(40vw, 150px);
    height: min(40vw, 150px);
    max-height: 22vh;
  }
  .core-glyph {
    font-size: 30px;
  }
  .click-hint {
    font-size: 7px;
    max-width: 70%;
  }
  .upgrade-card-name {
    font-size: 8.5px;
  }
  .upgrade-card-desc {
    display: none;
  }
}

@media (max-height: 650px) {
  .crucible-stage {
    min-height: 100px;
    margin: 1px 0;
  }
  .grand-crucible {
    width: min(32vw, 120px);
    height: min(32vw, 120px);
    max-height: 18vh;
  }
  .top-ribbon {
    padding: 2px 4px 4px 4px;
  }
  .upgrades-strip-section {
    padding: 2px 0 4px 0;
  }
}

/* ==========================================================================
   GUIDED PROGRESSION QUEST BAR & SUBSYSTEM TEASER STYLES
   ========================================================================== */

.progression-guide-bar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.15);
  z-index: 20;
  max-width: 92%;
  width: 540px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.progression-guide-bar:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.7), 0 0 20px rgba(56, 189, 248, 0.3);
  transform: translateX(-50%) translateY(-1px);
}

.guide-icon-box {
  font-size: 22px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.6));
}

.guide-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.guide-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.guide-title {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-pct {
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-gold);
  white-space: nowrap;
}

.guide-desc {
  font-size: 10.5px;
  color: var(--text-bright);
  line-height: 1.3;
}

.guide-tag {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

/* Pulsing Glow Highlight Animation on Buttons */
.pulse-highlight {
  animation: pulseGlow 1.5s infinite alternate !important;
  position: relative;
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.4), inset 0 0 4px rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.6);
  }
  100% {
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.8), inset 0 0 8px rgba(245, 158, 11, 0.4);
    border-color: #f59e0b;
    transform: scale(1.04);
  }
}

/* Subsystem Teaser Card Styling */
.teaser-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 10px 4px;
}

.teaser-lock-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.2) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 2px solid var(--accent-crimson);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
  animation: lockPulse 2s infinite ease-in-out;
}

@keyframes lockPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 15px rgba(239, 68, 68, 0.3); }
  50% { transform: scale(1.05); box-shadow: 0 0 25px rgba(239, 68, 68, 0.6); }
}

.teaser-req-pill {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--accent-crimson);
  color: #fca5a5;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.teaser-progress-bar-box {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.teaser-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-surface-2);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.teaser-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8 0%, #f59e0b 100%);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.teaser-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.teaser-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 6px;
  text-align: left;
}

.teaser-feature-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.teaser-feature-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 6px;
}

.teaser-feature-desc {
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Alchemical Pimpified Teaser Continue Button */
.teaser-continue-btn {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 50%, #0f172a 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.6);
  color: #fff;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 28px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 10px;
}

.teaser-continue-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-25deg);
  animation: alchemicalSweep 3s infinite;
}

@keyframes alchemicalSweep {
  0% { left: -100%; }
  35%, 100% { left: 200%; }
}

.teaser-continue-btn:hover {
  border-color: #38bdf8;
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(-2px) scale(1.02);
}

.teaser-continue-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
}

.teaser-continue-btn .btn-spark {
  color: var(--accent-gold);
  font-size: 13px;
  filter: drop-shadow(0 0 4px #fbbf24);
  animation: sparkTwinkle 1.8s infinite ease-in-out;
}

@keyframes sparkTwinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.25) rotate(15deg); opacity: 1; filter: drop-shadow(0 0 8px #fbbf24); }
}


/* Metal SVG Vector Icons (Bespoke Monoline Alchemical Icons) */
.metal-icon-svg-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform var(--trans-fast);
}

.metal-svg-icon {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.4));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.metal-step:hover .metal-svg-icon,
.metal-icon-svg-wrap:hover .metal-svg-icon {
  transform: scale(1.18) rotate(6deg);
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.8));
}

.jovian-tin-icon { filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.6)); }
.venusian-copper-icon { filter: drop-shadow(0 0 6px rgba(251, 113, 133, 0.6)); }
.lunar-silver-icon { filter: drop-shadow(0 0 6px rgba(226, 232, 240, 0.6)); }
.solar-gold-icon { filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.7)); }
.hyperborean-electrum-icon { filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.7)); }
.stellar-adamant-icon { filter: drop-shadow(0 0 8px rgba(192, 132, 252, 0.7)); }
.atlantean-orichalcum-icon { filter: drop-shadow(0 0 8px rgba(244, 63, 94, 0.7)); }
.cosmic-azoth-icon { filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.8)); }
