:root {
  color-scheme: dark;
  --court-blue: #1f87c7;
  --court-deep: #0d427a;
  --court-light: #44b6e8;
  --chalk: #f6fff9;
  --ink: #07110d;
  --ball: #e7f747;
  --coral: #ff6b56;
  --mint: #8cf0b7;
  --brand-cover: 100%;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--chalk);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.landing {
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 107, 86, 0.16), transparent 24%, transparent 76%, rgba(140, 240, 183, 0.14)),
    #07121c;
}

.court-shell {
  --brand-cover: 100%;
  position: relative;
  width: min(100vw, 31rem);
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #07121c;
  box-shadow: 0 0 0 1px rgba(246, 255, 249, 0.1), 0 0 5rem rgba(0, 0, 0, 0.55);
}

.court-shell::before,
.court-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.court-shell::before {
  background:
    radial-gradient(circle at 50% 47%, transparent 0 44%, rgba(0, 0, 0, 0.22) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 18%, transparent 78%, rgba(0, 0, 0, 0.16));
  mix-blend-mode: soft-light;
}

.court-shell::after {
  background:
    linear-gradient(100deg, transparent 0 24%, rgba(255, 255, 255, 0.12) 36%, transparent 48%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 12%, transparent 86%, rgba(0, 0, 0, 0.38));
  opacity: 0.72;
}

.court-photo-stack {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 34% 32% 34%;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.court-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.08) brightness(0.94);
}

.court-photo-top {
  object-position: center bottom;
}

.court-photo-middle {
  object-position: center center;
}

.court-photo-bottom {
  object-position: center top;
}

.court-photo-montage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.08) contrast(1.06) brightness(0.96);
  z-index: 0;
}

.court-grid,
.court-net,
.court-line,
.court-player {
  display: none;
}

.court-grid {
  position: absolute;
  inset: 1.25rem;
  border: 0.28rem solid rgba(246, 255, 249, 0.92);
  background:
    linear-gradient(0deg, transparent calc(50% - 0.08rem), rgba(246, 255, 249, 0.86) calc(50% - 0.08rem) calc(50% + 0.08rem), transparent calc(50% + 0.08rem));
  box-shadow: inset 0 0 4rem rgba(0, 0, 0, 0.22);
  z-index: 1;
}

.court-net {
  position: absolute;
  left: 1.1rem;
  right: 1.1rem;
  top: 50%;
  height: 0.75rem;
  translate: 0 -50%;
  background:
    repeating-linear-gradient(90deg, rgba(7, 17, 13, 0.52) 0 0.2rem, rgba(246, 255, 249, 0.34) 0.2rem 0.32rem),
    linear-gradient(0deg, rgba(7, 17, 13, 0.72), rgba(246, 255, 249, 0.2), rgba(7, 17, 13, 0.72));
  box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.28);
  z-index: 2;
}

.court-line {
  position: absolute;
  pointer-events: none;
  z-index: 3;
}

.court-line-border {
  inset: 1.25rem;
  border: 0.12rem solid rgba(246, 255, 249, 0.94);
}

.court-line-service-top,
.court-line-service-bottom {
  left: 1.25rem;
  right: 1.25rem;
  height: 0.12rem;
  background: rgba(246, 255, 249, 0.86);
}

.court-line-service-top {
  top: 16%;
}

.court-line-service-bottom {
  bottom: 16%;
}

.court-line-service-axis-top,
.court-line-service-axis-bottom {
  left: calc(50% - 0.055rem);
  width: 0.11rem;
  background: rgba(246, 255, 249, 0.86);
}

.court-line-service-axis-top {
  top: 16%;
  bottom: 50%;
}

.court-line-service-axis-bottom {
  top: 50%;
  bottom: 16%;
}

