:root {
  --color-primary: #38bdf8;
  --color-primary-dark: #0ea5e9;
  --color-bg: #0f172a;
  --color-bg-dark: #111827;
  --color-accent: #f43f5e;
  --color-text: #e2e8f0;
  --color-text-light: #bae6fd;
  --color-success: #22c55e;
  --color-warning: #facc15;
  --color-danger: #ef4444;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050712;
  color: #f1f5f9;
}

.game-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

.game-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.game-header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.stat {
  background: #0f172a;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  min-width: 140px;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: #94a3b8;
}

.stat-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.game-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.rigs-panel,
.upgrades-panel {
  background: #020617;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem 1.25rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
}

.rigs-panel h2,
.upgrades-panel h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.rigs-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.rig-row {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr auto;
  gap: 0.5rem;
  align-items: center;
  background: #020617;
  border-radius: 0.5rem;
  border: 1px solid #1e293b;
  padding: 0.5rem 0.75rem;
}

.rig-row>.rig-progress-container {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
}

.rig-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.rig-name-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rig-meta {
  font-size: 0.8rem;
  color: #9ca3af;
}

.rig-label {
  display: block;
}

.rig-value {
  display: block;
  color: #e5e7eb;
}

.btn-upgrade {
  background: #22c55e;
  color: #022c22;
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.05s ease, background 0.1s ease;
}

.btn-upgrade:hover {
  background: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(34, 197, 94, 0.4);
}

.btn-upgrade:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
  transform: none;
}

/* Overdrive button explicit disabled style */
.btn-boost.is-disabled,
.btn-boost:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
  transform: none;
  filter: grayscale(0.4);
}

.upgrade {
  border-radius: 0.5rem;
  border: 1px solid #1e293b;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.upgrade-info h3 {
  margin: 0;
  font-size: 0.95rem;
}

.upgrade-info p {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  color: #9ca3af;
}

.upgrade-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.upgrade-cost {
  font-size: 0.8rem;
  color: #e5e7eb;
}

.btn-danger {
  width: 100%;
  margin-top: 0.5rem;
  background: #ef4444;
  color: #fee2e2;
  border: none;
  border-radius: 0.5rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger:hover {
  background: #b91c1c;
}

.offline-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0.75rem;
  margin-inline: auto;
  max-width: 650px;
  background: #0f172a;
  border-radius: 999px;
  border: 1px solid #22c55e;
  padding: 0.4rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.8);
}

.offline-banner.hidden {
  display: none;
}

#offline-close {
  background: transparent;
  border: none;
  color: #bbf7d0;
  cursor: pointer;
  font-weight: 600;
}

.click-upgrade-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.click-upgrade-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.click-buy-qty {
  display: flex;
  gap: 0.25rem;
}

.btn-qty {
  border: none;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  cursor: pointer;
  background: #0f172a;
  color: #e5e7eb;
  opacity: 0.7;
  transition: background 0.1s ease, opacity 0.1s ease, transform 0.05s ease;
}

.btn-qty:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.btn-qty.is-active {
  background: #22c55e;
  color: #022c22;
  opacity: 1;
}

/* Info Tooltip */
.info-tooltip {
  cursor: pointer;
  color: #94a3b8;
  font-size: 0.85em;
  position: relative;
  display: inline-block;
  user-select: none;
}

.info-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: #1e293b;
  color: #e2e8f0;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  white-space: nowrap;
  max-width: 250px;
  white-space: normal;
  width: max-content;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 1000;
}

.info-tooltip::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 1000;
}

.info-tooltip.is-active::after,
.info-tooltip.is-active::before {
  opacity: 1;
  visibility: visible;
}

.click-upgrade-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.rig-name-inner {
  display: flex;
  flex-direction: column;
  /* stack name + svg */
  align-items: flex-start;
  /* or center if you want: center */
  gap: 0.35rem;
}

.rig-icon-svg {
  display: inline-block;
  width: 72px;
  /* or whatever size you like */
  height: auto;
  transform-box: fill-box;
  transform-origin: center center;
  transition: filter 0.2s ease;
  position: relative;
}

