.match-profile-card,
.match-profile-body,
.match-profile-system,
.match-profile-identity {
  min-width: 0;
}

/* Optional Match Center feature shared by leagues and cup environments. */
.match-storylines-disabled [data-match-storylines] {
  display: none !important;
}

.match-storylines-panel {
  padding: 14px;
}

.storylines-panel {
  --storyline-accent: var(--accent, #087f86);
  color: var(--ink, var(--text, #17222d));
  background: var(--panel, #fff);
  border: 1px solid var(--line, #d4e0e5);
  border-radius: 16px;
  padding: 16px;
}

.storylines-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.storylines-heading span,
.storylines-heading em {
  color: var(--muted, #64717c);
  font-size: .76rem;
  font-style: normal;
  font-weight: 850;
}

.storylines-heading h2 { margin: 0; color: var(--ink, var(--text, #17222d)); font-size: 1.35rem; }

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

.storyline-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-width: 0;
  min-height: 154px;
  padding: 12px;
  border: 1px solid var(--line, #d4e0e5);
  border-top: 4px solid var(--storyline-color, var(--storyline-accent));
  border-radius: 13px;
  background: var(--panel-soft, var(--surface, #f3f7f8));
  box-shadow: 0 6px 18px rgba(20, 45, 55, .06);
}

.storyline-card.category-live { --storyline-color: #1d9b60; }
.storyline-card.category-history { --storyline-color: #6b63c7; }
.storyline-card.category-form { --storyline-color: #ca8b13; }
.storyline-card.category-personnel { --storyline-color: #2980b9; }
.storyline-card.category-venue { --storyline-color: #8c6544; }

.storyline-card > header,
.storyline-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.storyline-card > strong { margin: 8px 0 5px; color: var(--ink, var(--text, #17222d)); font-size: 1rem; line-height: 1.15; }
.storyline-copy { color: var(--muted, #53636d); font-size: .86rem; font-weight: 700; line-height: 1.35; }
.storyline-category { display: inline-flex; align-items: center; gap: 6px; color: var(--storyline-color, var(--storyline-accent)); font-size: .72rem; font-weight: 950; text-transform: uppercase; }
.storyline-category i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: color-mix(in srgb, var(--storyline-color, var(--storyline-accent)) 14%, transparent); font-style: normal; }
.storyline-dismiss { border: 0; background: transparent; color: var(--muted, #64717c); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.storyline-action,
.storylines-more { border: 1px solid var(--line, #cbd9de); border-radius: 9px; background: var(--panel, #fff); color: var(--storyline-accent); padding: 6px 9px; font: inherit; font-size: .76rem; font-weight: 900; cursor: pointer; }
.storyline-card > footer { justify-content: flex-end; margin-top: 9px; }
.storylines-more { display: block; margin: 12px auto 0; }
.storylines-empty { display: grid; gap: 4px; place-items: center; min-height: 110px; text-align: center; color: var(--muted, #64717c); }
.storylines-empty strong { color: var(--ink, var(--text, #17222d)); }

.league-storylines-wrap { padding: 0 12px 12px; }
.league-storylines-wrap[hidden] { display: none; }
.league-storylines-wrap .storylines-panel { border-radius: 12px; }
.meta-icon.storylines-active { color: var(--accent, #087f86); background: var(--accent-soft, #dff3f3); }

@media (max-width: 1050px) {
  .storylines-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .match-storylines-panel { padding: 8px; }
  .storylines-panel { padding: 11px; }
  .storylines-heading { align-items: start; flex-direction: column; }
  .storylines-grid { grid-template-columns: 1fr; }
  .storyline-card { min-height: 0; }
}

.match-profile-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line, rgba(125, 180, 184, 0.28));
}

.match-profile-identity strong,
.match-profile-identity em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-profile-identity strong {
  color: var(--text, #f4f8f8);
  font-weight: 950;
}

.match-profile-identity em {
  color: var(--muted, #adbac0);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 850;
}

.match-profile-body {
  display: grid;
  min-width: 0;
}

.match-profile-system {
  min-width: 0;
}

.match-center-lineup-workspace,
.match-center-lineup-board,
.match-center-bench,
.match-center-pitch {
  min-width: 0;
}

.match-center-lineup-slot {
  display: contents;
}

.match-center-timeline-head,
.match-center-timeline-track {
  min-width: 0;
}

.match-center-participant,
.match-center-participant-identity,
.match-center-participant-markers {
  min-width: 0;
}

.match-center-pitch-slot {
  min-width: 0;
}
