/* ===================================================================
   CPM1 APEX TUNING LAB - STYLESHEET
   Aesthetics: High-Performance Automotive Cockpit / Cyber Motorsport
   Creators: jozethdev & CTS_MAX
   =================================================================== */

:root {
  --bg-dark: #080a0f;
  --bg-card: rgba(14, 18, 27, 0.82);
  --bg-card-hover: rgba(20, 26, 39, 0.92);
  --border-card: rgba(0, 240, 255, 0.18);
  --border-card-gold: rgba(255, 215, 0, 0.28);
  
  --neon-cyan: #00f0ff;
  --neon-cyan-glow: rgba(0, 240, 255, 0.35);
  --racing-red: #ff1e42;
  --racing-red-glow: rgba(255, 30, 66, 0.35);
  --king-gold: #ffc400;
  --king-gold-glow: rgba(255, 196, 0, 0.45);
  --neon-green: #00ffa3;
  --neon-green-glow: rgba(0, 255, 163, 0.35);

  --text-main: #f0f4fc;
  --text-muted: #8391a8;
  --text-dim: #4b556b;

  --font-race: 'Orbitron', -apple-system, sans-serif;
  --font-tech: 'Rajdhani', -apple-system, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;
  
  --transition-fast: 0.18s ease;
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-tech);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Background Carbon & Cyber Grid */
.carbon-bg {
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 50% 0%, rgba(0, 240, 255, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 90% 90%, rgba(255, 30, 66, 0.06) 0%, transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 2px, transparent 2px, transparent 6px),
    #080a0f;
  z-index: -2;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-size: 50px 50px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  z-index: -1;
  pointer-events: none;
}

.ambient-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  filter: blur(120px);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}
.cyan-glow {
  top: -100px;
  left: 20%;
  background: rgba(0, 240, 255, 0.12);
}
.red-glow {
  bottom: 0;
  right: 15%;
  background: rgba(255, 30, 66, 0.1);
}

/* ===================================================================
   TOP NAVIGATION & WATERMARKS
   =================================================================== */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(10, 14, 22, 0.85);
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(255, 30, 66, 0.2));
  border: 1px solid var(--neon-cyan);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neon-cyan);
  box-shadow: 0 0 15px var(--neon-cyan-glow);
}

.brand-text .title {
  display: block;
  font-family: var(--font-race);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 1.5px;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.brand-text .subtitle {
  display: block;
  font-size: 0.8rem;
  color: var(--neon-cyan);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.creators-watermark-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.created-by-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.creator-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-race);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  transition: var(--transition-fast);
}

.tiktok-svg {
  width: 14px;
  height: 14px;
  color: #fff;
}

.creator-pill:hover {
  background: linear-gradient(135deg, rgba(254, 44, 85, 0.2), rgba(37, 244, 238, 0.2));
  border-color: #fe2c55;
  box-shadow: 0 0 12px rgba(254, 44, 85, 0.4), 0 0 12px rgba(37, 244, 238, 0.3);
  transform: translateY(-2px);
}

/* ===================================================================
   MAIN LAYOUT & COCKPIT CONTAINER
   =================================================================== */
.app-main {
  flex: 1;
  padding: 2rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.panel-section {
  width: 100%;
  max-width: 1100px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.panel-section.hidden {
  display: none !important;
}

/* ===================================================================
   LOGIN COCKPIT CARD & RPM BANNER
   =================================================================== */
.cockpit-container {
  max-width: 480px;
  margin: 1rem auto;
}

.rpm-gauge-banner {
  background: rgba(14, 18, 27, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 0.75rem 1.25rem 0.5rem;
}

.rpm-scale {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-race);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.rpm-mark.redline {
  color: var(--racing-red);
  font-weight: 900;
}

.rpm-unit {
  font-size: 0.65rem;
  color: var(--neon-cyan);
  letter-spacing: 0.5px;
}

.rpm-needle-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.rpm-fill {
  height: 100%;
  width: 15%;
  background: linear-gradient(90deg, var(--neon-cyan), #f0f 70%, var(--racing-red));
  border-radius: 4px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px var(--neon-cyan);
}

.rpm-fill.revving {
  animation: tachRev 1.2s infinite alternate ease-in-out;
}

@keyframes tachRev {
  0% { width: 45%; }
  50% { width: 92%; box-shadow: 0 0 15px var(--racing-red); }
  100% { width: 85%; }
}

.cockpit-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 240, 255, 0.05);
}

.card-header {
  text-align: center;
  margin-bottom: 1.8rem;
}

.turbo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  background: rgba(0, 255, 163, 0.1);
  border: 1px solid rgba(0, 255, 163, 0.3);
  color: var(--neon-green);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-family: var(--font-race);
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--neon-green);
  border-radius: 50%;
  animation: pulseGreen 1.5s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 8px var(--neon-green); }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.card-header h2 {
  font-family: var(--font-race);
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  margin-bottom: 0.4rem;
  color: #fff;
}