.court-player {
  --player-x: 50%;
  --player-y: 50%;
  --move-x: 0px;
  --move-y: 0px;
  --player-rot: 0deg;
  --lean: 0deg;
  --swing: 0deg;
  --kit: #ff6b56;
  --kit-dark: #9c2c25;
  --skin: #f2c39a;
  display: none;
  position: absolute;
  left: var(--player-x);
  top: var(--player-y);
  width: 2.15rem;
  height: 3.55rem;
  z-index: 4;
  opacity: 0.96;
  transform: translate(calc(-50% + var(--move-x)), calc(-50% + var(--move-y))) rotate(var(--player-rot)) rotate(var(--lean));
  transform-origin: 50% 54%;
  transition: filter 120ms ease;
  pointer-events: none;
}

.court-player span {
  position: absolute;
  display: block;
}

.player-shadow {
  left: 50%;
  bottom: 0.08rem;
  width: 2.45rem;
  height: 0.46rem;
  translate: -50% 0;
  border-radius: 50%;
  background: rgba(7, 17, 13, 0.24);
  filter: blur(1px);
}

.player-head {
  left: 50%;
  top: 0.08rem;
  width: 0.68rem;
  height: 0.68rem;
  translate: -50% 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 240, 210, 0.85), transparent 0.18rem),
    var(--skin);
  box-shadow: 0 0.08rem 0 rgba(90, 52, 32, 0.5);
}

.player-torso {
  left: 50%;
  top: 0.78rem;
  width: 1.14rem;
  height: 1.38rem;
  translate: -50% 0;
  border-radius: 0.58rem 0.58rem 0.38rem 0.38rem;
  background: linear-gradient(180deg, var(--kit), var(--kit-dark));
  box-shadow: inset 0 -0.2rem 0 rgba(7, 17, 13, 0.14), 0 0.2rem 0.5rem rgba(0, 0, 0, 0.2);
}

.player-arm {
  top: 0.96rem;
  width: 0.36rem;
  height: 1.18rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--skin), #c77f55);
  transform-origin: 50% 0.15rem;
}

.player-arm-left {
  left: 0.32rem;
  transform: rotate(24deg);
}

.player-arm-right {
  right: 0.32rem;
  transform: rotate(calc(-28deg + var(--swing)));
}

.player-leg {
  top: 1.9rem;
  width: 0.42rem;
  height: 1.08rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #15251d, #09120d);
  transform-origin: 50% 0.12rem;
}

.player-leg-left {
  left: 0.72rem;
  transform: rotate(-10deg);
}

.player-leg-right {
  right: 0.72rem;
  transform: rotate(10deg);
}

.player-racket {
  right: -0.52rem;
  top: 1.34rem;
  width: 0.94rem;
  height: 0.72rem;
  border: 0.14rem solid rgba(246, 255, 249, 0.9);
  border-radius: 50%;
  background: rgba(7, 17, 13, 0.08);
  transform-origin: -0.08rem 0.22rem;
  transform: rotate(calc(28deg + var(--swing)));
}

.player-racket::after {
  content: "";
  position: absolute;
  left: -0.42rem;
  top: 0.36rem;
  width: 0.54rem;
  height: 0.12rem;
  border-radius: 999px;
  background: rgba(246, 255, 249, 0.88);
}

.court-player-one,
.court-player-two {
  --kit: #8cf0b7;
  --kit-dark: #15734e;
}

.court-player-one {
  --player-x: 42%;
  --player-y: 16%;
  --player-rot: 178deg;
}

.court-player-four {
  --player-x: 58%;
  --player-y: 84%;
  --player-rot: 2deg;
}

.court-player-two,
.court-player-three {
  display: none;
}

