@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800&family=Barlow:wght@400;500;600&display=swap');

.fs-widget, .fs-widget * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Barlow', sans-serif;
  -webkit-font-smoothing: antialiased;
}
.fs-widget button { cursor: pointer; border: none; background: none; font-family: inherit; }
.fs-widget img { display: block; }
.fs-widget table { border-collapse: collapse; }

.fs-widget {
  background: #0d0f14;
  color: #e8eaf0;
  max-width: 900px;
  margin: 0 auto 2rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  font-size: 13px;
  line-height: 1.4;
}

/* Controls */
.fs-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: #161a22;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.fs-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6b7280;
  margin-bottom: 4px;
  font-weight: 600;
  font-family: 'Barlow Condensed', sans-serif;
}
.fs-season-select {
  background: #1e2430;
  border: 1px solid rgba(255,255,255,0.07);
  color: #e8eaf0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  min-width: 130px;
}
.fs-season-select:focus { border-color: #00ff87; }

/* Tabs */
.fs-tabs {
  display: flex;
  background: #161a22;
  border-bottom: 2px solid rgba(255,255,255,0.07);
  overflow-x: auto;
  scrollbar-width: none;
}
.fs-tabs::-webkit-scrollbar { display: none; }

.fs-tab {
  flex: 1;
  min-width: 110px;
  padding: 11px 14px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
  white-space: nowrap;
  justify-content: center;
}
.fs-tab:hover { color: #e8eaf0; background: rgba(255,255,255,0.03); }
.fs-tab.is-active {
  color: #fff;
  border-bottom-color: #00ff87;
  background: rgba(255,255,255,0.04);
}
.fs-tab-flag {
  font-size: 20px;
  line-height: 1;
  display: inline-block;
}
.fs-tab[data-code="PL"] .fs-tab-flag {
  transform: scale(1.35);
  transform-origin: center;
  display: inline-block;
}

/* Panel */
.fs-panel { display: none; }
.fs-panel.is-active { display: block; }

.fs-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
}
.fs-panel-flag { font-size: 22px; line-height: 1; }
.fs-panel-info { flex: 1; }
.fs-panel-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  margin: 0;
}
.fs-panel-season { font-size: 11px; color: rgba(255,255,255,0.55); }
.fs-matchday {
  background: rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}

/* Table */
.fs-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.fs-table thead tr { background: #161a22; }
.fs-table thead th {
  padding: 8px 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #6b7280;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.fs-table thead th.fs-col-team { text-align: left; padding-left: 14px; }

.fs-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.12s;
}
.fs-table tbody tr:last-child { border-bottom: none; }
.fs-table tbody tr:hover { background: rgba(255,255,255,0.03); }

.fs-table tbody td {
  padding: 8px 10px;
  text-align: center;
  white-space: nowrap;
  color: #6b7280;
}

/* Zone */
.fs-table tbody tr.zone-cl { border-left: 3px solid #1a6eff; }
.fs-table tbody tr.zone-el { border-left: 3px solid #ff8800; }
.fs-table tbody tr.zone-rel { border-left: 3px solid #e03131; }

/* Position badge */
.fs-col-pos { width: 40px; }
.fs-pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255,255,255,0.06);
  color: #6b7280;
}
.zone-cl .fs-pos-badge { background: rgba(26,110,255,0.18); color: #5a9eff; }
.zone-el .fs-pos-badge { background: rgba(255,136,0,0.18); color: #ffaa44; }
.zone-rel .fs-pos-badge { background: rgba(224,49,49,0.18); color: #ff6b6b; }

/* Team cell */
.fs-col-team { text-align: left !important; min-width: 160px; padding-left: 14px !important; }
.fs-team-cell { display: flex; align-items: center; gap: 9px; }
.fs-crest { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.fs-team-name { font-weight: 600; font-size: 13px; color: #e8eaf0; }

/* Stats */
.fs-col-num { min-width: 30px; font-size: 12.5px; }
.fs-col-pts { min-width: 36px; }
.fs-col-pts strong { color: #fff; font-size: 14px; font-weight: 800; }
.positive { color: #4ade80 !important; }
.negative { color: #f87171 !important; }

/* Form */
.fs-col-form { min-width: 80px; }
.fs-form-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  margin: 0 1px;
  font-family: 'Barlow Condensed', sans-serif;
}
.fs-form-dot.w { background: rgba(74,222,128,0.2); color: #4ade80; }
.fs-form-dot.d { background: rgba(250,204,21,0.2); color: #facc15; }
.fs-form-dot.l { background: rgba(248,113,113,0.2); color: #f87171; }

/* Legend */
.fs-legend {
  display: flex;
  gap: 20px;
  padding: 8px 16px;
  background: #161a22;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-wrap: wrap;
}
.fs-legend-item { font-size: 11px; color: #6b7280; }
.fs-legend-item.cl { color: #5a9eff; }
.fs-legend-item.el { color: #ffaa44; }
.fs-legend-item.rel { color: #ff6b6b; }

/* Error / Loading */
.fs-error {
  display: flex; flex-direction: column; align-items: center;
  padding: 48px 20px; gap: 10px; color: #6b7280; text-align: center;
}
.fs-error span { font-size: 36px; }
.fs-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; color: #6b7280; gap: 12px;
}
.fs-spinner {
  width: 24px; height: 24px;
  border: 2px solid rgba(255,255,255,0.07);
  border-top-color: #00ff87;
  border-radius: 50%;
  animation: fs-spin 0.7s linear infinite;
}
@keyframes fs-spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 600px) {
  .fs-tab-name { display: none; }
  .fs-tab { min-width: 60px; }
  .fs-col-form { display: none; }
  .fs-table thead th:nth-child(7),
  .fs-table tbody td:nth-child(7),
  .fs-table thead th:nth-child(8),
  .fs-table tbody td:nth-child(8) { display: none; }
}
