/* Teams page (Apex roster) */

body.page-teams {
  --tm-text: #101a2e;
  --tm-muted: #69798f;
  --tm-muted-2: #52637a;
  --tm-line: rgba(16, 26, 46, 0.08);
  --tm-line-strong: rgba(16, 26, 46, 0.12);
  background:
    radial-gradient(circle at 7% 9%, rgba(27, 177, 242, 0.18), transparent 39%),
    radial-gradient(circle at 93% 13%, rgba(255, 7, 108, 0.15), transparent 43%),
    radial-gradient(circle at 74% 76%, rgba(27, 177, 242, 0.08), transparent 46%),
    radial-gradient(circle at 22% 78%, rgba(255, 7, 108, 0.055), transparent 44%),
    linear-gradient(180deg, #f8fbff 0%, #f4f8ff 46%, #eef4fb 100%);
  color: var(--tm-text);
}

body.page-team-detail {
  background: linear-gradient(145deg, var(--team-accent) 0%, var(--team-accent-2) 100%);
  color: var(--team-text);
}

body.page-team-detail::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.22), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.16), transparent 50%);
  mix-blend-mode: screen;
}

.page-team-detail .site-header {
  background: var(--team-accent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(18px);
}

.page-team-detail .site-header::after {
  background: none;
}

.page-team-detail .brand,
.page-team-detail .nav-link,
.page-team-detail .nav-link.is-active {
  color: var(--team-text);
}

.page-team-detail .nav-link::before {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.85), transparent);
}

.page-team-detail .nav-link:hover {
  color: var(--team-text);
}

.page-team-detail .nav-lang-toggle {
  color: var(--team-text);
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.18);
}

.page-team-detail .nav-lang-menu {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(255, 255, 255, 0.18);
}

.page-team-detail .nav-lang-option {
  color: var(--team-text);
}

.page-team-detail .nav-lang-option:hover,
.page-team-detail .nav-lang-option.is-active {
  background: rgba(255, 255, 255, 0.18);
  color: var(--team-text);
}

.page-team-detail .main-content {
  padding-top: 2.2rem;
  padding-bottom: 3.4rem;
}

.page-team-detail .site-footer {
  background: var(--team-accent-2);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(18px);
}

.page-team-detail .footer-kicker,
.page-team-detail .footer-col-title {
  color: var(--team-text);
}

.page-team-detail .footer-note,
.page-team-detail .footer-copy {
  color: var(--team-text-muted);
}

.page-team-detail .footer-list a {
  color: var(--team-text-muted);
}

.page-team-detail .footer-list a:hover {
  color: var(--team-text);
  border-bottom-color: rgba(255, 255, 255, 0.7);
}

body.page-teams::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(16, 26, 46, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 26, 46, 0.02) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.55;
}

.page-teams .site-header {
  background:
    linear-gradient(180deg, rgba(249, 252, 255, 0.93), rgba(249, 252, 255, 0.78)),
    radial-gradient(circle at 10% 0%, rgba(27, 177, 242, 0.08), transparent 42%),
    radial-gradient(circle at 90% 0%, rgba(255, 7, 108, 0.07), transparent 40%);
  border-bottom: 1px solid rgba(16, 26, 46, 0.05);
  box-shadow:
    0 10px 28px rgba(16, 26, 46, 0.035),
    0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

.page-teams .site-header::after {
  background: linear-gradient(
    90deg,
    rgba(27, 177, 242, 0.22),
    rgba(255, 7, 108, 0.18),
    rgba(16, 26, 46, 0)
  );
}

.page-teams .brand {
  color: var(--tm-text);
}

.page-teams .brand-mark {
  filter:
    drop-shadow(0 0 14px rgba(27, 177, 242, 0.16))
    drop-shadow(0 6px 14px rgba(255, 7, 108, 0.1));
}

.page-teams .nav-link {
  color: #5b6d84;
}

.page-teams .nav-link::before {
  background: linear-gradient(90deg, rgba(27, 177, 242, 0.95), rgba(255, 7, 108, 0.78));
}

.page-teams .nav-link:hover {
  color: #15253b;
}

.page-teams .nav-link.is-active {
  color: #0f1c30;
}

.page-teams .site-footer {
  position: relative;
  z-index: 3;
  border-top: 1px solid rgba(16, 26, 46, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.54)),
    radial-gradient(circle at 8% 16%, rgba(27, 177, 242, 0.08), transparent 45%),
    radial-gradient(circle at 92% 15%, rgba(255, 7, 108, 0.07), transparent 44%);
  backdrop-filter: blur(10px);
}

