.car-test-page {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 72% 78%, rgba(224, 0, 0, 0.13), transparent 34%),
    radial-gradient(circle at 18% 18%, rgba(244, 200, 75, 0.06), transparent 26%),
    linear-gradient(135deg, rgba(16, 0, 0, 0.82), #030303 42%, #060606 100%);
}

.car-test-page .car-test-header {
  background: rgba(5, 5, 5, 0.78);
}

.car-test-main {
  padding: 84px 0 34px;
}

.car-test-shell {
  min-height: calc(100vh - 132px);
  display: grid;
  grid-template-columns: minmax(300px, 0.58fr) minmax(480px, 1.42fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
}

.car-test-copy,
.car-viewer-panel,
.car-livery-controls {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.068), rgba(255, 255, 255, 0.018)),
    rgba(5, 5, 5, 0.82);
  box-shadow: 0 34px 92px rgba(0, 0, 0, 0.54);
}

.car-test-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(22px, 3.8vw, 44px);
}

.car-test-copy h1 {
  max-width: 12ch;
  margin: 10px 0 14px;
  color: #fff;
  font-size: clamp(2.4rem, 4.6vw, 4.7rem);
  line-height: 0.92;
  text-transform: uppercase;
}

.car-test-subtitle {
  max-width: 34rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.6;
}

.car-test-summary {
  max-width: 34rem;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.98rem;
  line-height: 1.62;
}

.car-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 0;
}

.car-stat-grid div {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(244, 200, 75, 0.08), transparent 48%),
    rgba(255, 255, 255, 0.044);
}

.car-stat-grid dt {
  color: rgba(244, 200, 75, 0.92);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.car-stat-grid dd {
  margin: 5px 0 0;
  color: #fff;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 950;
  line-height: 1;
}

.performance-note {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.78rem;
  line-height: 1.45;
}

.car-test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.car-control-button,
.business-test-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.065);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 950;
  padding: 0 14px;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.car-control-button:hover,
.car-control-button:focus-visible,
.business-test-button:hover,
.business-test-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(224, 0, 0, 0.62);
  background: rgba(224, 0, 0, 0.2);
  box-shadow: 0 16px 38px rgba(224, 0, 0, 0.18);
  outline: none;
}

.car-control-button[aria-pressed="true"],
.business-test-button {
  border-color: rgba(255, 218, 218, 0.74);
  background: linear-gradient(180deg, #ff4747, #d70a0a 48%, #8e0000);
  color: #fff;
  box-shadow: 0 12px 30px rgba(224, 0, 0, 0.28);
}

.car-back-button {
  border-color: rgba(244, 200, 75, 0.54);
  color: #ffe994;
}

.car-viewer-panel {
  position: relative;
  min-height: 600px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 78%, rgba(255, 0, 28, 0.16), transparent 25%),
    radial-gradient(circle at 64% 22%, rgba(255, 255, 255, 0.07), transparent 34%),
    linear-gradient(180deg, #090a0d, #020202 78%);
}

.car-viewer-stack {
  display: grid;
  grid-template-rows: minmax(560px, 1fr) auto;
  gap: 12px;
  min-height: 100%;
}

.car-livery-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(224, 0, 0, 0.12), transparent 46%),
    rgba(5, 5, 5, 0.76);
}

.car-livery-controls span {
  flex: 0 0 auto;
  color: rgba(244, 200, 75, 0.92);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.car-livery-buttons {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 8px;
}

.car-livery-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.064);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 950;
  padding: 0 12px;
  text-transform: uppercase;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.car-livery-button:hover,
.car-livery-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(224, 0, 0, 0.64);
  background: rgba(224, 0, 0, 0.2);
  box-shadow: 0 14px 34px rgba(224, 0, 0, 0.16);
  outline: none;
}

.car-livery-button[aria-pressed="true"] {
  border-color: rgba(255, 218, 218, 0.78);
  background: linear-gradient(180deg, #ff4747, #d70a0a 48%, #8e0000);
  color: #fff;
  box-shadow: 0 10px 26px rgba(224, 0, 0, 0.28);
}

.car-viewer-panel::before,
.car-viewer-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.car-viewer-panel::before {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.032), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.028)),
    radial-gradient(circle at 50% 100%, rgba(244, 200, 75, 0.08), transparent 34%);
  mix-blend-mode: screen;
}

.car-viewer-panel::after {
  inset: auto 10% 9% 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 200, 75, 0.46), transparent);
  box-shadow: 0 0 34px rgba(224, 0, 0, 0.22);
}

#carCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.viewer-message {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: calc(100% - 32px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.72);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 10px 14px;
  text-align: center;
}

.viewer-message.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.viewer-message.is-error {
  border-color: rgba(255, 50, 50, 0.72);
  background: rgba(60, 0, 0, 0.78);
  color: #fff;
}

@media (max-width: 980px) {
  .car-test-main {
    padding-top: 116px;
  }

  .car-test-shell {
    grid-template-columns: 1fr;
  }

  .car-test-copy h1 {
    max-width: none;
  }

  .car-viewer-panel {
    min-height: 58vh;
  }

  .car-viewer-stack {
    grid-template-rows: minmax(58vh, auto) auto;
  }
}

@media (max-width: 620px) {
  .car-test-main {
    padding-top: 110px;
  }

  .car-test-actions {
    display: grid;
  }

  .car-stat-grid {
    grid-template-columns: 1fr;
  }

  .car-control-button {
    width: 100%;
  }

  .car-livery-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .car-livery-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }
}
