.team-screen {
  max-width: 1500px;
  margin: 0 auto;
}

.team-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.team-toolbar > div {
  display: grid;
  gap: 5px;
}

.team-kicker {
  margin: 0;
  color: var(--green-hot);
  font-size: .5rem;
  font-weight: 800;
  letter-spacing: .14em;
}

.team-toolbar h2 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -.035em;
}

.team-toolbar > div > span {
  color: #65746b;
  font-size: .5rem;
}

.team-toolbar > div > span b {
  color: #a8b5ae;
}

.team-search {
  width: min(310px, 100%);
  height: 42px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  border: 1px solid var(--line-strong);
  background: #08110c;
}

.team-search span {
  color: #607067;
  text-align: center;
}

.team-search input {
  width: 100%;
  height: 100%;
  padding: 0 12px 0 0;
  border: 0;
  background: transparent;
  color: #e8f1ec;
  font-size: .53rem;
}

.team-search input::placeholder {
  color: #56645c;
}

.team-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 13px;
}

.team-filters button {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #08110c;
  color: #74827a;
  font-size: .47rem;
  font-weight: 800;
  text-transform: uppercase;
}

.team-filters button i {
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #101d16;
  font-size: .39rem;
  font-style: normal;
}

.team-filters button.is-active {
  border-color: rgba(89,243,167,.32);
  background: #123823;
  color: #eef7f2;
}

.team-filters button.is-active i {
  background: var(--green);
  color: #031009;
}

.team-layout {
  display: grid;
  grid-template-columns: minmax(600px, 1.4fr) minmax(315px, .6fr);
  gap: 13px;
  align-items: start;
}

.team-roster,
.team-profile {
  border: 1px solid var(--line);
  background: var(--panel);
}

.team-section-head {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.team-section-head span {
  color: var(--green-hot);
  font-size: .46rem;
  font-weight: 800;
  letter-spacing: .13em;
}

.team-section-head small {
  color: #617067;
  font-size: .44rem;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.team-player-card {
  position: relative;
  min-height: 300px;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: #08110c;
  color: #eff6f2;
  text-align: left;
}

.team-player-card:before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at 50% 28%, rgba(25,199,119,.18), transparent 48%);
  transition: opacity .2s ease;
}

.team-player-card:hover:before,
.team-player-card.is-active:before {
  opacity: 1;
}

.team-player-card.is-active {
  box-shadow: inset 0 0 0 1px rgba(89,243,167,.5);
}

