#fx-match-modal,
#ls-match-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.72);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 12px;
}
#ls-match-modal.ls-open {
  display: block;
  padding: 24px 12px;
}
.fx-modal,
#ls-match-modal .ls-modal-content {
  max-width: 960px;
  width: 92%;
  margin: 0 auto;
  background: var(--bg-surface);
  border-radius: 16px;
  color: var(--text);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  padding: 0;
}
.fx-modal-header,
#ls-match-modal .ls-modal-header {
  position: relative;
  padding: 20px 48px 16px 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  background: var(--bg-surface);
  text-align: center;
}
.fx-modal-close,
#ls-match-modal .ls-modal-close {
  position: absolute;
  right: 14px;
  top: 10px;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}
.fx-modal-close:hover,
#ls-match-modal .ls-modal-close:hover {
  color: var(--text);
}
.fx-modal-teams,
#ls-match-modal .ls-modal-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
}
.fx-modal-team,
#ls-match-modal .ls-modal-team {
  text-align: center;
  flex: 1;
}
.fx-modal-team img,
#ls-match-modal .ls-modal-team img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: #374151;
  border-radius: 50%;
}
.fx-modal-vs,
#ls-match-modal .ls-modal-vs {
  font-size: 1.5rem;
  font-weight: 700;
  min-width: 80px;
  color: var(--accent);
  padding: 0 12px;
}
.fx-modal-info,
#ls-match-modal .ls-modal-info {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 10px;
  line-height: 1.5;
}
.fx-modal-tabs,
#ls-match-modal .ls-modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  overflow-x: auto;
  background: color-mix(in srgb, var(--text) 6%, var(--bg-surface));
  flex-wrap: nowrap;
}
.fx-modal-tab,
#ls-match-modal .ls-modal-tab {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.fx-modal-tab.fx-active,
#ls-match-modal .ls-modal-tab.ls-active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.fx-modal-content,
#ls-match-modal #ls-modal-tab-contents {
  padding: 16px;
  background: var(--bg-surface);
}
.fx-content,
#ls-match-modal .ls-tab-pane {
  display: none;
  color: var(--text);
}
.fx-content.fx-active,
#ls-match-modal .ls-tab-pane.ls-active {
  display: block;
  color: var(--text);
}
.fx-loading,
.fx-error,
#ls-match-modal .ls-loading,
#ls-match-modal .ls-error {
  text-align: center;
  padding: 24px;
  font-size: 14px;
}
.fx-loading,
#ls-match-modal .ls-loading {
  color: var(--accent);
}
.fx-error,
#ls-match-modal .ls-error {
  color: #f87171;
}

.fx-event-item,
#ls-match-modal .ls-event-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 5%, transparent);
  font-size: 13px;
  color: var(--text);
  margin: 0;
}
.fx-event-minute,
#ls-match-modal .ls-event-minute {
  min-width: 36px;
  color: var(--text-muted);
  font-weight: 600;
}
.fx-goal-event-home,
#ls-match-modal .ls-goal-event-home {
  background: color-mix(in srgb, var(--accent) 12%, transparent) !important;
}
.fx-goal-event-away,
#ls-match-modal .ls-goal-event-away {
  background: color-mix(in srgb, var(--accent-2) 12%, transparent) !important;
}
.ls-event-logo {
  display: none !important;
}

.fx-stat-row,
#ls-match-modal .ls-stat-row {
  margin-bottom: 12px;
}
.fx-stat-name,
#ls-match-modal .ls-stat-name {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-align: center;
  width: auto;
}
.fx-bar-group,
#ls-match-modal .ls-bar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  width: 100%;
}
.fx-stat-value-home,
#ls-match-modal .ls-stat-value-home {
  min-width: 40px;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  color: var(--accent);
}
.fx-stat-value-away,
#ls-match-modal .ls-stat-value-away {
  min-width: 40px;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  color: var(--accent-2);
}
.fx-bar-container,
#ls-match-modal .ls-bar-container {
  flex: 1;
  height: 8px;
  background: color-mix(in srgb, var(--text) 8%, var(--bg-surface));
  border-radius: 99px;
  display: flex;
  overflow: hidden;
  position: relative;
}
.fx-bar-home,
#ls-match-modal .ls-bar-home {
  background: var(--accent);
  height: 100%;
}
.fx-bar-away,
#ls-match-modal .ls-bar-away {
  background: var(--accent-2);
  height: 100%;
}
#ls-match-modal .ls-bar-home {
  position: absolute;
  left: 0;
  top: 0;
}
#ls-match-modal .ls-bar-away {
  position: absolute;
  right: 0;
  top: 0;
}