.page-teams .footer-kicker {
  color: #16263a;
}

.page-teams .footer-note,
.page-teams .footer-copy,
.page-teams .footer-col-title {
  color: #63758c;
}

.page-teams .footer-list a {
  color: #31465d;
}

.page-teams .footer-list a:hover {
  color: #14253a;
  border-bottom-color: rgba(27, 177, 242, 0.26);
}

.page-teams .main-content {
  position: relative;
  z-index: 1;
  padding-top: 1.35rem;
  padding-bottom: 2.9rem;
}

.tm-deity-stage {
  --tm-deity-top: 4.95rem;
  position: fixed;
  inset: var(--tm-deity-top) 0 0;
  z-index: 0;
  pointer-events: none;
}

.tm-deity {
  position: absolute;
  bottom: 0;
  height: calc(100svh - var(--tm-deity-top) - 1px);
  width: auto;
  opacity: 0.75;
  filter:
    drop-shadow(0 12px 18px rgba(16, 26, 46, 0.05))
    drop-shadow(0 0 20px rgba(255, 255, 255, 0.55));
}

.tm-deity-left {
  left: clamp(-12rem, -8vw, -6.5rem);
  filter:
    drop-shadow(0 14px 18px rgba(16, 26, 46, 0.05))
    drop-shadow(0 0 26px rgba(27, 177, 242, 0.15))
    drop-shadow(0 0 16px rgba(255, 255, 255, 0.45));
}

.tm-deity-right {
  right: clamp(-12rem, -8vw, -6.5rem);
  filter:
    drop-shadow(0 14px 18px rgba(16, 26, 46, 0.05))
    drop-shadow(0 0 26px rgba(255, 7, 108, 0.14))
    drop-shadow(0 0 16px rgba(255, 255, 255, 0.45));
}

.tm-hero,
.tm-roster {
  position: relative;
  z-index: 2;
}

.tm-shell {
  max-width: min(100%, 1100px);
  margin-inline: auto;
}

.tm-hero {
  margin-top: 0.2rem;
}

.tm-hero-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 1.35rem 1.7rem;
  align-items: end;
  padding: 0.9rem 0 0.65rem;
  border-top: 1px solid rgba(16, 26, 46, 0.06);
}

.tm-hero-shell::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: min(100%, 520px);
  height: 1px;
  background: linear-gradient(90deg, rgba(27, 177, 242, 0.52), rgba(255, 7, 108, 0.38), transparent);
  pointer-events: none;
}

.tm-hero-copy .eyebrow {
  color: #6d7f96;
}

.tm-hero-copy h1 {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.05rem, 4vw, 3.25rem);
  line-height: 0.96;
  letter-spacing: -0.032em;
  color: #101a2e;
  max-width: 14ch;
}

.tm-hero-copy h1 .hl-lead-a {
  color: #1bb1f2;
}

.tm-hero-copy h1 .hl-lead-b {
  color: #ff076c;
}

.tm-hero-note {
  margin: 0.9rem 0 0;
  color: var(--tm-muted);
  font-size: 0.99rem;
  line-height: 1.55;
  max-width: 47ch;
}

.tm-hero-meta {
  align-self: end;
  display: grid;
  gap: 0.38rem;
  padding: 0.25rem 0 0.05rem 1.15rem;
  border-left: 1px solid rgba(16, 26, 46, 0.08);
}

.tm-meta-row {
  display: grid;
  grid-template-columns: minmax(5.75rem, auto) 1fr;
  align-items: baseline;
  gap: 0.8rem;
  padding: 0.42rem 0;
  border-bottom: 1px dashed rgba(16, 26, 46, 0.08);
}

.tm-meta-row:last-child {
  border-bottom: 0;
}

.tm-meta-k {
  color: #73859b;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
}

.tm-meta-v {
  color: #1b2c43;
  font-size: 0.91rem;
  font-weight: 600;
}

.tm-meta-row:nth-child(1) .tm-meta-v {
  color: #1b2c43;
}

.tm-meta-row:nth-child(2) .tm-meta-v {
  color: #0d7ca0;
}

.tm-meta-row:nth-child(3) .tm-meta-v {
  color: #b33667;
}

.tm-roster {
  margin-top: 1.3rem;
}

.tm-roster-shell {
  padding-top: 0.55rem;
}

.tm-roster-head .eyebrow {
  color: #74869d;
}

.tm-roster-head h2 {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.05;
  letter-spacing: -0.022em;
  color: #0f1b30;
  max-width: 22ch;
}

.tm-roster-head h2 .hl-lead-a {
  color: #1bb1f2;
}