.rig-icon-cogs {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.rig-icon-svg.is-mining .rig-icon-cogs {
  opacity: 1;
}

.rig-icon-cogs path {
  animation: lightning-pulse 1s ease-in-out infinite;
}

@keyframes lightning-pulse {

  0%,
  100% {
    opacity: 0.8;
  }

  50% {
    opacity: 1;
    filter: drop-shadow(0 0 4px #facc15);
  }
}

/* Constant “on” glow when rig has at least 1 level */
.rig-icon-svg.rig-icon-on {
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.7));
}

/* Burst pulse when upgraded */
@keyframes rigActivatePulse {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(34, 197, 94, 0));
  }

  40% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 14px rgba(34, 197, 94, 0.9));
  }

  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(34, 197, 94, 0));
  }
}

.rig-icon-svg.rig-icon-burst {
  animation: rigActivatePulse 0.35s ease-out;
}


.rig-name-label {
  font-weight: 600;
}


@media (max-width: 768px) {
  .game-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .rig-row {
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: auto auto;
  }

  .rig-meta:nth-child(2) {
    order: 2;
  }

  .rig-meta:nth-child(3) {
    order: 3;
  }

  .rig-row .btn-upgrade {
    order: 4;
    justify-self: end;
    margin-top: 0.15rem;
  }
}

/* Manual miner button: extra juice */
.btn-mine {
  position: relative;
  overflow: hidden;
}

/* Press / glow animation */
@keyframes mine-press {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(34, 197, 94, 0.0);
  }

  30% {
    transform: translateY(1px) scale(0.96);
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.7);
  }

  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(34, 197, 94, 0.0);
  }
}

.btn-mine--anim {
  animation: mine-press 0.18s ease-out;
}

/* Optional: subtle ripple effect on click */
.btn-mine::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at center, rgba(190, 242, 100, 0.4), transparent 60%);
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
}

@keyframes mine-ripple {
  0% {
    opacity: 0.6;
    transform: scale(0.4);
  }

  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}

.btn-mine--ripple::after {
  animation: mine-ripple 0.25s ease-out;
}

/* Per-rig boost controls inside rig row */
.rig-boost-controls {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
}

.btn-rig-boost {
  border: none;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  background: #38bdf8;
  color: #0b1120;
  transition: transform 0.05s ease, box-shadow 0.05s ease, background 0.1s ease;
}

.btn-rig-boost:hover {
  background: #0ea5e9;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(56, 189, 248, 0.5);
}

.btn-rig-boost:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.rig-boost-text {
  color: #9ca3af;
}

.rig-progress-container {
  width: 100%;
  height: 6px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.rig-row>.rig-progress-container {
  width: 100%;
}

.rig-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

/* ===== SIDE PANEL ===== */

.side-panel-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1001;
  background: #1e293b;
  /* requested background */
  color: #e2e8f0;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 1.0rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.45);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.side-panel-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.6);
}

/* Left variant of the side panel toggle */
.side-panel-toggle-left {
  left: 1rem;
  right: auto;
}

/* Toggle contents: icon + label */
.side-panel-toggle .toggle-icon {
  display: none;
  /* hide icon as requested */
}

.side-panel-toggle .toggle-label {
  margin-left: 0.25rem;
  font-size: 0.95rem;
  display: inline-block;
  vertical-align: middle;
  color: #e2e8f0;
}

.side-panel-toggle .toggle-icon {
  display: block;
}

.side-panel-toggle.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.side-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
}

.side-panel-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 90vw;
  height: 100vh;
  background: #0a0f1e;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.side-panel.is-open {
  transform: translateX(0);
}

/* Left panel shares the same visual style but opens from the left */
/* Fix left panel visibility and stacking */
.left-panel {
  left: 0;
  right: auto;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  transform: translateX(-100%);
  z-index: 1002 !important;
  border-left: 3px solid #38bdf8;
}

.left-panel.is-open {
  transform: translateX(0) !important;
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #020617;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}

.side-panel-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #f1f5f9;
}

.side-panel-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.side-panel-close:hover {
  color: #f1f5f9;
}

.side-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

/* ===== ACCORDION ===== */

.accordion {
  margin-bottom: 0.75rem;
  border: 1px solid #1e293b;
  border-radius: 0.5rem;
  background: #020617;
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  background: #0f172a;
  border: none;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
  transition: background 0.2s ease;
}

.accordion-header:hover {
  background: #1e293b;
}

.accordion-icon {
  font-size: 0.75rem;
  color: #94a3b8;
  transition: transform 0.3s ease;
}