.fx-table,
#ls-match-modal .ls-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
  color: var(--text);
}
.fx-table th,
.fx-table td,
#ls-match-modal .ls-stats-table th,
#ls-match-modal .ls-stats-table td {
  padding: 6px 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
  text-align: center;
  color: var(--text);
}
.fx-table th,
#ls-match-modal .ls-stats-table th {
  color: var(--text-muted);
  font-weight: 600;
}
.fx-player-name-cell,
#ls-match-modal .ls-player-name-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  min-width: 120px;
  white-space: nowrap;
}
.fx-player-name-cell img,
#ls-match-modal .ls-player-name-cell img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: #444;
  flex-shrink: 0;
}
#ls-match-modal .ls-player-stats-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
@media (min-width: 768px) {
  #ls-match-modal .ls-player-stats-container {
    flex-direction: row;
    gap: 16px;
  }
  #ls-match-modal .ls-player-stats-team {
    flex: 1;
    width: 50%;
    min-width: 0;
  }
}
#ls-match-modal .ls-player-stats-team {
  margin: 0;
  padding: 12px;
  background: color-mix(in srgb, var(--text) 6%, var(--bg-surface));
  border-radius: 8px;
  overflow-x: auto;
  width: 100%;
}
#ls-match-modal .ls-player-stats-team .ls-stats-table {
  min-width: 420px;
}
.fx-rating-box,
#ls-match-modal .ls-rating-box {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #111;
}
.fx-rating-high,
#ls-match-modal .ls-rating-high {
  background: #4ade80;
}
.fx-rating-med,
#ls-match-modal .ls-rating-med {
  background: #fbbf24;
}
.fx-rating-low,
#ls-match-modal .ls-rating-low {
  background: #f97316;
  color: #fff;
}

.fx-lineups-wrap,
#ls-match-modal .ls-lineups-container {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.fx-lineup-side,
#ls-match-modal .ls-lineup-team {
  flex: 1;
  min-width: 280px;
  max-width: 480px;
  padding: 12px;
  background: color-mix(in srgb, var(--text) 6%, var(--bg-surface));
  border-radius: 8px;
}
.fx-lineup-title,
#ls-match-modal .ls-team-name-header {
  text-align: center;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 16px;
}
.fx-coach,
#ls-match-modal .ls-team-coach {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 10px;
}
.fx-pitch,
#ls-match-modal .ls-pitch-container {
  position: relative;
  height: 540px;
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 33.33% 100%,
    linear-gradient(180deg, #15803d 0%, #166534 40%, #14532d 60%, #166534 100%);
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.fx-pitch-line,
#ls-match-modal .ls-pitch-line {
  position: absolute;
  pointer-events: none;
}
.fx-center-line,
#ls-match-modal .ls-center-line {
  left: 6%;
  right: 6%;
  top: 50%;
  height: 0;
  width: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  border-left: none;
  border-right: none;
  border-bottom: none;
}
.fx-center-circle,
#ls-match-modal .ls-center-circle {
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
}
.fx-goal-box {
  left: 28%;
  width: 44%;
  height: 11%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.12);
}
.fx-goal-box.top {
  top: 0;
  border-top: none;
  border-radius: 0 0 6px 6px;
}
.fx-goal-box.bottom {
  bottom: 0;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}
.fx-goal-mouth {
  left: 38%;
  width: 24%;
  height: 3.5%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.45);
}
.fx-goal-mouth.top {
  top: 0;
  border-top: none;
}
.fx-goal-mouth.bottom {
  bottom: 0;
  border-bottom: none;
}
.fx-player,
#ls-match-modal .ls-lineup-player-item {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 76px;
  text-align: center;
  z-index: 2;
}
.fx-player-photo,
#ls-match-modal .ls-lineup-player-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: block;
  margin: 0 auto;
  background: var(--bg-surface);
  overflow: hidden;
}
#ls-match-modal .ls-lineup-player-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fx-photo-fallback {
  background: #374151;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.5);
}
.fx-player-number,
#ls-match-modal .ls-lineup-player-number {
  position: absolute;
  top: -2px;
  right: 10px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 10px;
  line-height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  z-index: 3;
  text-align: center;
}
.fx-player-name,
#ls-match-modal .ls-lineup-player-name {
  margin-top: 4px;
  font-size: 11px;
  color: #f8fafc;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 76px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.fx-player-meta,
#ls-match-modal .ls-lineup-player-stats {
  margin-top: 2px;
  display: flex;
  gap: 3px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  font-size: 11px;
}
.fx-ic-goal {
  font-size: 11px;
}
.fx-ic-card {
  display: inline-block;
  width: 10px;
  height: 12px;
  border-radius: 2px;
}
.fx-ic-card.yc {
  background: #fbbf24;
}
.fx-ic-card.rc {
  background: #ef4444;
}

