/* Empire Builder - Side Hustle Grind
   Version: 2.0.1 (Regal Theme + W/S Scroll)
   Regal theme with gold accents, deep maroon background */

:root {
  /* Base vars (will be overridden by theme) */
  --bg-gradient: linear-gradient(135deg, #2c0e0e 0%, #1a0808 100%);
  --primary-color: #d4af37;
  --secondary-color: #aa8c2c;
  --accent-color: #fceeb5;
  --card-bg: rgba(0, 0, 0, 0.6);
  --text-primary: #ffffff;
  --text-secondary: #e0d5b0;
  --btn-gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  --success-color: #4ade80;
}

/* Theme: Sunset */
.theme-sunset {
  --bg-gradient: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 50%, #fffbe6 100%);
  --primary-color: #fb923c;
  --secondary-color: #f97316;
  --accent-color: #fff7ed;
  --card-bg: rgba(0, 0, 0, 0.4);
}

/* Theme: Ocean */
.theme-ocean {
  --bg-gradient: linear-gradient(135deg, #0c4a6e 0%, #075985 50%, #cffafe 100%);
  --primary-color: #38bdf8;
  --secondary-color: #0ea5e9;
  --accent-color: #f0f9ff;
  --card-bg: rgba(0, 0, 0, 0.4);
}

/* Theme: Forest */
.theme-forest {
  --bg-gradient: linear-gradient(135deg, #064e3b 0%, #047857 50%, #d1fae5 100%);
  --primary-color: #34d399;
  --secondary-color: #10b981;
  --accent-color: #ecfdf5;
  --card-bg: rgba(0, 0, 0, 0.4);
}

/* Theme: Neon */
.theme-neon {
  --bg-gradient: linear-gradient(135deg, #4c1d95 0%, #6d28d9 50%, #f5d0fe 100%);
  --primary-color: #e879f9;
  --secondary-color: #d8b4fe;
  --accent-color: #faf5ff;
  --card-bg: rgba(0, 0, 0, 0.4);
}

/* Theme: Gray */
.theme-gray {
  --bg-gradient: linear-gradient(135deg, #1f2937 0%, #374151 50%, #9ca3af 100%);
  --primary-color: #d1d5db;
  --secondary-color: #9ca3af;
  --accent-color: #f3f4f6;
  --card-bg: rgba(0, 0, 0, 0.4);
}

/* Regal Theme (Default for Empire Builder) */
.theme-regal {
  --bg-gradient: linear-gradient(135deg, #2c0e0e 0%, #1a0808 50%, #1f120b 100%);
  --primary-color: #d4af37;
  --secondary-color: #aa8c2c;
  --accent-color: #fceeb5;
  --card-bg: rgba(0, 0, 0, 0.6);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Theme Bar */
.theme-bar {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 16px;
  border-radius: 50px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.theme-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.2);
}

.theme-btn.active {
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 10px var(--primary-color), inset 0 0 5px var(--primary-color);
}

/* Header */
.game-header {
  text-align: center;
  padding: 32px 24px 24px;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 100%);
}

.game-header h1 {
  font-size: 2.5rem;
  color: var(--primary-color);
  text-shadow: 0 0 10px var(--secondary-color), 0 0 20px rgba(0,0,0,0.8);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  opacity: 0.9;
}

#prestige-display {
  background: linear-gradient(45deg, #a855f7, #7c3aed);
  padding: 8px 16px;
  border-radius: 50px;
  margin-top: 16px;
  display: inline-block;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

/* Main Game Area */
.game-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.clicker-section {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 32px;
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 0 2px rgba(0,0,0,0.3);
}

.cash-register {
  width: 160px;
  height: 140px;
  margin: 0 auto 32px;
  background: linear-gradient(135deg, #fff 0%, var(--accent-color) 100%);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(255,255,255,0.3);
}

.cash-register:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(255,255,255,0.4);
}

.cash-register:active {
  transform: translateY(2px) scale(0.98);
}

.cash-register svg {
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  animation: pulse-gold 3s ease-in-out infinite;
}

@keyframes pulse-gold {
  0%, 100% { filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)); }
  50% { filter: drop-shadow(0 0 20px var(--primary-color)) drop-shadow(0 4px 8px rgba(0,0,0,0.3)); }
}

.register-label {
  margin-top: 16px;
  font-weight: 700;
  color: #4a3b2a;
  letter-spacing: 1px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: linear-gradient(135deg, rgba(0,0,0,0.4), rgba(0,0,0,0.6));
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  border: 1px solid rgba(212, 175, 55, 0.3);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border-color: var(--primary-color);
}

.stat-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

/* Equipment Upgrades Section */
.upgrades-section {
  margin-bottom: 32px;
}

.upgrades-section h2 {
  color: var(--primary-color);
  font-size: 1.4rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(212, 175, 55, 0.3);
  letter-spacing: 1px;
}

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

.upgrade-card {
  background: linear-gradient(135deg, rgba(0,0,0,0.4), rgba(0,0,0,0.6));
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s ease;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.upgrade-card:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
  border-color: var(--primary-color);
  transform: translateX(4px);
}

.upgrade-card.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.upgrade-card.disabled:hover {
  background: linear-gradient(135deg, rgba(0,0,0,0.4), rgba(0,0,0,0.6));
  transform: none;
}

.upgrade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.upgrade-name {
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.upgrade-cost {
  color: var(--primary-color);
  font-weight: 700;
  background: rgba(212, 175, 55, 0.1);
  padding: 4px 12px;
  border-radius: 8px;
}

.upgrade-stats {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-left: 0;
}

/* Prestige Section */
.prestige-section {
  margin-top: 32px;
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(212, 175, 55, 0.3);
}

.btn-prestige {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: white;
  border: none;
  padding: 16px 48px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
  letter-spacing: 1px;
}

.btn-prestige:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(168, 85, 247, 0.6);
}

.prestige-info {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Game Log */
.game-log {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 24px;
  padding: 24px;
  max-height: 500px;
  display: flex;
  flex-direction: column;
  margin-top: 24px;
}

.game-log h3 {
  color: var(--primary-color);
  margin-bottom: 16px;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

#log-container {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.log-entry {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}

.log-entry:first-child {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Animations */
@keyframes cashPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.cash-pop {
  animation: cashPop 0.3s ease;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(1.2);
  }
}

.float-up-text {
  animation: floatUp 1s ease-out forwards;
}

/* Scrollbar */
#log-container::-webkit-scrollbar {
  width: 8px;
}
#log-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}
#log-container::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .game-header h1 { font-size: 2rem; }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .cash-register { width: 140px; height: 120px; }
}