.team-player-visual {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  background: linear-gradient(150deg,#0c1d14,#07100b 70%);
}

.team-player-visual:before {
  content: '';
  position: absolute;
  inset: 13px;
  border: 1px solid rgba(89,243,167,.1);
  background-image: linear-gradient(rgba(89,243,167,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(89,243,167,.04) 1px,transparent 1px);
  background-size: 28px 28px;
}

.team-card-number {
  position: absolute;
  right: 12px;
  top: 4px;
  font-family: var(--display);
  color: rgba(89,243,167,.11);
  font-size: 4.6rem;
  font-weight: 900;
  line-height: 1;
}

.team-player-visual > img {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: -3px;
  width: auto;
  height: 95%;
  max-width: none;
  object-fit: contain;
  object-position: center bottom;
  transform: translate(calc(-50% + var(--crop-x,0%)),var(--crop-y,0%)) scale(var(--player-scale,1));
  transform-origin: center bottom;
  filter: drop-shadow(0 12px 15px rgba(0,0,0,.42));
}

.team-card-placeholder {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(89,243,167,.18);
  border-radius: 50%;
  background: radial-gradient(circle,#17482f,#0b1d13 68%);
  color: rgba(89,243,167,.75);
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 900;
  transform: translate(-50%,-50%);
  box-shadow: 0 0 0 10px rgba(89,243,167,.025);
}

.team-card-badge {
  position: absolute;
  z-index: 3;
  left: 13px;
  bottom: 9px;
  padding: 5px 7px;
  background: rgba(4,13,8,.82);
  color: var(--green-hot);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.team-player-meta {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 3px;
  padding: 13px 14px 15px;
  border-top: 1px solid var(--line);
  background: rgba(6,14,9,.95);
}

.team-player-meta small {
  color: var(--green-hot);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.team-player-meta strong {
  overflow: hidden;
  font-family: var(--display);
  font-size: 1.42rem;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.team-player-meta span {
  color: #5e6c64;
  font-size: .66rem;
}

.team-player-meta span b {
  color: #a7b4ad;
}

.team-empty {
  min-height: 420px;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.team-empty:not([hidden]) {
  display: grid;
}

.team-empty > span {
  font-family: var(--display);
  color: rgba(89,243,167,.16);
  font-size: 5rem;
  font-weight: 900;
}

.team-empty h3 {
  margin: 5px 0;
  font-size: .9rem;
}

.team-empty p {
  max-width: 300px;
  margin: 0;
  color: #617067;
  font-size: .48rem;
  line-height: 1.6;
}

.team-profile {
  position: sticky;
  top: 18px;
  overflow: hidden;
}

.team-profile-close {
  display: none;
}

.profile-hero {
  position: relative;
  height: 335px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 72%,rgba(25,199,119,.24),transparent 45%),linear-gradient(145deg,#0b281a,#06100b);
}

.profile-hero-grid {
  position: absolute;
  inset: 0;
  opacity: .55;
  background-image: linear-gradient(rgba(89,243,167,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(89,243,167,.05) 1px,transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(#000,transparent 88%);
}

.profile-hero-logo {
  position: absolute;
  left: 50%;
  top: 43%;
  width: 68%;
  opacity: .08;
  transform: translate(-50%,-50%) rotate(-9deg);
}

.profile-hero-number {
  position: absolute;
  z-index: 1;
  right: 13px;
  top: 6px;
  font-family: var(--display);
  color: rgba(89,243,167,.12);
  font-size: 7rem;
  font-weight: 900;
  line-height: 1;
}

.profile-player-image {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: -7px;
  width: auto;
  height: 92%;
  max-width: none;
  object-fit: contain;
  object-position: center bottom;
  transform: translate(calc(-50% + var(--crop-x,0%)),var(--crop-y,0%)) scale(var(--player-scale,1));
  transform-origin: center bottom;
  filter: drop-shadow(0 18px 22px rgba(0,0,0,.5));
}

.profile-player-placeholder {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 49%;
  width: 130px;
  height: 130px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(89,243,167,.22);
  border-radius: 50%;
  background: radial-gradient(circle,#194b31,#0a1d13 70%);
  color: rgba(89,243,167,.8);
  font-family: var(--display);
  font-size: 2.8rem;
  font-weight: 900;
  transform: translate(-50%,-50%);
  box-shadow: 0 0 0 18px rgba(89,243,167,.025);
}

.profile-role {
  position: absolute;
  z-index: 4;
  left: 17px;
  bottom: 14px;
  padding: 6px 8px;
  background: rgba(4,13,8,.82);
  color: var(--green-hot);
  font-size: .42rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.profile-copy {
  padding: 19px;
}

.team-profile .profile-copy {
  align-self: stretch;
}

.profile-copy > p {
  margin: 0;
  color: var(--green-hot);
  font-size: .42rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.profile-copy > h2 {
  margin: 5px 0 3px;
  font-family: var(--display);
  font-size: 1.8rem;
  line-height: 1;
  text-transform: uppercase;
}

.profile-platform {
  color: #66756c;
  font-size: .44rem;
}

.profile-platform b {
  color: #93a199;
}

.profile-sync {
  display: grid;
  grid-template-columns: 7px 1fr auto;
  align-items: center;
  gap: 7px;
  margin: 16px 0 12px;
  padding: 10px;
  border: 1px solid rgba(89,243,167,.13);
  background: #0a1810;
}

.team-profile .profile-sync {
  display: grid;
  gap: 7px;
  margin: 16px 0 12px;
}

.team-profile .profile-sync span,
.team-profile .profile-stats span {
  padding: 0;
  border: 0;
  background: transparent;
}

.profile-sync i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-hot);
}

.profile-sync span {
  font-size: .44rem;
  font-weight: 700;
}

.profile-sync small {
  color: #56645c;
  font-size: .38rem;
}

.profile-facts,
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
}

.team-profile .profile-stats {
  display: grid;
  gap: 0;
  margin-top: 10px;
}

.profile-facts {
  border: 1px solid var(--line);
}

.profile-facts div {
  display: grid;
  gap: 5px;
  padding: 11px 9px;
  border-right: 1px solid var(--line);
}

.profile-facts div:last-child {
  border-right: 0;
}

.profile-facts dt {
  color: #59675f;
  font-size: .37rem;
}

.profile-facts dd {
  margin: 0;
  color: #d7e1db;
  font-size: .52rem;
  font-weight: 800;
}

.profile-stats {
  margin-top: 10px;
  background: #07100b;
}

.profile-stats div {
  display: grid;
  gap: 5px;
  padding: 12px 9px;
  border-right: 1px solid var(--line);
}

.profile-stats div:last-child {
  border-right: 0;
}

.profile-stats span {
  color: #59675f;
  font-size: .37rem;
}

.profile-stats b {
  font-family: var(--display);
  font-size: 1.22rem;
}

.profile-chat-button {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  border: 1px solid var(--line-strong);
  background: #0b1710;
  color: #9eada4;
  font-size: .43rem;
  font-weight: 800;
}

.profile-chat-button svg {
  width: 14px;
}

@media (max-width: 1180px) {
  .team-layout {
    grid-template-columns: minmax(500px, 1fr) 300px;
  }

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

@media (max-width: 820px) {
  .team-screen.is-active {
    animation: none;
    transform: none;
  }

  .team-toolbar {
    display: grid;
    gap: 15px;
  }

  .team-toolbar h2 {
    font-size: 1.18rem;
  }

  .team-search {
    width: 100%;
  }

  .team-filters {
    margin-right: -13px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .team-filters::-webkit-scrollbar {
    display: none;
  }

  .team-filters button {
    flex: 0 0 auto;
    min-width: 84px;
    justify-content: center;
  }

  .team-layout {
    display: block;
  }

  .team-roster {
    margin-inline: -13px;
    border-left: 0;
    border-right: 0;
  }

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

  .team-player-card {
    min-height: 224px;
  }

  .team-player-visual {
    min-height: 158px;
  }

  .team-player-meta {
    padding: 11px 12px 13px;
  }

  .team-player-meta strong {
    font-size: 1.02rem;
  }

  .team-profile {
    position: fixed;
    z-index: 60;
    inset: 0;
    display: grid;
    grid-template-rows: minmax(280px, 43svh) 1fr;
    overflow-y: auto;
    border: 0;
    background: #07100b;
    opacity: 0;
    pointer-events: none;
    transform: translateY(24px);
    transition: opacity .2s ease, transform .25s ease;
  }

  .team-profile.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .team-profile-close {
    position: fixed;
    z-index: 70;
    right: 13px;
    top: 13px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 50%;
    background: rgba(5,12,8,.82);
    color: #fff;
    font-size: 1.2rem;
  }

  .profile-hero {
    height: auto;
    min-height: 0;
  }

  .profile-player-image {
    width: 88%;
    height: 94%;
  }

  .team-profile .profile-copy {
    padding: 21px 18px calc(30px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 370px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
}
