/* CSS Custom Properties / Theme Variables */
:root {
  --bg-color: #03030d;
  --panel-bg: rgba(10, 10, 26, 0.65);
  --panel-border: rgba(0, 242, 254, 0.25);
  --panel-border-red: rgba(255, 0, 85, 0.3);
  --neon-blue: #00f2fe;
  --neon-green: #05f2c7;
  --neon-red: #ff0055;
  --neon-yellow: #ffe600;
  --neon-purple: #bd00ff;

  --font-title: 'Orbitron', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.hidden {
  display: none !important;
}

/* Base Styles & Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  /* Safari mobile support */
  touch-action: none;
  /* Default to none to prevent double-tap zoom globally */
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
  font-family: var(--font-body);
  color: #e2e8f0;
}

/* Container for canvas & interactive overlay UI */
#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #0a0a20 0%, #03030d 100%);
}

#canvas-wrapper {
  position: absolute;
  box-sizing: border-box;
  z-index: 1;
}

#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  border-radius: 16px;
  border: 2px solid rgba(0, 242, 254, 0.3);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.25),
    inset 0 0 15px rgba(0, 242, 254, 0.15);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Glassmorphism Panel styles */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5),
    inset 0 0 15px rgba(0, 242, 254, 0.05);
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Glow effects & colors */
.color-neon-blue {
  color: var(--neon-blue);
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

.color-neon-green {
  color: var(--neon-green);
  text-shadow: 0 0 10px rgba(5, 242, 199, 0.5);
}

.color-neon-red {
  color: var(--neon-red);
  text-shadow: 0 0 10px rgba(255, 0, 85, 0.5);
}

.color-neon-yellow {
  color: var(--neon-yellow);
  text-shadow: 0 0 10px rgba(255, 230, 0, 0.5);
}

/* HUD Top Status Bar */
#hud-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

#hud-speed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}


#hud-speed .hud-label {
  font-size: 0.58rem;
  margin-bottom: 0px;
}

.speed-buttons {
  display: flex;
  gap: 5px;
}

.btn-speed {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  border-radius: 6px;
  padding: 4px 8px;
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-speed:hover {
  background: rgba(0, 242, 254, 0.1);
  border-color: var(--neon-blue);
  color: var(--neon-blue);
}

.btn-speed.active {
  background: var(--neon-blue);
  border-color: var(--neon-blue);
  color: #03030d;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
}


.hud-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hud-label {
  font-family: var(--font-title);
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: #94a3b8;
  margin-bottom: 2px;
}

.hud-value {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.4rem;
}

/* HUD Health Display (Top Bar leftmost) */
#hud-item-health {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
}

/* Upgrades Right Panel */
#upgrades-panel {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-top: 1px solid var(--panel-border);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

#upgrades-panel .panel-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
  margin-bottom: 4px;
}

.upgrade-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px 0;
}

.panel-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
  margin-bottom: 4px;
}

.panel-subtitle {
  font-family: var(--font-title);
  font-size: 0.8rem;
  letter-spacing: 1px;
  color: #94a3b8;
  margin-bottom: 10px;
}

.upgrade-item {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 5px 8px;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.upgrade-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(0, 242, 254, 0.1);
}

.upgrade-item.locked {
  opacity: 0.55;
  filter: grayscale(0.4);
  border-color: rgba(239, 68, 68, 0.2);
}

.upgrade-item.locked:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(239, 68, 68, 0.2);
}

.upgrade-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 2px;
}

.upgrade-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: #e2e8f0;
}

.upgrade-lvl {
  font-size: 0.75rem;
  color: #cbd5e1;
  font-family: var(--font-title);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 2px;
}

.upgrade-lvl-badge {
  font-weight: 700;
  color: var(--neon-blue);
  text-shadow: 0 0 6px rgba(0, 242, 254, 0.4);
  margin-right: 8px;
}

.stat-badge {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}


