/* ==========================================================================
   MOTOSPACE — Cyberpunk / Gaming Style Car Modification HUD
   Inspired by Need For Speed Underground, Cyberpunk 2077 & Forza Horizon
   ========================================================================== */

:root {
  --gm-cyan: #00f0ff;
  --gm-cyan-glow: rgba(0, 240, 255, 0.45);
  --gm-magenta: #ff0055;
  --gm-magenta-glow: rgba(255, 0, 85, 0.45);
  --gm-yellow: #ffe600;
  --gm-yellow-glow: rgba(255, 230, 0, 0.4);
  --gm-bg-dark: #05070d;
  --gm-panel-bg: rgba(9, 13, 24, 0.88);
  --gm-border-neon: rgba(0, 240, 255, 0.3);
  --gm-font-gaming: 'Orbitron', 'Rajdhani', monospace, sans-serif;
}

/* Background Cyber Grid */
.gaming-body {
  background-color: var(--gm-bg-dark) !important;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 50% 10%, rgba(255, 0, 85, 0.1) 0%, transparent 60%),
    radial-gradient(circle at 80% 50%, rgba(0, 240, 255, 0.08) 0%, transparent 50%) !important;
  background-size: 30px 30px, 30px 30px, 100% 100%, 100% 100% !important;
  color: #e2e8f0;
  position: relative;
}

/* Scanline Effect Overlay */
.cyber-scanlines {
  position: fixed;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
  z-index: 999;
  pointer-events: none;
  opacity: 0.6;
}

/* ==========================================================================
   GAMING HUD HEADER & STATUS BAR
   ========================================================================== */
.gaming-hud-bar {
  background: rgba(4, 7, 14, 0.95);
  border-bottom: 2px solid var(--gm-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
  padding: 12px 24px;
  font-family: var(--gm-font-gaming);
  position: sticky;
  top: 80px;
  z-index: 900;
}

.hud-bar-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.hud-player-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hud-avatar-box {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--gm-cyan), var(--gm-magenta));
  clip-path: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  color: #000;
}

.hud-player-info {
  display: flex;
  flex-direction: column;
}

.hud-player-name {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
}

.hud-player-rank {
  font-size: 10px;
  color: var(--gm-cyan);
  letter-spacing: 1.5px;
}

.hud-stats-group {
  display: flex;
  align-items: center;
  gap: 24px;
}

.hud-stat-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hud-stat-label {
  font-size: 9px;
  color: #64748b;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hud-stat-val {
  font-size: 15px;
  font-weight: 900;
  color: #fff;
}

.hud-stat-val.gold {
  color: var(--gm-yellow);
  text-shadow: 0 0 8px var(--gm-yellow-glow);
}

.hud-audio-btn {
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid var(--gm-cyan);
  color: var(--gm-cyan);
  padding: 6px 14px;
  border-radius: 4px;
  font-family: var(--gm-font-gaming);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.hud-audio-btn:hover {
  background: var(--gm-cyan);
  color: #000;
  box-shadow: 0 0 15px var(--gm-cyan-glow);
}

/* ==========================================================================
   GAMING HERO SECTION
   ========================================================================== */
.gaming-hero {
  padding: 60px 0 40px;
  position: relative;
  text-align: center;
}

.gaming-title-box {
  display: inline-block;
  position: relative;
  margin-bottom: 24px;
}

.gaming-title-badge {
  display: inline-block;
  background: var(--gm-magenta);
  color: #fff;
  font-family: var(--gm-font-gaming);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 3px;
  padding: 4px 14px;
  margin-bottom: 12px;
  clip-path: polygon(0 0, 100% 0, 92% 100%, 0% 100%);
  text-shadow: 0 0 8px var(--gm-magenta-glow);
}

.gaming-main-title {
  font-family: var(--gm-font-gaming);
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 900;
  letter-spacing: 3px;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 
    0 0 10px rgba(0, 240, 255, 0.5),
    0 0 30px rgba(255, 0, 85, 0.3);
}

.gaming-main-title span {
  color: var(--gm-cyan);
}

.gaming-subtitle {
  font-size: 16px;
  color: #94a3b8;
  max-width: 680px;
  margin: 0 auto;
}

/* ==========================================================================
   INTERACTIVE TUNING SIMULATOR / HUD ARENA
   ========================================================================== */
.tuning-simulator-wrap {
  padding: 40px 0 80px;
}

.tuning-hud-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

/* Left: Vehicle Stage & Loadout Customizer */
.loadout-panel {
  background: var(--gm-panel-bg);
  border: 1px solid var(--gm-border-neon);
  border-radius: 14px;
  padding: 28px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.loadout-panel::before {
  content: "CYBER_TUNING_MATRIX // V2.0";
  position: absolute;
  top: -10px;
  left: 24px;
  background: var(--gm-bg-dark);
  padding: 0 10px;
  font-family: var(--gm-font-gaming);
  font-size: 10px;
  color: var(--gm-cyan);
  letter-spacing: 2px;
  border: 1px solid var(--gm-border-neon);
  border-radius: 4px;
}

/* Vehicle Showcase Display */
.vehicle-stage-box {
  position: relative;
  height: 360px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 240, 255, 0.2);
  margin-bottom: 30px;
  background: radial-gradient(circle at 50% 60%, #151e36 0%, #080c16 80%);
}

.vehicle-stage-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.5s ease;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.9));
}

