:root {
  --bg: #ffffff;
  --ink: #0b1220;
  --muted: #5a6b85;
  --blue: #0b5fff;
  --blue-deep: #0639a8;
  --blue-soft: #9ec0ff;
  --squad-bg: #06140c;
  --squad-panel: rgba(6, 18, 12, 0.72);
  --squad-ink: #f2fff6;
  --squad-muted: #b7d0c0;
  --squad-line: rgba(180, 230, 190, 0.18);
  --font: "Outfit", system-ui, sans-serif;
  --display: "Syne", system-ui, sans-serif;
  --radius: 14px;
  --card-gk: linear-gradient(165deg, #f0c14b 0%, #b8860b 55%, #7a5208 100%);
  --card-def: linear-gradient(165deg, #3d7cff 0%, #0b5fff 50%, #0639a8 100%);
  --card-mid: linear-gradient(165deg, #2fd67a 0%, #0f9d58 55%, #06663a 100%);
  --card-att: linear-gradient(165deg, #ff6b4a 0%, #e11d48 55%, #9f1239 100%);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  color: var(--ink);
  background: #05080f;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* ========== FULL-PAGE SLIDER ========== */
.pages {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #05080f;
}

.pages__track {
  height: 100%;
  width: 100%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  transition: transform 780ms cubic-bezier(0.65, 0.05, 0.2, 1);
}

.page {
  height: 100%;
  height: 100dvh;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.page-dots {
  position: fixed;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: grid;
  gap: 0.55rem;
  pointer-events: auto;
}

.page-dots__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.page-dots__dot.is-active {
  background: #fff;
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(11, 95, 255, 0.35);
}

/* ========== HERO ========== */
.hero {
  display: grid;
  place-items: end start;
  color: #fff;
  background: #05080f;
}

.hero__media,
.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__media img {
  object-fit: cover;
  object-position: 50% 40%;
}

.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 20, 48, 0.18) 0%, rgba(6, 20, 48, 0.12) 38%, rgba(6, 20, 48, 0.78) 100%),
    linear-gradient(90deg, rgba(6, 20, 48, 0.48) 0%, transparent 58%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  padding-bottom: clamp(4.5rem, 10vw, 6rem);
  max-width: 40rem;
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand {
  margin: 0 0 0.55rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 5.5vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
  text-transform: uppercase;
}

.brand span {
  color: var(--blue-soft);
  margin-left: 0.08em;
}

.hero__title {
  margin: 0 0 1.35rem;
  font-family: var(--font);
  font-weight: 600;
  font-size: clamp(1.35rem, 3.4vw, 1.85rem);
  letter-spacing: -0.025em;
  line-height: 1.2;
  max-width: 18ch;
  color: rgba(255, 255, 255, 0.94);
  text-wrap: balance;
}

.cta {
  appearance: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.85rem 1.35rem 0.8rem;
  background: #fff;
  color: var(--blue-deep);
  font-family: inherit;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.cta:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.015);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.4);
}

.cta:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.cta:disabled { opacity: 0.78; cursor: wait; }

.cta__label {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.cta__hint {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.62;
}

.hero__note {
  margin: 0.85rem 0 0;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 26rem;
  line-height: 1.35;
}

.hero__scroll {
  appearance: none;
  border: none;
  background: transparent;
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  padding: 0.6rem 1rem;
  font: inherit;
}

.hero__scroll:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
  border-radius: 8px;
}

.hero__scroll span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__scroll i {
  width: 1.5px;
  height: 28px;
  background: linear-gradient(180deg, #fff, transparent);
  animation: scrollPulse 1.4s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.25; transform: scaleY(0.7); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__content { animation: none; }
  .hero__scroll i { animation: none; }
}

/* ========== SQUAD ========== */
.squad {
  background: #070b10;
  color: var(--squad-ink);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.squad__inner {
  min-height: 100%;
  padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1rem, 3vw, 2rem) 2.5rem;
}

.squad__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  max-width: 1280px;
  margin: 0 auto 1.1rem;
}

.squad__eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.squad__head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.03em;
  color: #fff;
}

.squad__meta {
  display: grid;
  gap: 0.35rem;
  justify-items: end;
  text-align: right;
}

.mode-toggle {
  display: grid;
  gap: 0.2rem;
}

.mode-btn,
.form-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.mode-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  color: rgba(255, 255, 255, 0.48);
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.84rem;
  letter-spacing: -0.01em;
}

.mode-btn:hover {
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.04);
}

.mode-btn.is-active {
  color: #fff;
  background: rgba(11, 95, 255, 0.12);
  border-color: rgba(11, 95, 255, 0.55);
  box-shadow: inset 3px 0 0 #0b5fff;
}

.mode-btn:focus-visible,
.form-btn:focus-visible {
  outline: 2px solid rgba(11, 95, 255, 0.8);
  outline-offset: 2px;
}

.form-choices {
  display: grid;
  gap: 0.28rem;
}

.form-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.form-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.03);
}

.form-btn.is-active {
  color: #fff;
  background: #0b5fff;
  border-color: #0b5fff;
}

.chem-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem 0.85rem;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.chem-legend__item::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.3rem;
  vertical-align: 0;
}

