:root {
  --rscm-team-red: #e43425;
  --rscm-team-red-dark: #bf2518;
  --rscm-team-red-soft: #fff7f5;
  --rscm-team-ink: #171717;
  --rscm-team-text: #292929;
  --rscm-team-muted: #737373;
  --rscm-team-line: #e8e8e8;
  --rscm-team-surface: #fff;
  --rscm-team-page: #f5f5f5;
  --rscm-team-green: #198754;
  --rscm-team-green-soft: #eaf5ef;
  --rscm-team-orange: #b85c00;
}

#rscm-team-profile,
#rscm-team-profile * {
  box-sizing: border-box;
}

.rscm-team-profile {
  padding-top: .65rem;
  color: var(--rscm-team-text);
}

.team-profile-breadcrumb {
  padding: .5rem 0 .9rem;
}

#main .team-profile-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  color: var(--rscm-team-muted);
  font-size: .76rem;
  font-weight: 700;
  text-decoration: none;
}

#main .team-profile-breadcrumb a:hover {
  color: var(--rscm-team-red);
}

.team-profile-hero {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--rscm-team-line);
  border-radius: 1rem;
  background: linear-gradient(145deg, #fff, var(--rscm-team-red-soft));
  box-shadow: 0 12px 38px rgba(86, 46, 42, .11);
}

.team-profile-visual {
  position: relative;
  min-height: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #ececec;
}

.team-profile-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 52%, rgba(122, 28, 20, .28));
  pointer-events: none;
}

.team-profile-visual > img:not(.team-profile-fallback-logo) {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.team-profile-visual.is-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--rscm-team-red), var(--rscm-team-red-dark));
}

.team-profile-visual.is-fallback::after {
  background: radial-gradient(circle at center, transparent, rgba(62, 0, 0, .25));
}

.team-profile-fallback-logo {
  width: min(42%, 11rem);
  height: auto;
  position: relative;
  z-index: 1;
  filter: brightness(0) invert(1);
}

.team-profile-heading {
  position: relative;
  padding: 1.4rem 1.15rem 1.3rem;
  color: var(--rscm-team-text);
}

.team-profile-heading::before {
  content: "";
  width: 3.25rem;
  height: .3rem;
  position: absolute;
  top: 0;
  left: 1.15rem;
  border-radius: 999px;
  background: var(--rscm-team-red);
}

.team-profile-eyebrow,
.team-profile-section-label {
  margin: 0;
  color: var(--rscm-team-red);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

#main .team-profile-heading h1 {
  max-width: 15ch;
  margin: .35rem 0 .85rem;
  color: var(--rscm-team-ink);
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.75rem, 13vw, 5rem);
  font-weight: 400;
  line-height: .88;
  letter-spacing: .012em;
  text-transform: uppercase;
}

.team-profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
}

.team-profile-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: .32rem .6rem;
  border: 1px solid #ddd2d0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: #555;
  font-size: .65rem;
  font-weight: 700;
}

.team-profile-tags span.is-primary {
  border-color: var(--rscm-team-red);
  background: var(--rscm-team-red);
  color: #fff;
}

#main .team-profile-calendar-link {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-top: 1.15rem;
  color: var(--rscm-team-red);
  font-size: .76rem;
  font-weight: 700;
  text-decoration: none;
}

.team-profile-calendar-link i {
  color: var(--rscm-team-red-dark);
  transition: transform .2s ease;
}

.team-profile-calendar-link:hover i {
  transform: translateX(3px);
}

.team-profile-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: -.2rem .55rem 0;
  overflow: hidden;
  border: 1px solid var(--rscm-team-line);
  border-radius: .85rem;
  background: #fff;
  box-shadow: 0 8px 25px rgba(31, 22, 21, .08);
}

.team-profile-stats > div {
  min-width: 0;
  padding: .85rem .35rem .8rem;
  text-align: center;
}

.team-profile-stats > div + div {
  border-left: 1px solid var(--rscm-team-line);
}

.team-profile-stats strong {
  display: block;
  color: var(--rscm-team-ink);
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
}

.team-profile-stats strong small {
  font-size: .7em;
}

.team-profile-stats > div > span {
  display: block;
  margin-top: .28rem;
  color: var(--rscm-team-muted);
  font-size: .58rem;
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
}

.team-profile-stats .team-profile-form-stat {
  grid-column: 1 / -1;
  border-top: 1px solid var(--rscm-team-line);
  border-left: 0;
}