.landing-racket {
  --racket-x: 50%;
  --racket-y: 50%;
  --move-x: 0px;
  --move-y: 0px;
  --racket-rot: 0deg;
  --racket-swing: 0deg;
  --racket-scale: 1;
  position: absolute;
  left: var(--racket-x);
  top: var(--racket-y);
  width: clamp(5.1rem, 21vw, 7rem);
  height: auto;
  z-index: 6;
  transform:
    translate(calc(-50% + var(--move-x)), calc(-50% + var(--move-y)))
    rotate(var(--racket-rot))
    rotate(var(--racket-swing))
    scale(var(--racket-scale));
  transform-origin: 50% 72%;
  filter:
    brightness(1.08)
    drop-shadow(0 0.32rem 0.46rem rgba(0, 0, 0, 0.38))
    drop-shadow(0 0 0.34rem rgba(255, 255, 255, 0.42));
  pointer-events: none;
  transition: filter 120ms ease;
}

.landing-racket-top {
  --racket-x: 42%;
  --racket-y: 11.5%;
  --racket-rot: 180deg;
}

.landing-racket-bottom {
  --racket-x: 62%;
  --racket-y: 78%;
  --racket-rot: 0deg;
}

.brand-lockup {
  position: absolute;
  top: 50%;
  left: 55%;
  width: min(132%, 42.7rem);
  translate: -50% -50%;
  aspect-ratio: 1536 / 1024;
  display: block;
  z-index: 5;
  filter:
    drop-shadow(0 0.34rem 0.55rem rgba(255, 255, 255, 0.22))
    drop-shadow(0 0.45rem 0.9rem rgba(0, 0, 0, 0.32));
}

.brand-wordmark {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
}

.brand-reveal {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.brand-line-main {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5.35rem;
  font-weight: 950;
}

.ball-slot {
  display: inline-block;
  width: 5.05rem;
  height: 5.05rem;
  margin-right: 0.05rem;
}

.brand-lockup .brand-wordmark-slot {
  position: absolute;
  left: 48.6%;
  top: 32.1%;
  width: 9.5%;
  height: auto;
  aspect-ratio: 1;
  translate: -50% -50%;
  margin: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  z-index: 2;
}

.brand-line-sub {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 1.62rem;
  font-weight: 900;
}

[data-reveal-letter] {
  opacity: 0;
  transform: translateY(0.8rem);
  transition: opacity 420ms ease, transform 420ms ease;
}

[data-reveal-letter].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.landing-action {
  position: absolute;
  left: 50%;
  z-index: 8;
  translate: -50% 0;
}

.landing-action {
  bottom: 2rem;
  min-width: 9.5rem;
  padding: 0.82rem 1.25rem;
  border: 1px solid rgba(246, 255, 249, 0.74);
  border-radius: 8px;
  background: var(--coral);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 0.8rem 1.7rem rgba(0, 0, 0, 0.24);
}

.landing-training-action {
  bottom: 5.55rem;
  background: rgba(7, 17, 13, 0.78);
  color: var(--chalk);
  border-color: rgba(246, 255, 249, 0.48);
  backdrop-filter: blur(10px);
}

.landing-action:focus-visible,
.back-link:focus-visible,
.serve-button:focus-visible,
.customize-button:focus-visible,
.customizer-close:focus-visible,
.customizer select:focus-visible {
  outline: 3px solid var(--ball);
  outline-offset: 3px;
}

.shot-path {
  position: absolute;
  inset: 1.25rem;
  background:
    radial-gradient(circle at var(--trail-x, 52%) var(--trail-y, 82%), rgba(250, 255, 125, 0.28), transparent 1.7rem),
    radial-gradient(circle at var(--trail-x, 52%) var(--trail-y, 82%), rgba(255, 255, 255, 0.18), transparent 0.58rem);
  opacity: 0.48;
  mix-blend-mode: screen;
  z-index: 3;
  pointer-events: none;
}

.ball-shadow {
  position: absolute;
  left: 0;
  top: 0;
  width: 3.25rem;
  height: 0.94rem;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 48% 52%, rgba(255, 255, 255, 0.24), transparent 0.42rem),
    radial-gradient(ellipse at 50% 50%, rgba(2, 8, 12, 0.42), transparent 72%);
  filter: blur(3.5px);
  mix-blend-mode: multiply;
  z-index: 4;
  pointer-events: none;
  will-change: transform, opacity;
}

