.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 45% 22%, #e1f0f6 0, transparent 58%),
    radial-gradient(ellipse at 90% 90%, #f6e7cc 0, transparent 50%), #fdf9f1;
  color: #194a6b;
  font-family: "DM Sans", sans-serif;
  text-align: center;
  padding: 32px;
  overflow: hidden;
}
.loading-screen:before,
.loading-screen:after {
  content: "";
  position: absolute;
  width: 480px;
  height: 180px;
  border-radius: 50%;
  background: #fffdf6;
  filter: blur(24px);
  opacity: 0.65;
  pointer-events: none;
}
.loading-screen:before {
  top: -90px;
  left: -120px;
}
.loading-screen:after {
  bottom: -120px;
  right: -80px;
}
.loading-logo {
  width: min(330px, 72vw);
  height: auto;
  margin-bottom: 34px;
}
.car-loader {
  color: #245f83;
  text-align: center;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 12px;
  position: relative;
}
.car-loader-scene {
  position: relative;
  width: 300px;
  max-width: 75vw;
  height: 174px;
  overflow: hidden;
}
.car-sprite-window {
  position: absolute;
  left: 40px;
  top: 10px;
  width: 220px;
  height: 150px;
  overflow: hidden;
  z-index: 2;
}
.car-sprite {
  width: 220px;
  height: 293.333px;
  position: absolute;
  top: -71px;
  background: url("/images/car-sprite.png") 0 0 /400% 200% no-repeat;
  animation: drive-sprites 0.8s step-end infinite;
}
.loader-road {
  position: absolute;
  bottom: 27px;
  left: 0;
  width: 100%;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    #87abc0 0 16px,
    transparent 16px 30px
  );
  animation: road-roll 0.9s linear infinite;
  opacity: 0.65;
}
.loader-cloud {
  position: absolute;
  background: #fffefa;
  border-radius: 100%;
  width: 65px;
  height: 19px;
  opacity: 0.9;
  animation: cloud-drift 6s linear infinite;
}
.loader-cloud:before {
  content: "";
  position: absolute;
  width: 30px;
  height: 25px;
  border-radius: 50%;
  background: inherit;
  left: 18px;
  top: -13px;
}
.cloud-one {
  top: 25px;
  right: 0;
}
.cloud-two {
  top: 65px;
  left: 5px;
  transform: scale(0.6);
  animation-delay: -3s;
}
.loader-flower {
  position: absolute;
  right: 15px;
  bottom: 24px;
  font-size: 25px;
  color: #bca369;
}
.car-loader p {
  font-size: 14px;
  letter-spacing: 0.3px;
  line-height: 1.6;
  margin: 14px 0 0;
}
.loader-dots {
  display: flex;
  gap: 6px;
  margin-top: 17px;
}
.loader-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #6599b7;
  animation: dot-breathe 1.6s ease-in-out infinite;
}
.loader-dots i:nth-child(2) {
  animation-delay: 0.2s;
}
.loader-dots i:nth-child(3) {
  animation-delay: 0.4s;
}
.loading-note {
  font:
    italic 20px Georgia,
    serif;
  color: #698da2;
  margin: 18px 0 0;
  line-height: 1.5;
}
.loading-destination {
  position: absolute;
  bottom: 35px;
  font-size: 9px;
  letter-spacing: 2px;
  color: #698da2;
}
.loading-screen .loading-continue {
  margin-top: 26px;
  width: min(290px, 100%);
  min-height: 66px;
  padding: 18px 32px;
  border-radius: 22px;
  font-size: 21px;
  font-weight: 600;
  gap: 18px;
  box-shadow: 0 8px 22px #245f8326;
}
@media (max-height: 650px) {
  .loading-logo { margin-bottom: 12px; width: min(270px, 68vw); }
  .loading-screen .loading-continue { margin-top: 12px; }
  .loading-note { margin-top: 12px; font-size: 17px; }
  .loading-destination { bottom: 14px; }
}
.loading-continue:disabled {
  cursor: default;
  opacity: 0.65;
}
.loading-screen.is-departing {
  pointer-events: none;
  animation: departure-reveal 1.7s ease-in both;
}
.car-loader-departing .car-loader-scene {
  overflow: visible;
}
.car-loader-departing .car-sprite-window {
  transform-origin: 50% 85%;
  animation: car-takeoff 1.35s cubic-bezier(0.4, 0, 0.85, 0.5) both;
}
.car-loader-departing .car-sprite {
  animation-duration: 0.35s;
}
.car-loader-departing .loader-road {
  animation-duration: 0.25s;
}
.car-loader-departing .loader-cloud,
.car-loader-departing .loader-dots {
  visibility: hidden;
}
.departure-trail {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.departure-cloud {
  position: absolute;
  left: var(--puff-x, 42px);
  bottom: 26px;
  width: var(--puff-size, 50px);
  height: auto;
  color: #90afbd;
  opacity: 0;
  filter: drop-shadow(0 2px 3px #60899e14);
  transform-origin: 80% 80%;
  animation: departure-puff 1.05s ease-out var(--puff-delay, 0.08s) both;
}
.departure-cloud:nth-child(2) {
  --puff-x: 54px;
  --puff-size: 61px;
  --puff-delay: 0.2s;
}
.departure-cloud:nth-child(3) {
  --puff-x: 78px;
  --puff-size: 55px;
  --puff-delay: 0.34s;
}
.departure-cloud:nth-child(4) {
  --puff-x: 112px;
  --puff-size: 43px;
  --puff-delay: 0.46s;
}
.departure-cloud:nth-child(5) {
  --puff-x: 160px;
  --puff-size: 34px;
  --puff-delay: 0.58s;
}
@keyframes car-takeoff {
  0% { transform: translateX(0) rotate(0); }
  14% { transform: translate(-9px, 2px) rotate(-2deg); }
  28% { transform: translate(8px, -3px) rotate(1deg); }
  100% { transform: translateX(calc(50vw + 180px)) rotate(0); }
}
@keyframes departure-puff {
  0% { transform: translate(0, 3px) scale(0.2); opacity: 0; }
  16% { opacity: 0.95; }
  48% { opacity: 0.9; }
  100% { transform: translate(-60px, -35px) scale(1.55); opacity: 0; }
}
@keyframes departure-reveal {
  0%, 78% { opacity: 1; }
  100% { opacity: 0; }
}
.car-loader-compact {
  padding: 6px;
  min-height: 220px;
  justify-content: center;
}
.car-loader-compact .car-loader-scene {
  transform: scale(0.7);
  height: 150px;
  margin: -25px 0;
}
.car-loader-compact p {
  font-size: 12px;
}
.car-loader-compact .loader-dots {
  margin-top: 8px;
}
@keyframes drive-sprites {
  0%,
  100% {
    background-position: 0 0;
  }
  12.5% {
    background-position: 33.333333% 0;
  }
  25% {
    background-position: 66.666667% 0;
  }
  37.5% {
    background-position: 100% 0;
  }
  50% {
    background-position: 0 100%;
  }
  62.5% {
    background-position: 33.333333% 100%;
  }
  75% {
    background-position: 66.666667% 100%;
  }
  87.5% {
    background-position: 100% 100%;
  }
}
@keyframes road-roll {
  to {
    background-position: -30px 0;
  }
}
@keyframes cloud-drift {
  from {
    translate: 25px 0;
    opacity: 0;
  }
  20%,
  80% {
    opacity: 0.8;
  }
  to {
    translate: -95px 0;
    opacity: 0;
  }
}
@keyframes dot-breathe {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .car-sprite,
  .loader-road,
  .loader-cloud,
  .loader-dots i,
  .loading-screen.is-departing,
  .car-loader-departing .car-sprite-window,
  .departure-cloud {
    animation: none !important;
  }
  .loader-cloud {
    opacity: 0.7;
  }
}
