/* ── Variables ── */
:root {
  --bg: #000000;
  --gold: #ffc03f;
  --orange: #ff9245;
  --cyan: #25d6e9;
  --text-dim: rgba(255,255,255,0.45);
  --text-mid: rgba(255,255,255,0.65);
  --nav-dot: #9C9C9C;
  --nav-active: #ff9245;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
  color: #fff;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── Canvas ── */
#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 1;
}
#canvas-container canvas { display: block; }

/* ═══════════════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════════════ */
.loading-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.loading-overlay.hidden {
  opacity: 0; visibility: hidden; pointer-events: none;
}

.loading-ring-wrap {
  position: relative;
  width: 120px; height: 120px;
  margin-bottom: 24px;
}
.loading-ring-svg { width: 100%; height: 100%; }
.loading-ring-bg { stroke: rgba(255,255,255,0.08); }
.loading-ring-fg { transition: stroke-dashoffset 0.15s linear; }
.loading-pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 300; letter-spacing: 0.04em;
  color: rgba(255,255,255,0.8);
}

.loading-text {
  font-size: 13px; letter-spacing: 0.12em;
  color: rgba(255,255,255,0.35);
}

.loading-error {
  display: none; margin-top: 20px;
  font-size: 12px; color: rgba(255,100,100,0.8);
  text-align: center; line-height: 1.8; max-width: 360px;
}
.loading-error code {
  background: rgba(255,255,255,0.08);
  padding: 3px 8px; border-radius: 4px; font-size: 11px;
}

/* ═══════════════════════════════════════════
   FLASH TRANSITION
   ═══════════════════════════════════════════ */
.flash-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: #fff; opacity: 0; pointer-events: none;
}
.flash-overlay.active {
  opacity: 1;
  transition: opacity 0.08s ease-in;
}
.flash-overlay.fading {
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

/* ═══════════════════════════════════════════
   BOOST INDICATOR
   ═══════════════════════════════════════════ */
.boost-indicator {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--orange);
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 0 60px rgba(255,146,69,0.8), 0 0 120px rgba(255,146,69,0.4);
  transition: opacity 0.15s ease;
}
.boost-indicator.active {
  opacity: 0.8;
  animation: boostPulse 0.6s ease-in-out infinite alternate;
}
@keyframes boostPulse {
  from { text-shadow: 0 0 60px rgba(255,146,69,0.8), 0 0 120px rgba(255,146,69,0.4); }
  to   { text-shadow: 0 0 100px rgba(255,146,69,1), 0 0 180px rgba(255,146,69,0.6); }
}

/* ═══════════════════════════════════════════
   TOP INFO AREA
   ═══════════════════════════════════════════ */
.top-info {
  position: fixed;
  top: 24px; left: 24px; right: 24px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.top-version {
  font-size: 12px; font-weight: 400; letter-spacing: 0.06em;
  color: rgba(255,255,255,0.35);
  pointer-events: all;
}
.top-right {
  display: flex; align-items: center; gap: 16px;
  pointer-events: all;
}
.top-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.45); cursor: pointer;
  width: 28px; height: 28px; padding: 4px;
  transition: color 0.3s, transform 0.3s;
}
.top-btn:hover { color: rgba(255,255,255,0.85); transform: scale(1.15); }
.top-btn svg { width: 100%; height: 100%; }

.top-logo {
  opacity: 0.5;
  transition: opacity 0.3s;
}
.top-logo:hover { opacity: 0.8; }
.top-logo svg { width: 80px; height: auto; display: block; }

/* ═══════════════════════════════════════════
   RIGHT NAV — vertical dots + line
   ═══════════════════════════════════════════ */
.side-nav {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.nav-item {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}
.nav-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--nav-dot);
  transition: background 0.35s, box-shadow 0.35s, transform 0.35s;
}
.nav-label {
  position: absolute;
  right: 38px;
  font-size: 11px;
  color: rgba(255,255,255,0);
  white-space: nowrap;
  transition: color 0.3s, opacity 0.3s;
  pointer-events: none;
}
.nav-item:hover .nav-dot {
  background: #D9D9D9;
  transform: scale(1.3);
}
.nav-item:hover .nav-label {
  color: rgba(255,255,255,0.7);
}
.nav-item.active .nav-dot {
  background: #fff;
  box-shadow: 0 0 0 1px var(--orange), 0 0 12px rgba(255,146,69,0.4);
}
.nav-item.active .nav-label {
  color: rgba(255,255,255,0.85);
}
.nav-line {
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,0.15);
}

/* Hide interior nav for SU7 */
.nav-interior.hidden,
.nav-interior-line.hidden {
  display: none;
}

/* ═══════════════════════════════════════════
   CAR SWITCHER
   ═══════════════════════════════════════════ */
.car-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 50px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 20px;
}
.car-switch-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 8px 20px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.35s ease;
  font-family: inherit;
  white-space: nowrap;
}
.car-switch-btn:hover {
  color: rgba(255,255,255,0.75);
}
.car-switch-btn.active {
  background: rgba(255,192,63,0.15);
  color: var(--gold);
  box-shadow: 0 0 12px rgba(255,192,63,0.15);
}

/* ═══════════════════════════════════════════
   BOTTOM CONTROLS
   ═══════════════════════════════════════════ */
.bottom-controls {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ═══════════════════════════════════════════
   BOTTOM COLOR BAR
   ═══════════════════════════════════════════ */
.color-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.color-bar-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
}
.color-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 50px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.06);
}
.color-swatch {
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
}
.color-swatch:hover { transform: scale(1.25); }
.color-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 12px rgba(255,255,255,0.25);
}

/* ═══════════════════════════════════════════
   SCREENSHOT BUTTON
   ═══════════════════════════════════════════ */
.screenshot-btn {
  position: fixed;
  bottom: 155px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  transition: color 0.3s, transform 0.3s, background 0.3s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.screenshot-btn:hover {
  color: rgba(255,255,255,0.8);
  transform: translateX(-50%) scale(1.12);
  background: rgba(255,255,255,0.12);
}
.screenshot-btn svg { width: 18px; height: 18px; }

/* ═══════════════════════════════════════════
   INFO PANEL
   ═══════════════════════════════════════════ */
.info-panel {
  position: fixed;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: none;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.info-panel.visible { display: flex; }

.info-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  opacity: 0;
  animation: infoFadeIn 0.4s ease forwards;
}
.info-row:nth-child(1) { animation-delay: 0.05s; }
.info-row:nth-child(2) { animation-delay: 0.12s; }
.info-row:nth-child(3) { animation-delay: 0.19s; }
.info-row:nth-child(4) { animation-delay: 0.26s; }

.info-val {
  font-size: 52px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}
.info-unit {
  font-size: 13px;
  color: rgba(255,255,255,0.35);
}
.info-label {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.06em;
}

@keyframes infoFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .side-nav { right: 12px; }
  .nav-item { width: 24px; height: 24px; }
  .nav-dot { width: 6px; height: 6px; }
  .nav-line { height: 12px; }
  .nav-label { display: none; }
  .car-switch-btn { font-size: 12px; padding: 6px 14px; }
  .color-bar { gap: 6px; padding: 8px 14px; }
  .color-swatch { width: 20px; height: 20px; }
  .screenshot-btn { bottom: 140px; width: 34px; height: 34px; }
  .screenshot-btn svg { width: 15px; height: 15px; }
  .info-panel { left: 16px; }
  .info-val { font-size: 26px; }
  .top-version { font-size: 11px; }
  .top-info { top: 16px; left: 16px; right: 16px; }
  .boost-indicator { font-size: 40px; }
}
