/* wgf-loadscreen.css - the WoW Forever loading screen (2026-11-11).

   Owner: "make the load screen look like classic wow loadscreens from forever, the NEW
   ones". The client shows a wide painted plate letterboxed on pure black, the World of
   Warcraft Forever logo over its top-left corner, and the classic loading bar (frame +
   fill) centred on its bottom edge. All three are client textures:
     assets/loading-screens/forever/*.jpg      the 1.60 plates (1920 wide, about 21:8)
     assets/ui/loadscreen/forever-logo.png     camelot160/logo/logo_camelot
     assets/ui/loadscreen/loading-bar-*.png    interface/glues/loadingbar (black = clear:
                                               the frame is laid over the fill with screen
                                               blending, as the client's ADD layer does)
   DOM is built by wgf-loadscreen.js: overlay > screen > [art > (image, logo, bar), tip]. */

.wgf-loadscreen-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  /* quick in, quick out: the screen must never be the slow part of a page change */
  transition: opacity 140ms ease-out, visibility 140ms ease-out;
  pointer-events: none;
  font-family: 'FrizQuadrata', FrizQT, 'Cinzel', 'Palatino Linotype', serif;
  color: #ffd100;
}

.wgf-loadscreen-overlay.visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* destination half of a page change: already up on the first frame */
.wgf-loadscreen-overlay.instant {
  transition: none;
}

.wgf-loadscreen-screen {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* The plate: full width, or as wide as the height allows once the tip has its room. */
.wgf-loadscreen-art {
  position: relative;
  flex: 0 0 auto;
  width: min(100vw, calc((100vh - 150px) * 1920 / 734));
  aspect-ratio: 1920 / 734;
  background: #0b0a09;
}

.wgf-loadscreen-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 160ms ease-out;
}

.wgf-loadscreen-image.loaded {
  opacity: 1;
}

.wgf-loadscreen-logo {
  position: absolute;
  left: 1.2%;
  top: 0;
  width: 17%;
  min-width: 96px;
  height: auto;
  transform: translateY(-22%);
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .8));
  pointer-events: none;
}

/* Loading-BarBorder is 512x64; its window is the middle band of the texture. */
.wgf-loadscreen-bar {
  /* no transform here: it would isolate the frame's screen blend from the plate under it
     and the texture's black would show as a box */
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  margin: 0 auto;
  width: min(46%, 512px);
  min-width: 240px;
  aspect-ratio: 512 / 64;
}

.wgf-loadscreen-bar::before {
  /* the dark well behind the fill */
  content: "";
  position: absolute;
  inset: 30% 3.6%;
  background: #000;
}

.wgf-loadscreen-bar-fill {
  position: absolute;
  left: 3.6%;
  top: 30%;
  bottom: 30%;
  width: 0;
  background: url(/assets/ui/loadscreen/loading-bar-fill.png) left center / auto 100% repeat-x;
}

.wgf-loadscreen-bar-fill.run {
  animation: wgf-ls-fill 900ms cubic-bezier(.2, .7, .3, 1) forwards;
}

@keyframes wgf-ls-fill {
  from { width: 0; }
  to { width: 92.8%; }
}

.wgf-loadscreen-bar-border {
  position: absolute;
  inset: 0;
  background: url(/assets/ui/loadscreen/loading-bar-border.png) center / 100% 100% no-repeat;
  mix-blend-mode: screen;
}

.wgf-loadscreen-tip {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 100%;
  max-width: 760px;
  margin: 44px 0 0;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
  color: #ffd100;
  text-shadow: 1px 1px 0 #000;
}

.wgf-loadscreen-tip::before {
  content: "Tip: ";
  color: #fff;
}

/* Phones held upright: a 21:8 strip would be a sliver, so the plate gets a taller window
   and the art crops to its centre. */
@media (max-aspect-ratio: 1/1) {
  .wgf-loadscreen-art {
    width: 100vw;
    aspect-ratio: auto;
    height: 46vh;
  }
  .wgf-loadscreen-logo { width: 34%; left: 3%; transform: translateY(-30%); }
  .wgf-loadscreen-bar { width: 78%; min-width: 0; bottom: -16px; }
  .wgf-loadscreen-tip { font-size: 14px; margin-top: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .wgf-loadscreen-overlay,
  .wgf-loadscreen-image { transition: none; }
  .wgf-loadscreen-bar-fill.run { animation: none; width: 92.8%; }
}