.fx-h2h-summary,
.ls-h2h-summary {
  background: color-mix(in srgb, var(--text) 6%, var(--bg-surface));
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 16px;
  text-align: center;
  color: var(--text);
}
.fx-h2h-summary h3,
.ls-h2h-summary h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 15px;
}
.fx-h2h-stats,
.ls-h2h-stats {
  display: flex;
  justify-content: space-around;
  font-size: 14px;
  margin: 10px 0;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text);
}
.ls-h2h-home {
  color: var(--accent);
  font-weight: bold;
}
.ls-h2h-away {
  color: var(--accent-2);
  font-weight: bold;
}
.fx-section-title,
.ls-section-title {
  font-size: 14px;
  font-weight: bold;
  margin: 16px 0 12px;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}
.fx-h2h-table,
.ls-h2h-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 12px;
  color: var(--text);
}
.fx-h2h-table th,
.fx-h2h-table td,
.ls-h2h-table th,
.ls-h2h-table td {
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.fx-h2h-table th,
.ls-h2h-table th {
  background: var(--bg-body);
  color: var(--text-muted);
}
.ls-h2h-score-center {
  font-weight: bold;
  font-size: 14px;
  min-width: 80px;
}
.ls-h2h-score-number {
  color: var(--text);
  font-weight: bold;
}
.ls-h2h-dash {
  color: var(--text-muted);
  margin: 0 4px;
}
.ls-form-section {
  background: color-mix(in srgb, var(--text) 6%, var(--bg-surface));
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.ls-form-team {
  flex: 1;
  text-align: center;
  min-width: 140px;
}
.ls-form-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  justify-content: center;
}
.ls-form-header-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
  background: #444;
}
.ls-form-header-name {
  font-weight: bold;
  font-size: 14px;
  color: var(--text);
}
.ls-recent-form {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 10px 0;
}
.ls-form-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
}
.ls-form-win {
  background: #10b981;
  color: white;
}
.ls-form-draw {
  background: #fbbf24;
  color: black;
}
.ls-form-loss {
  background: #ef4444;
  color: white;
}

.fx-standings-scroll,
.ls-standings-scroll {
  overflow-x: auto;
  border-radius: 8px;
  background: var(--bg-body);
}
.fx-standings-table,
.ls-standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 600px;
  color: var(--text);
}
.fx-standings-table th,
.ls-standings-table th {
  background: var(--bg-body);
  padding: 10px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  border-bottom: 2px solid var(--border);
}
.fx-standings-table td,
.ls-standings-table td {
  padding: 6px 4px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.ls-standings-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: color-mix(in srgb, var(--text) 6%, var(--bg-surface));
  border-radius: 8px;
  margin-bottom: 16px;
}
.ls-standings-league-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--border);
}
.ls-standings-league-name {
  font-size: 16px;
  font-weight: bold;
  color: var(--text);
}
.ls-standings-season {
  font-size: 12px;
  color: var(--text-muted);
}
.ls-standings-team-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  min-width: 160px;
}
.ls-standings-team-logo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: contain;
  background: #444;
  flex-shrink: 0;
}
.ls-standings-rank {
  font-weight: bold;
  color: var(--text);
}
.ls-standings-points {
  font-weight: bold;
  color: var(--accent);
  font-size: 13px;
}
.ls-standings-home {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 25%, transparent) 0%, transparent 15%) !important;
  border-left: 3px solid var(--accent);
}
.ls-standings-away {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-2) 25%, transparent) 0%, transparent 15%) !important;
  border-left: 3px solid var(--accent-2);
}
.ls-standings-relegation {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.2) 0%, transparent 18%) !important;
  border-left: 3px solid #ef4444;
}

@media (max-width: 640px) {
  .fx-pitch,
  #ls-match-modal .ls-pitch-container {
    height: 440px;
  }
  .fx-player,
  #ls-match-modal .ls-lineup-player-item {
    width: 62px;
  }
  .fx-player-photo,
  .fx-photo-fallback,
  #ls-match-modal .ls-lineup-player-photo {
    width: 40px;
    height: 40px;
  }
  .fx-modal-team img,
  #ls-match-modal .ls-modal-team img {
    width: 40px;
    height: 40px;
  }
  .fx-modal-vs,
  #ls-match-modal .ls-modal-vs {
    font-size: 1.1rem;
    min-width: 60px;
  }
  .fx-modal-tab,
  #ls-match-modal .ls-modal-tab {
    padding: 10px 6px;
    font-size: 12px;
  }
}
@media (max-width: 480px) {
  .fx-modal-team img,
  #ls-match-modal .ls-modal-team img {
    width: 32px;
    height: 32px;
  }
  .fx-modal-tab,
  #ls-match-modal .ls-modal-tab {
    font-size: 11px;
    padding: 8px 4px;
  }
  .ls-standings-team-cell {
    min-width: 130px;
  }
}
