/* On phones, the opening is the event summary below the sticky navigation. */
body:not(.cinema-page) #main[data-ssr-preview-entry="garage"]:has([data-ronde-opening]) {
  margin-block-start: 0;
}

#main #competition-opening[data-ronde-opening] {
  width: 100%;
  margin-inline: 0;
}

body #main #competition-opening[data-ronde-opening] .ssr-rally-scene {
  height: auto;
  min-block-size: 0;
}

body #main #competition-opening[data-ronde-opening] .ssr-rally-sticky {
  position: relative;
  top: auto;
  display: block;
  height: auto;
  min-block-size: 0;
  overflow: visible;
}

/* Suppress the server-rendered desktop shell before hydration. */
#main #competition-opening[data-ronde-opening]
  :is(.ssr-rally-stage, .ssr-rally-fallback, .ssr-rally-controls, .ssr-rally-fade) {
  display: none;
}

body #main:has([data-ronde-opening]) #competition-opening [class*="_garageOverlay_"] {
  position: relative;
  inset: auto;
  display: block;
  min-block-size: 0;
  padding: 0;
  margin: 0;
  z-index: 2;
}

#main #competition-opening [class*="_garageOverlay_"]::before {
  content: none;
}

body #main:has([data-ronde-opening]) #competition-opening [class*="_garageCopy_"] {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  column-gap: 14px;
  row-gap: 0;
  width: 100%;
  margin: 0;
  padding: clamp(18px, 5vw, 30px) 0 14px;
  text-align: left;
}

#main #competition-opening [class*="_garagePlate_"] {
  grid-area: 1 / 1 / 3 / 2;
  width: clamp(104px, 32vw, 136px);
  max-width: 100%;
  margin: 0;
}

#main #competition-opening [class*="_garageCopy_"] [class*="_kicker_"] {
  grid-area: 1 / 2;
  align-self: end;
  margin: 0;
  color: #bfc2b7;
  font-size: .62rem;
  letter-spacing: .09em;
}

#main #competition-opening [class*="_garageCopy_"] [data-state] {
  grid-area: 2 / 2;
  align-self: start;
  margin-block-start: 3px;
  font-size: .79rem;
}

body #main #competition-opening [role="timer"] {
  --timer-gap: clamp(14px, 5vw, 23px);
  --timer-digit-size: clamp(25px, 7.6vw, 32px);
  grid-area: 3 / 1 / 4 / -1;
  justify-self: center;
  margin: 15px 0 0;
}

body #main #competition-opening [class*="_heroActions_"] {
  grid-area: 4 / 1 / 5 / -1;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: stretch;
  gap: 8px;
  margin: 14px 0 0;
}

#main #competition-opening [class*="_heroActions_"] :is([class*="_primary_"], [class*="_link_"]):not([class*="_timingLink_"]) {
  justify-content: space-between;
  width: 100%;
  gap: 6px;
  padding: 9px 11px;
  font-size: .85rem;
}

#main #competition-opening [class*="_timingLink_"] {
  justify-content: space-between;
  gap: 6px;
  min-height: 48px;
  padding: 8px 9px;
  border: 1px solid #ffffff37;
  border-radius: 4px;
  background: #1c1f1f;
  color: #f4f4ef;
  text-decoration: none;
  font-size: .72rem;
  line-height: 1.3;
}

#main #competition-opening [class*="_timingLink_"] > span {
  flex-shrink: 0;
}

body #main:has([data-ronde-opening]) #competition-opening .ssr-preview-garage-note {
  grid-area: 5 / 1 / 6 / -1;
  max-width: none;
  margin: 15px 0 0;
  padding: 13px 0 0;
  border: 0;
  border-top: 1px solid #ffffff23;
  background: transparent;
}

body #main #competition-opening .ssr-preview-garage-note__caption {
  display: none;
}

body #main #competition-opening .ssr-preview-garage-note__label {
  margin: 0 0 7px;
  font-size: .65rem;
  letter-spacing: .075em;
}

#main #competition-opening .ssr-preview-garage-note ul {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

#main #competition-opening .ssr-preview-garage-note li {
  padding: 5px 2px;
  border: 1px solid #ffffff22;
  border-radius: 3px;
  background: #ffffff0a;
  font-size: .68rem;
  text-align: center;
}

@media (min-width: 580px) {
  body #main:has([data-ronde-opening]) #competition-opening [class*="_garageCopy_"] {
    width: min(100%, 570px);
    margin-inline: auto;
  }
}