.team-profile-form {
  min-height: 28px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: .28rem;
}

.team-profile-form span {
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-family: "Lato", sans-serif;
  font-size: .62rem;
  font-weight: 700;
}

.team-profile-form .is-win {
  background: var(--rscm-team-green);
}

.team-profile-form .is-loss {
  background: var(--rscm-team-red);
}

.team-profile-form .is-draw {
  background: var(--rscm-team-orange);
}

.team-profile-form .is-empty {
  background: #d5d5d5;
}

.team-profile-roster {
  margin-top: 1.6rem;
}

.team-profile-roster-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .72rem;
}

#main .team-profile-roster-header h2 {
  margin: .18rem 0 0;
  color: var(--rscm-team-ink);
  font-size: 1.75rem;
  line-height: 1;
}

.team-profile-roster-header > span {
  flex: 0 0 auto;
  padding: .28rem .55rem;
  border-radius: 999px;
  background: var(--rscm-team-red-soft);
  color: var(--rscm-team-red);
  font-size: .65rem;
  font-weight: 700;
}

.team-player-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.team-player-card {
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: .72rem .8rem;
  border: 1px solid var(--rscm-team-line);
  border-left: 3px solid var(--rscm-team-red);
  border-radius: .72rem;
  background: #fff;
  box-shadow: 0 3px 13px rgba(52, 30, 28, .045);
}

.team-player-card strong {
  min-width: 0;
  overflow: hidden;
  color: var(--rscm-team-text);
  font-size: .8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-season {
  margin-top: 2rem;
}

.team-season-header,
.team-season-title,
.team-match-row,
.team-result-row {
  display: flex;
  align-items: center;
}

.team-season-header {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.team-season-eyebrow {
  margin: 0 0 .2rem;
  color: var(--rscm-team-red);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

#main .team-season h2,
#main .team-season h3 {
  margin: 0;
  color: var(--rscm-team-ink);
}

#main .team-season h2 {
  font-size: clamp(2rem, 9vw, 3.2rem);
  line-height: .95;
}

#main .team-season-calendar-link {
  flex: 0 0 auto;
  color: var(--rscm-team-red);
  font-size: .7rem;
  font-weight: 700;
  text-align: right;
  text-decoration: none;
}

.team-season-calendar-link i {
  margin-left: .25rem;
}

.team-next-section {
  margin-top: .5rem;
}

.team-next-card {
  position: relative;
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: .9rem;
  margin-top: .5rem;
  padding: 1rem;
  overflow: hidden;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--rscm-team-red), var(--rscm-team-red-dark));
  color: #fff;
  box-shadow: 0 10px 28px rgba(228, 52, 37, .24);
}

.team-next-card::after {
  content: "";
  width: 10rem;
  height: 10rem;
  position: absolute;
  right: -4rem;
  bottom: -5rem;
  border: 2rem solid rgba(255, 255, 255, .07);
  border-radius: 50%;
}

.team-next-date {
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .65rem .35rem;
  border-radius: .72rem;
  background: #fff;
  color: var(--rscm-team-red);
  line-height: 1;
}

.team-next-date strong {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2rem;
  font-weight: 400;
}

.team-next-date span {
  margin-top: .05rem;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
}

.team-next-main {
  min-width: 0;
  position: relative;
  z-index: 1;
}

#main .team-next-main h3 {
  margin: .18rem 0 .5rem;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 1.65rem;
  line-height: 1;
}

.team-next-main p {
  display: flex;
  align-items: flex-start;
  gap: .38rem;
  margin: .22rem 0 0;
  color: rgba(255, 255, 255, .82);
  font-size: .69rem;
  line-height: 1.4;
}

.team-next-main p i {
  width: .8rem;
  margin-top: .12rem;
  text-align: center;
}

.team-next-vs {
  position: absolute;
  right: .85rem;
  top: .25rem;
  color: rgba(255, 255, 255, .1);
  font-family: "Bebas Neue", sans-serif;
  font-size: 4.2rem;
  line-height: 1;
}

.team-season-section {
  margin-top: 1.65rem;
}

.team-season-title {
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .7rem;
}

#main .team-season-title h3 {
  font-size: 1.55rem;
}