/* Upgrade buttons styling */
.btn-upgrade {
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--neon-blue);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-width: 65px;
  height: 28px;
  transition: all 0.2s ease;
  font-family: var(--font-title);
  box-sizing: border-box;
}

.btn-upgrade:hover:not(:disabled) {
  background: var(--neon-blue);
  color: #03030d;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
}

.btn-upgrade:disabled {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: #475569;
  cursor: not-allowed;
}

.btn-upgrade .btn-cost {
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

/* Special styling for repair */
.btn-repair {
  background: rgba(5, 242, 199, 0.1);
  border-color: var(--neon-green);
  color: var(--neon-green);
}

.btn-repair:hover:not(:disabled) {
  background: var(--neon-green);
  color: #000;
  box-shadow: 0 0 10px rgba(5, 242, 199, 0.4);
}

.upgrade-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px 0;
}

/* Ability / Ultimate section */
/* Ability / Ultimate section */
.hud-ability-container {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 10;
  box-sizing: border-box;
}

.bottom-hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  box-sizing: border-box;
}

.bottom-hud-item .hud-label {
  font-family: var(--font-title);
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: #94a3b8;
  margin-bottom: 2px;
}

.bottom-hud-item .hud-value {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.4rem;
}

.btn-ability {
  position: relative;
  background: rgba(189, 0, 255, 0.1);
  border: 1px solid rgba(189, 0, 255, 0.3);
  color: var(--neon-purple);
  border-radius: 6px;
  padding: 0 12px;
  height: 36px;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  font-family: var(--font-title);
  flex: 1;
  max-width: 200px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-ability:hover:not(:disabled) {
  background: var(--neon-purple);
  color: #fff;
  box-shadow: 0 0 15px rgba(189, 0, 255, 0.5);
}

.btn-ability:disabled {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  color: #475569;
  cursor: not-allowed;
}

.ability-text {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  z-index: 2;
}

.ability-cooldown {
  font-size: 0.8rem;
  font-weight: 900;
  z-index: 2;
}

.ability-pulse {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(189, 0, 255, 0.2);
  z-index: 1;
  transition: width 0.1s linear;
}

/* Screen Overlays (Start/Game Over screens) */
.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 3, 13, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.game-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-content {
  width: 460px;
  padding: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.animated-border {
  animation: borderGlow 4s infinite alternate;
}

.animated-border-red {
  border-color: var(--neon-red) !important;
  animation: borderGlowRed 4s infinite alternate;
}

.game-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.game-subtitle {
  font-family: var(--font-title);
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: var(--neon-blue);
  margin-top: -10px;
}

.game-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #94a3b8;
  margin: 10px 0;
}

/* Action Buttons */
.btn-action {
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-green));
  color: #03030d;
  border: none;
  border-radius: 8px;
  padding: 14px 32px;
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 242, 254, 0.5),
    0 0 10px rgba(5, 242, 199, 0.3);
}

.btn-action:active {
  transform: translateY(1px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--neon-red), var(--neon-purple));
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 0, 85, 0.3);
}

.btn-danger:hover {
  box-shadow: 0 6px 25px rgba(255, 0, 85, 0.5);
}

.controls-hint {
  font-size: 0.75rem;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  width: 100%;
  padding-top: 16px;
  margin-top: 8px;
}

/* Stats summary at game over */
.game-stats-summary {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 10px 0;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: #94a3b8;
}

.stat-row span:last-child {
  font-weight: 700;
  font-size: 1rem;
}

/* Animations */
@keyframes borderGlow {
  0% {
    border-color: rgba(0, 242, 254, 0.25);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5),
      0 0 5px rgba(0, 242, 254, 0.05);
  }

  100% {
    border-color: rgba(0, 242, 254, 0.6);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5),
      0 0 15px rgba(0, 242, 254, 0.2);
  }
}