.card-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Form Controls */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(8, 12, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-tech);
  font-size: 1.05rem;
  outline: none;
  transition: var(--transition-fast);
}

.input-wrapper input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan-glow);
  background: rgba(12, 18, 28, 0.95);
}

.input-wrapper.password-input-wrapper input {
  padding-right: 2.75rem;
}

.toggle-password-btn {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.toggle-password-btn:hover {
  color: var(--neon-cyan);
}

.input-readonly {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--neon-cyan) !important;
  font-family: var(--font-race) !important;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.form-row-compact {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}

.flex-1 {
  flex: 1;
}

.remember-group {
  padding-bottom: 0.85rem;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input {
  accent-color: var(--neon-cyan);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Engine Ignition Button */
.engine-start-btn {
  margin-top: 0.8rem;
  position: relative;
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #ff1a4b 0%, #a80b2a 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-race);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 1.5px;
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition-normal);
  box-shadow: 0 8px 25px rgba(255, 26, 75, 0.4);
}

.engine-start-btn .btn-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  position: relative;
  z-index: 2;
}

.engine-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 26, 75, 0.6), 0 0 20px rgba(255, 26, 75, 0.4);
  background: linear-gradient(135deg, #ff2d5b 0%, #c41035 100%);
}

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

.engine-start-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.5);
}

.advanced-settings-toggle {
  margin-top: 1.5rem;
  text-align: center;
}

.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-tech);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: color 0.2s;
}

.link-btn:hover {
  color: var(--neon-cyan);
}

.adv-settings-panel {
  margin-top: 0.75rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  text-align: left;
}

.hint-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.hint-text code {
  color: var(--neon-cyan);
}

/* ===================================================================
   DASHBOARD / COCKPIT TELEMETRY
   =================================================================== */
.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* HUD Top Bar */
.account-hud-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.75rem;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.driver-profile {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.driver-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(255, 215, 0, 0.2));
  border: 2px solid var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neon-cyan);
  box-shadow: 0 0 15px var(--neon-cyan-glow);
}

.driver-session-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.session-badge-online {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-race);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--neon-green);
  letter-spacing: 1px;
}

.session-game-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* ===================================================================
   FICHA DE DATOS DE LA CUENTA (ORDENADO: NOMBRE, ID, DINERO, MONEDAS)
   DISEÑO ANTICORTES / RESPONSIVO
   =================================================================== */
.account-overview-section {
  width: 100%;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  width: 100%;
}

@media (max-width: 1024px) {
  .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

.overview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
  min-width: 0; /* IMPEDIR DESBORDAMIENTO */
  overflow: hidden;
  backdrop-filter: blur(14px);
  transition: var(--transition-fast);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.overview-card:hover {
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.card-mini-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-mini-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.card-mini-icon {
  font-size: 1.1rem;
}

.card-main-content {
  min-width: 0;
  display: flex;
  align-items: center;
}

.account-name-text {
  font-family: var(--font-race);
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  font-weight: 800;
  color: #fff;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.35;
  min-width: 0;
}

.id-content-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

.account-id-text {
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.08);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  word-break: break-all;
  overflow-wrap: anywhere;
  min-width: 0;
  flex: 1;
}

.money-text-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
}

.money-number {
  font-family: var(--font-race);
  font-size: clamp(1.15rem, 2.5vw, 1.65rem);
  font-weight: 900;
  color: #00ffa3;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.coins-text-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
}

.coins-number {
  font-family: var(--font-race);
  font-size: clamp(1.15rem, 2.5vw, 1.65rem);
  font-weight: 900;
  color: #ffc400;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.overview-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.2rem;
}

.overview-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.driver-meta code {
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.08);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0.2rem;
  transition: transform 0.2s;
}

.copy-btn:hover {
  transform: scale(1.2);
}

.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.online {
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hud-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  font-family: var(--font-race);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.refresh-btn {
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.3);
  color: var(--neon-cyan);
}

