/* Motions game loading screen (assets/motions-game-loader.js). Covers every game from its first paint until it is ready (not on an online match link). */

.motions-loader {
  position: fixed; inset: 0; z-index: 2147483647; overflow: hidden;
  background: linear-gradient(160deg, #2b1f85 0%, #5a31d0 100%);
  color: #fff; font-family: "Kanit", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  /* One size drives the whole band, so it scales together on phones (upright or sideways) and desktops. */
  font-size: clamp(13px, min(2.1vw, 3.6vh), 26px);
  -webkit-user-select: none; user-select: none; touch-action: none; cursor: progress;
}
.motions-loader *, .motions-loader *::before, .motions-loader *::after { box-sizing: border-box; }
.motions-loader__picture, .motions-loader__picture img {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}
.motions-loader__picture img { object-fit: cover; object-position: center; border: 0; }

.motions-loader__band {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; gap: 0.7em;
  padding: 4em max(1.4em, env(safe-area-inset-right)) calc(1.5em + env(safe-area-inset-bottom)) max(1.4em, env(safe-area-inset-left));
  background: linear-gradient(to top, rgba(25, 18, 67, 0.86) 0%, rgba(25, 18, 67, 0.62) 55%, rgba(25, 18, 67, 0) 100%);
  text-align: center;
}
.motions-loader__title {
  display: block; width: auto; height: auto;
  max-width: min(74vw, 22em); max-height: min(24vh, 9em); object-fit: contain;
  filter: drop-shadow(0 0.18em 0 rgba(25, 18, 67, 0.55));
}
.motions-loader__bar {
  position: relative; width: min(82vw, 24em); height: 1.25em; margin: 0.15em 0 0.1em;
  background: #fff; border: 0.2em solid #191243; border-radius: 0.28em;
  box-shadow: 0.22em 0.26em 0 #191243; transform: skewX(-8deg); overflow: hidden;
}
.motions-loader__bar i {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; display: block;
  background: #ffd23f; box-shadow: inset 0 -0.22em 0 rgba(25, 18, 67, 0.16);
  transition: width 0.45s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.motions-loader__tip {
  margin: 0; max-width: 30em; min-height: 1.25em;
  font-weight: 600; font-size: 1em; line-height: 1.2; letter-spacing: -0.022em;
  color: #fff; text-shadow: 0 0.08em 0 rgba(25, 18, 67, 0.75), 0 0.1em 0.5em rgba(25, 18, 67, 0.5);
  text-wrap: balance;
}

/* Upright phones: a wider bar and slightly larger words. */
@media (max-aspect-ratio: 1/1) {
  .motions-loader { font-size: clamp(14px, 4.2vw, 24px); }
  .motions-loader__title { max-width: 80vw; max-height: 20vh; }
}
/* Phones on their side: little height, so the band tightens up. */
@media (max-height: 460px) {
  .motions-loader { font-size: clamp(12px, 3.9vh, 18px); }
  .motions-loader__band { gap: 0.45em; padding-top: 2.4em; padding-bottom: calc(0.9em + env(safe-area-inset-bottom)); }
  .motions-loader__title { max-height: 30vh; }
}
@media (prefers-reduced-motion: reduce) {
  .motions-loader__bar i { transition: none; }
}

/* ---- The collage look: the game's title big in the middle; at the bottom a drawn percentage over a chunky slanted bar ---- */
.motions-loader__mid {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: grid; place-items: center; pointer-events: none;
  padding: 0 max(1.4em, env(safe-area-inset-right)) 6.5em max(1.4em, env(safe-area-inset-left));
}
.motions-loader__mid .motions-loader__title {
  max-width: min(78vw, 46em); max-height: min(34vh, 15em);
  filter: drop-shadow(0 0.22em 0 rgba(25, 18, 67, 0.7)) drop-shadow(0 0 1.2em rgba(25, 18, 67, 0.45));
  animation: motions-loader-pop 520ms cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
@keyframes motions-loader-pop { from { transform: scale(0.82); opacity: 0; } to { transform: none; opacity: 1; } }
.motions-loader__band { gap: 0.45em; padding-top: 5.5em; background: linear-gradient(to top, rgba(25, 18, 67, 0.72) 0%, rgba(25, 18, 67, 0.4) 50%, rgba(25, 18, 67, 0) 100%); }
.motions-loader__pct { display: flex; align-items: flex-end; justify-content: center; height: 2.6em; gap: 0.02em; filter: drop-shadow(0 0.14em 0 rgba(25, 18, 67, 0.6)); }
.motions-loader__pct img { height: 100%; width: auto; display: block; }
.motions-loader__pct img:last-child { height: 82%; margin-left: 0.08em; }
.motions-loader__pct.is-type { font-weight: 800; font-size: 2.2em; height: auto; line-height: 1; letter-spacing: -0.02em; -webkit-text-stroke: 0.08em #191243; paint-order: stroke fill; }
.motions-loader__bar { width: min(70vw, 28em); height: 1.6em; border-width: 0.22em; box-shadow: 0 0.3em 0 #191243; background: #3a1f6e; }
.motions-loader__bar i { background: linear-gradient(180deg, #ffd23f 0 54%, #f7a81d 54% 100%); box-shadow: inset -0.2em 0 0 rgba(255, 255, 255, 0.55); }
.motions-loader__tip { font-size: 0.9em; opacity: 0.92; }
@media (max-aspect-ratio: 1/1) { .motions-loader__mid .motions-loader__title { max-width: 86vw; max-height: 22vh; } .motions-loader__bar { width: 80vw; } }
@media (max-height: 460px) { .motions-loader__mid { padding-bottom: 5em; } .motions-loader__mid .motions-loader__title { max-height: 34vh; } .motions-loader__pct { height: 2.1em; } .motions-loader__band { padding-top: 3em; } }
.motions-loader__pct img + img { margin-left: -0.18em; }   /* the drawn digits sit close, like one number */

/* the title is now the game's name stacked on two staggered lines (drawn big): it fills the middle and sits lower, over the art */
.motions-loader__mid { padding: 3em max(1.4em, env(safe-area-inset-right)) 4.2em max(1.4em, env(safe-area-inset-left)); }
.motions-loader__mid .motions-loader__title { max-width: min(62vw, 40em); max-height: min(52vh, 26em); }
@media (max-aspect-ratio: 1/1) { .motions-loader__mid { padding-bottom: 8em; } .motions-loader__mid .motions-loader__title { max-width: 84vw; max-height: 34vh; } }
@media (max-height: 460px) { .motions-loader__mid { padding-top: 1em; padding-bottom: 4.6em; } .motions-loader__mid .motions-loader__title { max-height: 54vh; max-width: 54vw; } }