@keyframes borderGlowRed {
  0% {
    border-color: rgba(255, 0, 85, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5),
      0 0 5px rgba(255, 0, 85, 0.05);
  }

  100% {
    border-color: rgba(255, 0, 85, 0.7);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5),
      0 0 15px rgba(255, 0, 85, 0.25);
  }
}

/* Scrollbar customizations for upgrades panel */
#upgrades-panel::-webkit-scrollbar {
  width: 4px;
}

#upgrades-panel::-webkit-scrollbar-track {
  background: transparent;
}

#upgrades-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

#upgrades-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 242, 254, 0.3);
}

/* Responsive adjustments */
@media (max-height: 700px) {
  #upgrades-panel {
    gap: 8px;
    padding: 16px;
  }

  .upgrade-item {
    padding: 8px 10px;
  }

  .ability-section {
    margin-top: 10px;
  }

  .btn-ability {
    padding: 10px;
  }
}

.hotkey-hint {
  font-family: var(--font-title);
  font-size: 0.65rem;
  color: var(--neon-blue);
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 6px;
  display: inline-block;
  vertical-align: middle;
  box-shadow: 0 0 6px rgba(0, 242, 254, 0.15);
  text-shadow: 0 0 4px rgba(0, 242, 254, 0.4);
  font-weight: 700;
}

/* Gold Icon & Cost Wrapper Styling */
.cost-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 0px;
}

.gold-icon {
  width: 13px;
  height: 13px;
  display: inline-block;
  vertical-align: middle;
  filter: drop-shadow(0 0 2px rgba(255, 230, 0, 0.7));
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.btn-upgrade:hover:not(:disabled) .gold-icon {
  transform: scale(1.1) rotate(10deg);
}

.btn-upgrade:disabled .gold-icon {
  filter: grayscale(1) opacity(0.3);
}

/* Glassmorphic Input field for Pilot username */
.glass-input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 16px;
  color: #fff;
  font-family: var(--font-title);
  font-size: 0.9rem;
  text-align: center;
  letter-spacing: 1.5px;
  width: 80%;
  max-width: 260px;
  outline: none;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.glass-input:focus {
  border-color: var(--neon-blue);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
  background: rgba(0, 242, 254, 0.05);
}

.glass-input::placeholder {
  color: #475569;
  letter-spacing: 1px;
}

/* Difficulty Selection UI Styling */
.difficulty-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 10px 0 20px 0;
}

.difficulty-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.btn-difficulty {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  flex: 1 1 calc(33% - 8px);
  min-width: 100px;
}

.btn-difficulty:hover {
  background: rgba(0, 242, 254, 0.08);
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.btn-difficulty.active[data-difficulty="easy"] {
  background: rgba(5, 242, 199, 0.2);
  border-color: var(--neon-green);
  color: var(--neon-green);
  box-shadow: 0 0 15px rgba(5, 242, 199, 0.4);
}

.btn-difficulty.active[data-difficulty="medium"] {
  background: rgba(255, 230, 0, 0.2);
  border-color: var(--neon-yellow);
  color: var(--neon-yellow);
  box-shadow: 0 0 15px rgba(255, 230, 0, 0.4);
}

.btn-difficulty.active[data-difficulty="hard"] {
  background: rgba(255, 0, 85, 0.2);
  border-color: var(--neon-red);
  color: var(--neon-red);
  box-shadow: 0 0 15px rgba(255, 0, 85, 0.4);
}

.btn-difficulty.active[data-difficulty="expert"] {
  background: rgba(189, 0, 255, 0.2);
  border-color: var(--neon-purple);
  color: var(--neon-purple);
  box-shadow: 0 0 15px rgba(189, 0, 255, 0.4);
}

.btn-difficulty.active[data-difficulty="impossible"] {
  background: linear-gradient(135deg, rgba(255, 0, 85, 0.3), rgba(189, 0, 255, 0.3));
  border-color: #ff00ff;
  color: #ff00ff;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.6);
  animation: pulse-impossible 1.5s infinite alternate;
}

@keyframes pulse-impossible {
  0% {
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.4);
  }

  100% {
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.8);
  }
}

