/* ==========================================================================
   NFS DADA: NITRO HIGHWAY DRIFT (HIGH-OCTANE PSEUDO-3D RACER)
   Styled for games.html - Kishan Kumar Sharma Portfolio
   ========================================================================== */

#nfsGameSection {
  scroll-margin-top: 100px;
}

/* Tab Switcher NFS Accent */
.game-tab-btn.tab-nfs.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.35) 100%);
  border-color: #F59E0B;
  color: #FDE68A;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

/* --------------------------------------------------------------------------
   NFS CONSOLE WRAPPER
   -------------------------------------------------------------------------- */
.nfs-console-card {
  background: linear-gradient(180deg, #090B14 0%, #040508 100%);
  border: 2px solid rgba(245, 158, 11, 0.4);
  border-radius: 28px;
  box-shadow: 
    0 35px 90px -15px rgba(0, 0, 0, 0.95),
    0 0 50px -10px rgba(245, 158, 11, 0.25);
  padding: 24px;
  max-width: 1040px;
  margin: 0 auto 60px;
  position: relative;
  overflow: hidden;
  user-select: none;
}

/* Flashing Police Heat Border on Console during Police Chase */
.nfs-console-card.police-heat-active {
  animation: consolePolicePulse 0.8s infinite alternate;
}

@keyframes consolePolicePulse {
  0% {
    border-color: rgba(239, 68, 68, 0.85);
    box-shadow: 0 0 45px rgba(239, 68, 68, 0.5), inset 0 0 25px rgba(239, 68, 68, 0.2);
  }
  100% {
    border-color: rgba(59, 130, 246, 0.85);
    box-shadow: 0 0 45px rgba(59, 130, 246, 0.5), inset 0 0 25px rgba(59, 130, 246, 0.2);
  }
}

/* --------------------------------------------------------------------------
   1. THE GARAGE / CUSTOMIZATION SCREEN
   -------------------------------------------------------------------------- */
.nfs-garage-screen {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  text-align: center;
}

.nfs-garage-card {
  background: linear-gradient(180deg, #121422 0%, #090A12 100%);
  border: 2px solid #F59E0B;
  border-radius: 24px;
  padding: 28px 32px;
  max-width: 640px;
  width: 96%;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.95),
    0 0 40px rgba(245, 158, 11, 0.25);
}

.nfs-garage-header-icon {
  font-size: 2.8rem;
  margin-bottom: 6px;
  display: inline-block;
  animation: garageIconFloat 2.5s ease-in-out infinite alternate;
}

@keyframes garageIconFloat {
  0% { transform: translateY(0) rotate(-2deg); }
  100% { transform: translateY(-6px) rotate(2deg); }
}

.nfs-garage-title {
  font-family: var(--font-display, var(--font-heading));
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 900;
  color: #F59E0B;
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

.nfs-garage-subtitle {
  font-size: 0.88rem;
  color: #CBD5E1;
  margin-bottom: 20px;
  line-height: 1.45;
}

/* Supercar Selector Grid */
.nfs-car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.nfs-car-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 12px 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.nfs-car-card:hover {
  border-color: rgba(245, 158, 11, 0.6);
  transform: translateY(-2px);
}

.nfs-car-card.selected {
  background: rgba(245, 158, 11, 0.16);
  border-color: #F59E0B;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
  transform: scale(1.03);
}

.nfs-car-icon {
  font-size: 2.2rem;
  line-height: 1.1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

.nfs-car-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nfs-car-trait {
  font-size: 0.64rem;
  font-weight: 700;
  color: #F59E0B;
}

/* Neon Underglow Swatches */
.nfs-underglow-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94A3B8;
  margin-bottom: 8px;
  display: block;
  text-align: left;
}

.nfs-underglow-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
}

.underglow-swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.underglow-swatch.selected {
  border-color: #FFFFFF;
  transform: scale(1.15);
  box-shadow: 0 0 20px var(--swatch-color);
}

.underglow-swatch::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--swatch-color);
}