.tm-roster-head h2 .hl-lead-b {
  color: #ff076c;
}

.tm-roster-list {
  margin-top: 1.2rem;
  border-top: 1px solid rgba(16, 26, 46, 0.08);
}

.tm-roster-list::before {
  content: "";
  display: block;
  width: min(100%, 320px);
  height: 1px;
  background: linear-gradient(90deg, rgba(27, 177, 242, 0.45), rgba(255, 7, 108, 0.34), transparent);
  transform: translateY(-1px);
}

.tm-member {
  position: relative;
  display: grid;
  grid-template-columns: minmax(122px, 152px) minmax(0, 1fr);
  gap: clamp(0.9rem, 2vw, 1.4rem);
  align-items: center;
  padding: 1.05rem 0.35rem 1.05rem 0.2rem;
  border-bottom: 1px solid rgba(16, 26, 46, 0.08);
  transition:
    background-color 220ms ease,
    transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tm-member::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(27, 177, 242, 0.55), rgba(255, 7, 108, 0.42));
  transition: width 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tm-member:hover {
  transform: translate3d(0, -1px, 0);
  background:
    linear-gradient(
      90deg,
      rgba(27, 177, 242, 0.025),
      rgba(255, 7, 108, 0.018) 56%,
      rgba(255, 255, 255, 0)
    );
}

.tm-member:hover::before {
  width: min(100%, 420px);
}

.tm-member--open {
  text-decoration: none;
  color: inherit;
  border-bottom: 1px dashed rgba(16, 26, 46, 0.14);
}