.refresh-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  box-shadow: 0 0 15px var(--neon-cyan-glow);
}

.logout-btn {
  background: rgba(255, 30, 66, 0.1);
  border-color: rgba(255, 30, 66, 0.3);
  color: var(--racing-red);
}

.logout-btn:hover {
  background: rgba(255, 30, 66, 0.2);
  box-shadow: 0 0 15px var(--racing-red-glow);
}

/* ===================================================================
   TELEMETRY GRID (GAUGES)
   =================================================================== */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.telemetry-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: var(--transition-fast);
}

.telemetry-card:hover {
  border-color: var(--neon-cyan);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.card-bg-watermark {
  position: absolute;
  right: -10px;
  bottom: -15px;
  font-family: var(--font-race);
  font-size: 7rem;
  font-weight: 900;
  opacity: 0.04;
  color: #fff;
  pointer-events: none;
  user-select: none;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.telemetry-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}

.telemetry-icon {
  font-size: 1.3rem;
}

.telemetry-value-container {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin-bottom: 0.8rem;
}

.currency-prefix {
  font-family: var(--font-race);
  font-size: 1.4rem;
  color: var(--neon-cyan);
  font-weight: 700;
}

.telemetry-value {
  font-family: var(--font-race);
  font-size: 2.1rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
}

.rank-value {
  font-size: 1.8rem;
  color: var(--king-gold);
}

.telemetry-footer {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.telemetry-limit {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.telemetry-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.telemetry-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.money-bar-fill {
  background: linear-gradient(90deg, #00ffa3, #00f0ff);
  box-shadow: 0 0 10px var(--neon-cyan);
}

.coins-bar-fill {
  background: linear-gradient(90deg, #ff9900, #ffd700);
  box-shadow: 0 0 10px var(--king-gold);
}

/* ===================================================================
   WORKSHOP ACTIONS GRID
   =================================================================== */
.workshop-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-left: 4px solid var(--neon-cyan);
  padding-left: 0.85rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-race);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #fff;
}

.section-badge {
  font-family: var(--font-race);
  font-size: 0.75rem;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 240, 255, 0.25);
}

.tuning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.tuning-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.2rem;
  backdrop-filter: blur(12px);
  transition: var(--transition-fast);
}

.tuning-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.king-tuning-card {
  border-color: rgba(255, 215, 0, 0.3);
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.05) 0%, rgba(14, 18, 27, 0.9) 100%);
}

.king-tuning-card:hover {
  border-color: var(--king-gold);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.25);
}

.w16-tuning-card {
  border-color: rgba(255, 30, 66, 0.3);
  background: linear-gradient(180deg, rgba(255, 30, 66, 0.05) 0%, rgba(14, 18, 27, 0.9) 100%);
}

.w16-tuning-card:hover {
  border-color: var(--racing-red);
  box-shadow: 0 0 25px rgba(255, 30, 66, 0.25);
}

.tuning-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tuning-badge {
  align-self: flex-start;
  font-family: var(--font-race);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.crown-badge {
  background: rgba(255, 215, 0, 0.15);
  color: var(--king-gold);
  border: 1px solid rgba(255, 215, 0, 0.4);
}

.money-badge {
  background: rgba(0, 255, 163, 0.15);
  color: var(--neon-green);
  border: 1px solid rgba(0, 255, 163, 0.4);
}

.coins-badge {
  background: rgba(255, 180, 0, 0.15);
  color: #ffb400;
  border: 1px solid rgba(255, 180, 0, 0.4);
}

.w16-badge {
  background: rgba(255, 30, 66, 0.15);
  color: var(--racing-red);
  border: 1px solid rgba(255, 30, 66, 0.4);
}

.tuning-header h4 {
  font-family: var(--font-race);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
}

.tuning-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.crown-preview-icon {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0;
}

.svg-crown-icon {
  width: 52px;
  height: 52px;
  color: var(--king-gold);
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
}

.w16-engine-graphic {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 30, 66, 0.2);
  font-family: var(--font-race);
  font-weight: 900;
}

.w16-spec {
  color: var(--racing-red);
}

.hp-spec {
  color: #fff;
}

.tuning-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.tuning-desc code {
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

/* Custom Amount Inputs */
.custom-amount-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-with-addons {
  position: relative;
  display: flex;
  align-items: center;
}

.addon-prefix {
  position: absolute;
  left: 0.85rem;
  font-family: var(--font-race);
  font-weight: 700;
  color: var(--neon-cyan);
  pointer-events: none;
}

.input-with-addons input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.2rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-race);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-fast);
}

