/* Homepage layout fixes (loaded after the built homepage CSS).
   1. Demo "driving surface": stack the HUD in normal flow so the gauge, gear
      switch and SOUND/RPM row can never overlap, at any width.
   2. Six sound tabs wrap into tidy rows instead of squeezing into one line.
   3. "Take a virtual drive" keeps its label on one line on phones.
   4. Feature strip: no mid-word wrapping, badge sits next to its text. */

/* ---------- 1. Demo driving surface ---------- */
.driving-surface {
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  height: auto !important;
  min-height: 300px;
  padding: 16px 18px 12px;
  box-sizing: border-box;
}
.driving-surface > canvas,
.driving-surface > .scene-shade {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}
.driving-surface > .hud-top,
.driving-surface > .hud-center,
.driving-surface > .hud-bottom,
.driving-surface > .simulation-note {
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  z-index: 1;
}
.driving-surface > .hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.driving-surface > .hud-center {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  align-self: center;
  gap: 8px;
  width: auto !important;
}
.driving-surface .gauge {
  width: clamp(132px, 34vw, 168px) !important;
  height: clamp(132px, 34vw, 168px) !important;
}
.driving-surface .gear-mode {
  position: static !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
}
.driving-surface > .hud-bottom {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 18px;
  width: 100%;
}
.driving-surface > .hud-bottom strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.driving-surface > .simulation-note {
  align-self: flex-start;
  margin-top: 2px;
}

/* ---------- 2. Sound tabs: two/three per row ---------- */
.sound-tabs {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: 100% !important;
  height: auto !important;
  padding: 4px !important;
}
.sound-tabs > button {
  height: 34px !important;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 420px) {
  .sound-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 3. Virtual drive button ---------- */
.drive-button { gap: 10px; }
.drive-button > span { white-space: nowrap; }
.drive-button > small { white-space: nowrap; margin-left: auto; }
@media (max-width: 420px) {
  .drive-button { flex-wrap: wrap; row-gap: 2px; }
  .drive-button { justify-content: center; }
  .drive-button > small { flex-basis: 100%; margin-left: 0; text-align: center; }
}

/* ---------- 4. Feature strip ---------- */
.feature-strip > span {
  hyphens: none;
  -webkit-hyphens: none;
  word-break: normal;
  overflow-wrap: normal;
  flex-wrap: wrap;
}
.feature-strip > span > svg { flex: 0 0 auto; width: 16px; height: 16px; }
.feature-strip .new-tag { margin-left: 2px; }
@media (max-width: 560px) {
  .feature-strip { grid-template-columns: minmax(0, 1fr) !important; row-gap: 12px; }
}

/* odd last tab spans the whole row instead of sitting alone on the left */
.sound-tabs > button:last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
@media (max-width: 420px) {
  .sound-tabs > button:last-child:nth-child(3n + 1) { grid-column: auto; }
  .sound-tabs > button:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