.tm-open-icon {
  width: clamp(118px, 12vw, 148px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px dashed rgba(27, 177, 242, 0.32);
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  font-weight: 600;
  color: #1bb1f2;
  background: radial-gradient(circle at 30% 25%, rgba(27, 177, 242, 0.12), transparent 60%);
  transition: border-color 200ms ease, color 200ms ease, background-color 200ms ease;
}

.tm-open-copy {
  padding-right: 0.5rem;
}

.tm-open-kicker {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #5a6d84;
  font-weight: 700;
}

.tm-open-text {
  margin: 0.45rem 0 0;
  color: var(--tm-muted-2);
  max-width: 46ch;
}

.tm-open-cta {
  display: inline-flex;
  margin-top: 0.6rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: #1a2f4a;
  gap: 0.35rem;
  align-items: center;
}

.tm-open-cta::after {
  content: "→";
  font-size: 0.9em;
}

.tm-member--open:hover {
  background:
    linear-gradient(
      90deg,
      rgba(27, 177, 242, 0.03),
      rgba(255, 7, 108, 0.02) 56%,
      rgba(255, 255, 255, 0)
    );
}

.tm-member--open:hover .tm-open-icon {
  border-color: rgba(27, 177, 242, 0.6);
  color: #0f67c5;
}

.tm-member--flip {
  grid-template-columns: minmax(0, 1fr) minmax(122px, 152px);
}

.tm-member--flip .tm-member-media {
  order: 2;
  justify-self: end;
}

.tm-member--flip .tm-member-copy {
  order: 1;
  text-align: right;
}

.tm-member--flip .tm-member-roleline {
  justify-content: flex-end;
}

.tm-avatar-wrap {
  position: relative;
  width: clamp(118px, 12vw, 148px);
  height: clamp(118px, 12vw, 148px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.tm-avatar-wrap::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background:
    conic-gradient(
      from 150deg,
      rgba(27, 177, 242, 0.18),
      rgba(255, 7, 108, 0.12),
      rgba(27, 177, 242, 0.16),
      rgba(255, 255, 255, 0.1),
      rgba(27, 177, 242, 0.18)
    );
  opacity: 0.75;
  filter: blur(2px);
  z-index: 0;
}

.tm-avatar-wrap::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 22%, rgba(27, 177, 242, 0.14), transparent 65%),
    radial-gradient(circle at 75% 80%, rgba(255, 7, 108, 0.11), transparent 72%),
    rgba(255, 255, 255, 0.66);
  box-shadow:
    0 10px 18px rgba(16, 26, 46, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.tm-avatar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
  filter: saturate(1.02) contrast(1.02);
  box-shadow:
    0 12px 22px rgba(16, 26, 46, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.tm-member-copy {
  min-width: 0;
}

.tm-member-index {
  margin: 0;
  color: #7c8ea4;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tm-member:nth-child(odd) .tm-member-index {
  color: rgba(27, 177, 242, 0.8);
}

.tm-member:nth-child(even) .tm-member-index {
  color: rgba(255, 7, 108, 0.74);
}

.tm-member-tag {
  margin: 0.22rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: #0f1b30;
}

.tm-member:hover .tm-member-tag {
  color: #101f36;
  text-shadow:
    0 0 0 rgba(0, 0, 0, 0),
    14px 0 26px rgba(27, 177, 242, 0.05),
    -14px 0 26px rgba(255, 7, 108, 0.045);
}

.tm-member-name {
  margin: 0.28rem 0 0;
  color: #61748d;
  font-size: 0.86rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.tm-member-roleline {
  margin: 0.55rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.tm-member-role {
  color: #20334d;
  font-weight: 700;
  font-size: 0.95rem;
}

.tm-member--core .tm-member-role {
  color: #183755;
}

.tm-member--staff .tm-member-role {
  color: #27405f;
}

.tm-member--roster .tm-member-role {
  color: #253b56;
}

.tm-member-sep {
  width: 1.55rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(27, 177, 242, 0.55), rgba(255, 7, 108, 0.45));
  opacity: 0.7;
}

.tm-member-roletag {
  color: #6b7f98;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tm-member-roletag--core {
  color: #099aa6;
}

.tm-member-roletag--staff {
  color: #7a66c7;
}

.tm-member-roletag--roster {
  color: #d0497f;
}

.tm-member-text {
  margin: 0.55rem 0 0;
  max-width: 62ch;
  color: var(--tm-muted-2);
  line-height: 1.55;
  font-size: 0.95rem;
}

.tm-member--core .tm-member-text strong,
.tm-member--staff .tm-member-text strong,
.tm-member--roster .tm-member-text strong {
  color: #0f1b30;
}

.tm-member--flip .tm-member-text {
  margin-left: auto;
}

.tm-partner {
  position: relative;
  z-index: 2;
}

.tm-partner-card {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.2rem);
  align-items: center;
  padding: clamp(1.4rem, 3vw, 2.4rem);
  border-radius: 1.6rem;
  border: 1px solid rgba(16, 26, 46, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.6)),
    radial-gradient(circle at 12% 20%, rgba(27, 177, 242, 0.08), transparent 50%),
    radial-gradient(circle at 86% 10%, rgba(255, 7, 108, 0.07), transparent 48%);
  box-shadow: 0 18px 40px rgba(16, 26, 46, 0.08);
}

.tm-partner-logo img {
  width: clamp(110px, 18vw, 170px);
  height: auto;
  display: block;
}

.tm-partner-copy p {
  margin: 0.6rem 0 0;
  color: var(--tm-muted);
  max-width: 52ch;
}

@media (max-width: 1380px) {
  .tm-deity-left {
    left: clamp(-7.5rem, -5vw, -3.75rem);
  }

  .tm-deity-right {
    right: clamp(-7.5rem, -5vw, -3.75rem);
  }

  .tm-deity {
    opacity: 0.68;
  }
}

@media (max-width: 1180px) {
  .tm-deity-stage {
    display: none;
  }

  .tm-shell {
    max-width: 100%;
  }

  .tm-hero-shell {
    grid-template-columns: 1fr;
    gap: 0.95rem;
  }

  .tm-hero-meta {
    padding: 0.2rem 0 0;
    border-left: 0;
    border-top: 1px solid rgba(16, 26, 46, 0.07);
  }
}

@media (max-width: 860px) {
  .page-teams .main-content {
    padding-top: 1rem;
    padding-bottom: 2.3rem;
  }

  .tm-hero-shell {
    padding-top: 0.65rem;
  }

  .tm-hero-copy h1 {
    max-width: 16ch;
  }

  .tm-roster {
    margin-top: 1rem;
  }

  .tm-roster-list {
    margin-top: 0.95rem;
  }

  .tm-partner-card {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .tm-member,
  .tm-member--flip {
    grid-template-columns: minmax(94px, 116px) minmax(0, 1fr);
    gap: 0.9rem;
    padding: 0.9rem 0.05rem;
  }

  .tm-member--flip .tm-member-media,
  .tm-member--flip .tm-member-copy {
    order: initial;
    justify-self: initial;
    text-align: left;
  }

  .tm-member--flip .tm-member-roleline {
    justify-content: flex-start;
  }

  .tm-avatar-wrap {
    width: clamp(90px, 22vw, 112px);
    height: clamp(90px, 22vw, 112px);
  }

  .tm-open-icon {
    width: clamp(90px, 22vw, 112px);
    height: clamp(90px, 22vw, 112px);
  }

  .tm-member-tag {
    font-size: clamp(1.2rem, 5vw, 1.6rem);
  }

  .tm-member-name {
    font-size: 0.76rem;
    letter-spacing: 0.1em;
  }

  .tm-member-role {
    font-size: 0.88rem;
  }

  .tm-member-sep {
    width: 1.05rem;
  }

  .tm-member-text {
    font-size: 0.9rem;
    line-height: 1.45;
  }
}

@media (max-width: 560px) {
  .tm-hero-copy h1 {
    font-size: clamp(1.65rem, 9vw, 2.25rem);
    line-height: 0.98;
    letter-spacing: -0.028em;
  }

  .tm-hero-note {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .tm-meta-row {
    grid-template-columns: 4.7rem 1fr;
    gap: 0.55rem;
  }

  .tm-meta-v {
    font-size: 0.86rem;
  }

  .tm-roster-head h2 {
    font-size: clamp(1.18rem, 6.8vw, 1.45rem);
    line-height: 1.05;
  }

  .tm-member,
  .tm-member--flip {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.9rem 0;
  }

  .tm-member-media {
    justify-self: start;
  }

  .tm-avatar-wrap {
    width: 84px;
    height: 84px;
  }

  .tm-open-icon {
    width: 84px;
    height: 84px;
  }

  .tm-member-roleline {
    gap: 0.45rem;
  }

  .tm-member-roletag {
    letter-spacing: 0.12em;
  }

  .tm-partner-card {
    grid-template-columns: 1fr;
    padding: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tm-member {
    transition: none;
    transform: none !important;
  }

  .tm-member::before {
    transition: none;
  }
}

/* --- New Team Directory + Detail --- */

.team-directory {
  position: relative;
  z-index: 2;
  padding: 2.5rem 0 3.5rem;
}

.team-directory-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}

.team-directory-head {
  text-align: center;
  max-width: 720px;
}

.team-directory-head h1 {
  margin: 0.3rem 0 0.6rem;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-family: var(--font-display);
}

.team-directory-search {
  width: min(520px, 100%);
}

.team-directory-search input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(16, 26, 46, 0.12);
  background: #fff;
  font: inherit;
  box-shadow: 0 12px 30px rgba(16, 26, 46, 0.08);
}

.team-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.team-card {
  text-decoration: none;
  color: var(--tm-text);
  background: #fff;
  border-radius: 1.2rem;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(16, 26, 46, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px rgba(16, 26, 46, 0.16);
}

.team-card-banner {
  height: 140px;
  background-image: var(--team-banner);
  background-size: cover;
  background-position: center;
  border-radius: 1.2rem 1.2rem 0 0;
}

.team-card-banner--empty {
  background: linear-gradient(135deg, var(--team-color-a, #d7dde6), var(--team-color-b, #eef1f6));
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-card-edit {
  width: 28px;
  height: 28px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.team-card-banner--empty:hover .team-card-edit,
.team-card-logo-wrap--empty:hover .team-card-edit,
.team-hero--empty .team-hero-banner:hover .team-card-edit,
.team-hero-logo--empty:hover img {
  opacity: 0.7;
}

.team-card-body {
  position: static;
  padding: 1.4rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.team-card-header {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin-top: -3.6rem;
  min-height: auto;
  padding-left: 0;
}

.team-card-name {
  margin-top: 1.6rem;
}

.team-card-logo-wrap {
  width: 74px;
  height: 74px;
  border-radius: 18px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 18px rgba(16, 26, 46, 0.15);
  flex-shrink: 0;
  position: static;
  top: auto;
  left: auto;
  margin-top: -0.4rem;
}

.team-card-logo-wrap--empty {
  background: var(--team-logo-color, #d7dde6);
  position: static;
  top: auto;
  left: auto;
  margin-top: -0.4rem;
}

.team-card-logo {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: contain;
  background: #fff;
  padding: 4px;
}

.team-card-header h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.2;
}

.team-card-badge {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(27, 177, 242, 0.12);
  color: #0b1c2b;
  font-size: 0.72rem;
  font-weight: 600;
}

.team-card-meta {
  margin: 0.6rem 0 0.4rem;
  color: var(--tm-muted);
  font-size: 0.9rem;
}

.team-card-desc {
  margin: 0.5rem 0 0;
  color: var(--tm-muted-2);
  font-size: 0.92rem;
}

.team-empty {
  text-align: center;
  padding: 2rem;
  color: var(--tm-muted);
}

.team-hero {
  position: relative;
  margin-top: 0;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

.team-detail {
  --team-accent: #1bb1f2;
  --team-accent-2: #ff076c;
  padding: 2rem 0 3.5rem;
}

.team-hero-banner {
  height: 320px;
  background-image: var(--team-banner);
  background-size: cover;
  background-position: center;
  border-radius: 1.8rem;
  background-color: #e2e6ee;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.team-hero-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.28) 40%, transparent 75%);
  pointer-events: none;
  z-index: 1;
}

.team-detail .team-hero--empty .team-hero-banner {
  background-image: linear-gradient(135deg, var(--team-accent), var(--team-accent-2));
}

.team-hero--empty .team-hero-banner::after {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.18) 0%, transparent 60%);
}

.team-hero--empty .team-hero-banner img {
  width: 36px;
  height: 36px;
  opacity: 0.45;
  position: relative;
  z-index: 2;
}

.team-hero-content {
  display: flex;
  align-items: flex-end;
  gap: 1.6rem;
  padding: 0 0.5rem;
  margin-top: -72px;
  position: relative;
  z-index: 2;
  color: var(--team-text);
}

.team-hero-body {
  padding-bottom: 0.2rem;
}

.team-hero-title h1,
.team-hero-desc,
.team-hero-meta {
  text-shadow:
    0 1px 12px rgba(0, 0, 0, 0.45),
    0 2px 28px rgba(0, 0, 0, 0.25);
}

.team-hero-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.team-hero-title h1 {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0;
}

.team-edit-btn {
  border: 0;
  background: rgba(var(--team-accent-rgb), 0.12);
  color: var(--team-accent);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 180ms ease, transform 180ms ease;
  flex-shrink: 0;
}

.team-edit-btn:hover {
  background: rgba(var(--team-accent-rgb), 0.2);
  transform: scale(1.04);
}

.team-setup-note {
  margin: 0.6rem 0 0;
  color: #64748b;
  font-size: 0.9rem;
}

.team-hero-logo {
  width: 140px;
  height: 140px;
  border-radius: 30px;
  background: #fff;
  object-fit: contain;
  padding: 12px;
  position: relative;
  z-index: 3;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.92),
    0 24px 56px rgba(16, 26, 46, 0.24),
    0 8px 18px rgba(16, 26, 46, 0.1);
}

.team-hero-logo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8ecf2;
}

.team-hero-logo--empty img {
  width: 30px;
  height: 30px;
  opacity: 0.5;
}

.team-hero-desc {
  margin: 1.75rem 0 0;
  max-width: 520px;
  color: var(--team-text-muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.team-hero-meta {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  margin-top: 0.7rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--team-text-soft, var(--team-text-muted));
}

.team-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.team-hero-meta a {
  color: var(--team-accent);
  text-decoration: none;
  font-weight: 700;
  transition: opacity 180ms ease;
}

.team-hero-meta a:hover {
  opacity: 0.75;
}

.team-setup {
  margin: 2rem 0;
}

.team-setup-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1.2rem;
  padding: 1.6rem 2rem;
  box-shadow: 0 18px 40px rgba(16, 26, 46, 0.1);
  backdrop-filter: blur(6px);
}

.team-setup-form {
  margin-top: 1.2rem;
  display: none;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1.2rem;
  padding: 1.6rem 2rem;
  box-shadow: 0 18px 40px rgba(16, 26, 46, 0.1);
  backdrop-filter: blur(6px);
}

.team-color-field input[type="color"] {
  width: 100%;
  height: 48px;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.25rem;
  background: #fff;
  cursor: pointer;
}

.team-color-field input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 0.65rem;
}

.team-color-field input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 0.65rem;
}

.team-setup-form.is-open {
  display: block;
}

.team-setup-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.team-setup-modal.is-open {
  display: flex;
}

.team-setup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 20, 34, 0.55);
}

.team-setup-panel {
  position: relative;
  background: #fff;
  color: #0b1220;
  border-radius: 1.4rem;
  padding: 1.8rem 2rem;
  width: min(900px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  z-index: 10000;
  box-shadow: 0 24px 60px rgba(16, 26, 46, 0.22);
}

.team-setup-panel h2,
.team-setup-panel p,
.team-setup-panel label,
.team-setup-panel span {
  color: #0b1220;
}

.team-setup-panel .team-setup-note {
  color: #64748b;
}

body.modal-open {
  overflow: hidden;
}

body.modal-open .site-header,
body.modal-open .site-footer {
  position: relative;
  z-index: 0;
}

.team-setup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: rgba(16, 26, 46, 0.08);
  cursor: pointer;
}

.team-upload-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.team-upload-card {
  position: relative;
  background: #e2e6ee;
  border-radius: 1.1rem;
  min-height: 140px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
  justify-content: flex-end;
  background-image: var(--preview);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.team-upload-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(16, 26, 46, 0.35);
  opacity: 0;
  transition: opacity 160ms ease;
}

.team-upload-card:hover::after {
  opacity: 1;
}

.team-upload-card span,
.team-upload-card .team-upload-icon {
  position: relative;
  z-index: 1;
}

.team-upload-card .team-upload-icon {
  width: 28px;
  height: 28px;
  opacity: 0.8;
}

.team-upload-card.has-preview span {
  opacity: 0;
  pointer-events: none;
}

.team-upload-card.has-preview:hover {
  backdrop-filter: blur(4px);
}

.team-upload-card.has-preview:hover::before {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(6px);
  background: rgba(16, 26, 46, 0.12);
  z-index: 1;
}

.team-upload-card.has-preview .team-upload-icon {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.team-upload-card.has-preview:hover .team-upload-icon {
  opacity: 1;
  transform: translateY(0);
}

.team-upload-card.has-preview .team-upload-icon,
.team-upload-card.has-preview span {
  color: #fff;
}

.team-upload-card input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.team-upload-card--logo {
  min-height: 140px;
}

.team-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.4rem;
}

.team-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
  color: #0b1220;
}

.team-form-grid input,
.team-form-grid textarea {
  padding: 0.6rem 0.75rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(16, 26, 46, 0.12);
  font: inherit;
  color: #0b1220;
  background: #fff;
}

.team-form-grid textarea {
  min-height: 120px;
}

/* ── Positions list in setup form ── */
.team-positions-section {
  grid-column: 1 / -1;
  margin-top: 0.4rem;
}

.team-positions-label {
  font-weight: 600;
  color: #0b1220;
  margin-bottom: 0.5rem;
}

.team-positions-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.team-position-item {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.team-position-item .pos-role {
  flex: 1;
  padding: 0.5rem 0.7rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(16, 26, 46, 0.12);
  font: inherit;
  color: #0b1220;
  background: #fff;
}

.team-position-item .pos-desc {
  flex: 2;
  padding: 0.5rem 0.7rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(16, 26, 46, 0.12);
  font: inherit;
  color: #0b1220;
  background: #fff;
}

.team-position-item .pos-remove {
  background: none;
  border: none;
  color: #e53935;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 0.4rem;
  line-height: 1;
  border-radius: 0.4rem;
  transition: background 0.15s;
}

.team-position-item .pos-remove:hover {
  background: rgba(229, 57, 53, 0.1);
}

.team-position-add {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: 0.6rem;
  border: 1px dashed rgba(16, 26, 46, 0.18);
  background: rgba(16, 26, 46, 0.03);
  color: #0b1220;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.team-position-add:hover {
  background: rgba(16, 26, 46, 0.07);
  border-color: rgba(16, 26, 46, 0.3);
}

.team-position-add.is-disabled,
.team-position-add:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background: rgba(16, 26, 46, 0.02);
  border-color: rgba(16, 26, 46, 0.18);
}

/* Position edit button on wanted cards */
.pos-edit {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.team-member-row:hover .pos-edit {
  opacity: 1;
}

.team-form-full {
  grid-column: 1 / -1;
}

.team-form-actions {
  margin-top: 1rem;
}

.team-form-error {
  color: #b91c1c;
  margin: 0.6rem 0 0;
  font-weight: 600;
}

.team-reject-note {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
  color: #7f1d1d;
}

.team-reject-note p {
  margin: 0.4rem 0 0;
}

.team-locked {
  margin: 3rem auto;
  text-align: center;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 1.2rem;
  box-shadow: 0 18px 40px rgba(16, 26, 46, 0.1);
  backdrop-filter: blur(6px);
}

.team-members {
  margin: 2rem 0 3rem;
}

.team-members .tm-shell {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  border-top: 0;
}

.team-member-grid {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  margin-top: 2rem;
}

.team-member-row {
  display: flex;
  position: relative;
  padding: 1.6rem 0;
  min-height: 180px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  transition: transform 180ms ease, border-color 180ms ease;
}

.team-member-row.is-right {
  justify-content: flex-end;
}

.team-member-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--member-avatar);
  background-size: cover;
  background-position: center;
  opacity: 0.28;
  filter: blur(16px) saturate(1.15);
  border-radius: 28px;
  z-index: 0;
}

