/* ==========================================================================
   Building Empire Clicker - Modern Glassmorphic Cyber-Construction Theme
   ========================================================================== */

:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --panel-bg: rgba(17, 24, 39, 0.78);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-border-bright: rgba(56, 189, 248, 0.3);

  --accent-gold: #fbbf24;
  --accent-gold-glow: rgba(251, 191, 36, 0.4);
  --accent-amber: #f59e0b;
  --accent-cyan: #38bdf8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.4);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.35);
  --accent-ruby: #ef4444;
  --accent-fever: #ff5722;
  --accent-fever-glow: rgba(255, 87, 34, 0.5);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-sans: 'Outfit', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;

  --shadow-elevated: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.1);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
  --transition-smooth: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(245, 158, 11, 0.07) 0%, transparent 45%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  background-position: 0 0, 0 0, -1px -1px, -1px -1px;
}

/* Base App Layout */
#game-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1600px;
  margin: 0 auto;
  padding: 14px 20px;
  gap: 14px;
}

/* ==========================================================================
   Header Bar
   ========================================================================== */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 10px 20px;
  box-shadow: var(--shadow-card);
  gap: 16px;
  flex-wrap: wrap;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px var(--accent-gold-glow));
  animation: floatSubtle 4s ease-in-out infinite;
}

.logo-text h1 {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #fff 30%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.logo-text .subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-cyan);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--panel-border);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
}

.money-badge {
  border-color: rgba(251, 191, 36, 0.35);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.12);
}

.money-badge .badge-value {
  color: var(--accent-gold);
  font-size: 1.4rem;
  font-weight: 900;
  text-shadow: 0 0 12px var(--accent-gold-glow);
}

.cps-badge {
  border-color: rgba(56, 189, 248, 0.35);
}

.cps-badge .badge-value {
  color: var(--accent-cyan);
  font-size: 1.15rem;
  font-weight: 800;
}

.badge-icon {
  font-size: 1.4rem;
}

.badge-content {
  display: flex;
  flex-direction: column;
}

.badge-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: var(--transition-smooth);
}

.icon-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.icon-btn.danger-hover:hover {
  border-color: var(--accent-ruby);
  background: rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   Main Layout: Split Stage & Sidebar
   ========================================================================== */
.game-main {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 16px;
  flex: 1;
  min-height: 0; /* Important for inner scrollbars */
}

/* ==========================================================================
   Left Section: Building Stage
   ========================================================================== */
.stage-section {
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  gap: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* Building Info Header */
.building-info-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.tier-pill {
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.building-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  flex: 1;
  letter-spacing: -0.5px;
}

.blueprint-selector-btn {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.blueprint-selector-btn:hover {
  background: var(--accent-cyan);
  color: #04101e;
  box-shadow: 0 0 14px var(--accent-cyan-glow);
}

.building-sub-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

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

.highlight-cyan {
  color: var(--accent-cyan);
}

/* Viewport / Interactive Building Stage */
.viewport-wrapper {
  flex: 1;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: radial-gradient(circle at center 65%, #182847 0%, #0c1424 75%, #070c16 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
  min-height: 280px;
}

.construction-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image: 
    radial-gradient(ellipse at 50% 100%, rgba(56, 189, 248, 0.2) 0%, transparent 60%);
}

.crane-silhouette {
  position: absolute;
  right: 15px;
  top: 15px;
  width: 90px;
  height: 120px;
  border-left: 2px dashed rgba(56, 189, 248, 0.35);
  border-top: 2px solid rgba(56, 189, 248, 0.4);
}

.crane-silhouette::after {
  content: '';
  position: absolute;
  top: 0;
  right: 10px;
  width: 1px;
  height: 45px;
  background: rgba(251, 191, 36, 0.6);
  animation: cableSway 3s ease-in-out infinite alternate;
}

/* Interactive Clickable Building Container */
.building-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transform-origin: bottom center;
  transition: transform 0.08s ease-out;
}

.building-container:active {
  transform: scale(0.94) translateY(6px);
}

.building-art-frame {
  width: 92%;
  height: 92%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.7));
  transition: filter 0.3s ease;
}

