.utility-group[data-menu-state="staged"] {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-start;
  align-items: stretch;
}

.utility-group[data-menu-state="staged"] .utility,
.utility-group[data-menu-state="racing"] .back-to-start-button {
  min-height: 37.5px;
  padding: 6px clamp(7.5px, 1.55vw, 13.5px);
  border-radius: 10.5px;
  white-space: nowrap;
}

.back-to-lot-button {
  background: #ff7b54;
}

.sound-guide-button {
  background: #38d9ff;
}

.back-to-start-button,
.recalibrate-button,
.reset-rivals-button {
  background: var(--turn-surface-page);
}

.back-to-start-button.is-lap-invalid {
  background: #ff6b6b;
}

.back-to-start-button.is-lap-invalid-pulse {
  animation: turn-restart-invalid-pulse 680ms cubic-bezier(0.2, 0.85, 0.3, 1.2) 1;
}

/* STEERING CENTRED (#1032): RECALIBRATE blinks yellow twice with the message, so the
   player sees where centring lives. Two blinks in a second, well under the flash
   threshold; reduced motion holds a steady highlight instead. */
.recalibrate-button.is-centred-blink {
  animation: turn-recalibrate-centred 960ms linear 1;
}

@keyframes turn-recalibrate-centred {
  0%, 24%, 50%, 74% { background-color: var(--yellow); color: var(--turn-ink); }
  25%, 49%, 75%, 100% { background-color: var(--turn-surface-page); color: var(--turn-text); }
}

@keyframes turn-restart-invalid-pulse {
  0%, 100% { transform: scale(1); }
  36% { transform: scale(1.08); }
  64% { transform: scale(0.985); }
}

.utility-group[data-menu-state="hidden"] {
  display: none;
}

.sound-guide-dialog {
  width: min(570px, calc(100vw - 21px));
  max-width: none;
  max-height: calc(100dvh - 21px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--turn-text);
  overflow: visible;
}

.sound-guide-dialog:not([open]) {
  display: none;
}

.sound-guide-dialog::backdrop {
  background: rgba(8, 9, 10, 0.72);
  backdrop-filter: blur(3.75px);
}

.sound-guide-card {
  max-height: calc(100dvh - 21px);
  padding: clamp(13.5px, 3vw, 22.5px);
  overflow: auto;
  border: 3px solid var(--turn-outline);
  border-radius: 16.5px;
  background: var(--turn-surface-page);
  box-shadow: 0 13.5px 0 rgba(8, 9, 10, 0.28);
}

.sound-guide-head {
  display: flex;
  gap: 13.5px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sound-guide-head h2,
.sound-guide-card h3,
.sound-guide-card h4 {
  margin: 0;
  line-height: 1;
  text-transform: uppercase;
}

.sound-guide-head h2 {
  font-size: max(var(--turn-text-floor, 11px), clamp(1.2375rem, 4.4vw, 2.1rem));
}

.sound-guide-card h3 {
  margin-top: 15px;
  font-size: max(var(--turn-text-floor, 11px), clamp(0.675rem, 2vw, 0.8625rem));
  letter-spacing: 0.08em;
}

.sound-guide-card h4 {
  font-size: max(var(--turn-text-floor, 11px), clamp(0.615rem, 1.8vw, 0.75rem));
}

.sound-guide-card p {
  margin: 6px 0 0;
  line-height: 1.42;
}

.sound-guide-close {
  flex: 0 0 auto;
  width: 33px;
  height: 33px;
  padding: 0;
  border: 2.25px solid var(--turn-outline);
  border-radius: 50%;
  background: #ff6b6b;
  color: var(--turn-ink);
  font: inherit;
  font-size: max(var(--turn-text-floor, 11px), 1.1625rem);
  font-weight: 900;
  line-height: 1;
}

.sound-guide-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 9px;
}

.sound-guide-list > section {
  min-width: 0;
  padding: 10.5px;
  border: 2.25px solid var(--turn-outline);
  border-radius: 11.25px;
  background: var(--turn-surface-raised);
}

.sound-guide-button:focus-visible,
.sound-guide-close:focus-visible {
  outline: 3px solid #ffd43b;
  outline-offset: 2.25px;
}

@media (max-width: 465px) {
  .sound-guide-list {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 322.5px) {
  .utility-group[data-menu-state="staged"] {
    gap: 5.25px;
  }

  .utility-group[data-menu-state="staged"] .utility,
  .utility-group[data-menu-state="racing"] .back-to-start-button {
    min-height: 30px;
    padding: 4.5px clamp(6px, 1.2vw, 9.75px);
    font-size: max(var(--turn-text-floor, 11px), clamp(0.39rem, 1.18vw, 0.48rem));
  }

  .sound-guide-dialog {
    width: min(615px, calc(100vw - 13.5px));
    max-height: calc(100dvh - 13.5px);
  }

  .sound-guide-card {
    max-height: calc(100dvh - 13.5px);
    padding: 11.25px 13.5px 13.5px;
    border-radius: 12px;
  }

  .sound-guide-head {
    margin-bottom: 6px;
  }

  .sound-guide-head h2 {
    font-size: max(var(--turn-text-floor, 11px), clamp(1.0125rem, 3.8vw, 1.5rem));
  }

  .sound-guide-card h3 {
    margin-top: 9px;
  }

  .sound-guide-card p {
    margin-top: 3.75px;
    font-size: max(var(--turn-text-floor, 11px), 0.615rem);
    line-height: 1.3;
  }

  .sound-guide-close {
    width: 28.5px;
    height: 28.5px;
  }

  .sound-guide-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
  }

  .sound-guide-list > section {
    padding: 7.5px;
    border-width: 1.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-start-button.is-lap-invalid-pulse {
    animation: none;
  }

  .recalibrate-button.is-centred-blink {
    animation: none;
    background-color: var(--yellow);
    color: var(--turn-ink);
  }
}