/* Start Menu Actions */
.menu-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
  margin-top: 5px;
}

.menu-actions .btn-action {
  flex: 1;
  max-width: 200px;
}

.btn-secondary {
  background: rgba(189, 0, 255, 0.1) !important;
  border: 1px solid var(--neon-purple) !important;
  color: var(--neon-purple) !important;
  box-shadow: 0 4px 15px rgba(189, 0, 255, 0.2) !important;
}

.btn-secondary:hover {
  background: var(--neon-purple) !important;
  color: #fff !important;
  box-shadow: 0 6px 25px rgba(189, 0, 255, 0.4) !important;
}

/* Store Panel Elements */
.animated-border-purple {
  border-color: var(--neon-purple) !important;
  animation: borderGlowPurple 4s infinite alternate;
}

@keyframes borderGlowPurple {
  0% {
    border-color: rgba(189, 0, 255, 0.25);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5),
      0 0 5px rgba(189, 0, 255, 0.05);
  }

  100% {
    border-color: rgba(189, 0, 255, 0.6);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5),
      0 0 15px rgba(189, 0, 255, 0.2);
  }
}

.store-currency {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(5, 242, 199, 0.04);
  border: 1px solid rgba(5, 242, 199, 0.15);
  border-radius: 12px;
  padding: 12px 24px;
  margin: 5px 0 15px 0;
  width: 100%;
  box-shadow: 0 4px 15px rgba(5, 242, 199, 0.05);
}

#store-content {
  width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* Store Tab Buttons & Layout */
.store-tabs {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.02);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 10px;
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: var(--neon-purple);
  color: #fff;
  box-shadow: 0 0 12px rgba(189, 0, 255, 0.4);
}

.store-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.store-lock-req {
  font-size: 0.65rem;
  color: var(--neon-red);
  font-family: var(--font-title);
  font-weight: 500;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}


.store-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
  max-height: 40vh;
  overflow-y: auto;
  padding-right: 8px;
}

/* Custom Scrollbar for store-items */
.store-items::-webkit-scrollbar {
  width: 4px;
}

.store-items::-webkit-scrollbar-track {
  background: transparent;
}

.store-items::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.store-items::-webkit-scrollbar-thumb:hover {
  background: rgba(189, 0, 255, 0.3);
}

/* Scrollbar customizations for checkpoint selection container */
#checkpoint-buttons-container::-webkit-scrollbar {
  width: 4px;
}

#checkpoint-buttons-container::-webkit-scrollbar-track {
  background: transparent;
}

#checkpoint-buttons-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

#checkpoint-buttons-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 242, 254, 0.3);
}

.store-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px 16px;
  transition: all 0.2s ease;
  width: 100%;
}

.store-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(189, 0, 255, 0.2);
}

.store-item.locked {
  opacity: 0.55;
  filter: grayscale(0.4);
  border-color: rgba(239, 68, 68, 0.2);
}

.store-item.locked:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(239, 68, 68, 0.2);
}

.store-item-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.store-item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-title);
  letter-spacing: 0.5px;
}

.store-item-lvl {
  font-size: 0.8rem;
  color: var(--neon-blue);
  font-family: var(--font-title);
  font-weight: 500;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: 4px;
  padding: 1px 6px;
}

.store-item-desc {
  font-size: 0.7rem;
  color: #94a3b8;
  font-family: var(--font-main);
  line-height: 1.3;
  margin-top: 2px;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.05);
}

.btn-store-upgrade {
  background: rgba(5, 242, 199, 0.1);
  border: 1px solid var(--neon-green);
  color: var(--neon-green);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  transition: all 0.2s ease;
  font-family: var(--font-title);
}

.btn-store-upgrade:hover:not(:disabled) {
  background: var(--neon-green);
  color: #03030d;
  box-shadow: 0 0 12px rgba(5, 242, 199, 0.4);
}

