:root {
  --black: #0b0c10;
  --navy: #1f2833;
  --teal: #45a29e;
  --aqua: #66fcf1;
  --silver: #c5c6c7;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --mobile-header-offset: 88px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Orbitron", "Vazirmatn", sans-serif;
  color: var(--silver);
  background: linear-gradient(120deg, var(--black), var(--navy));
  --home-merch-opacity: 0.52;
  min-height: 100vh;
  line-height: 1.65;
  overflow-x: hidden;
}

body[dir="rtl"] {
  font-family: "Vazirmatn", "Orbitron", sans-serif;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 15% 20%, rgba(102, 252, 241, 0.24), transparent 42%),
    radial-gradient(circle at 85% 18%, rgba(69, 162, 158, 0.24), transparent 38%),
    linear-gradient(145deg, var(--black), var(--navy));
}

.home-merch-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: center top / cover no-repeat url("../images/MerchBG.png");
  opacity: var(--home-merch-opacity, 0.52);
  transition: opacity 0.18s linear;
  mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 100%);
}

body:not(.page-home) .home-merch-bg {
  display: none;
}

.bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(197, 198, 199, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(197, 198, 199, 0.03) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at center, black 22%, transparent 90%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  padding: 14px 5vw;
  backdrop-filter: blur(14px);
  background: rgba(11, 12, 16, 0.72);
  border-bottom: 1px solid rgba(102, 252, 241, 0.15);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--aqua);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 1px;
}

.brand img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(102, 252, 241, 0.2));
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-nav a {
  color: var(--silver);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--black);
  background: var(--aqua);
  border-color: var(--aqua);
  transform: translateY(-2px);
}

.lang-switch,
.menu-toggle {
  border: 1px solid rgba(102, 252, 241, 0.35);
  background: rgba(31, 40, 51, 0.6);
  color: var(--aqua);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.lang-switch::before,
.menu-toggle::before,
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, rgba(102, 252, 241, 0.2), rgba(69, 162, 158, 0.24));
  transform: translateX(-104%);
  transition: transform 0.3s ease;
}

.lang-switch:hover,
.menu-toggle:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(102, 252, 241, 0.7);
  box-shadow: 0 12px 24px rgba(102, 252, 241, 0.22);
}

.lang-switch:hover::before,
.menu-toggle:hover::before,
.btn:hover::before {
  transform: translateX(0);
}

.menu-toggle {
  display: none;
}

.game-nav {
  width: min(1140px, 92vw);
  margin: 14px auto 0;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(102, 252, 241, 0.16);
  background: rgba(11, 12, 16, 0.6);
  backdrop-filter: blur(10px);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 252, 241, 0.45) transparent;
}

.game-nav::-webkit-scrollbar {
  height: 8px;
}

.game-nav::-webkit-scrollbar-thumb {
  background: rgba(102, 252, 241, 0.38);
  border-radius: 99px;
}

.game-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--silver);
  border: 1px solid transparent;
  background: rgba(31, 40, 51, 0.72);
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.28s ease, color 0.28s ease, border-color 0.28s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.game-chip img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.game-chip:hover,
.game-chip:focus-visible,
.game-chip.active {
  color: #fff;
  border-color: rgba(102, 252, 241, 0.55);
  background: linear-gradient(120deg, rgba(102, 252, 241, 0.2), rgba(69, 162, 158, 0.26));
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 252, 241, 0.18);
}

main {
  width: min(1140px, 92vw);
  margin: 0 auto;
  padding: 44px 0 72px;
}

.hero,
.page-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: stretch;
}

.page-hero {
  grid-template-columns: 1fr;
  max-width: 760px;
}

.page-home .hero {
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
}

.hero-media {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(102, 252, 241, 0.28);
  background: linear-gradient(155deg, rgba(31, 40, 51, 0.78), rgba(11, 12, 16, 0.88));
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(102, 252, 241, 0.08) 42%,
    transparent 70%
  );
  transform: translateX(-120%);
  animation: mediaSweep 4.4s ease-in-out infinite;
  pointer-events: none;
}

.hero-media img {
  width: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.02);
}

.hero h1,
.page-hero h1 {
  font-size: clamp(1.8rem, 3.9vw, 3.5rem);
  line-height: 1.14;
  margin: 0;
  color: #fff;
}

.hero-copy p,
.page-hero p {
  max-width: 66ch;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--aqua);
  letter-spacing: 1px;
  font-weight: 700;
}

.hero-card,
.info-card,
.player-card,
.form-card {
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(31, 40, 51, 0.92), rgba(11, 12, 16, 0.9));
  border: 1px solid rgba(102, 252, 241, 0.2);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-card::after,
.info-card::after,
.player-card::after,
.form-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  top: -90px;
  right: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(102, 252, 241, 0.24), transparent 70%);
  opacity: 0;
  transition: opacity 0.32s ease;
  pointer-events: none;
}

.hero-card:hover::after,
.info-card:hover::after,
.player-card:hover::after,
.form-card:hover::after {
  opacity: 1;
}

