/* world-loading.css — Fortnite-style loading screen, Gen-3 chrome.
   Full-bleed over the console screen (overworld sits at z 55, the team
   portal at 64 — loading covers everything at 70 while the map mounts).
   pointer-events is NONE for the overlay's entire life: skip input rides
   document-level listeners in world-loading.js, so QA taps and gameplay
   input are never intercepted. All motion is hard-stepped (POKE-SPEC). */

.world-loading {
  --u: 2px;
  position: absolute;
  inset: 0;
  z-index: 70;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(14px, 3vh, 26px);
  padding: clamp(10px, 3vw, 28px);
  overflow: hidden;
  pointer-events: none;
  font-family: 'PokeDialogue', 'PokeText', "Courier New", monospace;
  background: linear-gradient(180deg,
    #000 0 4%,
    #7a1818 4% 9%,
    #10283A 9% 91%,
    #7a1818 91% 96%,
    #000 96% 100%);
}

/* FRLG scanline sheen over the teal band. */
.world-loading-sky {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, .05) 3px 4px);
}

.world-loading-logo {
  position: relative;
  width: min(76%, 470px);
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .35));
}

/* gen3-frame1 paper window (border-image duplicated from styles.css — this
   file must stay standalone, same rule as team-portal.css). */
.world-loading-panel {
  position: relative;
  display: grid;
  gap: 10px;
  width: min(88%, 460px);
  padding: 12px 16px 14px;
  background: #F8F8F8;
  background-clip: padding-box;
  border: calc(var(--u) * 7) solid transparent;
  border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' shape-rendering='crispEdges'%3E%3Crect width='16' height='16' rx='3' fill='%23293131'/%3E%3Crect x='1' y='1' width='14' height='14' rx='2.5' fill='%234A4A6A'/%3E%3Crect x='2' y='2' width='12' height='12' rx='2' fill='%23626294'/%3E%3Crect x='3' y='3' width='10' height='10' rx='1.5' fill='%237373AC'/%3E%3Crect x='4' y='4' width='8' height='8' rx='1' fill='%238B8BCD'/%3E%3Crect x='5' y='5' width='6' height='6' rx='.5' fill='%23DED5DE'/%3E%3Crect x='6' y='6' width='4' height='4' fill='%23F8F8F8'/%3E%3C/svg%3E") 7;
}

.world-loading-title {
  margin: 0;
  color: #424242;
  font: 800 12px/1 'PokeText', ui-monospace, monospace;
  letter-spacing: .12em;
  text-shadow: 1px 1px 0 #D0D0C8;
}

.world-loading-cursor {
  display: inline-block;
  margin-left: 8px;
  color: #E00808;
  animation: world-loading-pulse 1.07s steps(2, jump-none) infinite;
}

/* Stepped Gen-3 progress bar: 16 hard cells inside a dark plate. */
.world-loading-bar {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 2px;
  height: 18px;
  padding: 3px;
  background: #293131;
  border: 2px solid #4A4A6A;
  border-radius: 3px;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, .4);
}

.world-loading-bar i {
  background: #10283A;
}

.world-loading-bar i.on {
  background: #F8D048;
  box-shadow: inset 0 -3px 0 #D8883C;
}

.world-loading-tip {
  min-height: 1.5em;
  margin: 0;
  color: #606060;
  font-size: 14px;
  line-height: 1.4;
  text-shadow: 1px 1px 0 #E8E8E0;
}

.world-loading-tip::before {
  content: "TIP: ";
  color: #C74637;
  font: 800 9px/1 'PokeText', ui-monospace, monospace;
  letter-spacing: .14em;
}

.world-loading-hint {
  position: relative;
  margin: 0;
  color: #F8F8F8;
  font: 800 10px/1 'PokeText', ui-monospace, monospace;
  letter-spacing: .1em;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, .5);
  animation: world-loading-pulse 1.07s steps(2, jump-none) infinite;
}

/* Hard-stepped exit fade (never smooth, per POKE-SPEC). */
.world-loading.is-leaving {
  animation: world-loading-out 280ms steps(4, jump-none) forwards;
}

@keyframes world-loading-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes world-loading-pulse {
  from { opacity: 1; }
  to { opacity: .18; }
}

@media (max-width: 760px) {
  .world-loading { --u: 1.5px; }

  .world-loading-logo { width: min(88%, 340px); }

  .world-loading-panel { width: min(94%, 400px); }
}

@media (prefers-reduced-motion: reduce) {
  .world-loading-cursor,
  .world-loading-hint,
  .world-loading.is-leaving {
    animation: none;
  }
}