.btn-store-upgrade:disabled {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
  color: #475569;
  cursor: not-allowed;
}

.btn-store-upgrade .btn-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.btn-store-upgrade .btn-cost {
  font-size: 0.8rem;
  font-weight: 900;
}

/* Enemy Info Panel (Bottom Left) */
#enemy-info-panel {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#enemy-info-panel .panel-title {
  cursor: pointer;
  user-select: none;
  width: 100%;
}

#enemy-info-panel:not(.collapsed) .panel-title {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

#enemy-info-panel .toggle-icon {
  font-size: 0.75rem;
  color: var(--neon-blue);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-block;
}

#enemy-info-panel.collapsed .toggle-icon {
  transform: rotate(180deg);
}

#enemy-info-panel .panel-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 500px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, margin-top 0.3s ease;
}

#enemy-info-panel.collapsed .panel-content {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.enemy-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.enemy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.enemy-dot.standard {
  background: #ffe600;
  box-shadow: 0 0 8px #ffe600;
}

.enemy-dot.fast {
  background: #00f2fe;
  box-shadow: 0 0 8px #00f2fe;
}

.enemy-dot.tank {
  background: #ff0055;
  box-shadow: 0 0 8px #ff0055;
}

.enemy-dot.boss {
  background: #bd00ff;
  box-shadow: 0 0 8px #bd00ff;
}

.enemy-text-container {
  display: flex;
  flex-direction: column;
}

.enemy-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.enemy-title.standard {
  color: #ffe600;
}

.enemy-title.fast {
  color: #00f2fe;
}

.enemy-title.tank {
  color: #ff0055;
}

.enemy-title.boss {
  color: #bd00ff;
}

.enemy-desc {
  font-family: var(--font-main);
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 1px;
}

/* Mobile Responsive Overrides */
@media (max-width: 768px) {

  #gameCanvas {
    border-left: none !important;
    border-right: none !important;
    border-radius: 0 !important;
  }

  /* Overlay Responsive scaling */
  .overlay-content {
    width: calc(100% - 24px);
    max-width: 380px;
    padding: 24px 16px;
    gap: 16px;
  }

  .game-title {
    font-size: 1.6rem;
  }

  .game-subtitle {
    font-size: 0.75rem;
  }

  .game-desc {
    font-size: 0.75rem;
    line-height: 1.4;
  }

  .btn-action {
    padding: 10px 20px;
    font-size: 0.85rem;
  }

  .difficulty-options {
    gap: 6px;
  }

  .btn-difficulty {
    padding: 6px 10px;
    font-size: 0.7rem;
    min-width: 80px;
  }

  /* Compact, 1-Row Status Bar Overlay on Mobile */
  #hud-top {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    right: 12px !important;
    height: auto !important;
    background: rgba(10, 10, 26, 0.75) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(0, 242, 254, 0.25) !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    gap: 12px !important;
    align-items: center !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
    z-index: 10 !important;
  }

  #hud-top .hud-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px !important;
    width: auto !important;
  }

  #hud-top .hud-label {
    display: none !important;
  }

  #hud-top .hud-value {
    font-size: 0.85rem !important;
  }

  /* Add simple prefixes via CSS for mobile values */
  #wave-display::before {
    content: 'W: ';
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 700;
  }

  #enemies-display::before {
    content: '👾 ';
    font-size: 0.75rem;
  }

  #xp-display::before {
    content: 'XP: ';
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 700;
  }

  #gold-display::before {
    content: '🟡 ';
    font-size: 0.7rem;
  }

  .bottom-hud-item {
    min-width: 44px !important;
    height: 48px !important;
    padding: 2px 6px !important;
    border-radius: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .bottom-hud-item .hud-label {
    display: none !important;
  }

  .bottom-hud-item .hud-value {
    font-size: 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Reposition and flex mobile buttons at the bottom */
  .hud-ability-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: auto !important;
    min-width: 0 !important;
    bottom: 12px !important;
    left: 4px !important;
    right: 4px !important;
    transform: none !important;
  }

  .btn-ability {
    flex: 1 !important;
    width: auto !important;
    height: 48px !important;
    min-width: 120px !important;
    padding: 0 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
  }

  .ability-text {
    font-size: 0.65rem !important;
  }

  .ability-cooldown {
    font-size: 0.7rem !important;
  }

  .btn-ingame-store {
    padding: 0 !important;
    font-size: 1.3rem !important;
    border-radius: 8px !important;
    background: transparent !important;
    border: none !important;
    color: #bd00ff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    width: 48px !important;
    height: 48px !important;
    position: relative !important;
    box-sizing: border-box !important;
  }

  .btn-settings-toggle {
    padding: 0 !important;
    font-size: 1.3rem !important;
    border-radius: 8px !important;
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    width: 48px !important;
    height: 48px !important;
    box-sizing: border-box !important;
  }
}