.building-art-frame svg {
  width: 100%;
  height: 100%;
  max-height: 380px;
  overflow: visible;
}

/* Complete Banner */
.complete-banner {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  opacity: 0;
  transition: var(--transition-bounce);
  pointer-events: none;
  z-index: 20;
  text-align: center;
}

.complete-banner.active {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

.banner-ribbon {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  padding: 8px 24px;
  border-radius: var(--radius-full);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.8);
  letter-spacing: 1px;
  animation: pulseRibbon 1.5s infinite alternate;
}

.banner-sub {
  font-size: 0.8rem;
  color: var(--accent-gold);
  margin-top: 4px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
  font-weight: 700;
}

/* Floating Sell Action Button */
.sell-action-btn {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 2px solid #34d399;
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 30;
  box-shadow: 0 0 30px var(--accent-emerald-glow), 0 8px 25px rgba(0, 0, 0, 0.5);
  transition: var(--transition-bounce);
}

.sell-action-btn:hover {
  transform: translateX(-50%) scale(1.06);
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 0 45px rgba(52, 211, 153, 0.7);
}

.sell-action-btn:active {
  transform: translateX(-50%) scale(0.96);
}

.sell-icon {
  font-size: 1.6rem;
}

.sell-text-group {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.sell-main-title {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.sell-payout-amount {
  font-size: 0.85rem;
  color: #d1fae5;
  font-weight: 700;
}

/* Click Ripple Ring */
.click-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transform: scale(0);
  opacity: 0;
  border: 3px solid var(--accent-cyan);
}

.click-ripple.animate {
  animation: shockwave 0.5s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

/* Floating Effects & Particle Overlay */
.fx-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 25;
}

.floating-text {
  position: absolute;
  font-weight: 900;
  pointer-events: none;
  animation: floatFade 0.85s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.floating-text.normal {
  font-size: 1.25rem;
  color: var(--accent-cyan);
}

.floating-text.crit {
  font-size: 1.6rem;
  color: #fbbf24;
  text-shadow: 0 0 15px rgba(251, 191, 36, 0.8), 0 2px 10px rgba(0,0,0,0.9);
}

.spark-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: sparkBurst 0.6s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}

/* ==========================================================================
   Progress & Fever Bars
   ========================================================================== */
.progress-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-bar-wrapper {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.progress-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.progress-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.progress-number {
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 14px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7 0%, var(--accent-cyan) 60%, var(--accent-gold) 100%);
  border-radius: var(--radius-full);
  position: relative;
  transition: width 0.12s linear;
  box-shadow: 0 0 12px var(--accent-cyan-glow);
}

.progress-glow {
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 100%;
  background: #fff;
  filter: blur(4px);
  opacity: 0.8;
}

.progress-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Fever Gauge */
.fever-gauge-wrapper {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  transition: var(--transition-smooth);
}

.fever-gauge-wrapper.active-fever {
  border-color: var(--accent-fever);
  background: rgba(255, 87, 34, 0.12);
  box-shadow: 0 0 20px var(--accent-fever-glow);
  animation: feverPulse 1s infinite alternate;
}

.fever-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.fever-gauge-wrapper.active-fever .fever-label {
  color: #ff7849;
  font-weight: 900;
}

.fever-track {
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.fever-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  border-radius: var(--radius-full);
  transition: width 0.1s linear;
}

/* ==========================================================================
   Right Section: Sidebar & Upgrades
   ========================================================================== */
.sidebar-section {
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* Sidebar Tab Navigation */
.sidebar-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid var(--panel-border);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  border-bottom: 2px solid transparent;
}

.tab-btn .tab-icon {
  font-size: 1.15rem;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

/* Tab Content Areas */
.tab-content {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 14px;
  overflow-y: auto;
  gap: 12px;
}

.tab-content.active {
  display: flex;
}

.upgrade-list-header {
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 8px;
}

.upgrade-list-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.upgrade-list-header p {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Upgrade Item Cards */
.upgrade-list, .blueprint-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upgrade-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.upgrade-card:hover:not(.disabled) {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(30, 41, 59, 0.65);
  transform: translateX(4px);
}

.upgrade-card.disabled {
  opacity: 0.48;
  filter: grayscale(0.5);
  cursor: not-allowed;
}

.upgrade-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.upgrade-card-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

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

.upgrade-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upgrade-level {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.upgrade-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.upgrade-effect {
  font-size: 0.73rem;
  color: var(--accent-emerald);
  font-weight: 700;
}

.upgrade-buy-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #111827;
  font-weight: 900;
  font-size: 0.82rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 86px;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.upgrade-buy-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 0 14px var(--accent-gold-glow);
  transform: translateY(-1px);
}

.upgrade-buy-btn:disabled {
  background: rgba(71, 85, 105, 0.4);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
}

/* Blueprint Cards */
.blueprint-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: var(--transition-smooth);
  cursor: pointer;
  position: relative;
}

.blueprint-card:hover:not(.locked) {
  border-color: var(--accent-cyan);
  background: rgba(30, 41, 59, 0.65);
  transform: translateX(4px);
}

.blueprint-card.selected {
  border-color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.08);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.15);
}