.vehicle-laser-grid {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(transparent, rgba(0, 240, 255, 0.25));
  border-top: 1px dashed var(--gm-cyan);
  pointer-events: none;
}

.stage-hud-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--gm-font-gaming);
  pointer-events: none;
}

.stage-badge {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--gm-cyan);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  color: #fff;
  letter-spacing: 1px;
}

/* Mod Slots Grid */
.mod-slots-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mod-slot-card {
  background: rgba(14, 20, 36, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.mod-slot-card:hover {
  background: rgba(20, 30, 54, 0.8);
  border-color: rgba(0, 240, 255, 0.4);
  transform: translateX(4px);
}

.mod-slot-card.active {
  background: rgba(0, 240, 255, 0.08);
  border-color: var(--gm-cyan);
  box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.15), 0 0 15px rgba(0, 240, 255, 0.2);
}

.mod-slot-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mod-slot-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gm-cyan);
  flex-shrink: 0;
}

.mod-slot-card.active .mod-slot-icon {
  background: var(--gm-cyan);
  color: #000;
  box-shadow: 0 0 12px var(--gm-cyan-glow);
}

.mod-slot-name {
  font-family: var(--gm-font-gaming);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.mod-slot-desc {
  font-size: 12px;
  color: #94a3b8;
}

.mod-slot-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mod-stat-chip {
  font-family: var(--gm-font-gaming);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 0, 85, 0.15);
  color: var(--gm-magenta);
  border: 1px solid rgba(255, 0, 85, 0.3);
}

.mod-stat-chip.positive {
  background: rgba(0, 240, 255, 0.15);
  color: var(--gm-cyan);
  border-color: rgba(0, 240, 255, 0.3);
}

.mod-toggle-switch {
  width: 44px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  position: relative;
  transition: all 0.25s ease;
}

.mod-toggle-thumb {
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: all 0.25s ease;
}

.mod-slot-card.active .mod-toggle-switch {
  background: var(--gm-cyan);
}

.mod-slot-card.active .mod-toggle-thumb {
  transform: translateX(22px);
  background: #000;
}

/* ==========================================================================
   RIGHT: TELEMETRY & STATS HUD
   ========================================================================== */
.telemetry-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 150px;
}

.telemetry-panel {
  background: var(--gm-panel-bg);
  border: 1px solid var(--gm-border-neon);
  border-radius: 14px;
  padding: 26px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.telemetry-panel::before {
  content: "DYNO_DIAGNOSTICS";
  position: absolute;
  top: -10px;
  left: 20px;
  background: var(--gm-bg-dark);
  padding: 0 10px;
  font-family: var(--gm-font-gaming);
  font-size: 10px;
  color: var(--gm-magenta);
  letter-spacing: 2px;
  border: 1px solid rgba(255, 0, 85, 0.4);
  border-radius: 4px;
}

/* Rank & Overall Rating */
.rating-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.rating-label {
  font-family: var(--gm-font-gaming);
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: 1px;
}

.rating-tier {
  font-family: var(--gm-font-gaming);
  font-size: 32px;
  font-weight: 900;
  color: var(--gm-yellow);
  text-shadow: 0 0 15px var(--gm-yellow-glow);
}

/* Stat Meters */
.telemetry-gauges {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gauge-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gauge-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--gm-font-gaming);
  font-size: 12px;
}