/* Landscape Layout Overrides */
.layout-landscape #upgrades-panel {
  border: 1px solid var(--panel-border) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5),
    inset 0 0 15px rgba(0, 242, 254, 0.05) !important;
  padding: 10px;
  /* reduced from 20px */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 6px;
  /* reduced from 10px */
}

.layout-landscape #upgrades-panel .panel-title,
.layout-landscape #upgrades-panel .upgrade-separator {
  grid-column: 1 / -1;
}

.layout-landscape .upgrade-item {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.layout-portrait #upgrades-panel {
  border-top: 1px solid var(--panel-border) !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: none !important;
  border-radius: 16px 16px 0 0 !important;
  padding: 6px;
  /* reduced from 12px */
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  /* reduced from 8px */
}

.layout-portrait #upgrades-panel .panel-title,
.layout-portrait #upgrades-panel .upgrade-separator {
  grid-column: span 2;
}

.layout-portrait .upgrade-item {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 4px 6px !important;
  gap: 4px !important;
}

.layout-portrait .upgrade-item .upgrade-info {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  text-align: left !important;
  width: auto !important;
}

.layout-portrait .upgrade-item .upgrade-name {
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  text-align: left !important;
  display: block !important;
}

.layout-portrait .upgrade-item .upgrade-lvl {
  font-size: 0.6rem !important;
  justify-content: flex-start !important;
  margin-top: 1px !important;
}

.layout-portrait .upgrade-item .stat-badge {
  display: none !important;
  /* Hide the upgrade effect as requested by user */
}

.layout-portrait .upgrade-item .btn-upgrade {
  width: auto !important;
  min-width: 50px !important;
  padding: 2px 6px !important;
  font-size: 0.65rem !important;
  height: 24px !important;
  border-radius: 12px !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

/* ability-section removed from upgrades panel */

.layout-portrait .hotkey-hint {
  display: none !important;
}

/* In-Game Store & Settings bottom button styling */
.btn-ingame-store {
  position: relative;
  background: transparent;
  border: none;
  color: #bd00ff;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.btn-settings-toggle {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.btn-ingame-store:hover {
  background: rgba(189, 0, 255, 0.2);
  border-color: #bd00ff;
  box-shadow: 0 0 12px rgba(189, 0, 255, 0.4);
  transform: translateY(-1px);
}

.btn-ingame-store:active {
  transform: translateY(0);
}

/* Store Notification Dot */
.store-notify-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 10px;
  height: 10px;
  background: #ff0055;
  border-radius: 50%;
  border: 2px solid #03030d;
  box-shadow: 0 0 8px rgba(255, 0, 85, 0.6);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: visibility 0s;
}

.store-notify-dot.active {
  opacity: 1;
  visibility: visible;
  animation: storeNotifyBlink 2s ease-in-out infinite;
}

