/* Blackline Strike's in-game loading-art/content/rule/progress layout.
   Scoped to transitions; the original atra-loader boot screen is untouched. */
#match-loading.reference-transition {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: auto;
  background: #111a20;
  color: #f2f2ef;
  overflow: auto;
  font-family: Barlow, Arial, sans-serif;
}
#match-loading.reference-transition[hidden] {
  display: none !important;
}
#match-loading.reference-transition .loading-art {
  position: fixed;
  inset: 0;
  background: none;
  animation: none;
  filter: none;
}
#match-loading.reference-transition .loading-art > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}
#match-loading.reference-transition .loading-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0a1119f5 5%, #0e182477 75%, #12212e22);
}
#match-loading.reference-transition .loading-content {
  position: relative;
  left: 7%;
  width: min(600px, 75vw);
  padding: clamp(60px, 18vh, 220px) 0 100px;
}
#match-loading.reference-transition .eyebrow {
  font:
    600 11px Barlow,
    sans-serif;
  letter-spacing: 0.19em;
}
#match-loading.reference-transition h2 {
  font: 800 clamp(48px, 7vw, 106px) / 1.03 var(--condensed);
  letter-spacing: -0.02em;
  margin: 16px 0;
  overflow-wrap: break-word;
}
#match-loading.reference-transition p {
  letter-spacing: 0.18em;
  font-size: 12px;
  line-height: 1.6;
  color: #bdc7c3;
}
#match-loading.reference-transition .loading-rule {
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 26px 0;
}
#match-loading.reference-transition strong {
  display: block;
  font:
    600 clamp(17px, 2.2vw, 24px) / 1.4 Barlow,
    sans-serif;
  letter-spacing: 0.02em;
}
#match-loading.reference-transition small.atra-load-tip {
  display: block;
  color: #c2c5c3;
  margin: 18px 0 30px;
  font-size: 14px;
  line-height: 1.6;
}
#match-loading.reference-transition .loader-progress {
  height: 7px;
  padding: 1px;
  border: 1px solid #f2f2ef66;
  border-radius: 0;
  box-shadow: none;
  background:
    repeating-linear-gradient(90deg, #f2f2ef0c 0 23px, transparent 23px 26px),
    #13181c88;
}
#match-loading.reference-transition .loader-progress > i {
  display: block;
  width: 0;
  height: 100%;
  background: #f2f2ef;
  box-shadow: none;
  transition: none;
}
#match-loading.reference-transition .transition-status {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  color: #c2c5c3;
  font:
    500 11px/1.6 Barlow,
    sans-serif;
  letter-spacing: 0.1em;
}
#match-loading.reference-transition .loading-brand {
  position: fixed;
  right: 5%;
  bottom: 6%;
  font: italic 800 50px/0.8 var(--condensed);
  letter-spacing: -0.04em;
}
#match-loading.reference-transition .loading-brand small {
  display: block;
  margin-top: 12px;
  font:
    600 9px Barlow,
    sans-serif;
  letter-spacing: 0.2em;
}
#match-loading.reference-transition .load-retry {
  margin-top: 24px;
}
@media (max-width: 600px) {
  #match-loading.reference-transition .loading-content {
    width: 86%;
    padding-top: 12vh;
    padding-bottom: 110px;
  }
  #match-loading.reference-transition .loading-brand {
    font-size: 36px;
    bottom: 25px;
  }
  #match-loading.reference-transition h2 {
    font-size: 54px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  #match-loading.reference-transition .loading-content {
    padding-top: 28px;
    padding-bottom: 30px;
    width: 70%;
  }
  #match-loading.reference-transition h2 {
    font-size: 44px;
  }
  #match-loading.reference-transition .loading-rule {
    margin: 12px 0;
  }
  #match-loading.reference-transition small.atra-load-tip {
    margin: 10px 0 16px;
  }
}

