/* Keep the foreground portrait framed from the bottom and place its eyes near
   the map's eye line. Ratios refer to the existing visible sprite crops. */
.cs-game-hero [data-game-panel="cs16"] {
  --portrait-ratio: 1.3852;
  --portrait-height: 81cqh;
  --portrait-x: -1%;
  --portrait-tone: saturate(.84) sepia(.07) contrast(.99);
  --scene-position: 55% 74%;
  --scene-mobile-position: 60% 67%;
  --scene-wash: rgb(122 90 55 / 9%);
  --shadow-x: 5px;
}
.cs-game-hero [data-game-panel="cs2"] {
  --portrait-ratio: 1.2385;
  --portrait-height: 69cqh;
  --portrait-x: 2%;
  --portrait-tone: brightness(1.12) contrast(.94) saturate(.88);
  --scene-position: 61% 82%;
  --scene-mobile-position: 58% 62%;
  --scene-wash: rgb(57 82 94 / 8%);
  --shadow-x: 4px;
}
.cs-game-hero [data-game-panel="csgo"] {
  --portrait-ratio: .7578;
  --portrait-height: 73cqh;
  --portrait-x: 1%;
  --portrait-tone: brightness(.96) saturate(.90) sepia(.06);
  --scene-position: 68% 70%;
  --scene-mobile-position: 69% 65%;
  --scene-wash: rgb(129 103 73 / 8%);
  --shadow-x: 5px;
}
.cs-game-hero [data-game-panel="source"] {
  --portrait-ratio: .834;
  --portrait-height: 75cqh;
  --portrait-x: -1%;
  --portrait-tone: brightness(.97) contrast(1.02) saturate(.90) sepia(.13);
  --scene-position: 52% 71%;
  --scene-mobile-position: 54% 65%;
  --scene-wash: rgb(111 88 68 / 8%);
  --shadow-x: 6px;
}
.cs-game-hero [data-game-panel="standoff2"] {
  --portrait-ratio: 1;
  --portrait-height: 76cqh;
  --portrait-x: -3%;
  --portrait-tone: contrast(1.07) saturate(1.03) sepia(.08);
  --scene-position: 42% 69%;
  --scene-mobile-position: 44% 67%;
  --scene-wash: rgb(143 87 58 / 8%);
  --shadow-x: 4px;
}
.cs-game-hero .cs-game-hero__panel > .cs-game-hero__visual {
  container-type: size;
}
@media (min-width: 801px) {
  .cs-game-hero .cs-game-hero__panel > .cs-game-hero__visual {
    height: auto;
    align-self: stretch;
  }
}
.cs-game-hero .cs-game-hero__visual > .cs-game-hero__figure {
  position: absolute;
  inset: auto 0 -3px var(--portrait-x);
  width: min(98%, 510px);
  width: min(98%, calc(var(--portrait-ratio) * var(--portrait-height)));
  height: auto;
  max-width: none;
  margin: 0 auto;
  aspect-ratio: var(--portrait-ratio);
  filter: var(--portrait-tone) drop-shadow(var(--shadow-x) 4px 5px rgb(21 23 23 / 24%));
}
/* Preserve the original sprite geometry, including both hand-cropped images.
   The outer filter also reaches those sprites without adding a second shadow. */
.cs-game-hero .cs-game-hero__visual > .cs-game-hero__figure > img { filter: none; }
.cs-game-hero .cs-game-hero__scene > img { object-position: var(--scene-position); }
.cs-game-hero .cs-game-hero__scene > :is(img, canvas[data-hero-refraction]) {
  filter: brightness(.94) saturate(.91) contrast(1.025);
}
.cs-game-hero .cs-game-hero__scene::after {
  background: linear-gradient(to top, rgb(21 28 31 / 15%), transparent 49%),
              linear-gradient(130deg, var(--scene-wash), transparent 67%);
}
.cs-game-hero.is-switching .cs-game-hero__panel:not([hidden]) .cs-game-hero__figure {
  animation: cs-hero-portrait-in 320ms ease-out both;
}
@keyframes cs-hero-portrait-in { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 801px) and (max-width: 960px) {
  .cs-game-hero .cs-game-hero__visual > :is(.cs-game-hero__figure--cs16, .cs-game-hero__figure--cs2) {
    inset-inline: auto -5%;
    width: min(117%, calc(var(--portrait-ratio) * var(--portrait-height)));
  }
}
@media (max-width: 800px) {
  .cs-game-hero .cs-game-hero__visual > .cs-game-hero__figure {
    --portrait-height: 93cqh;
    inset-inline: 0;
  }
  .cs-game-hero .cs-game-hero__scene > img { object-position: var(--scene-mobile-position); }
}
@media (max-width: 480px) {
  .cs-game-hero .cs-game-hero__visual > :is(.cs-game-hero__figure--cs16, .cs-game-hero__figure--cs2) {
    inset-inline: -12px;
    width: min(calc(100% + 24px), calc(var(--portrait-ratio) * var(--portrait-height)));
  }
}