.chem-legend__item--good::before { background: #22c55e; }
.chem-legend__item--mid::before { background: #eab308; }
.chem-legend__item--bad::before { background: #ef4444; }

.chem-legend__fit {
  opacity: 0.9;
  letter-spacing: 0.02em;
  text-transform: none;
  font-weight: 500;
}

.chem-avg {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.02em;
}

.chem-avg[data-tone="good"] { color: #86efac; }
.chem-avg[data-tone="mid"] { color: #fde68a; }
.chem-avg[data-tone="bad"] { color: #fca5a5; }

.squad__layout {
  display: grid;
  grid-template-columns: minmax(168px, 210px) minmax(0, 1fr) auto;
  gap: clamp(0.65rem, 1.6vw, 1.25rem);
  max-width: 1280px;
  margin: 0 auto;
  align-items: start;
}

.side-rail {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: clamp(76px, 12vw, 108px);
}

.bench-rail {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.tactics-rail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.tactics-panel {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.tactics-panel > .rail__label {
  margin-top: 0.35rem;
  text-align: left;
}

.tactics-panel > .rail__label:first-child {
  margin-top: 0;
}

.coach-rail {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.rail__label {
  margin: 0;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
}

.bench {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow: visible;
  padding: 0;
  max-height: none;
}

.bench .card,
.coach-rail .card--coach {
  width: 100%;
  flex: 0 0 auto;
}

.coach-rail .card--coach {
  text-align: center;
  padding: 0.42rem 0.38rem 0.48rem;
}

.coach-rail .card--coach .card__avatar {
  aspect-ratio: 1;
}

.coach-rail .card--coach .card__name {
  font-size: 0.68rem;
}

.pitch2d {
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) + 6px);
  padding: 0;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.pitch2d__field {
  position: relative;
  min-height: clamp(520px, 74vh, 720px);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  border: 1px solid rgba(220, 255, 230, 0.18);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.pitch2d__grass {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.pitch2d__links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  overflow: visible;
}

.chem line {
  stroke-width: 2.25;
  stroke-linecap: round;
  opacity: 0.85;
}

.chem--good line { stroke: #22c55e; }
.chem--mid line { stroke: #eab308; }
.chem--bad line { stroke: #ef4444; }

.chem__dot {
  fill: rgba(8, 12, 18, 0.92);
  stroke-width: 2;
}

.chem--good .chem__dot { stroke: #22c55e; }
.chem--mid .chem__dot { stroke: #eab308; }
.chem--bad .chem__dot { stroke: #ef4444; }

.chem__score {
  fill: #fff;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font);
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.65);
  stroke-width: 2px;
}

.pitch2d__grid {
  position: relative;
  z-index: 3;
  height: 100%;
  min-height: inherit;
  display: grid;
  grid-auto-rows: 1fr;
  padding: 4% 2.5% 3.5%;
  gap: 0.55rem;
}

.pitch2d__grid .card {
  position: relative;
  z-index: 1;
}

.row {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: 0.35rem;
}

/* Cards */
.card {
  width: clamp(76px, 12vw, 108px);
  background: var(--card-mid);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 0.42rem 0.38rem 0.48rem;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  color: #fff;
}

.card--gk { background: var(--card-gk); color: #1a1200; }
.card--def { background: var(--card-def); }
.card--mid { background: var(--card-mid); }
.card--att { background: var(--card-att); }

.card--gk .card__name,
.card--gk .card__fav,
.card--gk .card__pos { color: #1a1200; }

.card--gk .card__ovr {
  background: #1a1200;
  color: #f7d774;
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  gap: 0.15rem;
}

.card__pos {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.92);
}

.card__fit {
  font-size: 0.62rem;
  line-height: 1;
  margin-left: auto;
  margin-right: 0.15rem;
}

.card__fit.fit--ideal { color: #86efac; text-shadow: 0 0 6px rgba(34, 197, 94, 0.8); }
.card__fit.fit--ok { color: #fde047; text-shadow: 0 0 6px rgba(234, 179, 8, 0.7); }
.card__fit.fit--bad { color: #fca5a5; text-shadow: 0 0 6px rgba(239, 68, 68, 0.7); }

.card--gk .card__fit.fit--ideal { color: #166534; text-shadow: none; }
.card--gk .card__fit.fit--ok { color: #854d0e; text-shadow: none; }
.card--gk .card__fit.fit--bad { color: #991b1b; text-shadow: none; }

.card__ovr {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0b1220;
  background: #fff;
  border-radius: 6px;
  min-width: 1.7rem;
  padding: 0.1rem 0.28rem;
  line-height: 1.25;
}

.card__avatar {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #0c0e12;
  margin-bottom: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.card__flag {
  position: absolute;
  left: 4px;
  bottom: 4px;
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.card__name {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.card__fav {
  margin: 0.2rem 0 0;
  font-size: 0.58rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.02em;
}

.card--coach {
  background: #0b5fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
}

.card--coach .card__pos,
.card--coach .card__name,
.card--coach .card__fav { color: #fff; }

.card--coach .card__ovr {
  background: #fff;
  color: var(--blue-deep);
}

.card--coach .card__avatar {
  background: rgba(0, 0, 0, 0.25);
}

@media (max-width: 1100px) {
  .squad__layout {
    grid-template-columns: minmax(150px, 180px) minmax(0, 1fr) auto;
  }
}

@media (max-width: 820px) {
  .squad__layout {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .tactics-rail { order: 1; }
  .pitch2d { order: 2; width: 100%; }
  .side-rail {
    order: 3;
    width: 100%;
    flex-direction: row;
    align-items: flex-start;
    overflow-x: auto;
  }
  .bench {
    flex-direction: row;
  }
  .bench .card,
  .coach-rail .card--coach {
    width: clamp(72px, 16vw, 100px);
  }
  .pitch2d__field, .pitch2d__grid { min-height: 460px; }
  .card { width: clamp(64px, 18vw, 88px); }
  .squad__meta { justify-items: start; text-align: left; }
  .chem-legend { justify-content: flex-start; }
}

@media (max-width: 420px) {
  .cta { width: auto; }
  .card { width: 58px; border-radius: 10px; }
  .card__fav { display: none; }
  .card__ovr { font-size: 0.66rem; min-width: 1.4rem; }
}