.team-member-row::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  opacity: 0.65;
}

.team-member-row.is-right::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
}

.team-member-row:hover {
  transform: translateY(-3px) scale(1.01);
  border-top-color: rgba(255, 255, 255, 0.45);
  border-bottom-color: rgba(255, 255, 255, 0.45);
}

.team-member-card {
  position: relative;
  background: transparent;
  border-radius: 0;
  padding: 0 1.2rem;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  border: 0;
  max-width: 920px;
  width: 100%;
  z-index: 1;
}

.team-member-row.is-right .team-member-card {
  flex-direction: row-reverse;
  text-align: right;
}

.team-member-row.is-right .team-member-info {
  align-items: flex-end;
}

.team-member-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.team-member-avatar--wanted {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--team-accent-rgb, 27 177 242), 0.1);
  border: 3px dashed rgba(var(--team-accent-rgb, 27 177 242), 0.4);
}

.team-wanted-plus {
  font-size: 3.2rem;
  font-weight: 300;
  line-height: 1;
  color: var(--team-accent, #1bb1f2);
  opacity: 0.7;
  transition: opacity 180ms ease, transform 180ms ease;
}

.team-member-row--wanted .team-member-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.team-member-row--wanted:hover .team-wanted-plus {
  opacity: 1;
  transform: scale(1.15);
}

.team-member-row--wanted .team-member-igname {
  color: var(--team-accent, #1bb1f2);
}

.team-member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Wanted player card */
.team-member-row--wanted:hover {
  transform: translateY(-3px) scale(1.01);
}

.team-member-avatar--wanted {
  background: rgba(var(--team-accent-rgb, 27 177 242), 0.12);
  border-color: rgba(var(--team-accent-rgb, 27 177 242), 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-wanted-plus {
  font-size: 3.2rem;
  font-weight: 300;
  line-height: 1;
  color: var(--team-accent, #1bb1f2);
  opacity: 0.7;
  transition: opacity 180ms ease, transform 180ms ease;
}

.team-member-row--wanted:hover .team-wanted-plus {
  opacity: 1;
  transform: scale(1.15);
}

.team-member-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 520px;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.team-member-igname {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--team-text);
}

.team-member-name {
  margin: 0;
  font-weight: 600;
  color: var(--team-text);
  font-size: 1.02rem;
}

.team-member-role {
  margin: 0;
  font-weight: 600;
  color: var(--team-text-muted);
  font-size: 0.95rem;
}

.team-member-bio {
  margin: 0.2rem 0 0;
  color: var(--team-text-muted);
  font-size: 0.98rem;
}

.member-edit {
  position: absolute;
  top: 8px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.14);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  cursor: pointer;
}

.member-edit img {
  width: 18px;
  height: 18px;
  opacity: 0.75;
}

.team-member-row.is-left .member-edit {
  right: 16px;
}

.team-member-row.is-right .member-edit {
  left: 16px;
}

.team-member-row:hover .member-edit {
  opacity: 1;
  transform: translateY(-2px);
}

.member-edit-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.member-edit-modal.is-open {
  display: flex;
}

.member-edit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 20, 34, 0.55);
}

.member-edit-panel {
  position: relative;
  background: #fff;
  border-radius: 1.2rem;
  padding: 1.6rem 2rem;
  width: min(520px, 92vw);
  z-index: 10000;
  box-shadow: 0 24px 60px rgba(16, 26, 46, 0.22);
}

.member-edit-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: rgba(15, 23, 42, 0.08);
  color: #0b1220;
  cursor: pointer;
}