.padel-ball {
  position: absolute;
  left: 0;
  top: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: url("assets/real-padel-ball.svg?v=1") center / contain no-repeat;
  box-shadow:
    0 0.4rem 1rem rgba(0, 0, 0, 0.34),
    0 0 0.92rem rgba(231, 247, 71, 0.22);
  overflow: hidden;
  z-index: 7;
  will-change: transform;
}

.padel-ball::before {
  content: none;
}

.padel-ball::after {
  content: none;
}

.home-page.is-complete .padel-ball {
  animation: finalBallPulse 1600ms ease-in-out infinite;
}

@keyframes finalBallPulse {
  50% {
    filter: saturate(1.25);
    box-shadow: 0 0.4rem 1.15rem rgba(0, 0, 0, 0.35), 0 0 1.65rem rgba(231, 247, 71, 0.55);
  }
}

.game-layout {
  min-height: 100svh;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 107, 86, 0.11), transparent 28%),
    #0a1510;
}

.game-scene {
  position: absolute;
  inset: 0;
  min-height: 100svh;
}

.game-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.game-topbar,
.game-controls,
.rules-ribbon {
  position: absolute;
  left: 50%;
  width: min(calc(100% - 1.5rem), 45rem);
  translate: -50% 0;
  z-index: 5;
}

.game-topbar {
  top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.back-link,
.score-panel,
.game-controls,
.rules-ribbon {
  border: 1px solid rgba(246, 255, 249, 0.22);
  background: rgba(7, 17, 13, 0.68);
  backdrop-filter: blur(12px);
}

.back-link {
  flex: 0 0 auto;
  padding: 0.65rem 0.78rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 850;
  text-decoration: none;
}

.score-panel {
  min-height: 2.75rem;
  flex: 1 1 auto;
  display: flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: space-around;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 780;
}

.score-panel strong {
  color: var(--ball);
  font-size: 1rem;
}

.game-controls {
  bottom: 4.65rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.72rem;
  border-radius: 8px;
}

.game-controls p {
  margin: 0;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  color: rgba(246, 255, 249, 0.88);
  font-size: 0.92rem;
  font-weight: 700;
}

.serve-button {
  min-width: 6.4rem;
  min-height: 2.75rem;
  border: 0;
  border-radius: 8px;
  background: var(--ball);
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 950;
  cursor: pointer;
}

.rules-ribbon {
  bottom: 0.75rem;
  min-height: 2.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.55rem;
  border-radius: 8px;
  color: rgba(246, 255, 249, 0.85);
  font-size: 0.78rem;
  font-weight: 760;
}

.rules-ribbon span {
  padding: 0.28rem 0.48rem;
  border: 1px solid rgba(140, 240, 183, 0.28);
  border-radius: 8px;
  background: rgba(23, 96, 68, 0.48);
}

.game-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  text-align: center;
  background: #0a1510;
  color: var(--chalk);
  font-weight: 800;
  z-index: 10;
}

.game-page {
  background: #07121c;
}

.game-layout {
  background:
    linear-gradient(180deg, rgba(68, 182, 232, 0.16), transparent 32%),
    linear-gradient(90deg, rgba(255, 107, 86, 0.12), transparent 28%, transparent 72%, rgba(140, 240, 183, 0.12)),
    #07121c;
}

.game-topbar {
  width: min(calc(100% - 1rem), 48rem);
  display: grid;
  grid-template-columns: auto 1fr auto auto;
}

.game-title {
  min-height: 2.75rem;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.52rem;
  padding: 0.34rem 0.72rem;
  border: 1px solid rgba(246, 255, 249, 0.18);
  border-radius: 8px;
  background: rgba(7, 18, 28, 0.62);
  backdrop-filter: blur(12px);
  line-height: 0.95;
  text-align: left;
}