@keyframes storeNotifyBlink {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 8px rgba(255, 0, 85, 0.6);
  }

  50% {
    opacity: 0.15;
    box-shadow: 0 0 2px rgba(255, 0, 85, 0.2);
  }
}

/* ========================================
   UPGRADE INFO CODEX STYLES
   ======================================== */

#upgrade-info-content {
  width: 800px;
  max-width: calc(100vw - 24px);
  padding: 24px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Prevent scrolling on the wrapper */
}

/* Scrollable container for tab panels */
.upgrade-info-panels {
  flex: 1;
  overflow-y: auto;
  /* Scroll internally */
  padding-right: 4px;
  margin-bottom: 16px;
  touch-action: pan-y !important;
}

.upgrade-info-panels::-webkit-scrollbar {
  width: 4px;
}

.upgrade-info-panels::-webkit-scrollbar-track {
  background: transparent;
}

.upgrade-info-panels::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.2);
  border-radius: 2px;
}

.upgrade-info-panels::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 242, 254, 0.4);
}

/* Info Tabs */
.info-tab-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #64748b;
  border-radius: 8px;
  padding: 8px 14px;
  font-family: var(--font-title);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.info-tab-btn:hover {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.3);
  color: var(--neon-blue);
}

.info-tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(5, 242, 199, 0.1));
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.5);
}

/* Info Panels Container */
.upgrade-info-panels {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.info-tab-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  width: 100%;
  animation: infoFadeIn 0.3s ease;
}

@keyframes infoFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Info Cards */
.info-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 242, 254, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.info-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(0, 242, 254, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.info-card:hover::before {
  opacity: 1;
}

.info-card-special {
  border-color: rgba(5, 242, 199, 0.15);
  background: rgba(5, 242, 199, 0.02);
}

.info-card-special::before {
  background: linear-gradient(90deg, transparent, rgba(5, 242, 199, 0.4), transparent);
}

.info-card-special:hover {
  border-color: rgba(5, 242, 199, 0.25);
}

/* Info Card Header */
.info-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.info-card-icon {
  font-size: 1.25rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 242, 254, 0.06);
  border: 1px solid rgba(0, 242, 254, 0.12);
  border-radius: 8px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.info-card:hover .info-card-icon {
  background: rgba(0, 242, 254, 0.1);
  border-color: rgba(0, 242, 254, 0.25);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.15);
  transform: scale(1.05);
}

.info-card-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-card-name {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

.info-card-category {
  font-family: var(--font-title);
  font-size: 0.55rem;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Info Card Description */
.info-card-desc {
  font-family: var(--font-body);
  font-size: 0.75rem;
  line-height: 1.5;
  color: #94a3b8;
  margin-bottom: 8px;
  padding-left: 2px;
}

.info-card-desc strong {
  color: var(--neon-blue);
  font-weight: 600;
  text-shadow: 0 0 6px rgba(0, 242, 254, 0.3);
}

/* Info Card Stats */
.info-card-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 8px 10px;
}

.info-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
}

.info-stat-label {
  font-family: var(--font-title);
  font-size: 0.6rem;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.5px;
}

.info-stat-value {
  font-family: var(--font-title);
  font-size: 0.65rem;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 0.3px;
  text-align: right;
}

.info-stat-value.info-locked {
  color: #ef4444;
  text-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
  font-size: 0.6rem;
}

.info-stat-value.info-unlocked {
  color: var(--neon-green);
  text-shadow: 0 0 6px rgba(5, 242, 199, 0.3);
}