#memberEditForm {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin-top: 1.2rem;
}

#memberEditForm label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
  color: #0b1220;
}

#memberEditForm input,
#memberEditForm textarea {
  padding: 0.6rem 0.75rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(16, 26, 46, 0.12);
  font: inherit;
}

#memberEditForm textarea {
  min-height: 120px;
}

.member-form-actions {
  margin-top: 0.4rem;
}

.member-form-error {
  color: #b91c1c;
  font-weight: 600;
}

@media (max-width: 700px) {
  .team-hero-banner {
    height: 200px;
    border-radius: 1.2rem;
  }

  .team-hero-content {
    margin-top: -48px;
    gap: 1rem;
  }

  .team-hero-logo {
    width: 96px;
    height: 96px;
    border-radius: 20px;
    padding: 9px;
  }

  .team-hero-title h1 {
    font-size: 1.75rem;
  }

  .team-hero-desc {
    font-size: 0.92rem;
  }

  .team-form-grid {
    grid-template-columns: 1fr;
  }
}

.team-cta {
  margin-top: 2.5rem;
  width: 100%;
  background: #fff;
  border-radius: 1.4rem;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 18px 40px rgba(16, 26, 46, 0.1);
}

.team-cta h3 {
  margin: 0 0 0.6rem;
}

.team-cta p {
  margin: 0 0 1.2rem;
  color: var(--tm-muted-2);
}