.game-title::before {
  content: "";
  position: absolute;
  inset: -48%;
  background: url("assets/logo.png") center / cover no-repeat;
  opacity: 0.14;
  pointer-events: none;
}

.game-title-logo,
.game-title-text {
  position: relative;
  z-index: 1;
}

.game-title-logo {
  width: 2.3rem;
  height: 1.55rem;
  object-fit: cover;
  border: 1px solid rgba(31, 135, 199, 0.52);
  border-radius: 6px;
  box-shadow: 0 0 0.9rem rgba(31, 135, 199, 0.28);
}

.game-title-text {
  display: grid;
  align-content: center;
  gap: 0.1rem;
}

.game-title-text span {
  color: rgba(246, 255, 249, 0.78);
  font-size: 0.64rem;
  font-weight: 900;
}

.game-title-text strong {
  color: var(--court-blue);
  font-size: 0.86rem;
  font-weight: 950;
  text-shadow: 0 0 0.72rem rgba(31, 135, 199, 0.48);
}

.score-panel {
  background: rgba(7, 18, 28, 0.7);
}

.score-panel span {
  white-space: nowrap;
}

.customize-button,
.customizer-close {
  min-height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background: #050505;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.customize-button {
  padding: 0 0.72rem;
  backdrop-filter: blur(12px);
}

.customizer {
  position: absolute;
  top: 4.1rem;
  right: 0.5rem;
  bottom: 0.5rem;
  z-index: 8;
  width: min(22rem, calc(100% - 1rem));
  pointer-events: none;
}

.customizer[hidden] {
  display: none;
}

.customizer-panel {
  max-height: 100%;
  overflow: auto;
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: #000000;
  backdrop-filter: blur(14px);
  box-shadow: 0 1.2rem 2.4rem rgba(0, 0, 0, 0.42);
  padding: 0.85rem;
}

