.team-profile__panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--white);
  border-radius: 14px;
  padding: 20px;
}

.team-profile__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.team-profile__logo-wrap {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-profile__logo {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.team-profile__title {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text);
}

.team-profile__badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.team-profile__badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--grey-light);
  color: #3d3d3d;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 600;
}

.team-profile__badge--code {
  color: var(--primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.team-profile__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.team-profile__stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.team-profile__stack .team-profile__card:last-child {
  flex: 1 1 auto;
}

.team-profile__card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: 14px;
  padding: 20px;
}

.team-profile__card-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text);
}

.team-profile__rows,
.team-profile__tournaments {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.team-profile__row {
  display: grid;
  grid-template-columns: 24px minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 12px;
}

.team-profile__row-icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.team-profile__row-icon svg {
  display: block;
  width: 24px;
  height: 24px;
}

.team-profile__row-label-text {
  color: var(--grey);
  font-size: 14px;
  line-height: 1.3;
}

.team-profile__row-value {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
  overflow-wrap: break-word;
}

.team-profile__row-note {
  color: var(--grey);
  font-size: 12px;
  font-weight: 500;
}

.team-profile__link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.team-profile__link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.team-profile__country {
  display: inline;
  color: inherit;
}

.team-profile__flag {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 4px;
  border-radius: 3px;
  object-fit: cover;
  vertical-align: -3px;
}

.team-profile__colors {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.team-profile__color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--team-color, #d5d5d5);
}

.team-profile__color--light {
  box-shadow: inset 0 0 0 1px #d5d5d5;
}

.team-profile__tournament {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-profile__tournament-logo {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.team-profile__tournament-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.team-profile__tournament-icon svg {
  display: block;
  width: 24px;
  height: 24px;
}

.team-profile__tournament-name {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 400;
  text-decoration: none;
}

.team-profile__tournament-count {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  text-align: right;
}

.team-profile__goals {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-profile__goal {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-profile__goal-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-profile__goal-icon svg,
.team-profile__goal-img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.team-profile__goal--scored .team-profile__goal-icon {
  color: #34b945;
}

.team-profile__goal--conceded .team-profile__goal-icon {
  color: #f85c5f;
}

.team-profile__goal--conceded .team-profile__goal-img--tinted {
  filter: sepia(1) saturate(9) hue-rotate(320deg) brightness(1.05);
}

.team-profile__goal-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.team-profile__goal-value {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
}

.team-profile__goal--scored .team-profile__goal-value {
  color: #34b945;
}

.team-profile__goal--conceded .team-profile__goal-value {
  color: #f85c5f;
}

.team-profile__goal-label {
  color: var(--grey);
  font-size: 14px;
  line-height: 1.3;
}

.team-profile__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--grey-light);
}

.team-profile__form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.team-profile__form-label {
  color: var(--grey);
  font-size: 13px;
  line-height: 1.4;
}

.team-profile__form-summary {
  display: inline-flex;
  gap: 4px;
}

.team-profile__form-stat {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  white-space: nowrap;
}

.team-profile__form-stat--win {
  color: #2f8a47;
  background: rgba(58, 166, 87, 0.12);
}

.team-profile__form-stat--draw {
  color: #6b6b6b;
  background: rgba(154, 154, 154, 0.16);
}

.team-profile__form-stat--loss {
  color: #c43c3c;
  background: rgba(214, 69, 69, 0.12);
}

.team-profile__form-bar {
  display: flex;
  gap: 2px;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
}

.team-profile__form-bar-seg {
  flex: 0 1 0;
  min-width: 4px;
  border-radius: 999px;
}

.team-profile__form-bar-seg--win {
  background: #3aa657;
}

.team-profile__form-bar-seg--draw {
  background: #9a9a9a;
}

.team-profile__form-bar-seg--loss {
  background: #d64545;
}

.team-profile__form-chain {
  display: flex;
  gap: 4px;
}

.team-profile__form-chain .match-preview__form-badge {
  flex: 1 1 0;
  min-width: 0;
  max-width: 28px;
  width: auto;
  height: auto;
  aspect-ratio: 1 / 1;
  font-size: 11px;
}

@media (max-width: 768px) {
  .team-profile__panel {
    padding: 16px;
  }

  .team-profile__cards,
  .team-profile__stack {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .team-profile__title {
    font-size: 20px;
  }

  .team-profile__card {
    padding: 16px;
  }

  .team-profile__card-title {
    font-size: 18px;
  }
}