.hero-card {
  padding: 22px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.stat-grid article {
  background: rgba(102, 252, 241, 0.08);
  border: 1px solid rgba(102, 252, 241, 0.12);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}

.stat-grid strong {
  display: block;
  color: var(--aqua);
  font-size: 1.1rem;
}

.section {
  margin-top: 54px;
}

.section h2 {
  color: #fff;
  margin-top: 0;
  margin-bottom: 16px;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.team-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-card,
.player-card {
  padding: 20px;
  transition: 0.28s ease;
}

.info-card:hover,
.player-card:hover {
  transform: translateY(-8px);
  border-color: var(--aqua);
}

.player-card .role {
  color: var(--aqua);
  margin-top: -4px;
}

.player-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(102, 252, 241, 0.3);
  margin-bottom: 12px;
}

.page-team .player-image {
  aspect-ratio: 2 / 3;
  object-fit: contain;
  object-position: center center;
  background: #000;
}

.team-games-nav {
  width: 100%;
  margin: 0 0 18px;
}

.player-card.is-hidden {
  display: none;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(102, 252, 241, 0.26);
  background: rgba(31, 40, 51, 0.7);
  color: var(--silver);
  text-decoration: none;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease, color 0.28s ease;
}

.social-btn:hover,
.social-btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(102, 252, 241, 0.62);
  color: #fff;
  box-shadow: 0 10px 22px rgba(102, 252, 241, 0.2);
}

