/* ======================================================================
   KOJI DOJO v12.30 — ARCHIVE CLEAN STAGE FIX

   IMPORTANT:
   - Do NOT redefine .premium-stage geometry here.
   - The Archive wallpaper inherits the exact same .premium-stage positioning,
     width, transform and full-bleed behaviour as Fight Card / Players / Signup.
   - This file changes only Archive artwork, lighting and the floating book.
   ====================================================================== */

/* Remove old side characters and old pseudo-element experiments. */
.premium-fighter-dizzy-archive,
.premium-fighter-zato-archive {
  display: none !important;
}

.premium-archive::before,
.premium-archive::after {
  content: none !important;
  display: none !important;
}

/* Let the existing base .premium-stage class control ALL geometry.
   These are the only wallpaper-specific properties we override. */
.premium-stage-archive {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;

  background-image: url("archive-backyard-wallpaper.png") !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: center 48% !important;

  /* Deliberately brighter than the old archive treatment. */
  filter: saturate(.96) contrast(1.07) brightness(.78) !important;

  /* EXACT same vertical reveal/fade structure used by the working Fight Card. */
  -webkit-mask-image: linear-gradient(to bottom,
    transparent 0%,
    rgba(0,0,0,.56) 7%,
    #000 16%,
    #000 83%,
    rgba(0,0,0,.60) 93%,
    transparent 100%) !important;
  mask-image: linear-gradient(to bottom,
    transparent 0%,
    rgba(0,0,0,.56) 7%,
    #000 16%,
    #000 83%,
    rgba(0,0,0,.60) 93%,
    transparent 100%) !important;
}

/* Lighter cinematic treatment so the actual Backyard artwork is readable. */
.premium-stage-archive::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  pointer-events: none !important;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255,177,66,.24) 0%, rgba(255,147,46,.10) 24%, transparent 48%),
    radial-gradient(ellipse at 18% 50%, rgba(69,125,255,.12) 0%, transparent 34%),
    radial-gradient(ellipse at 82% 48%, rgba(72,132,255,.12) 0%, transparent 34%),
    linear-gradient(90deg,
      rgba(7,9,13,.48) 0%,
      rgba(7,9,13,.18) 18%,
      rgba(7,9,13,.05) 34%,
      rgba(7,9,13,.05) 66%,
      rgba(7,9,13,.18) 82%,
      rgba(7,9,13,.50) 100%),
    linear-gradient(180deg,
      rgba(7,9,13,.12) 0%,
      rgba(7,9,13,.04) 42%,
      rgba(7,9,13,.42) 100%) !important;
}

/* ----------------------------------------------------------------------
   FLOATING TOME
   The scene wrapper is anchored to the Archive content rail ONLY for book
   placement. It no longer paints or sizes the wallpaper.
   ---------------------------------------------------------------------- */
.premium-archive {
  overflow: visible !important;
}

.premium-archive > .archive-library-scene {
  position: absolute !important;
  inset: 0 !important;
  z-index: 4 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: none !important;
  overflow: visible !important;
  background: none !important;
  filter: none !important;
  transform: none !important;
}

.archive-library-scene::before,
.archive-library-scene::after {
  content: none !important;
  display: none !important;
}

/* A clearly visible halo behind the book, outside the main archive card. */
.archive-library-halo {
  position: absolute !important;
  top: 92px !important;
  right: -285px !important;
  width: 390px !important;
  aspect-ratio: 1 !important;
  z-index: 1 !important;
  border-radius: 50% !important;
  background:
    radial-gradient(circle,
      rgba(108,145,255,.34) 0%,
      rgba(89,126,255,.18) 27%,
      rgba(255,180,73,.10) 46%,
      transparent 70%) !important;
  filter: blur(20px) !important;
  opacity: .96 !important;
  animation: archiveHaloV130 7s ease-in-out infinite !important;
}

.archive-library-tome {
  position: absolute !important;
  top: 92px !important;
  right: -255px !important;
  width: clamp(250px, 19vw, 355px) !important;
  height: auto !important;
  z-index: 2 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: none !important;
  transform-origin: 52% 58% !important;
  filter:
    brightness(1.18)
    contrast(1.08)
    saturate(1.02)
    drop-shadow(0 16px 30px rgba(0,0,0,.70))
    drop-shadow(0 0 24px rgba(103,140,255,.42))
    drop-shadow(0 0 32px rgba(255,180,72,.18)) !important;
  animation: archiveTomeV130 8.4s ease-in-out infinite !important;
}

@keyframes archiveHaloV130 {
  0%,100% { transform: scale(1); opacity: .88; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes archiveTomeV130 {
  0%,100% { transform: translate3d(0,0,0) rotate(-7deg) scale(1); }
  25% { transform: translate3d(-5px,-10px,0) rotate(-4deg) scale(1.018); }
  50% { transform: translate3d(5px,-17px,0) rotate(-8deg) scale(1.03); }
  75% { transform: translate3d(-3px,-7px,0) rotate(-5.5deg) scale(1.015); }
}

/* Archive content sits above the wallpaper. The floating book is mostly placed
   outside the card so it remains visible instead of being hidden behind it. */
.premium-archive > .section-heading,
.premium-archive > .archive-event {
  position: relative !important;
  z-index: 5 !important;
}

/* Let more stage art show through the archive event itself. */
.premium-archive .archive-event {
  background:
    linear-gradient(180deg, rgba(7,10,21,.66), rgba(5,8,17,.76)) !important;
  border-color: rgba(255,218,115,.18) !important;
  box-shadow:
    0 18px 46px rgba(0,0,0,.30),
    inset 0 1px 0 rgba(255,255,255,.035),
    0 0 0 1px rgba(81,104,174,.08) !important;
  backdrop-filter: blur(1px) !important;
}

/* On normal laptop widths, pull the book inward enough to stay on-screen. */
@media (max-width: 1550px) {
  .archive-library-halo {
    right: -175px !important;
    width: 330px !important;
  }
  .archive-library-tome {
    right: -150px !important;
    width: 285px !important;
  }
}

@media (max-width: 1250px) {
  .archive-library-halo {
    top: 112px !important;
    right: -80px !important;
    width: 275px !important;
    opacity: .80 !important;
  }
  .archive-library-tome {
    top: 110px !important;
    right: -55px !important;
    width: 235px !important;
    opacity: .90 !important;
  }
}

@media (max-width: 900px) {
  .premium-archive {
    overflow: hidden !important;
  }
  .premium-stage-archive {
    background-position: 54% 48% !important;
    filter: saturate(.88) contrast(1.06) brightness(.68) !important;
  }
  .archive-library-halo {
    top: 145px !important;
    right: -48px !important;
    width: 220px !important;
    opacity: .64 !important;
  }
  .archive-library-tome {
    top: 144px !important;
    right: -28px !important;
    width: 175px !important;
    opacity: .72 !important;
  }
}

@media (max-width: 560px) {
  .archive-library-halo {
    display: none !important;
  }
  .archive-library-tome {
    top: 160px !important;
    right: -34px !important;
    width: 135px !important;
    opacity: .48 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .archive-library-halo,
  .archive-library-tome {
    animation: none !important;
  }
  .archive-library-tome {
    transform: rotate(-7deg) !important;
  }
}