/* Garage Inputs (Driver & Plate) */
.nfs-garage-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
  text-align: left;
}

@media (max-width: 600px) {
  .nfs-garage-input-row {
    grid-template-columns: 1fr;
  }
}

.nfs-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nfs-input-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #F59E0B;
}

.nfs-text-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.6);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  outline: none;
  transition: all 0.25s ease;
}

.nfs-text-input:focus {
  border-color: #F59E0B;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
}

.btn-start-race {
  width: 100%;
  padding: 13px 24px;
  border-radius: 30px;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 50%, #B45309 100%);
  color: #000000;
  border: 1px solid #FDE68A;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.5);
  transition: all 0.25s ease;
  margin-top: 6px;
}

.btn-start-race:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 40px rgba(245, 158, 11, 0.75);
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
}

/* --------------------------------------------------------------------------
   2. RACING ARENA & PSEUDO-3D CANVAS
   -------------------------------------------------------------------------- */
#nfsBattleArea {
  position: relative;
  width: 100%;
}

/* Top Cockpit Story & Driver Strip */
.nfs-hud-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(18, 20, 34, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 18px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.nfs-driver-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nfs-driver-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #181928;
  border: 2px solid #F59E0B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.nfs-driver-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.nfs-driver-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.04em;
}

.nfs-plate-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: #F59E0B;
  background: rgba(0, 0, 0, 0.5);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  letter-spacing: 0.08em;
  display: inline-block;
  margin-top: 2px;
}

/* Heat Level & Stats Badges */
.nfs-hud-stats-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nfs-stat-pill {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nfs-stat-pill-label {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94A3B8;
  text-transform: uppercase;
}

.nfs-stat-pill-val {
  font-size: 1.05rem;
  font-weight: 900;
  font-family: var(--font-display, var(--font-heading));
  color: #FFFFFF;
}

/* Heat Level Indicator */
.nfs-heat-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  transition: all 0.3s ease;
}

.nfs-heat-indicator.active {
  background: rgba(239, 68, 68, 0.2);
  border-color: #EF4444;
  color: #F87171;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
  animation: heatBlink 0.6s infinite alternate;
}

@keyframes heatBlink {
  0% { opacity: 0.8; }
  100% { opacity: 1; transform: scale(1.02); }
}

/* --------------------------------------------------------------------------
   THE 3D CANVAS STAGE
   -------------------------------------------------------------------------- */
.nfs-canvas-container {
  position: relative;
  width: 100%;
  height: 480px;
  background: #020306;
  border-radius: 22px;
  overflow: hidden;
  border: 2px solid rgba(245, 158, 11, 0.35);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.95);
}

@media (max-width: 768px) {
  .nfs-canvas-container {
    height: 380px;
  }
}

#nfsCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Nitro Warp Speed Lines Effect (Active when NOS is firing) */
.nfs-nitro-warp-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 60%, transparent 40%, rgba(6, 182, 212, 0.25) 100%);
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.nfs-nitro-warp-overlay.active {
  opacity: 1;
}