.accordion.is-open .accordion-icon {
  transform: rotate(-180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1rem;
}

.accordion.is-open .accordion-content {
  max-height: 2000px;
  padding: 1rem;
}

/* ===== TABS ===== */

.tabs-container {
  margin: 0;
  display: flex;
  gap: 1.5rem;
}

.tabs-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-right: 2px solid #1e293b;
  padding-right: 1rem;
  min-width: 150px;
}

.tab-button {
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-right: 3px solid transparent;
  margin-right: -2px;
  transition: all 0.2s ease;
  text-align: left;
  border-radius: 0.5rem 0 0 0.5rem;
}

.tab-button:hover {
  color: #f1f5f9;
  background: #0f172a;
}

.tab-button.active {
  color: #38bdf8;
  border-right-color: #38bdf8;
  background: #0f172a;
}

.tabs-content {
  min-height: 100px;
  flex: 1;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Rack grid styles removed - now using mining grid */

.rigs-container-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Extra crit animation for manual miner */
@keyframes mine-crit {
  0% {
    box-shadow: 0 0 0 rgba(248, 250, 252, 0);
  }

  20% {
    box-shadow: 0 0 24px rgba(248, 250, 252, 0.9);
  }

  100% {
    box-shadow: 0 0 0 rgba(248, 250, 252, 0);
  }
}

.btn-mine--crit {
  animation: mine-crit 0.2s ease-out;
}

.click-miner-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.click-miner-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.click-miner-svg {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.4));
  transition: transform 0.15s ease-out, filter 0.15s ease-out;
}

.click-miner-svg.click-icon-burst {
  animation: clickMinerHit 0.25s ease-out;
}

@keyframes clickMinerHit {
  0% {
    transform: translateY(0) rotate(-8deg) scale(1);
  }

  40% {
    transform: translateY(2px) rotate(4deg) scale(1.05);
  }

  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

#dc2-status {
  margin-left: 0.75rem;
}

/* Purchased Miners Accordion & Carousel */
.purchased-miners-accordion {
  margin-bottom: 1rem;
}

.miners-carousel-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
}

/* Inventory Internal Tabs */
.inventory-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #1e293b;
  padding-bottom: 0.5rem;
}

.inventory-tab-button {
  flex: 1;
  padding: 0.5rem 1rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.375rem;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.inventory-tab-button:hover {
  background: rgba(51, 65, 85, 0.7);
  border-color: rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
}

.inventory-tab-button.active {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  border-color: #0ea5e9;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.3);
}

.inventory-tab-panel {
  display: none;
}

.inventory-tab-panel.active {
  display: block;
}

.carousel-arrow {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #94a3b8;
  z-index: 2;
}

.carousel-arrow:hover:not(:disabled) {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(148, 163, 184, 0.5);
  color: #cbd5e1;
}

.carousel-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.carousel-arrow svg {
  width: 20px;
  height: 20px;
}

.miners-slider {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 0.25rem;
  min-height: 80px;
  align-items: center;
  flex: 1;
  min-width: 0;
  max-width: calc(14 * 60px + 13 * 0.5rem + 1rem);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.miners-slider::-webkit-scrollbar {
  display: none;
}

.miner-slot {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 0.25rem;
  cursor: grab;
  transition: all 0.2s ease;
}

.miner-slot:active {
  cursor: grabbing;
}

.miner-slot:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(148, 163, 184, 0.5);
  transform: translateY(-2px);
}

.miner-slot svg {
  width: 45px;
  height: 45px;
  filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.3));
  pointer-events: none;
}

/* Rack Shelves for Drag and Drop - DEPRECATED, using simplified CSS racks */
/* Old styles kept for reference but not used */
.rack-content {
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 100%;
  pointer-events: none;
}

/* Rack shelf and frame styles removed */

/* ===== TAB 2: MINING GRID WITH POWER SYSTEM ===== */

.mining-grid-container {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
  padding: 1rem;
}

/* Power Grid Column */
.power-grid-column {
  display: flex;
  flex-direction: column;
}

.power-grid-unit {
  background: linear-gradient(135deg, #78350f 0%, #451a03 100%);
  border: 3px solid #f97316;
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.3);
  position: relative;
}

.power-grid-unit::before {
  content: '⚡';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
  opacity: 0.1;
}

