:root {
  --bg-dark: rgba(13, 16, 23, 0.84);
  --bg-panel: rgba(20, 25, 35, 0.88);
  --border-glass: rgba(255, 255, 255, 0.12);
  --chevy-gold: #d4af37;
  --chevy-gold-bright: #f5d061;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
}

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0d14;
  color: var(--text-main);
}

#canvas-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  border-radius: 14px;
}

/* TOP HEADER BAR */
#top-bar {
  position: fixed;
  top: 14px;
  left: 16px;
  right: 16px;
  height: 62px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-dark);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chevy-bowtie {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 8px 10px;
  border-radius: 10px;
}

.brand-badge h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trim-tag {
  font-size: 0.72rem;
  background: linear-gradient(135deg, #d4af37, #aa821c);
  color: #0b0d12;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 800;
}

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

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.camera-pills {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 4px;
}

.cam-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 7px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.cam-btn.active {
  background: rgba(212, 175, 55, 0.22);
  color: var(--chevy-gold-bright);
  border: 1px solid rgba(212, 175, 55, 0.45);
}

.game-mode-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #d4af37 0%, #b5891c 100%);
  color: #090b10;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(212, 175, 55, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.game-mode-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.55);
}

.game-mode-btn.in-game {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.45);
}

/* LEFT CONTROL DOCK */
#control-dock {
  position: fixed;
  top: 90px;
  left: 16px;
  width: 345px;
  max-height: calc(100vh - 108px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.dock-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border-glass);
  padding: 5px;
  gap: 4px;
}

.tab-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 9px 4px;
  font-size: 0.73rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}

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

.tab-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--chevy-gold-bright);
}

.tab-content {
  display: none;
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-header h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #e5e7eb;
}

.value-badge {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.09);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--chevy-gold-bright);
  font-weight: 600;
}

.value-badge.status-on {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* SWATCHES */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.swatch {
  height: 36px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.25), 0 3px 8px rgba(0, 0, 0, 0.4);
}

.swatch:hover {
  transform: scale(1.06);
}

.swatch.active {
  border-color: var(--chevy-gold-bright);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.55);
}

.custom-picker-row, .slider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 11px;
  border-radius: 8px;
}

.slider-row {
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
}

input[type="color"] {
  width: 44px;
  height: 26px;
  border: none;
  border-radius: 5px;
  background: none;
  cursor: pointer;
}

.ui-select {
  background: #141923;
  color: #fff;
  border: 1px solid var(--border-glass);
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 0.78rem;
  outline: none;
}

.helper-hint {
  font-size: 0.73rem;
  line-height: 1.4;
  color: var(--text-muted);
  background: rgba(212, 175, 55, 0.08);
  border-left: 3px solid var(--chevy-gold);
  padding: 8px 10px;
  border-radius: 6px;
}

/* DOORS & TOGGLES */
.quick-door-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.action-btn {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
}

.action-btn.primary {
  background: rgba(212, 175, 55, 0.2);
  border-color: rgba(212, 175, 55, 0.45);
  color: var(--chevy-gold-bright);
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.door-toggle-list, .system-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.part-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 9px 11px;
  border-radius: 9px;
}

.part-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.part-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f3f4f6;
}

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

.toggle-part-btn {
  min-width: 68px;
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.toggle-part-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.toggle-part-btn.open {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #34d399;
}

/* RIMS CARDS */
.rim-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rim-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  border-radius: 10px;
  color: left;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}

.rim-card:hover {
  background: rgba(255, 255, 255, 0.07);
}

.rim-card.active {
  background: rgba(212, 175, 55, 0.16);
  border-color: var(--chevy-gold);
}

.rim-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--chevy-gold-bright);
  flex-shrink: 0;
}

.rim-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rim-meta strong {
  font-size: 0.8rem;
  color: #fff;
}

.rim-meta span {
  font-size: 0.69rem;
  color: var(--text-muted);
}

/* TELEMETRY & MINIMAP HUD */
#telemetry-hud {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 10;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 242px;
}

#minimap-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 10px;
}

.minimap-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-muted);
}

.signal-indicator {
  font-size: 0.7rem;
  color: #34d399;
}

#minimap-canvas {
  width: 100%;
  height: 185px;
  background: #0d131a;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.cluster-gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gauge-box {
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: #6ee7b7;
  letter-spacing: 0.06em;
}

.gauge-value {
  font-family: 'Orbitron', monospace;
  font-size: 1.45rem;
  font-weight: 800;
  color: #ecfdf5;
  margin: 2px 0;
}

.gauge-unit {
  font-size: 0.6rem;
  color: var(--text-muted);
}

.rpm-bar-bg {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.rpm-bar-fill {
  height: 100%;
  width: 15%;
  background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
  transition: width 0.08s linear;
}

.gear-strip {
  display: flex;
  gap: 5px;
  margin-top: 5px;
  font-family: 'Orbitron', monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.gear-strip span {
  padding: 1px 4px;
  border-radius: 3px;
}

.gear-strip span.active {
  background: #10b981;
  color: #051b11;
  font-weight: 800;
}

/* DRIVING OVERLAY */
#driving-controls-overlay {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.controls-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--chevy-gold-bright);
  letter-spacing: 0.06em;
}

.key-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.74rem;
  color: #e5e7eb;
}

kbd {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 0.72rem;
  color: #fff;
}

#part-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 50;
  background: rgba(12, 15, 22, 0.92);
  border: 1px solid var(--chevy-gold);
  color: var(--chevy-gold-bright);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.hidden {
  display: none !important;
}
