/* Racket hero layer. Sits behind the hero copy and never takes pointer events. */
.v2-hero:has(> .v2-racket) { position: relative; overflow: hidden; }
.v2-racket { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.v2-hero:has(> .v2-racket) > :not(.v2-racket) { position: relative; z-index: 1; }
/* .v2-racket-poster is the runtime poster, painted on a 2D <canvas> by the loader (a canvas is never an LCP candidate; an <img> was).
   .v2-racket-live is the WebGL canvas. .v2-racket-img survives only for the <noscript> poster. All three fill the same square layer. */
.v2-racket-img, .v2-racket canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; object-position: center bottom; pointer-events: none;
  transition: opacity .6s ease;
}
.v2-racket .v2-racket-live { opacity: 0; }
.v2-racket .v2-racket-poster { opacity: 1; }
.v2-racket.is-live .v2-racket-live { opacity: 1; }
.v2-racket.is-live .v2-racket-poster { opacity: 0; }
.v2-racket.is-still .v2-racket-poster{opacity:1}
.v2-racket.is-still .v2-racket-img{opacity:1}
@media (prefers-reduced-motion: reduce) { .v2-racket-img, .v2-racket canvas { transition: none; } }

/* The layer is always square, like the 1200px poster, and the img and canvas fill it, so the poster->canvas crossfade is the same box and framing. */
/* Placement (Task 8, verified against screenshots at 320/375/1440, EN + DE).
   The racket owns its own frame (the scene sizes itself to .v2-racket, not the hero), so it can never sit under the copy:
   - below 1000px: a square strip centred under the copy, hero gets bottom padding to make room;
   - from 1000px: right-hand column (square, vertically centred), home copy is left-aligned in the left half.
   The scene is framed (racket-scene.js FRAME_*) so poster and live canvas keep a transparent margin on every side: no edge mask is needed. */
body.v2 .v2-hero.v2-hero--home.v2-hero--stage:has(> .v2-racket) { padding-bottom: calc(min(300px, 80vw) + 16px); }
body.v2 .v2-hero--home .v2-racket { inset: auto auto 0 50%; width: min(300px, 80vw); height: min(300px, 80vw); transform: translateX(-50%); }
@media (min-width: 1000px) {
  body.v2 .v2-hero.v2-hero--home.v2-hero--stage:has(> .v2-racket) { padding-bottom: 64px; }
  /* Stage: the hero fills the first screen (80svh; the vh line is the fallback; below 80 it does not reach the 25 % dark-share limit on the English home, measured 25.7 % at 80svh) and the copy is centred in it. The wrap keeps its own
     width (a flex item with auto inline margins would otherwise shrink to its content). Phones are untouched: below 1000px the hero is
     as tall as its content, so headline, button and racket stay in one screen. */
  body.v2 .v2-hero.v2-hero--home.v2-hero--stage:has(> .v2-racket) { min-height: 80vh; min-height: 80svh; display: flex; flex-direction: column; justify-content: center; }
  body.v2 .v2-hero--home:has(> .v2-racket) > .v2-wrap { width: 100%; box-sizing: border-box; }
  /* The square layer stays inside the hero: below the 64px sticky header (+8px), 8px above the hero bottom, and a right gutter so it
     does not sit on the viewport edge. Height is the free hero height (capped at 42vw so it never reaches the copy), width follows
     from the 1:1 ratio, auto margins centre it vertically. */
  /* Part 2 (2030 r1): the layer starts 48px from the hero top (the poster keeps a ~5% transparent margin above the racket head, so the head
     still clears the 64px bar) and is capped at 47vw, which is 1.6x the old 42vw-of-a-560px-hero box at 1440px (422px -> 677px). The racket
     sits in the middle of the square layer, so the transparent left part of the box may overlap the copy column but never its text. */
  body.v2 .v2-hero--home .v2-racket { inset: 48px clamp(16px, 2.5vw, 48px) 0 auto; margin-block: auto; width: auto; height: min(calc(100% - 48px), 47vw); aspect-ratio: 1; transform: none; }
  body.v2 .v2-hero--home:has(> .v2-racket) .v2-hero-copy { margin-inline: 0; max-width: min(600px, 54%); text-align: left; }
  body.v2 .v2-hero--home:has(> .v2-racket) .v2-actions { justify-content: flex-start; }
  body.v2 .v2-hero--home:has(> .v2-racket) .v2-sub { margin-inline: 0; }
}
/* the no-JS poster lives in a <noscript> child of the hero; it must not become the (zero-size) containing block */
body.v2 .v2-hero:has(> .v2-racket) > noscript { position: static; z-index: auto; }