.power-cell {
  width: 100%;
  height: 60px;
  border-radius: 0.5rem;
  border: 2px solid #78350f;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
}

.power-cell.inactive {
  background: linear-gradient(135deg, #1c1917 0%, #0c0a09 100%);
  border-color: #44403c;
  opacity: 0.5;
}

.power-cell.active {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  border-color: #9ca3af;
  box-shadow: 0 0 10px rgba(107, 114, 128, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.power-cell.active.boosted {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border-color: #4ade80;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.2);
  animation: powerPulse 2s ease-in-out infinite;
}

@keyframes powerPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.8;
  }
}

/* Mining Slots Grid */
.mining-slots-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 1.5rem;
}

.mining-slot {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #475569;
  border-radius: 0.75rem;
  padding: 1rem;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
}

.mining-slot.free {
  border-color: #38bdf8;
  background: linear-gradient(135deg, #0c4a6e 0%, #082f49 100%);
}

.mining-slot.unlockable {
  border-style: dashed;
  border-color: #64748b;
}

.mining-slot.locked {
  opacity: 0.6;
}

.mining-slot:not(.locked):hover {
  border-color: #22c55e;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
  transform: translateY(-2px);
}

/* Slot Header */
.slot-header {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.slot-label {
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Slot Enhancements */
.slot-enhancements {
  display: flex;
  gap: 0.25rem;
}

.enhancement-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: bold;
  border: 2px solid;
  transition: all 0.2s ease;
}

.enhancement-icon.inactive {
  background: #1e293b;
  border-color: #475569;
  color: #64748b;
}

.enhancement-icon.active {
  background: #0ea5e9;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.5);
}

/* Slot Content */
.slot-content {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Slot Mods */
.slot-mods {
  display: flex;
  gap: 0.25rem;
}

.mod-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  border: 2px solid;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mod-icon.inactive {
  background: #0f172a;
  border-color: #334155;
  opacity: 0.4;
  cursor: not-allowed;
}

.mod-icon.active {
  opacity: 1;
  transform: none;
}

.mod-icon.power-mod.active {
  background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.mod-icon.value-mod.active {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  border-color: #c084fc;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.5);
}

.mod-icon.multi-mount-mod.active {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  border-color: #22d3ee;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
}

/* Slot Drop Zone */
.slot-drop-zone {
  flex: 1;
  border: 2px dashed #475569;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.75rem;
  text-align: center;
  padding: 1rem 1rem 0.5rem 1rem;
  transition: all 0.3s ease;
  min-height: 80px;
}

.slot-drop-zone.drag-over {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

/* Unlock Prompt */
.unlock-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 1rem;
  text-align: center;
}

.unlock-prompt h4 {
  margin: 0;
  color: #94a3b8;
  font-size: 0.9rem;
}

.btn-unlock-slot {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  border: 1px solid #38bdf8;
  border-radius: 0.375rem;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-unlock-slot:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

.btn-unlock-slot:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Power Lines Overlay */
.power-lines-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.power-line {
  stroke-width: 3;
  stroke-dasharray: 5, 5;
  transition: all 0.3s ease;
}

.power-line.inactive {
  stroke: #475569;
  opacity: 0.3;
  stroke-dasharray: 8, 8;
}

.power-line.active {
  stroke: #22c55e;
  opacity: 0.8;
  animation: powerFlow 2s linear infinite;
}

@keyframes powerFlow {
  0% {
    stroke-dashoffset: 0;
  }

  100% {
    stroke-dashoffset: 20;
  }
}

.power-junction {
  transition: all 0.3s ease;
  stroke-width: 2;
}

.power-junction.inactive {
  fill: #475569;
  stroke: #64748b;
  opacity: 0.4;
}

.power-junction.active {
  fill: #f97316;
  stroke: #fb923c;
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.6));
}

/* Power Grid Progress Bar Animation */
/* Power grid progress bar - animation only when speed class is present */
#power-grid-progress.speed-1 {
  animation: powerProgress 4s linear infinite;
}

#power-grid-progress.speed-2 {
  animation: powerProgress 3s linear infinite;
}

#power-grid-progress.speed-3 {
  animation: powerProgress 2s linear infinite;
}

#power-grid-progress.speed-4 {
  animation: powerProgress 1s linear infinite;
}

@keyframes powerProgress {
  0% {
    width: 0%;
  }

  100% {
    width: 100%;
  }
}