:root {
  --bg-primary: #0a0e14;
  --bg-card: rgba(18, 25, 38, 0.85);
  --bg-card-hover: rgba(26, 36, 54, 0.95);
  --border-neon: rgba(0, 242, 254, 0.3);
  --border-glow: #00f2fe;
  --neon-cyan: #00f2fe;
  --neon-green: #39ff14;
  --neon-purple: #b537f2;
  --neon-red: #ff3366;
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --accent-gold: #ffd700;
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Consolas", "Fira Code", monospace;
}

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

body {
  background: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 242, 254, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(57, 255, 20, 0.08) 0%, transparent 40%),
    linear-gradient(rgba(10, 14, 20, 0.95), rgba(10, 14, 20, 0.95)),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 242, 254, 0.02) 2px, rgba(0, 242, 254, 0.02) 4px);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  padding: 24px 16px;
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header & Branding */
header {
  text-align: center;
  margin-bottom: 32px;
  position: relative;
}

.brand-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.12) 0%, rgba(57, 255, 20, 0.12) 100%);
  border: 1px solid rgba(0, 242, 254, 0.4);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.25), inset 0 0 10px rgba(57, 255, 20, 0.15);
  backdrop-filter: blur(10px);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 10px var(--neon-green);
  animation: pulse 1.8s infinite;
}

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

.brand-text {
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 2.5px;
  background: linear-gradient(90deg, #ffffff 0%, #00f2fe 50%, #39ff14 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.brand-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--neon-cyan);
  border-radius: 12px;
}

.main-title {
  font-size: 2.6rem;
  font-weight: 950;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #00f2fe 0%, #ffffff 50%, #39ff14 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 35px rgba(0, 242, 254, 0.5);
  margin-bottom: 6px;
}

.neon-bolt {
  -webkit-text-fill-color: #ffd700;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8));
  display: inline-block;
  animation: boltFloat 2s ease-in-out infinite alternate;
}

@keyframes boltFloat {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-3px) scale(1.1); }
}

.tuner-credit {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.credit-highlight {
  color: var(--neon-cyan);
  background: rgba(0, 242, 254, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0, 242, 254, 0.3);
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.6);
}
  text-shadow: 0 0 25px rgba(0, 242, 254, 0.4);
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* Dropzone */
.dropzone-container {
  margin-bottom: 24px;
}

.dropzone {
  border: 2px dashed var(--border-neon);
  background: rgba(18, 25, 38, 0.5);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--neon-cyan);
  background: rgba(0, 242, 254, 0.05);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.2);
  transform: translateY(-2px);
}

.dropzone-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.5));
}

.dropzone-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.dropzone-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.file-input {
  display: none;
}

/* Profile Bar */
.profile-bar {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-neon);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  align-items: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-value input[type="text"], .stat-value input[type="number"] {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--neon-green);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  width: 140px;
  outline: none;
}

.stat-value input:focus {
  border-color: var(--neon-green);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

.status-pill {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.status-pill.valid {
  background: rgba(57, 255, 20, 0.15);
  border: 1px solid var(--neon-green);
  color: var(--neon-green);
}

.status-pill.invalid {
  background: rgba(255, 51, 102, 0.15);
  border: 1px solid var(--neon-red);
  color: var(--neon-red);
}

/* Tabs Navigation */
.tabs-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.tab-btn.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.tab-badge {
  font-size: 0.75rem;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  margin-left: 6px;
}

/* Master Actions */
.master-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  outline: none;
}

.btn-beast {
  background: linear-gradient(135deg, #00f2fe 0%, #39ff14 100%);
  color: #050a0f;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
  font-size: 1.05rem;
  padding: 14px 26px;
  flex: 1 1 300px;
}

.btn-beast:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(57, 255, 20, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--neon-cyan);
}

.btn-gold {
  background: rgba(255, 215, 0, 0.1);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.btn-gold:hover {
  background: rgba(255, 215, 0, 0.2);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* Garage Grid */
.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.garage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.car-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.car-card:hover {
  border-color: var(--border-neon);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

.car-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.car-slot-tag {
  font-size: 0.7rem;
  color: var(--neon-cyan);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.car-name-select {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 242, 254, 0.2);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 4px 8px;
  outline: none;
  width: 100%;
  margin-top: 4px;
}

.car-name-select:focus {
  border-color: var(--neon-cyan);
}

/* Stat Bars */
.stat-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.bar-label {
  width: 90px;
  color: var(--text-muted);
}

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

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.bar-fill.accel {
  background: linear-gradient(90deg, #ff9900, #ff3366);
}

.bar-fill.speed {
  background: linear-gradient(90deg, #00f2fe, #39ff14);
}

.bar-fill.handling {
  background: linear-gradient(90deg, #00d2ff, #0072ff);
}

.bar-value {
  width: 48px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Card Controls */
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.82rem;
  border-radius: 6px;
  flex: 1;
}

/* Tuning Drawer */
.tuning-drawer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: none;
}

.tuning-drawer.open {
  display: block;
}

.slider-group {
  margin-bottom: 10px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.slider-header span:last-child {
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--neon-cyan);
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
}

/* Export Panel */
.export-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-neon);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  margin-top: 24px;
}

.export-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
}

.instructions {
  margin-top: 20px;
  background: rgba(0, 0, 0, 0.4);
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: left;
  border-left: 3px solid var(--neon-cyan);
}

.instructions code {
  color: var(--neon-cyan);
  background: rgba(0, 242, 254, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: rgba(18, 25, 38, 0.95);
  border: 1px solid var(--neon-green);
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 768px) {
  .master-actions { flex-direction: column; }
  .btn-beast { width: 100%; }
}