.customizer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.customizer-head span,
.customizer-field {
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.customizer-head h2 {
  margin: 0.12rem 0 0;
  color: #ffffff;
  font-size: 1.05rem;
}

.customizer-close {
  min-width: 5rem;
  padding: 0 0.65rem;
}

.customizer-field {
  display: grid;
  gap: 0.38rem;
  margin-top: 0.72rem;
}

.customizer select {
  min-height: 2.45rem;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  background: #050505;
  color: #ffffff;
  font: inherit;
  font-size: 0.86rem;
  text-transform: none;
}

.customizer option {
  background: #050505;
  color: #ffffff;
}

.racket-preview {
  display: block;
  width: 100%;
  min-height: 12rem;
  max-height: 15rem;
  margin-top: 0.8rem;
  padding: 0.55rem;
  box-sizing: border-box;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #f3f3f3 25%, transparent 25%),
    linear-gradient(-45deg, #f3f3f3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f3f3f3 75%),
    linear-gradient(-45deg, transparent 75%, #f3f3f3 75%),
    #ffffff;
  background-position: 0 0, 0 0.7rem, 0.7rem -0.7rem, -0.7rem 0;
  background-size: 1.4rem 1.4rem;
}

.customizer-racket {
  margin: 0.8rem 0 0;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.35;
}

.game-controls {
  bottom: 4.4rem;
  width: min(calc(100% - 1rem), 48rem);
  grid-template-columns: minmax(0, 1fr) auto auto;
  background: rgba(7, 18, 28, 0.72);
}

.shot-buttons {
  display: flex;
  gap: 0.38rem;
  align-items: center;
  justify-content: center;
}

.shot-button {
  min-height: 2.55rem;
  padding: 0 0.58rem;
  border: 1px solid rgba(246, 255, 249, 0.22);
  border-radius: 8px;
  background: rgba(246, 255, 249, 0.08);
  color: rgba(246, 255, 249, 0.9);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.shot-button.is-active {
  border-color: rgba(231, 247, 71, 0.84);
  background: rgba(231, 247, 71, 0.18);
  color: var(--ball);
}

.shot-button:focus-visible {
  outline: 3px solid var(--ball);
  outline-offset: 3px;
}

.serve-button {
  background: var(--coral);
}

.serve-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.rules-ribbon {
  width: min(calc(100% - 1rem), 48rem);
  background: rgba(7, 18, 28, 0.68);
}

.rules-ribbon span {
  background: rgba(31, 135, 199, 0.36);
}

.game-controls,
.rules-ribbon {
  display: none;
}

.mobile-play-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 12;
  display: none;
  align-items: end;
  justify-content: space-between;
  padding: 0 1.05rem;
  pointer-events: none;
}

.mobile-joystick {
  --joy-x: 0px;
  --joy-y: 0px;
  width: 6.4rem;
  height: 6.4rem;
  position: relative;
  border: 1px solid rgba(246, 255, 249, 0.24);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(231, 247, 71, 0.2), transparent 32%),
    rgba(5, 12, 18, 0.62);
  box-shadow:
    inset 0 0 1.2rem rgba(31, 135, 199, 0.25),
    0 0.7rem 1.6rem rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  touch-action: none;
}

.mobile-joystick::before {
  content: "";
  position: absolute;
  inset: 1.05rem;
  border: 1px solid rgba(246, 255, 249, 0.13);
  border-radius: inherit;
}

.mobile-joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.55rem;
  height: 2.55rem;
  translate: -50% -50%;
  transform: translate(var(--joy-x), var(--joy-y));
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.85), transparent 0.48rem),
    linear-gradient(145deg, var(--ball), #a7c60c);
  box-shadow:
    inset -0.18rem -0.22rem 0.36rem rgba(55, 81, 3, 0.45),
    0 0.35rem 0.72rem rgba(0, 0, 0, 0.36),
    0 0 0.7rem rgba(231, 247, 71, 0.35);
}

.mobile-serve-button {
  min-width: 6.9rem;
  min-height: 3.35rem;
  padding: 0 1.05rem;
  border: 1px solid rgba(246, 255, 249, 0.28);
  border-radius: 8px;
  background: var(--coral);
  color: #07110d;
  font-size: 1rem;
  font-weight: 950;
  box-shadow: 0 0.7rem 1.35rem rgba(0, 0, 0, 0.34);
  pointer-events: auto;
  touch-action: manipulation;
}

.mobile-serve-button:disabled {
  opacity: 0.45;
}

.game-layout {
  background:
    linear-gradient(180deg, rgba(18, 106, 165, 0.1), transparent 34%),
    #050b12;
}

.game-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 22%, transparent 76%, rgba(0, 0, 0, 0.22)),
    radial-gradient(circle at 50% 45%, transparent 0 36%, rgba(0, 0, 0, 0.3) 100%);
}

@media (max-width: 40rem) {
  .mobile-play-controls {
    display: flex;
  }

  .game-title {
    min-height: 2.45rem;
    gap: 0.38rem;
    padding: 0.28rem 0.48rem;
  }

  .game-topbar {
    grid-template-columns: auto 1fr auto;
  }

  .game-title-logo {
    width: 1.72rem;
    height: 1.16rem;
  }

  .game-title-text span {
    font-size: 0.5rem;
  }

  .game-title-text strong {
    font-size: 0.72rem;
  }

  .score-panel {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: center;
  }

  .customize-button {
    min-width: 2.75rem;
    padding: 0 0.58rem;
  }

  .customizer {
    top: 3.85rem;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    width: auto;
  }

  .game-controls {
    bottom: 4.55rem;
    grid-template-columns: 1fr;
  }

  .shot-buttons {
    width: 100%;
  }

  .shot-button,
  .serve-button {
    flex: 1 1 0;
  }
}