/* Dialog content remains reachable on narrow and short displays. */
dialog.car-design-preview {
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: clamp(12px, 3vw, 24px);
}
dialog.car-design-preview img {
  max-height: calc(100dvh - 130px);
}
#match-loading .loading-error {
  padding: clamp(20px, 5vw, 40px);
  max-width: 650px;
  max-height: 100dvh;
  overflow: auto;
}
#match-loading .loading-error h2 {
  margin-top: 30px;
}
#match-loading .error-details {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Keep the map artwork above the loading copy on portrait displays. */
@media (max-width: 700px) and (orientation: portrait) {
  #match-loading.atra-loader .atra-load-art {
    height: min(56vh, 125vw);
    object-position: 34% center;
  }
  #match-loading.atra-loader .atra-load-shade {
    background: linear-gradient(
      0deg,
      #142b30 44%,
      #142b30aa 52%,
      transparent 75%
    );
  }
  #match-loading.reference-transition .loading-art > img {
    height: 56vh;
    object-position: 92% center;
  }
  #match-loading.reference-transition .loading-art::after {
    background: linear-gradient(
      0deg,
      #111a20 44%,
      #111a20bb 52%,
      transparent 75%
    );
  }
  #match-loading.reference-transition .loading-content {
    top: 0;
    padding-top: 46vh;
  }
}

/* ===== Boot loader: responsive, never clipped =====
   Panel is anchored bottom-right with auto height (no fixed top/bottom
   stretch), every size scales with both width and height, and safe-area
   insets keep it off notches. Loaded last so it wins over campaign.css. */
#match-loading.atra-loader {
  overflow: hidden;
  --ld-pad: max(14px, min(4vw, 6vh));
}
#match-loading.atra-loader .atra-load-content {
  position: absolute;
  top: auto;
  left: auto;
  right: max(var(--ld-pad), env(safe-area-inset-right));
  bottom: max(var(--ld-pad), env(safe-area-inset-bottom));
  width: clamp(240px, 26vw, 440px);
  min-width: 0;
  max-width: calc(100vw - 2 * var(--ld-pad));
  max-height: calc(100dvh - 2 * var(--ld-pad));
  overflow: hidden;
  box-sizing: border-box;
}
#match-loading.atra-loader .atra-load-mode {
  margin-bottom: clamp(6px, 1.6vh, 20px);
  font-size: clamp(8px, min(0.7vw, 1.3vh), 12px);
}
#match-loading.atra-loader .wordmark {
  font-size: clamp(40px, min(6.5vw, 11vh), 140px);
  overflow-wrap: normal;
  white-space: nowrap;
}
#match-loading.atra-loader .wordmark > span {
  margin-top: clamp(6px, 1.6vh, 18px);
  font-size: clamp(8px, min(0.8vw, 1.5vh), 14px);
  letter-spacing: 0.3em;
}
#match-loading.atra-loader .atra-load-location {
  margin: clamp(8px, 2vh, 18px) 0 clamp(3px, 0.8vh, 8px);
  font-size: clamp(13px, min(1.4vw, 3vh), 24px);
}
#match-loading.atra-loader .atra-load-tip {
  font-size: clamp(9px, min(0.8vw, 1.7vh), 14px);
  max-width: none;
}
#match-loading.atra-loader .atra-load-bottom {
  margin-top: clamp(10px, 2.4vh, 22px);
  padding-top: clamp(7px, 1.5vh, 15px);
}
#match-loading.atra-loader .atra-load-status-row {
  font-size: clamp(8px, min(0.65vw, 1.4vh), 11px);
}
#match-loading.atra-loader .load-retry {
  align-self: flex-start;
  max-width: 100%;
  margin-top: clamp(8px, 1.6vh, 16px);
  padding: 8px 14px;
  font-size: clamp(9px, 1.4vh, 12px);
}

#match-loading .load-error-box {
  margin: 10px 0 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  font: 500 clamp(9px, min(0.8vw, 1.6vh), 13px) / 1.5 Barlow, sans-serif;
  letter-spacing: 0.04em;
  color: #f2a48c;
}

/* Short landscape screens: drop the secondary tip so the rest never clips */
@media (max-height: 460px) {
  #match-loading.atra-loader .atra-load-tip {
    display: none;
  }
}
@media (max-height: 340px) {
  #match-loading.atra-loader .atra-load-mode {
    display: none;
  }
}

/* Narrow / portrait: full-width panel along the bottom */
@media (max-width: 700px) {
  #match-loading.atra-loader .atra-load-content {
    right: max(var(--ld-pad), env(safe-area-inset-right));
    left: max(var(--ld-pad), env(safe-area-inset-left));
    width: auto;
    max-width: 420px;
    margin-inline: auto;
  }
  #match-loading.atra-loader .wordmark {
    font-size: clamp(48px, min(20vw, 10vh), 96px);
  }
}
@media (max-width: 700px) and (orientation: landscape) {
  #match-loading.atra-loader .atra-load-content {
    left: auto;
    width: clamp(220px, 46vw, 340px);
    margin-inline: 0;
  }
}