.gauge-title {
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.gauge-value {
  color: #fff;
  font-weight: 800;
}

.gauge-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.gauge-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gm-cyan), var(--gm-magenta));
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px var(--gm-cyan-glow);
}

/* Dyno Run Action */
.dyno-action-box {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-dyno-run {
  background: linear-gradient(135deg, var(--gm-magenta), #b3003b);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-family: var(--gm-font-gaming);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 14px 20px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-transform: uppercase;
  box-shadow: 0 0 20px var(--gm-magenta-glow);
  transition: all 0.25s ease;
}

.btn-dyno-run:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(255, 0, 85, 0.7);
  background: linear-gradient(135deg, #ff1a6b, var(--gm-magenta));
}

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

.btn-build-order {
  background: linear-gradient(135deg, var(--gm-cyan), #0099b8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #000;
  font-family: var(--gm-font-gaming);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.5px;
  padding: 12px 18px;
  border-radius: 8px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
  box-shadow: 0 0 18px var(--gm-cyan-glow);
  transition: all 0.25s ease;
}

.btn-build-order:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(0, 240, 255, 0.7);
}

/* Sound Wave Animation on Rev */
.sound-wave-box {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 24px;
  margin-top: 8px;
}

.sound-wave-box.active {
  display: flex;
}

.wave-bar {
  width: 4px;
  height: 100%;
  background: var(--gm-cyan);
  border-radius: 2px;
  animation: wavePulse 0.4s infinite alternate ease-in-out;
}

.wave-bar:nth-child(2) { animation-delay: 0.1s; background: var(--gm-magenta); }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; background: var(--gm-yellow); }
.wave-bar:nth-child(5) { animation-delay: 0.15s; }

@keyframes wavePulse {
  0% { height: 4px; }
  100% { height: 24px; }
}

/* ==========================================================================
   MODIFICATION STAGES / TIERS GRID
   ========================================================================== */
.gaming-stages-section {
  padding: 60px 0 90px;
}

.section-head-gaming {
  text-align: center;
  margin-bottom: 48px;
}

.section-head-gaming h2 {
  font-family: var(--gm-font-gaming);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-head-gaming h2 span {
  color: var(--gm-cyan);
}

.section-head-gaming p {
  color: #94a3b8;
  font-size: 15px;
  max-width: 600px;
  margin: 0 auto;
}

.stage-tier-card {
  background: var(--gm-panel-bg);
  border: 1px solid var(--gm-border-neon);
  border-radius: 14px;
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all 0.3s ease;
}

.stage-tier-card:hover {
  transform: translateY(-6px);
  border-color: var(--gm-cyan);
  box-shadow: 0 15px 35px rgba(0, 240, 255, 0.2);
}

.stage-tier-card.pro {
  border-color: var(--gm-magenta);
  background: linear-gradient(180deg, rgba(32, 10, 22, 0.9) 0%, rgba(9, 13, 24, 0.95) 100%);
  box-shadow: 0 10px 30px rgba(255, 0, 85, 0.2);
}

.tier-number-tag {
  font-family: var(--gm-font-gaming);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--gm-cyan);
  margin-bottom: 8px;
}

.stage-tier-card.pro .tier-number-tag {
  color: var(--gm-magenta);
}

.tier-title {
  font-family: var(--gm-font-gaming);
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 14px;
}

.tier-hp-boost {
  font-family: var(--gm-font-gaming);
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 18px;
}

.tier-hp-boost span {
  font-size: 14px;
  color: var(--gm-yellow);
}

.tier-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.tier-features-list li {
  font-size: 13.5px;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tier-features-list li::before {
  content: '>';
  font-family: var(--gm-font-gaming);
  color: var(--gm-cyan);
  font-weight: 900;
}

.stage-tier-card.pro .tier-features-list li::before {
  color: var(--gm-magenta);
}

/* ==========================================================================
   RESPONSIVE GAMING HUD
   ========================================================================== */
@media (max-width: 1024px) {
  .tuning-hud-grid {
    grid-template-columns: 1fr;
  }
  .telemetry-sidebar {
    position: static;
  }
  .vehicle-stage-box {
    height: 300px;
  }
}

@media (max-width: 768px) {
  .hud-stats-group {
    display: none;
  }
  .gaming-main-title {
    font-size: 36px;
  }
  .mod-slot-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .mod-slot-stats {
    width: 100%;
    justify-content: space-between;
  }
  .vehicle-stage-box {
    height: 240px;
  }
}
