.trn-portal-loading {
  --trn-orange: #e87532;
  --trn-ink: #25282b;
  --trn-paper: #f6f2eb;
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding:
    max(24px, env(safe-area-inset-top))
    max(22px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(22px, env(safe-area-inset-left));
  background:
    radial-gradient(ellipse at 50% 44%, #ffb16b 0%, #ed8740 38%, #d9672e 100%);
  color: var(--trn-ink);
  isolation: isolate;
  overscroll-behavior: contain;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.trn-portal-loading *,
.trn-portal-loading *::before,
.trn-portal-loading *::after {
  box-sizing: border-box;
}

.trn-portal-loading__atmosphere {
  position: absolute;
  z-index: -1;
  inset: -12%;
  opacity: 0.32;
  background:
    linear-gradient(135deg, transparent 49.94%, #fff7eb 50%, transparent 50.08%) 0 0 / 104px 104px,
    linear-gradient(45deg, transparent 49.94%, #8f482c 50%, transparent 50.08%) 0 0 / 104px 104px;
  mask-image: linear-gradient(135deg, transparent 4%, #000 45%, #000 75%, transparent 100%);
  animation: trn-loading-drift 24s linear infinite;
}

.trn-portal-loading__panel {
  display: flex;
  width: min(100%, 366px);
  min-height: 302px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(30px, 8vw, 48px) 24px 34px;
  border: 1px solid rgb(255 250 243 / 54%);
  background: rgb(250 246 239 / 92%);
  box-shadow: 0 24px 80px rgb(91 48 27 / 19%), 0 2px 7px rgb(91 48 27 / 10%);
  text-align: center;
  animation: trn-loading-arrive 420ms cubic-bezier(.2, .75, .25, 1) both;
}

.trn-portal-loading__graphic {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 31px 0 21px;
}

.trn-portal-loading__frame {
  position: absolute;
  inset: 7px;
  border: 1px solid rgb(37 40 43 / 28%);
  transform: rotate(45deg);
  animation: trn-loading-frame 2.8s cubic-bezier(.65, 0, .35, 1) infinite;
}

.trn-portal-loading__beam {
  position: absolute;
  top: 35px;
  left: 3px;
  width: 66px;
  height: 2px;
  overflow: hidden;
  background: rgb(37 40 43 / 17%);
}

.trn-portal-loading__beam::after {
  position: absolute;
  inset: 0;
  background: var(--trn-orange);
  content: "";
  transform: scaleX(.28);
  transform-origin: left;
  animation: trn-loading-scan 1.65s cubic-bezier(.65, 0, .35, 1) infinite;
}

.trn-portal-loading__point {
  position: absolute;
  top: 31px;
  left: 31px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--trn-orange);
  box-shadow: 0 0 0 5px rgb(232 117 50 / 13%);
  animation: trn-loading-pulse 1.65s ease-in-out infinite;
}

.trn-portal-loading__message {
  margin: 0;
  color: var(--trn-ink);
  font-family: "DM Sans", "Trebuchet MS", sans-serif;
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.5;
}

@keyframes trn-loading-arrive {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes trn-loading-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(104px, 104px, 0); }
}

@keyframes trn-loading-frame {
  0%, 100% { transform: rotate(45deg) scale(.91); opacity: .72; }
  50% { transform: rotate(135deg) scale(1.04); opacity: 1; }
}

@keyframes trn-loading-scan {
  0% { transform: translateX(-24px) scaleX(.3); }
  52% { transform: translateX(39px) scaleX(.62); }
  100% { transform: translateX(75px) scaleX(.2); }
}

@keyframes trn-loading-pulse {
  0%, 100% { transform: scale(.84); opacity: .8; }
  50% { transform: scale(1.08); opacity: 1; }
}

@media (max-width: 380px) {
  .trn-portal-loading__panel {
    min-height: 270px;
    padding: 25px 18px 28px;
  }

  .trn-portal-loading__graphic {
    margin-top: 24px;
    margin-bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trn-portal-loading *,
  .trn-portal-loading *::before,
  .trn-portal-loading *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
