.landing { --player-glow-edge: #58caff; --player-glow-halo: #168fff; }
.landing .hero::after {
  inset: 0 calc(50% - 50vw) -9% 25%;
  background-position: 57% 54%;
  opacity: .65;
  filter: saturate(.79);
  -webkit-mask-image: radial-gradient(ellipse 62% 66% at 68% 48%, #000 18%, transparent 97%);
  mask-image: radial-gradient(ellipse 62% 66% at 68% 48%, #000 18%, transparent 97%);
}
.operator-scene::before { display: none; }
.hero { --hud-width: 108px; }
.operator-scene {
  width: calc(50% - var(--hud-width));
  right: calc(var(--hud-width) + 6px);
  bottom: 0;
  container-type: size;
  display: grid;
  align-items: end;
  justify-items: center;
  overflow: visible;
  clip-path: inset(0 0 0 -18%);
  pointer-events: auto;
}
.operative-art {
  --box-right: 12%;
  --headroom: clamp(10px, 1.25vw, 18px);
  position: relative;
  width: 78%;
  width: min(calc(100cqw - 45px), calc(120cqh - 32px));
  aspect-ratio: 6 / 5;
  margin-inline-end: 26px;
}
.operative-ready, .operative-outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.operative-pose { position: absolute; inset: 0; pointer-events: none; }
.operative-ready { -webkit-mask-image: linear-gradient(#000 0 88%, transparent); mask-image: linear-gradient(#000 0 88%, transparent); }
.operative-outline {
  filter: drop-shadow(3px 0 var(--player-glow-edge)) drop-shadow(-3px 0 var(--player-glow-edge)) drop-shadow(0 -3px var(--player-glow-edge)) drop-shadow(0 3px var(--player-glow-edge)) drop-shadow(0 0 5px var(--player-glow-halo));
}
.operative-outline img {
  display: block; width: 100%; height: 100%;
  /* Follow the sleeve and supporting glove; exclude the projecting barrel. */
  clip-path: polygon(0 0,100% 0,100% 100%,0 100%,0 81%,19% 81%,18.2% 77%,18% 75%,17.5% 70%,17.5% 61%,0 61%);
}
.operative-outline { -webkit-mask-image: linear-gradient(#000 0 78%, transparent 91%); mask-image: linear-gradient(#000 0 78%, transparent 91%); }
.operative-box, .operative-hp {
  position: absolute; z-index: 1; top: calc(0px - var(--headroom)); bottom: .6%; pointer-events: none;
}
.operative-box { left: 23%; right: var(--box-right); border: 2px solid #c6e1e3b8; border-bottom: 0; }
.operative-hp { left: calc(100% - var(--box-right) + 3px); width: clamp(3px,.33vw,4.5px); }
.operative-hp::before { content: ''; display: block; height: 100%; background: #69ee83; box-shadow: 0 0 0 1px #152725; transform-origin: bottom; }
.operative-hp span {
  position: absolute; top: 0; left: calc(100% + 4px); white-space: nowrap;
  padding: 2px 4px; border-radius: 3px; background: #10211fea; color: #a2ffb2;
  font: 700 clamp(9px, .85vw, 12px)/1.1 Arial, sans-serif;
}
.operative-weapon {
  position: absolute; z-index: 1;
  left: calc(100% - var(--box-right) + clamp(3px,.33vw,4.5px) + 7px);
  top: calc(0px - var(--headroom) + 1.25em + 6px);
  display: inline-grid; justify-items: center; gap: 1px; padding: 2px 4px;
  border-radius: 3px; background: #10211fea; color: #eaf4fb;
  font: 700 clamp(9px, .85vw, 12px)/1.1 Arial, sans-serif; white-space: nowrap;
}
.operative-weapon img { display: block; width: 3em; height: auto; }
.operative-outline, .operative-box, .operative-hp, .operative-weapon { opacity: 0; }
.operative-art .is-on { opacity: 1; }
.operative-hp:not(.is-on)::before { transform: scaleY(0); }
.hud-controls {
  position: absolute; z-index: 2; right: 0; top: 50%; transform: translateY(-50%);
  width: var(--hud-width);
}
.hud-controls, .aim-features {
  padding: 4px 8px;
  border: 1px solid #aac8ce40; border-radius: 12px;
  background: #0e1a22ef; color: #eef5f6;
  box-shadow: 0 5px 24px #05101933;
}
.hud-switch, .aim-features > [data-indicator] {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  min-height: 32px; font: 600 11px/1.2 Arial, sans-serif;
}
.hud-switch { cursor: pointer; }
.hud-switch input {
  appearance: none; -webkit-appearance: none;
  position: relative; flex: none; width: 26px; height: 16px; margin: 0;
  border-radius: 12px; border: 1px solid #657681; background: #33424c; cursor: pointer;
}
.hud-switch input::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 10px; height: 10px; border-radius: 50%; background: #f3f6f8;
}
.hud-switch input:checked { background: #78e2c8; border-color: #78e2c8; }
.hud-switch input:checked::after { transform: translateX(10px); background: #102a26; }
.hud-clear {
  display: block; width: 100%; min-height: 30px; padding: 4px 0;
  border: 0; border-top: 1px solid #aac8ce3b; background: transparent;
  font: 500 11px/1.2 Arial, sans-serif; color: #c5d9dd; cursor: pointer;
}
.hud-clear:hover { color: #fff; }
.hud-controls :focus-visible { outline: 2px solid #a6efdf; outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .operative-art :is(.operative-outline,.operative-box,.operative-weapon,.operative-hp) { transition: opacity .36s ease; }
  .operative-hp::before { transition: transform .5s ease; }
  .hud-switch input, .hud-switch input::after { transition: background-color .16s, transform .18s; }
}
/* Expose only the tiny muzzle patch; the rest of the original portrait stays intact. */
.operative-ready {
  clip-path: polygon(0 0,100% 0,100% 100%,0 100%,0 77.29%,6.45% 77.29%,6.45% 73.10%,0 73.10%);
}
.operative-detail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
html[data-game="valorant"] .landing .hero::after { background-image: url('assets/valorant-ascent.webp'); }
html[data-game="valorant"] .operative-art { --box-right: 22%; --headroom: -5%; }
html[data-game="valorant"] .operative-box { left: 28%; }
html[data-game="fortnite"] .landing .hero::after { background-image: url('assets/fortnite-town.webp'); }
html[data-game="fortnite"] .operative-art { --box-right: 33%; --headroom: 0px; }
html[data-game="fortnite"] .operative-box { left: 40%; }
html[data-game="fortnite"] .operative-weapon img { filter: brightness(0) invert(1); }
html[data-game="fortnite"] :is(.operative-ready,.operative-outline img) {
  object-fit: contain;
  object-position: center top;
  clip-path: none;
}
@media (max-width: 365px) {
  html[data-game="valorant"] .operative-hp span { left: auto; right: calc(100% + 4px); }
}
html[data-game="valorant"] :is(.operative-ready,.operative-outline img) {
  object-fit: cover;
  object-position: center top;
  clip-path: none;
}
@media (max-width: 700px) {
  .landing .hero { display: grid; grid-template-columns: minmax(0,1fr) var(--hud-width); gap: 16px 8px; padding-block: 24px 8px; }
  .hero-copy { grid-column: 1 / -1; }
  .landing .hero h1 { min-height: 0; }
  .hero-prefix, .hero-game { max-width: 100%; }
  .landing .hero::after { left: 0; opacity: .52; background-position: center bottom; }
  .operator-scene {
    position: relative; inset: auto; width: 100%; height: clamp(150px, 44vw, 235px);
    align-items: end;
  }
  .operative-art { margin-inline-end: 16px; }
  .hud-controls { position: static; transform: none; align-self: center; }
}
