/* Original image mascots, in the existing page artwork slots. Page styles keep
   the composition; these rules only fit the original aspect ratios and prevent
   a retired portrait crop or square WebGL frame from distorting the artwork. */

img.legacy-mascot {
  display: block;
  max-width: 100%;
  object-fit: contain;
  animation: none !important;
}

body#home .gx-mascot-wrap > img.gx-mascot {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

body#home img.gx-feedback__art { width: 100%; height: auto; }
html body#home #home-footer .gx-home-footer__lean > img { width: 100%; height: auto; }
.cr-mascot > img.legacy-mascot { width: 100%; height: auto; }

/* The old library artwork is a complete landscape scene, rather than a square
   character. It owns the same artwork column and the same stacked phone row. */
body#notes-page .mascot-wrapper > img.legacy-mascot,
body#pyqs-page .mascot-wrapper > img.legacy-mascot,
body.testseries-body .series-search-mascot > img.legacy-mascot {
  display: block;
  width: min(100%, 560px);
  height: auto;
  margin-inline: auto;
  object-fit: contain;
}

body#games-page:not(#home):not(#quiz-page) .arcade-home .arcade-hero__art img.legacy-mascot {
  width: 100%;
  max-width: 100%;
  height: 100%;
  right: 0;
  bottom: 0;
  object-fit: contain;
  object-position: right bottom;
  mix-blend-mode: normal;
}

/* Account artwork stays inside its existing column, clear of names and copy. */
img.pf-hero__mascot.legacy-mascot {
  left: 50%;
  right: auto;
  bottom: 0;
  width: 100%;
  max-width: 380px;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
}

img.rw-hero__mascot.legacy-mascot {
  left: 50%;
  right: auto;
  bottom: 0;
  max-width: 100%;
  height: min(100%, 430px);
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
}

img.rw-success__gyani.legacy-mascot {
  width: clamp(86px, 18vw, 120px);
  height: auto;
  max-height: 170px;
  margin: 0 auto 12px;
}

/* Both original registration variants share the existing artwork cell. */
body:has(.auth-shell) .auth-visual picture {
  display: block !important;
  width: 100%;
  height: 100%;
}

body:has(.auth-shell) .auth-visual img.legacy-mascot {
  position: static;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transform: none;
}

/* Quiz artwork returns to the portrait busts. Their original soft edge blends
   into the dialog; the ready and question layouts retain their intended crops. */
.qp-pop__art > img.qp-pop__gyani.legacy-mascot {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(44dvh, 350px);
  object-fit: contain;
  object-position: center bottom;
  -webkit-mask-image: linear-gradient(#000 70%, transparent 98%);
  mask-image: linear-gradient(#000 70%, transparent 98%);
}

.qp-pop__art--tall > img.qp-pop__gyani.legacy-mascot {
  width: min(100%, 230px);
  height: min(42dvh, 330px);
  object-fit: cover;
  object-position: 62% top;
  clip-path: inset(0 0 0 7%);
}

#results-screen img.rs-mascot.legacy-mascot,
#resultPage img.tr-mascot.legacy-mascot { height: auto; object-fit: contain; }

@media (max-width: 980px) {
  body:has(.auth-shell) .info-pane .auth-visual {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 200px;
    max-height: 380px;
    margin: 0 !important;
    aspect-ratio: auto;
  }
  body:has(.auth-shell) .auth-visual picture {
    width: min(100%, 380px);
    height: auto;
    margin-inline: auto;
  }
  body:has(.auth-shell) .auth-visual img.legacy-mascot { height: auto; }
}

@media (max-width: 960px) {
  body#notes-page .mascot-wrapper > img.legacy-mascot,
  body#pyqs-page .mascot-wrapper > img.legacy-mascot,
  body.testseries-body .series-search-mascot > img.legacy-mascot { width: min(100%, 480px); }
}

@media (max-width: 900px) {
  #quiz-screen .qp-level { min-height: 236px; }
  #quiz-screen .qp-level h3,
  #quiz-screen .qp-level > p,
  #quiz-screen .qp-meter { max-width: calc(100% - 120px); }
  img.pf-hero__mascot.legacy-mascot { width: 100%; max-width: 100%; height: 100%; }
  img.rw-hero__mascot.legacy-mascot {
    left: auto;
    right: 0;
    width: 100%;
    height: 100%;
    transform: none;
    object-position: right bottom;
  }
}

@media (max-width: 820px) {
  .qp-pop__art > img.qp-pop__gyani.legacy-mascot { max-height: min(30dvh, 230px); }
  .qp-pop__art--tall > img.qp-pop__gyani.legacy-mascot { height: min(30dvh, 230px); }
}

@media (max-width: 680px) {
  body:has(.auth-shell) .info-pane {
    min-height: 0 !important;
    grid-template-rows: auto auto auto;
    padding-bottom: 24px !important;
  }
  body#notes-page .mascot-wrapper > img.legacy-mascot,
  body#pyqs-page .mascot-wrapper > img.legacy-mascot,
  body.testseries-body .series-search-mascot > img.legacy-mascot { width: min(100%, 380px); }
}

@media (max-height: 660px) and (max-width: 820px) {
  .qp-pop__art > img.qp-pop__gyani.legacy-mascot { max-height: min(22dvh, 140px); }
  .qp-pop__art--tall > img.qp-pop__gyani.legacy-mascot { height: min(22dvh, 140px); }
}