/* Mobile Adjustments for Info Panel */
@media (max-width: 600px) {
  #upgrade-info-content {
    width: calc(100vw - 12px);
    padding: 10px;
    max-height: 94vh;
  }

  .store-tabs {
    gap: 3px !important;
    padding: 2px !important;
    margin-bottom: 8px !important;
  }

  .info-tab-btn {
    padding: 5px 6px !important;
    font-size: 0.52rem !important;
    border-radius: 5px !important;
  }

  .info-card {
    padding: 8px !important;
    border-radius: 6px !important;
  }

  .info-card-header {
    gap: 6px !important;
    margin-bottom: 3px !important;
  }

  .info-card-icon {
    width: 20px !important;
    height: 20px !important;
    font-size: 0.85rem !important;
    border-radius: 4px !important;
  }

  .info-card-name {
    font-size: 0.7rem !important;
  }

  .info-card-category {
    font-size: 0.45rem !important;
  }

  .info-card-desc {
    font-size: 0.65rem !important;
    line-height: 1.3 !important;
    margin-bottom: 4px !important;
  }

  .info-card-stats {
    padding: 4px 6px !important;
    gap: 3px !important;
    border-radius: 4px !important;
  }

  .info-stat {
    padding: 0.5px 0 !important;
  }

  .info-stat-label,
  .info-stat-value {
    font-size: 0.55rem !important;
  }
}

/* Visibility Helper Classes & Zoom scroll configurations */
.desktop-only {
  display: flex !important;
}

.mobile-only {
  display: none !important;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
  }
}

#upgrades-panel,
.store-items,
.upgrade-info-panels,
#checkpoint-buttons-container {
  touch-action: pan-y !important;
}

button,
.btn-upgrade,
.btn-action,
.btn-store-upgrade,
.btn-speed,
.btn-difficulty,
.btn-settings-toggle,
.btn-ingame-store {
  touch-action: manipulation !important;
}

/* Hide descriptions of perks completely as requested */
.perk-card .perk-theme {
  display: none !important;
}

/* Perk Cards container & styling */
.perk-cards-container {
  display: flex;
  gap: 16px;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
}

#perk-selection-overlay .overlay-content {
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .perk-cards-container {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
  }

  .perk-card {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    gap: 8px;
  }

  .perk-title {
    font-size: 0.95rem;
  }

  .perk-theme {
    font-size: 0.75rem;
  }

  .perk-stats {
    padding-top: 6px;
    gap: 4px;
  }

  .perk-stat {
    font-size: 0.72rem;
  }
}

@media (max-height: 540px) {
  #perk-selection-overlay .overlay-content {
    max-height: 95vh;
    padding: 12px !important;
  }

  #perk-selection-overlay h1 {
    font-size: 1.2rem !important;
    margin-bottom: 2px !important;
  }

  #perk-selection-overlay .game-subtitle {
    font-size: 0.75rem !important;
    margin-bottom: 8px !important;
  }

  .perk-cards-container {
    flex-direction: row;
    gap: 8px;
  }

  .perk-card {
    padding: 8px;
    gap: 4px;
  }

  .perk-title {
    font-size: 0.85rem;
  }

  .perk-theme {
    display: none;
    /* Hide description in tight landscape height */
  }

  .perk-stats {
    padding-top: 4px;
    gap: 2px;
  }

  .perk-stat {
    font-size: 0.65rem;
  }
}

.perk-card {
  flex: 1;
  max-width: 240px;
  background: rgba(13, 13, 33, 0.65);
  border: 1px solid rgba(189, 0, 255, 0.25);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.perk-card:hover {
  transform: translateY(-5px);
  border-color: rgba(189, 0, 255, 0.85);
  box-shadow: 0 0 20px rgba(189, 0, 255, 0.45);
  background: rgba(13, 13, 33, 0.85);
}

.perk-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--neon-purple);
  text-shadow: 0 0 8px rgba(189, 0, 255, 0.5);
  margin: 0;
}

.perk-theme {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
  margin: 0;
  flex-grow: 1;
}

.perk-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 10px;
}

.perk-stat {
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.perk-buff {
  color: var(--neon-green);
  text-shadow: 0 0 6px rgba(5, 242, 199, 0.3);
}

.perk-debuff {
  color: var(--neon-red);
  text-shadow: 0 0 6px rgba(255, 0, 85, 0.3);
}