/* Flashy Comic Near-Miss / Overtake Popup */
.nfs-near-miss-popup {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  font-family: var(--font-display, var(--font-heading));
  font-size: clamp(1.4rem, 3.5vw, 2.4rem);
  font-weight: 900;
  color: #FBBF24;
  text-shadow: 
    0 0 20px rgba(245, 158, 11, 0.9),
    0 4px 8px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  opacity: 0;
  z-index: 25;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nfs-near-miss-popup.show {
  transform: translate(-50%, -50%) scale(1.15) rotate(-3deg);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   THE SPEEDOMETER & COCKPIT HUD
   -------------------------------------------------------------------------- */
.nfs-cockpit-hud {
  position: absolute;
  bottom: 14px;
  right: 18px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  z-index: 15;
  pointer-events: none;
}

/* Speedometer Dial Card */
.nfs-speedo-card {
  background: rgba(6, 8, 15, 0.82);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  border-radius: 20px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  min-width: 120px;
}

.speedo-num-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.speedo-num {
  font-family: var(--font-display, var(--font-heading));
  font-size: 2.2rem;
  font-weight: 900;
  color: #FFFFFF;
  line-height: 1;
  text-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
}

.speedo-unit {
  font-size: 0.72rem;
  font-weight: 800;
  color: #F59E0B;
  letter-spacing: 0.06em;
}

.speedo-gear-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #94A3B8;
  margin-top: 4px;
}

.gear-badge {
  background: #F59E0B;
  color: #000000;
  padding: 1px 7px;
  border-radius: 6px;
  font-weight: 900;
}

/* Nitro (NOS) Bottle Tank Gauge */
.nfs-nos-gauge-box {
  background: rgba(6, 8, 15, 0.82);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(6, 182, 212, 0.4);
  border-radius: 20px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  min-width: 90px;
}

.nos-label {
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #06B6D4;
  margin-bottom: 6px;
}

.nos-tank-track {
  width: 60px;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.nos-tank-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #06B6D4 0%, #3B82F6 100%);
  border-radius: 5px;
  transition: width 0.15s ease;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.8);
}

/* --------------------------------------------------------------------------
   BOTTOM CONTROLS BAR (KEYBOARD INSTRUCTIONS & MOBILE TOUCH)
   -------------------------------------------------------------------------- */
.nfs-controls-bar {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nfs-instructions-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #CBD5E1;
  flex-wrap: wrap;
}

.nfs-key-badge {
  background: #1E2235;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #F8FAFC;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.76rem;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

/* Mobile Virtual Touch Controls */
.nfs-mobile-controls-row {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  gap: 12px;
}

@media (max-width: 900px) {
  .nfs-mobile-controls-row {
    display: flex;
  }
}

.nfs-touch-steer-group {
  display: flex;
  gap: 10px;
}

.nfs-touch-btn {
  width: 58px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.nfs-touch-btn:active {
  background: rgba(245, 158, 11, 0.35);
  border-color: #F59E0B;
  transform: scale(0.94);
}

.nfs-touch-pedals-group {
  display: flex;
  gap: 10px;
}

.btn-touch-nitro {
  padding: 0 18px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #06B6D4 0%, #2563EB 100%);
  border: 1.5px solid #67E8F9;
  color: #FFFFFF;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.4);
}

.btn-touch-nitro:active {
  transform: scale(0.94);
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.8);
}

/* --------------------------------------------------------------------------
   3. GAME OVER / BUSTED / HIGH SCORE MODAL
   -------------------------------------------------------------------------- */
.nfs-gameover-modal {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 12, 0.94);
  backdrop-filter: blur(14px);
  z-index: 70;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.nfs-gameover-modal.show {
  display: flex;
  animation: modalFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.nfs-gameover-card {
  background: linear-gradient(180deg, #16192A 0%, #0A0D18 100%);
  border: 2px solid #F59E0B;
  border-radius: 24px;
  padding: 28px 32px;
  max-width: 520px;
  width: 95%;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.95),
    0 0 40px rgba(245, 158, 11, 0.3);
}

.nfs-gameover-card.busted {
  border-color: #EF4444;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.95),
    0 0 40px rgba(239, 68, 68, 0.4);
}

.nfs-gameover-title {
  font-family: var(--font-display, var(--font-heading));
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 900;
  color: #F59E0B;
  text-transform: uppercase;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}

.nfs-gameover-card.busted .nfs-gameover-title {
  color: #EF4444;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

.nfs-stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.nfs-summary-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
}

.nfs-summary-label {
  font-size: 0.6rem;
  font-weight: 800;
  color: #94A3B8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nfs-summary-val {
  font-family: var(--font-display, var(--font-heading));
  font-size: 1.25rem;
  font-weight: 900;
  color: #FBBF24;
  margin-top: 2px;
}

.nfs-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