@media (max-width: 23rem) {
  .brand-line-main {
    font-size: 4rem;
  }

  .ball-slot {
    width: 3.78rem;
    height: 3.78rem;
  }

  .brand-line-sub {
    font-size: 1.22rem;
  }

  .game-controls {
    grid-template-columns: 1fr;
  }

  .serve-button {
    width: 100%;
  }
}

@media (min-width: 48rem) {
  .court-shell {
    width: 31rem;
  }

  .brand-line-main {
    font-size: 5.9rem;
  }

  .ball-slot {
    width: 5.55rem;
    height: 5.55rem;
  }

  .brand-line-sub {
    font-size: 1.8rem;
  }

  .game-controls {
    bottom: 4.25rem;
  }
}

.training-page {
  min-height: 100svh;
  overflow: hidden;
  background: #050806;
  display: grid;
  place-items: center;
}

.training-app {
  position: relative;
  width: min(100vw, 31rem);
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #050806;
  box-shadow: 0 0 0 1px rgba(246, 255, 249, 0.1), 0 0 4rem rgba(0, 0, 0, 0.58);
}

.training-photo,
.training-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.training-photo {
  object-fit: cover;
  object-position: center;
  filter: saturate(1.05) contrast(1.04) brightness(0.88);
  z-index: 0;
}

.training-app::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 18%, transparent 66%, rgba(0, 0, 0, 0.72)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.28), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.28));
}

.training-canvas {
  z-index: 2;
  touch-action: none;
  cursor: crosshair;
}

.training-topbar,
.training-hud,
.training-shotbar {
  position: absolute;
  left: max(1rem, env(safe-area-inset-left));
  right: max(1rem, env(safe-area-inset-right));
  z-index: 4;
}

.training-topbar {
  top: max(0.75rem, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.training-title {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0 0.8rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(246, 255, 249, 0.22);
  font-weight: 900;
  text-transform: uppercase;
}

.training-title img {
  width: 1.6rem;
  height: 1.6rem;
  object-fit: contain;
}

.training-match-link {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(246, 255, 249, 0.28);
  background: rgba(0, 0, 0, 0.56);
  color: var(--chalk);
  font-weight: 800;
  text-decoration: none;
}

.training-hud {
  top: calc(max(0.75rem, env(safe-area-inset-top)) + 3.45rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  pointer-events: none;
}

.training-hud p,
.training-hud strong {
  margin: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(246, 255, 249, 0.18);
  box-shadow: 0 0.8rem 1.8rem rgba(0, 0, 0, 0.28);
}

.training-hud p {
  max-width: min(23rem, 72vw);
  padding: 0.72rem 0.8rem;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  font-weight: 800;
}

.training-hud strong {
  min-width: 3.4rem;
  padding: 0.62rem 0.72rem;
  color: var(--ball);
  font-size: 1.25rem;
  text-align: center;
}

.training-shotbar {
  bottom: max(0.85rem, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.training-shot,
.training-reset {
  min-height: 2.85rem;
  border-radius: 8px;
  border: 1px solid rgba(246, 255, 249, 0.24);
  background: rgba(0, 0, 0, 0.62);
  color: var(--chalk);
  font: inherit;
  font-weight: 850;
  letter-spacing: 0;
  box-shadow: 0 0.8rem 1.65rem rgba(0, 0, 0, 0.22);
}

.training-shot.is-active {
  border-color: rgba(231, 247, 71, 0.86);
  background: rgba(231, 247, 71, 0.18);
  color: var(--ball);
}

.training-reset {
  background: var(--coral);
  color: var(--ink);
}

.training-shot:focus-visible,
.training-reset:focus-visible,
.training-match-link:focus-visible {
  outline: 3px solid var(--ball);
  outline-offset: 3px;
}

@media (min-width: 48rem) {
  .training-shotbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 34rem) {
  .training-title span {
    display: none;
  }

  .training-shotbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