.blueprint-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

.blueprint-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.blueprint-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.blueprint-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blueprint-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}

.blueprint-metrics {
  display: flex;
  gap: 12px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.blueprint-tag {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.blueprint-tag.active {
  background: var(--accent-gold);
  color: #000;
}

.blueprint-tag.unlocked {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
}

.blueprint-tag.locked-tag {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-dim);
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 20, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-window {
  background: var(--bg-secondary);
  border: 1px solid var(--panel-border-bright);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--panel-border);
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-card-val {
  font-size: 1.15rem;
  font-weight: 800;
}

.text-center {
  text-align: center;
}

.offline-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.offline-reward-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
}

.action-btn-large {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  border: none;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  padding: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.action-btn-large:hover {
  box-shadow: 0 0 20px var(--accent-cyan-glow);
  transform: translateY(-2px);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes floatSubtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes cableSway {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(2deg); }
}

@keyframes pulseRibbon {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.04); filter: brightness(1.15); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 25px var(--accent-emerald-glow); }
  50% { box-shadow: 0 0 45px rgba(52, 211, 153, 0.8); }
}

.pulse-glow {
  animation: pulseGlow 1.8s infinite ease-in-out;
}

@keyframes shockwave {
  0% {
    width: 20px;
    height: 20px;
    opacity: 0.9;
    transform: scale(0.2);
  }
  100% {
    width: 220px;
    height: 220px;
    opacity: 0;
    transform: scale(1.5);
  }
}

@keyframes floatFade {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.9);
  }
  50% {
    transform: translateY(-35px) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translateY(-65px) scale(1);
  }
}

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

@keyframes feverPulse {
  0% { box-shadow: 0 0 10px var(--accent-fever-glow); }
  100% { box-shadow: 0 0 25px rgba(255, 87, 34, 0.8); }
}

@keyframes modalPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Custom Scrollbar for sidebar */
.tab-content::-webkit-scrollbar {
  width: 6px;
}

.tab-content::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}

.tab-content::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-full);
}

.tab-content::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 900px) {
  #game-app {
    height: auto;
    min-height: 100vh;
    padding: 10px;
  }

  .game-main {
    grid-template-columns: 1fr;
    height: auto;
  }

  .viewport-wrapper {
    min-height: 320px;
  }

  .sidebar-section {
    max-height: 520px;
  }
}