.input-with-addons input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan-glow);
}

.preset-buttons {
  display: flex;
  gap: 0.35rem;
}

.preset-btn {
  flex: 1;
  padding: 0.35rem 0.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-tech);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.preset-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: var(--neon-cyan);
}

.preset-btn.max-btn {
  color: var(--racing-red);
  border-color: rgba(255, 30, 66, 0.3);
}

.preset-btn.max-btn:hover {
  background: rgba(255, 30, 66, 0.2);
}

/* Action Buttons */
.action-btn {
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-race);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
}

.action-btn:hover {
  transform: translateY(-2px);
}

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

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-gold {
  background: linear-gradient(135deg, #ffd700 0%, #d49500 100%);
  color: #000;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.35);
}
.btn-gold:hover {
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.btn-green {
  background: linear-gradient(135deg, #00ffa3 0%, #009960 100%);
  color: #000;
  box-shadow: 0 4px 15px rgba(0, 255, 163, 0.35);
}
.btn-green:hover {
  box-shadow: 0 6px 20px rgba(0, 255, 163, 0.5);
}

.btn-yellow {
  background: linear-gradient(135deg, #ffc400 0%, #b88600 100%);
  color: #000;
  box-shadow: 0 4px 15px rgba(255, 196, 0, 0.35);
}
.btn-yellow:hover {
  box-shadow: 0 6px 20px rgba(255, 196, 0, 0.5);
}

.btn-red {
  background: linear-gradient(135deg, #ff1a4b 0%, #ad0b2d 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 26, 75, 0.35);
}
.btn-red:hover {
  box-shadow: 0 6px 20px rgba(255, 26, 75, 0.5);
}

.btn-cyan {
  background: linear-gradient(135deg, #00f0ff 0%, #0088cc 100%);
  color: #000;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.35);
}
.btn-cyan:hover {
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.5);
}

.btn-purple {
  background: linear-gradient(135deg, #c084fc 0%, #7e22ce 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(192, 132, 252, 0.35);
}
.btn-purple:hover {
  box-shadow: 0 6px 20px rgba(192, 132, 252, 0.5);
}

.email-badge {
  background: rgba(0, 240, 255, 0.15);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 240, 255, 0.4);
}

.pass-badge {
  background: rgba(192, 132, 252, 0.15);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.4);
}

.email-tuning-card:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
}

.pass-tuning-card:hover {
  border-color: #c084fc;
  box-shadow: 0 0 20px rgba(192, 132, 252, 0.25);
}

/* ===================================================================
   NON-INVASIVE SCREEN FEEDBACK BANNER & CARD ANIMATIONS
   =================================================================== */
.screen-feedback-banner {
  position: fixed;
  top: 75px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  z-index: 990;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.screen-feedback-banner.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-25px);
  pointer-events: none;
}

.feedback-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(10, 14, 22, 0.95);
  border: 1.5px solid var(--king-gold);
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 20px var(--king-gold-glow);
  font-family: var(--font-race);
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
  animation: bannerPulse 1.5s infinite alternate ease-in-out;
}

@keyframes bannerPulse {
  0% { transform: scale(0.98); }
  100% { transform: scale(1.02); box-shadow: 0 10px 35px rgba(0,0,0,0.8), 0 0 25px rgba(255, 215, 0, 0.6); }
}

.feedback-icon {
  font-size: 1.35rem;
  line-height: 1;
}

/* In-Card Non-Invasive Flash & Glow Animations */
.card-flash-gold {
  border-color: var(--king-gold) !important;
  box-shadow: 0 0 35px rgba(255, 215, 0, 0.6) !important;
  animation: cardFlashPulse 0.8s ease-in-out;
}

.card-flash-green {
  border-color: var(--neon-green) !important;
  box-shadow: 0 0 35px rgba(0, 255, 163, 0.6) !important;
  animation: cardFlashPulse 0.8s ease-in-out;
}

.card-flash-yellow {
  border-color: #ffc400 !important;
  box-shadow: 0 0 35px rgba(255, 196, 0, 0.6) !important;
  animation: cardFlashPulse 0.8s ease-in-out;
}

.card-flash-red {
  border-color: var(--racing-red) !important;
  box-shadow: 0 0 35px rgba(255, 30, 66, 0.6) !important;
  animation: cardFlashPulse 0.8s ease-in-out;
}

.card-flash-cyan {
  border-color: var(--neon-cyan) !important;
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.6) !important;
  animation: cardFlashPulse 0.8s ease-in-out;
}