.social-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.social-icon-fallback {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(102, 252, 241, 0.55);
  color: var(--aqua);
  font-size: 0.8rem;
  font-weight: 800;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn {
  border-radius: 12px;
  padding: 10px 16px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: 0.22s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn-primary {
  background: var(--aqua);
  color: var(--black);
  font-weight: 800;
}

.btn-primary:hover {
  transform: translateY(-3px);
  filter: brightness(1.08);
  box-shadow: 0 12px 30px rgba(102, 252, 241, 0.32);
}

.btn-ghost {
  border-color: rgba(102, 252, 241, 0.35);
  color: var(--silver);
}

.btn-ghost:hover {
  border-color: var(--aqua);
  color: var(--aqua);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(102, 252, 241, 0.24);
}

.form-card {
  padding: clamp(18px, 2.4vw, 28px);
  max-width: 780px;
  margin: 10px auto 0;
  display: grid;
  gap: 8px;
}

.form-card.compact {
  margin-top: 22px;
  max-width: 700px;
}

.form-card label {
  display: block;
  margin-top: 8px;
  margin-bottom: 2px;
  color: #fff;
  letter-spacing: 0.3px;
  font-size: 0.92rem;
  font-weight: 700;
}

.form-card input,
.form-card textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(102, 252, 241, 0.22);
  background: rgba(31, 40, 51, 0.74);
  color: var(--silver);
  font-size: 0.98rem;
  padding: 12px 14px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-card textarea {
  resize: vertical;
  min-height: 130px;
}

.form-card input:focus,
.form-card textarea:focus {
  border-color: var(--aqua);
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 252, 241, 0.16);
}

.form-card button {
  margin-top: 14px;
  justify-self: start;
  min-width: 180px;
}

@media (max-width: 768px) {
  .form-card {
    padding: 18px 14px;
    gap: 6px;
  }

  .form-card button {
    width: 100%;
    justify-self: stretch;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    padding: 24px 16px 22px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-bottom .footer-copy {
    text-align: left;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

.site-footer {
  width: min(1140px, 92vw);
  margin: 24px auto 30px;
  padding: 30px 24px 26px;
  border-radius: 16px;
  border: 1px solid rgba(102, 252, 241, 0.18);
  background: linear-gradient(155deg, rgba(31, 40, 51, 0.82), rgba(11, 12, 16, 0.9));
  color: rgba(197, 198, 199, 0.9);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}

.footer-block h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #fff;
  letter-spacing: 0.5px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.footer-links a {
  text-decoration: underline;
  color: var(--silver);
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(102, 252, 241, 0.35);
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: #fff;
  text-decoration-color: rgba(102, 252, 241, 0.85);
}

.footer-credit,
.footer-copy {
  margin: 14px 0 0;
  text-align: center;
}

.footer-credit {
  color: rgba(197, 198, 199, 0.98);
  font-weight: 600;
}

.heart-blue {
  color: #4ea8ff;
}

.footer-bottom {
  margin-top: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.footer-creator-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--silver);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.footer-creator-link:hover,
.footer-creator-link:focus-visible {
  color: #fff;
}

.footer-creator-link .social-icon {
  width: 18px;
  height: 18px;
}

.footer-bottom .footer-copy {
  margin: 0;
  text-align: right;
}

.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: grid;
  gap: 10px;
}

body[dir="rtl"] .toast-wrap {
  right: auto;
  left: 20px;
}

.toast {
  min-width: 260px;
  max-width: min(90vw, 360px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(102, 252, 241, 0.35);
  background: linear-gradient(155deg, rgba(31, 40, 51, 0.95), rgba(11, 12, 16, 0.95));
  box-shadow: var(--shadow);
  color: var(--silver);
  transform: translateY(12px);
  opacity: 0;
  transition: 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success .icon {
  color: var(--aqua);
}

.toast.error .icon {
  color: #ff8f8f;
}

.toast .icon {
  width: 20px;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
}

.toast .text {
  font-size: 0.93rem;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.site-shell {
  transition: opacity 0.7s ease, transform 0.7s ease, filter 0.7s ease;
}

body.site-pre-enter {
  overflow: hidden;
}

body.site-pre-enter .site-shell {
  opacity: 0;
  transform: translateY(26px) scale(0.985);
  filter: blur(8px);
  pointer-events: none;
}

body.site-entering .site-shell,
body.site-entered .site-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}

body.site-entering .site-header,
body.site-entered .site-header {
  transition-delay: 0.05s;
}

body.site-entering main,
body.site-entered main {
  transition-delay: 0.12s;
}

body.site-entering footer,
body.site-entered footer {
  transition-delay: 0.18s;
}

.enter-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 22%, rgba(102, 252, 241, 0.17), transparent 34%),
    radial-gradient(circle at 80% 80%, rgba(69, 162, 158, 0.16), transparent 36%),
    linear-gradient(130deg, rgba(11, 12, 16, 0.96), rgba(31, 40, 51, 0.97));
  animation: overlayPulse 4.5s ease-in-out infinite;
}

.enter-overlay.leave {
  animation: overlayLeave 0.95s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.enter-overlay__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(102, 252, 241, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 252, 241, 0.08) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(circle at center, black 24%, transparent 82%);
}

.enter-overlay__ring {
  position: absolute;
  width: min(72vw, 580px);
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(102, 252, 241, 0.26);
  border-radius: 50%;
  filter: drop-shadow(0 0 26px rgba(102, 252, 241, 0.3));
  animation: ringOrbit 5.4s linear infinite;
}

.enter-overlay__panel {
  border: 1px solid rgba(102, 252, 241, 0.48);
  border-radius: 16px;
  background: linear-gradient(140deg, rgba(11, 12, 16, 0.66), rgba(31, 40, 51, 0.62));
  color: #fff;
  min-width: min(84vw, 420px);
  padding: 26px 24px;
  display: grid;
  gap: 6px;
  justify-items: center;
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.35), 0 0 34px rgba(102, 252, 241, 0.16);
  transition: transform 0.25s ease;
  animation: ctaIdle 2.9s ease-in-out infinite;
}

.enter-overlay__hint {
  font-size: 0.82rem;
  letter-spacing: 2px;
  color: rgba(102, 252, 241, 0.9);
}

.enter-overlay__title {
  font-size: clamp(1.4rem, 4vw, 2.05rem);
  letter-spacing: 1px;
  font-weight: 800;
}

.floating {
  animation: bob 4s ease-in-out infinite;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes ctaIdle {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes overlayPulse {
  0%,
  100% {
    filter: saturate(1);
  }
  50% {
    filter: saturate(1.16);
  }
}

@keyframes ringOrbit {
  from {
    transform: rotate(0deg) scale(0.96);
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  to {
    transform: rotate(360deg) scale(1.04);
    opacity: 0.5;
  }
}

@keyframes overlayLeave {
  from {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
  to {
    opacity: 0;
    transform: scale(1.08);
    filter: blur(8px);
  }
}

@keyframes mediaSweep {
  0%,
  32%,
  100% {
    transform: translateX(-120%);
  }
  60% {
    transform: translateX(120%);
  }
}

@media (max-width: 920px) {
  .hero,
  .card-grid,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 5vw;
    right: 5vw;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    background: rgba(11, 12, 16, 0.97);
    border: 1px solid rgba(102, 252, 241, 0.18);
    padding: 12px;
    border-radius: 14px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: 0.24s ease;
  }

  .site-nav.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .game-nav {
    margin-top: 12px;
    padding: 7px;
  }

  .game-chip {
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  .game-chip img {
    width: 14px;
    height: 14px;
  }

  .page-team .team-games-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .page-team .team-games-nav .game-chip {
    min-width: 0;
    justify-content: center;
    text-align: center;
    white-space: normal;
  }

  .enter-overlay__panel {
    min-width: min(90vw, 420px);
    padding: 22px 16px;
  }

  .page-home .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .page-team .team-games-nav {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .page-home .home-merch-bg {
    top: calc(var(--mobile-header-offset) + env(safe-area-inset-top));
    right: 0;
    left: 0;
    bottom: auto;
    height: calc(100dvh - (var(--mobile-header-offset) + env(safe-area-inset-top)));
    min-height: calc(100svh - (var(--mobile-header-offset) + env(safe-area-inset-top)));
    background-position: center top;
    background-size: contain;
    mask-image: none;
    -webkit-mask-image: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