.team-season-title > span {
  min-width: 1.75rem;
  padding: .2rem .45rem;
  border-radius: 999px;
  background: var(--rscm-team-red-soft);
  color: var(--rscm-team-red);
  font-size: .68rem;
  font-weight: 700;
  text-align: center;
}

.team-match-list,
.team-result-list {
  display: grid;
  gap: .55rem;
}

.team-match-row,
.team-result-row {
  min-width: 0;
  gap: .72rem;
  padding: .78rem;
  border: 1px solid var(--rscm-team-line);
  border-radius: .72rem;
  background: #fff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .035);
}

.team-match-row time {
  flex: 0 0 4.8rem;
  color: var(--rscm-team-red);
  font-size: .68rem;
  font-weight: 700;
  text-transform: capitalize;
}

.team-match-row > div {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.team-match-row strong,
.team-result-row strong {
  overflow: hidden;
  color: var(--rscm-team-text);
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-match-row > div span,
.team-result-row time {
  overflow: hidden;
  color: var(--rscm-team-muted);
  font-size: .62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-result-row {
  border-left: 3px solid var(--rscm-team-red);
}

.team-result-row.is-win {
  border-left-color: var(--rscm-team-green);
}

.team-result-row.is-draw {
  border-left-color: var(--rscm-team-orange);
}

.team-result-status {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .48rem;
  background: var(--rscm-team-red);
  color: #fff;
  font-size: .66rem;
  font-weight: 700;
}

.team-result-row.is-win .team-result-status {
  background: var(--rscm-team-green);
}

.team-result-row.is-draw .team-result-status {
  background: var(--rscm-team-orange);
}

.team-result-row > div {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.team-result-score {
  flex: 0 0 auto;
  color: var(--rscm-team-ink);
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.35rem;
}

.team-season-empty {
  margin: .5rem 0 0;
  padding: 1.15rem;
  border: 1px dashed #d8d8d8;
  border-radius: .8rem;
  background: var(--rscm-team-page);
  color: var(--rscm-team-muted);
  font-size: .78rem;
  text-align: center;
}

.team-season-source {
  margin: 1.1rem 0 0;
  color: var(--rscm-team-muted);
  font-size: .65rem;
  text-align: right;
}

#main .team-season-source a {
  font-weight: 700;
}

.team-profile-breadcrumb a:focus-visible,
.team-profile-calendar-link:focus-visible,
.team-season-calendar-link:focus-visible,
.team-season-source a:focus-visible {
  outline: 3px solid rgba(228, 52, 37, .3);
  outline-offset: 3px;
}

@media (min-width: 480px) {
  .team-profile-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .team-profile-stats .team-profile-form-stat {
    grid-column: auto;
    border-top: 0;
    border-left: 1px solid var(--rscm-team-line);
  }
}

@media (min-width: 768px) {
  .rscm-team-profile {
    padding-top: 1rem;
  }

  .team-profile-hero {
    grid-template-columns: minmax(0, 1.65fr) minmax(18rem, .85fr);
    min-height: 26rem;
  }

  .team-profile-visual {
    height: 100%;
    aspect-ratio: auto;
  }

  .team-profile-visual::after {
    background: linear-gradient(90deg, transparent 62%, rgba(122, 28, 20, .24));
  }

  .team-profile-heading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
  }

  .team-profile-heading::before {
    width: .32rem;
    height: 3.7rem;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
  }

  #main .team-profile-heading h1 {
    font-size: clamp(3.4rem, 6vw, 5.4rem);
  }

  .team-profile-stats {
    max-width: calc(100% - 4rem);
    margin: -1.2rem auto 0;
  }

  .team-profile-stats > div {
    padding: 1rem .7rem;
  }

  .team-profile-roster,
  .team-season {
    max-width: 1040px;
    margin-right: auto;
    margin-left: auto;
  }

  .team-profile-roster {
    margin-top: 2rem;
  }

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

  .team-player-card {
    padding: .78rem;
  }

  .team-season {
    margin-top: 2.4rem;
  }

  .team-next-card {
    grid-template-columns: 5rem minmax(0, 1fr);
    padding: 1.2rem;
  }

  #main .team-next-main h3 {
    font-size: 2rem;
  }

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

@media (min-width: 1200px) {
  .team-profile-hero {
    max-width: 1260px;
    margin-right: auto;
    margin-left: auto;
  }

  .team-profile-stats {
    max-width: 1120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-profile-calendar-link i {
    transition: none;
  }
}