.card-flash-purple {
  border-color: #c084fc !important;
  box-shadow: 0 0 35px rgba(192, 132, 252, 0.6) !important;
  animation: cardFlashPulse 0.8s ease-in-out;
}

@keyframes cardFlashPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

/* Crown target animation */
.crown-animating {
  animation: crownBounce 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes crownBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.35) rotate(-5deg); filter: drop-shadow(0 0 25px rgba(255, 215, 0, 1)); }
  100% { transform: scale(1) rotate(0deg); }
}

/* W16 Turbo flame shake animation */
.w16-animating {
  animation: w16RevShake 0.9s ease-in-out;
}

@keyframes w16RevShake {
  0% { transform: scale(1); }
  25% { transform: scale(1.05) translateX(-3px); }
  50% { transform: scale(1.08) translateX(3px); filter: drop-shadow(0 0 20px rgba(255, 30, 66, 0.8)); }
  75% { transform: scale(1.05) translateX(-2px); }
  100% { transform: scale(1); }
}

/* Pre-Login Warning Alert Card */
.warning-alert-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(255, 180, 0, 0.08);
  border: 1.5px solid rgba(255, 180, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.15rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 15px rgba(255, 180, 0, 0.1);
}

.warning-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffc400;
  flex-shrink: 0;
}

.warning-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.warning-title {
  font-family: var(--font-race);
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffc400;
  letter-spacing: 1px;
}

.warning-msg {
  font-size: 0.85rem;
  color: #f0f4fc;
  line-height: 1.35;
}

/* In-HUD Warning Strip */
.hud-warning-strip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255, 180, 0, 0.07);
  border: 1px solid rgba(255, 180, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.15rem;
  font-size: 0.85rem;
  color: #e2e8f0;
}

.strip-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Telemetry Grid Two Columns */
.telemetry-grid-two {
  grid-template-columns: repeat(2, 1fr) !important;
}

.section-title-security {
  margin-top: 1.5rem;
  border-left-color: #c084fc !important;
}

.security-badge {
  color: #c084fc !important;
  background: rgba(192, 132, 252, 0.1) !important;
  border-color: rgba(192, 132, 252, 0.3) !important;
}

.tuning-grid-security {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
}

/* ===================================================================
   TOAST NOTIFICATIONS
   =================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  z-index: 9999;
  max-width: 380px;
  width: 100%;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(14, 18, 27, 0.95);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.15rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: #fff;
  border-left: 4px solid var(--neon-cyan);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s, transform 0.3s;
}

@keyframes toastIn {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

.toast.toast-success {
  border-left-color: var(--neon-green);
}

.toast.toast-error {
  border-left-color: var(--racing-red);
}

.toast.toast-warning {
  border-left-color: var(--king-gold);
}

.toast-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.toast-message {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.2rem;
}

/* ===================================================================
   FOOTER & WATERMARK
   =================================================================== */
.app-footer {
  padding: 1.5rem 2rem;
  background: rgba(8, 10, 15, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.watermark-signature {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.9rem;
}

.wm-text {
  color: var(--text-muted);
}

.footer-creators {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.link-handle {
  color: var(--neon-cyan);
  font-size: 0.75rem;
}

.footer-link:hover {
  background: rgba(254, 44, 85, 0.15);
  border-color: #fe2c55;
  box-shadow: 0 0 10px rgba(254, 44, 85, 0.4);
}

.creator-divider {
  color: var(--text-dim);
  font-weight: 700;
}

.footer-tech {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-race);
  letter-spacing: 0.5px;
}

/* ===================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   =================================================================== */
@media (max-width: 768px) {
  .top-nav {
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    text-align: center;
  }
  .creators-watermark-bar {
    flex-wrap: wrap;
    justify-content: center;
  }
  .app-main {
    padding: 1rem 0.85rem;
  }
  .cockpit-card {
    padding: 1.5rem 1.15rem;
  }
  .form-row-compact {
    flex-direction: column;
    gap: 0.85rem;
  }
  .account-hud-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem 1rem;
  }
  .hud-actions {
    width: 100%;
    justify-content: space-between;
  }
  .hud-action-btn {
    flex: 1;
    justify-content: center;
  }
  .telemetry-grid, .tuning-grid {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
  .footer-creators {
    flex-wrap: wrap;
    justify-content: center;
  }
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}
