:root {
  --bg: #0b1220;
  --bg-soft: #101a2e;
  --card: #141f38;
  --card-hover: #18274499;
  --border: #223050;
  --text: #e8eefc;
  --text-dim: #93a4c3;
  --text-faint: #5f7397;
  --accent: #00ff87;
  --accent-dim: #00c96b;
  --blue: #4f8cff;
  --purple: #a97bff;
  --orange: #ffb02e;
  --red: #ff5c72;
  --pink: #ff6bb5;
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(79, 140, 255, .10), transparent 60%),
    radial-gradient(900px 420px at 0% 0%, rgba(0, 255, 135, .06), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 18, 32, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(0,255,135,.16), rgba(79,140,255,.16));
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.brand-logo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand h1 { font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.brand-sub { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }

.badge {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}
.badge-season { color: var(--accent); border-color: rgba(0,255,135,.35); }
.badge-live {
  color: var(--orange);
  border-color: rgba(255,176,46,.4);
}
.badge-live.done { color: var(--accent); border-color: rgba(0,255,135,.4); }

.update-info { display: flex; align-items: center; gap: 10px; color: var(--text-faint); font-size: 12.5px; }

/* ---------- buttons & inputs ---------- */
.btn {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: all .18s;
}
.btn:hover { border-color: var(--accent-dim); color: var(--accent); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-dim), #00a854);
  border: none;
  color: #04120a;
  font-weight: 700;
}
.btn-primary:hover { filter: brightness(1.1); color: #04120a; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--bg-soft); }

.select, .input {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  min-width: 0;
}
.select:focus, .input:focus { border-color: var(--blue); }

/* ---------- tabs ---------- */
.tabs {
  max-width: 1200px;
  margin: 18px auto 0;
  padding: 0 20px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}
.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  padding: 9px 16px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  font-size: 14.5px;
  white-space: nowrap;
  transition: all .18s;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); background: var(--card-hover); }
.tab.active {
  color: var(--accent);
  background: var(--card);
  border-color: var(--border);
  border-bottom-color: var(--accent);
}

/* ---------- layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 18px 20px 60px; }
.tabpanel { display: none; }
.tabpanel.active { display: block; animation: fadeUp .28s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.grid { display: grid; gap: 14px; }
.kpi-row { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 14px; }

.panel {
  background: linear-gradient(180deg, var(--card), rgba(20, 31, 56, .72));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.panel-head h2 { font-size: 16.5px; font-weight: 700; }
.panel-sub { color: var(--text-faint); font-size: 12.5px; font-weight: 400; margin-left: 6px; }

/* ---------- KPI cards ---------- */
.kpi {
  background: linear-gradient(180deg, var(--card), rgba(20, 31, 56, .72));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.kpi.k-blue::before { background: linear-gradient(90deg, var(--blue), transparent); }
.kpi.k-orange::before { background: linear-gradient(90deg, var(--orange), transparent); }
.kpi.k-purple::before { background: linear-gradient(90deg, var(--purple), transparent); }
.kpi.k-red::before { background: linear-gradient(90deg, var(--red), transparent); }
.kpi-label { color: var(--text-dim); font-size: 12.5px; }
.kpi-value { font-size: 26px; font-weight: 800; margin-top: 2px; }
.kpi-extra { color: var(--text-faint); font-size: 12px; margin-top: 2px; }

/* ---------- matches ---------- */
.match-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.match-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}
.match-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.match-side.right { align-items: flex-end; text-align: right; }
.match-team { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-manager { color: var(--text-faint); font-size: 11.5px; }
.match-score {
  font-size: 20px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.match-side.winner .match-team { color: var(--accent); }
.match-score .w { color: var(--accent); }

/* ---------- dream team pitch ---------- */
.pitch-wrap { overflow-x: auto; padding: 4px 0; }
.fpl-perspective-field {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 7%, rgba(70, 136, 98, .28), transparent 43%),
    linear-gradient(180deg, #081b13 0%, #0a2418 48%, #06150f 100%);
}
.fpl-field-edge,
.fpl-field-surface {
  position: absolute;
  inset: 12px 2.5% 0;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
}
.fpl-field-edge { background: rgba(235, 255, 244, .75); filter: drop-shadow(0 16px 24px rgba(0,0,0,.28)); }
.fpl-field-surface {
  inset: 14px 2.8% 2px;
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,.035) 50%, transparent),
    repeating-linear-gradient(0deg, #1f8a57 0 52px, #18794b 52px 104px);
}
.fpl-field-line { position: absolute; z-index: 1; border-color: rgba(245,255,250,.58); pointer-events: none; }
.fpl-halfway-line { top: 51%; left: 8.5%; right: 8.5%; border-top: 1px solid rgba(245,255,250,.62); }
.fpl-center-circle { top: 44.5%; left: 41%; width: 18%; height: 13%; border: 1px solid rgba(245,255,250,.58); border-radius: 50%; }
.fpl-box-far { top: 13px; left: 35%; width: 30%; height: 12%; border: 1px solid rgba(245,255,250,.56); border-top: 0; clip-path: polygon(9% 0, 91% 0, 100% 100%, 0 100%); }
.fpl-goal-far { top: 13px; left: 43%; width: 14%; height: 5.5%; border: 1px solid rgba(245,255,250,.5); border-top: 0; }
.fpl-box-near { left: 20%; bottom: 1px; width: 60%; height: 17%; border: 1px solid rgba(245,255,250,.58); border-bottom: 0; clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%); }
.fpl-goal-near { left: 38%; bottom: 1px; width: 24%; height: 7%; border: 1px solid rgba(245,255,250,.52); border-bottom: 0; }
.pitch {
  min-width: 640px;
  height: 600px;
  background: #071a12;
  border: 1px solid rgba(0,255,135,.25);
  border-radius: 12px;
  padding: 25px 22px 8px;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: 0;
  position: relative;
  overflow: hidden;
}
.pitch-row { display: flex; align-items: center; justify-content: space-evenly; gap: 8px; flex-wrap: nowrap; position: relative; z-index: 2; }
.dt-card {
  width: 105px;
  flex: 0 0 105px;
  padding: 1px 3px 2px;
  text-align: center;
  position: relative;
}
.dt-kit {
  height: 72px;
  display: grid;
  place-items: center;
  position: relative;
  filter: drop-shadow(0 7px 7px rgba(0, 0, 0, .38));
}
.dt-kit-img { width: 58px; height: 76px; object-fit: contain; }
.dt-kit-fallback {
  display: none;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .28);
  font-size: 18px;
  font-weight: 800;
  color: #04120a;
}
.dt-kit.kit-error .dt-kit-img { display: none; }
.dt-kit.kit-error .dt-kit-fallback { display: grid; }
.pos-photo-GKP { background: linear-gradient(135deg, #ffb02e, #ff8a00) !important; color: #221200 !important; }
.pos-photo-DEF { background: linear-gradient(135deg, #4f8cff, #2960e8) !important; color: #0a1638 !important; }
.pos-photo-MID { background: linear-gradient(135deg, #a97bff, #7c4dff) !important; color: #1c0d40 !important; }
.pos-photo-FWD { background: linear-gradient(135deg, #ff5c72, #ff2d4a) !important; color: #2a070d !important; }
.dt-nameplate {
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 5px 12px rgba(0, 0, 0, .32);
  border: 1px solid rgba(255, 255, 255, .2);
  margin-top: -3px;
}
.dt-name {
  min-height: 25px;
  display: grid;
  place-items: center;
  padding: 4px 4px 3px;
  background: #f5fff9;
  color: #07150d;
  font-weight: 800;
  font-size: 11.5px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dt-score {
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  color: #04120a;
  font-size: 10.5px;
  line-height: 1;
  padding: 4px 3px;
}
.dt-score strong { font-size: 13px; }
.dt-meta { color: rgba(232, 238, 252, .72); font-size: 10px; margin-top: 3px; line-height: 1.2; }
.dt-owner {
  font-size: 10.5px;
  color: #7eb0ff;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dt-owner.free { color: var(--red); }
.dt-note { color: var(--text-faint); font-size: 12px; margin-top: 10px; }

/* ---------- transactions ---------- */
.tx-summary { display: grid; gap: 10px; }
.tx-group {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}
.tx-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.tx-manager { font-weight: 700; font-size: 14px; }
.tx-count { color: var(--text-faint); font-size: 12px; }
.tx-rows { display: grid; gap: 6px; }
.tx-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  padding: 6px 10px;
  background: rgba(20,31,56,.45);
  border-radius: 8px;
}
.tx-arrow { color: var(--text-faint); }
.tx-in { color: var(--accent); font-weight: 600; }
.tx-out { color: var(--red); font-weight: 600; }
.tx-meta { color: var(--text-faint); font-size: 11.5px; }
.tx-kind {
  font-size: 10.5px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.tx-kind.kind-t { color: var(--purple); border-color: rgba(169,123,255,.4); }
.tx-kind.kind-w { color: var(--blue); border-color: rgba(79,140,255,.4); }
.tx-status.denied { color: var(--red); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  color: var(--text-faint);
  font-weight: 600;
  font-size: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 9px 10px; border-bottom: 1px solid rgba(34,48,80,.5); white-space: nowrap; }
.table tbody tr { cursor: pointer; transition: background .15s; }
.table tbody tr:hover { background: var(--card-hover); }
.ta-c { text-align: center; }
.ta-r { text-align: right; }
/* Table headers and body cells must respect the same explicit column alignment. */
.table th.ta-r, .table td.ta-r { text-align: right; }
.table th.ta-c, .table td.ta-c { text-align: center; }
.rank-cell { font-weight: 800; color: var(--text-dim); }
.rank-1 .rank-cell { color: #ffd54a; }
.rank-2 .rank-cell { color: #cfd8e8; }
.rank-3 .rank-cell { color: #e0a370; }
.team-cell { display: flex; flex-direction: column; }
.team-name { font-weight: 700; }
.team-manager { color: var(--text-faint); font-size: 11.5px; }
.pos-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.pos-GKP { background: rgba(255,176,46,.15); color: var(--orange); }
.pos-DEF { background: rgba(79,140,255,.15); color: var(--blue); }
.pos-MID { background: rgba(169,123,255,.15); color: var(--purple); }
.pos-FWD { background: rgba(255,92,114,.15); color: var(--red); }
.table-note { color: var(--text-faint); font-size: 12px; margin-top: 10px; }
.form-dots { display: inline-flex; gap: 3px; }
.form-dot { width: 18px; height: 18px; border-radius: 6px; font-size: 10px; font-weight: 700; display: inline-grid; place-items: center; }
.form-dot.g { background: rgba(0,255,135,.18); color: var(--accent); }
.form-dot.r { background: rgba(255,92,114,.18); color: var(--red); }
.form-dot.n { background: rgba(95,115,151,.18); color: var(--text-faint); }
.trend-up { color: var(--accent); }
.trend-down { color: var(--red); }
.trend-flat { color: var(--text-faint); }

/* ---------- sort switch ---------- */
.sort-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.sort-btn {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all .15s;
}
.sort-btn.active { color: var(--accent); border-color: rgba(0,255,135,.45); background: rgba(0,255,135,.08); }

/* ---------- compare ---------- */
.compare-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.compare-controls .select { max-width: 220px; }
.btn-swap { padding: 8px 12px; }
.cmp-view-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(11, 18, 32, .62);
}
.cmp-view-btn {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-faint);
  padding: 5px 10px;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.cmp-view-btn.active { background: rgba(0, 255, 135, .13); color: var(--accent); }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .cmp-grid { grid-template-columns: 1fr; } }
.cmp-side {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.cmp-side-title { display: grid; gap: 9px; margin-bottom: 10px; }
.cmp-side-title h3 { font-size: 15px; }
.cmp-team-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cmp-formation { color: var(--accent); font-size: 10.5px; white-space: nowrap; }
.cmp-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  color: var(--text-faint);
  font-size: 11px;
}
.cmp-stat {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 6px;
  padding: 7px 9px;
  background: rgba(20,31,56,.55);
  border: 1px solid rgba(34,48,80,.6);
  border-radius: 8px;
  min-width: 0;
}
.cmp-stat-label { white-space: nowrap; }
.cmp-stat b { color: var(--text); text-align: right; font-size: 12px; white-space: nowrap; }
@media (max-width: 520px) {
  .cmp-stat { grid-template-columns: 1fr; gap: 2px; }
  .cmp-stat b { text-align: left; }
}
.squad-list { display: grid; gap: 4px; }
.squad-row {
  display: grid;
  grid-template-columns: 54px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(20,31,56,.5);
  font-size: 13px;
}
.squad-row.bench { opacity: .62; }
.squad-pos { font-size: 10.5px; }
.squad-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.squad-name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.squad-name .tm { color: var(--text-faint); font-size: 11px; }
.squad-alert { color: var(--orange); font-weight: 800; font-size: 10.5px; }
.squad-cost { color: var(--text-dim); font-size: 12px; }
.squad-pts { font-weight: 700; font-size: 12.5px; color: var(--text-dim); }
.cmp-pitch-scroll { overflow-x: auto; padding-bottom: 2px; }
.cmp-pitch {
  min-width: 430px;
  height: 440px;
  padding: 16px 8px 4px;
  border: 1px solid rgba(0, 255, 135, .28);
  border-radius: 11px;
  background: #071a12;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: 0;
  position: relative;
  overflow: hidden;
}
.cmp-pitch-row {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 4px;
  position: relative;
  z-index: 2;
}
.cmp-pitch-player { width: 78px; flex: 0 0 78px; text-align: center; position: relative; }
.cmp-kit { height: 52px; display: grid; place-items: center; position: relative; filter: drop-shadow(0 5px 5px rgba(0,0,0,.38)); }
.cmp-kit-img { width: 40px; height: 53px; object-fit: contain; }
.cmp-kit-fallback {
  display: none;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  color: #04120a;
}
.cmp-kit.kit-error .cmp-kit-img { display: none; }
.cmp-kit.kit-error .cmp-kit-fallback { display: grid; }
.cmp-player-alert {
  position: absolute;
  top: 1px;
  right: 12px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--orange);
  color: #251500;
  font-size: 10px;
  font-weight: 900;
  line-height: 15px;
}
.cmp-player-plate {
  margin-top: -2px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 4px 9px rgba(0,0,0,.3);
}
.cmp-player-name {
  padding: 3px 3px 2px;
  background: #f5fff9;
  color: #07150d;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmp-player-scores {
  display: flex;
  justify-content: space-around;
  gap: 2px;
  padding: 3px 2px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  color: #04120a;
  font-size: 8px;
  line-height: 1;
  white-space: nowrap;
}
.cmp-player-scores b { font-size: 9.5px; }
.cmp-bench-area {
  margin-top: 9px;
  padding: 7px 6px 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(11,18,32,.68);
}
.cmp-bench-label {
  display: flex;
  justify-content: space-between;
  margin: 0 4px 5px;
  color: var(--text-faint);
  font-size: 9.5px;
}
.cmp-bench { display: flex; justify-content: space-evenly; gap: 5px; min-height: 86px; }
.cmp-bench .cmp-pitch-player { width: 70px; flex-basis: 70px; }
.cmp-bench .cmp-kit { height: 46px; }
.cmp-bench .cmp-kit-img { width: 36px; height: 48px; }
.cmp-bench .cmp-player-name { font-size: 9px; }
.radar-wrap { margin-top: 14px; }
.cmp-verdict {
  margin-top: 14px;
  background: rgba(79,140,255,.07);
  border: 1px solid rgba(79,140,255,.3);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text-dim);
}
.cmp-verdict b { color: var(--text); }
.cmp-verdict .win { color: var(--accent); font-weight: 700; }

/* ---------- predict ---------- */
.predict-list { display: grid; gap: 10px; }
.pred-row {
  display: grid;
  grid-template-columns: 1fr 120px 120px 1fr;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}
@media (max-width: 760px) {
  .pred-row { grid-template-columns: 1fr; text-align: center; }
  .pred-row .pred-bar-zone { order: 5; }
}
.pred-side { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pred-side.right { align-items: flex-end; text-align: right; }
.pred-team { font-weight: 700; font-size: 13.5px; }
.pred-pts { font-size: 11.5px; color: var(--text-faint); }
.pred-est { text-align: center; font-weight: 800; font-size: 17px; }
.pred-winprob { text-align: center; font-size: 11.5px; color: var(--text-faint); }
.pred-bar-zone { grid-column: 1 / -1; }
.pred-bar { height: 6px; border-radius: 3px; background: var(--card); overflow: hidden; display: flex; }
.pred-bar-fill { height: 100%; transition: width .5s ease; }
.chart-box { position: relative; height: 300px; }
.chart-box.chart-half { height: 340px; }

/* ---------- trade evaluator ---------- */
.trade-intro { color: var(--text-dim); font-size: 13px; margin-bottom: 14px; }
.trade-grid { display: grid; grid-template-columns: 1fr 60px 1fr; gap: 10px; align-items: start; }
@media (max-width: 760px) { .trade-grid { grid-template-columns: 1fr; } .trade-vs { display: flex; justify-content: center; padding: 6px 0; } }
.trade-side { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.trade-side-title { font-size: 13.5px; font-weight: 700; margin-bottom: 8px; color: var(--text-dim); }
.player-picker { position: relative; }
.picker-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: #101a2e;
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 30;
  display: none;
  box-shadow: var(--shadow);
}
.picker-results.open { display: block; }
.pick-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid rgba(34,48,80,.4);
}
.pick-opt:hover { background: var(--card-hover); }
.pick-opt .nm { font-weight: 600; }
.pick-opt .sub { color: var(--text-faint); font-size: 11px; }
.pick-opt .cost { color: var(--text-dim); font-size: 12px; margin-left: auto; white-space: nowrap; }
.picked-list { display: grid; gap: 5px; margin-top: 10px; min-height: 46px; }
.picked-row {
  display: grid;
  grid-template-columns: 54px 1fr auto auto;
  gap: 8px;
  align-items: center;
  background: rgba(20,31,56,.5);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 13px;
}
.picked-row .rm {
  border: none; background: none; color: var(--red); cursor: pointer; font-size: 14px; padding: 2px 4px;
}
.trade-vs { display: grid; place-items: center; padding-top: 40px; }
.vs-badge {
  font-weight: 800;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--card);
}
.trade-verdict-card {
  margin-top: 14px;
  border-radius: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}
.verdict-score {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.verdict-badge {
  font-size: 14px; font-weight: 800;
  padding: 6px 16px;
  border-radius: 999px;
}
.v-good { background: rgba(0,255,135,.13); color: var(--accent); border: 1px solid rgba(0,255,135,.4); }
.v-even { background: rgba(255,176,46,.12); color: var(--orange); border: 1px solid rgba(255,176,46,.4); }
.v-bad { background: rgba(255,92,114,.12); color: var(--red); border: 1px solid rgba(255,92,114,.4); }
.verdict-diff { font-size: 13px; color: var(--text-dim); }
.trade-cmp-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.trade-cmp-table th, .trade-cmp-table td { padding: 6px 10px; text-align: center; border-bottom: 1px solid rgba(34,48,80,.5); }
.trade-cmp-table th:first-child, .trade-cmp-table td:first-child { text-align: left; color: var(--text-faint); }
.trade-cmp-table td { font-variant-numeric: tabular-nums; }
.trade-cmp-table .better { color: var(--accent); font-weight: 700; }
.trade-cmp-table .worse { color: var(--red); }
.trade-reasons { margin-top: 10px; display: grid; gap: 5px; }
.trade-reasons li { list-style: none; font-size: 13px; color: var(--text-dim); padding-left: 18px; position: relative; }
.trade-reasons li::before { content: "▸"; position: absolute; left: 4px; color: var(--blue); }
.trade-reasons li.risk::before { content: "!"; color: var(--orange); font-weight: 800; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(4, 8, 16, .7);
  backdrop-filter: blur(4px);
  display: none;
  place-items: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop.open { display: grid; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(560px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15.5px; }
.modal-body { padding: 14px 18px; overflow-y: auto; }
.modal-stats { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; color: var(--text-dim); font-size: 12.5px; }
.modal-stats b { color: var(--text); }

/* ---------- footer ---------- */
.footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 20px 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
}
.feedback-link {
  appearance: none;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.feedback-link:hover { color: var(--accent); }
.feedback-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.feedback-dialog {
  width: min(calc(100% - 28px), 430px);
  max-height: min(90vh, 760px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: transparent;
  color: #17251f;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .4);
}
.feedback-dialog::backdrop { background: rgba(4, 14, 10, .72); backdrop-filter: blur(5px); }
.feedback-dialog-card { position: relative; padding: 22px; background: #fff; }
.feedback-dialog-close {
  appearance: none;
  position: absolute;
  z-index: 1;
  top: 13px;
  right: 13px;
  width: 34px;
  height: 34px;
  border: 1px solid #dce8e1;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  color: #284237;
  font: 400 24px/1 sans-serif;
  cursor: pointer;
}
.feedback-dialog-copy { padding-right: 36px; }
.feedback-dialog-kicker { color: #087a4e; font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.feedback-dialog-copy h2 { margin: 5px 0 4px; color: #15271f; font-size: 25px; }
.feedback-dialog-copy p { margin: 0 0 16px; color: #64756e; font-size: 12.5px; line-height: 1.6; }
.feedback-dialog-card > img { display: block; width: 100%; max-height: 62vh; border: 1px solid #e2ebe7; border-radius: 12px; object-fit: contain; }

/* misc */
.legend { display: flex; gap: 14px; color: var(--text-faint); font-size: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-free { background: var(--red); }
.loading { text-align: center; color: var(--text-faint); padding: 60px 0; font-size: 14px; }
.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--card) 50%, var(--bg-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
  color: transparent;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- GW slicer (report tab) ---------- */
.gw-slicer-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--card), rgba(20, 31, 56, .72));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.gw-slicer-label { font-size: 12.5px; color: var(--text-faint); white-space: nowrap; }
.gw-slicer { flex: 1; }

/* ---------- trade picker position chips + ownership tag ---------- */
.picker-pos {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 6px 2px 2px;
}
.picker-pos .sort-btn { padding: 3px 9px; font-size: 11.5px; }
.pick-opt .own-tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  margin-left: auto;
}
.own-tag.mine { color: var(--accent); border: 1px solid rgba(0,255,135,.4); background: rgba(0,255,135,.08); }
.own-tag.ok { color: #6db3f2; border: 1px solid rgba(109,179,242,.4); background: rgba(109,179,242,.08); }
.own-tag.warn { color: #ffb347; border: 1px solid rgba(255,179,71,.45); background: rgba(255,179,71,.08); }

/* ---------- trend player selector ---------- */
.trend-select {
  max-width: 240px;
  padding: 5px 10px;
  font-size: 12.5px;
}

/* ---------- trade center ---------- */
.panel-head-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.panel-head-controls .trend-select { max-width: 150px; }
.net-pos { color: var(--accent); }
.net-neg { color: var(--red); }
#tcEvalTable .table { margin-top: 4px; }
#tcEvalTable .tx-arrow { color: var(--text-faint); }
#tcEvalTable .tx-in { color: var(--accent); }
#tcEvalTable .tx-out { color: var(--red); }

/* ---------- free agent market ---------- */
.free-agent-head { align-items: flex-start; }
.free-agent-lede { color: var(--text-faint); font-size: 12.5px; margin-top: 4px; }
.free-agent-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.free-agent-filters .input { width: 220px; }
.free-agent-filters .select { min-width: 138px; }
.free-agent-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 0 14px;
  border-top: 1px solid var(--border);
}
.free-agent-table th,
.free-agent-table td { vertical-align: middle; }
.free-agent-table tbody tr { cursor: default; }
.fa-player { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.fa-kit {
  width: 38px;
  height: 46px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  position: relative;
  filter: drop-shadow(0 4px 5px rgba(0,0,0,.25));
}
.fa-kit-img { width: 34px; height: 44px; object-fit: contain; }
.fa-kit-fallback {
  display: none;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  color: #06120c;
}
.fa-kit.kit-error .fa-kit-img { display: none; }
.fa-kit.kit-error .fa-kit-fallback,
.fa-kit:not(:has(.fa-kit-img)) .fa-kit-fallback { display: grid; }
.fa-player-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fa-player-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fa-player-copy span { color: var(--text-faint); font-size: 11.5px; }
.fa-status {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.fa-status.available { color: var(--accent); border-color: rgba(0,255,135,.32); background: rgba(0,255,135,.08); }
.fa-status.doubtful { color: var(--orange); border-color: rgba(255,176,46,.36); background: rgba(255,176,46,.09); }
.fa-status.injured,
.fa-status.suspended { color: var(--red); border-color: rgba(255,92,114,.36); background: rgba(255,92,114,.09); }
.fa-status.unavailable { color: var(--text-faint); background: rgba(95,115,151,.10); }
.fa-ep { color: var(--accent); font-size: 14px; }
.fa-empty { padding: 42px 12px; text-align: center; color: var(--text-faint); }
.free-agent-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 16px;
  color: var(--text-faint);
  font-size: 12px;
}
.free-agent-pager .btn:disabled { opacity: .38; cursor: not-allowed; }

@media (max-width: 760px) {
  .free-agent-filters { width: 100%; justify-content: stretch; }
  .free-agent-filters .input { width: 100%; }
  .free-agent-filters .select { flex: 1 1 140px; }
  .free-agent-toolbar { align-items: flex-start; flex-direction: column; }
}

/* ---------- squad share card ---------- */
.share-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 18px;
  align-items: start;
}
.share-editor-panel,
.share-preview-panel { min-width: 0; }
.share-preview-panel { position: sticky; top: 16px; }
.share-lede { margin-top: 5px; color: var(--text-faint); font-size: 12.5px; line-height: 1.55; }
.share-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 2px 0 14px;
  padding: 11px 0;
  border-block: 1px solid var(--border);
}
.share-legend { display: flex; align-items: center; gap: 16px; color: var(--text-muted); font-size: 12px; font-weight: 700; }
.share-legend span { display: inline-flex; align-items: center; gap: 6px; }
.share-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
.share-dot.tradable { background: var(--accent); }
.share-dot.locked { background: var(--purple); }
.share-squad-pitch-shell { display: grid; gap: 10px; }
.share-pitch-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}
.share-pitch-meta small { color: var(--text-faint); font-size: 10.5px; letter-spacing: 0; }
.share-pitch-scroll { overflow-x: auto; padding-bottom: 4px; border-radius: 14px; scrollbar-width: thin; }
.share-editor-pitch {
  position: relative;
  min-width: 620px;
  height: 540px;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: 0;
  padding: 18px 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 14px 14px 0 0;
  background: #071a12;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.share-pitch-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 3px;
}
.share-player-card {
  appearance: none;
  width: 106px;
  min-width: 0;
  min-height: 104px;
  display: grid;
  grid-template-rows: 62px auto auto;
  justify-items: center;
  align-content: end;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #17251f;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.share-player-card:hover { transform: translateY(-3px); filter: brightness(1.04); }
.share-player-card:focus-visible { outline: 3px solid rgba(0,255,135,.28); outline-offset: 2px; }
.share-player-card.locked { color: white; }
.share-kit {
  width: 58px;
  height: 64px;
  position: relative;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 5px 6px rgba(0,0,0,.28));
}
.share-kit-img { width: 54px; height: 62px; object-fit: contain; }
.share-kit-fallback {
  display: none;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  color: #06120c;
  font-size: 13px;
  font-weight: 900;
}
.share-kit.kit-error .share-kit-img { display: none; }
.share-kit.kit-error .share-kit-fallback,
.share-kit:not(:has(.share-kit-img)) .share-kit-fallback { display: grid; }
.share-lock-badge {
  position: absolute;
  top: 1px;
  right: -17px;
  padding: 3px 6px;
  border: 2px solid white;
  border-radius: 999px;
  background: #5c2470;
  color: white;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.share-player-name,
.share-player-score {
  width: 100%;
  overflow: hidden;
  padding: 4px 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-player-name { border-radius: 5px 5px 0 0; background: white; font-size: 11px; font-weight: 900; }
.share-player-score { border-radius: 0 0 5px 5px; background: #eaf2ee; color: #456157; font-size: 9px; }
.share-player-score b { color: #174a35; font-size: 10px; }
.share-player-card.locked .share-player-name { background: #5c2470; color: white; }
.share-player-card.locked .share-player-score { background: #3b164a; color: #ead9f0; }
.share-player-card.locked .share-player-score b { color: white; }
.share-bench-area {
  min-width: 620px;
  padding: 12px 22px 15px;
  border: 1px solid #24372f;
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: #13251e;
}
.share-bench-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: #d8e6df; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.share-bench-head small { color: #829d91; font-size: 9px; letter-spacing: 0; }
.share-bench-row { display: grid; grid-template-columns: repeat(4, 106px); justify-content: space-evenly; gap: 8px; }
.share-message-label { display: block; margin-top: 18px; }
.share-message { width: 100%; min-height: 78px; margin-top: 7px; resize: vertical; line-height: 1.55; }
.share-canvas-shell {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #dce8e1;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
}
.share-canvas-shell canvas { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; }
.share-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 13px; }
.share-actions .btn { justify-content: center; padding-inline: 8px; }
.share-feedback { min-height: 20px; margin-top: 10px; color: var(--accent); font-size: 12px; font-weight: 700; }
.share-feedback.error { color: var(--red); }

@media (max-width: 1040px) {
  .share-layout { grid-template-columns: 1fr; }
  .share-preview-panel { position: static; width: min(100%, 520px); margin-inline: auto; }
}

@media (max-width: 620px) {
  .share-editor-panel .panel-head { align-items: flex-start; flex-direction: column; }
  .share-editor-panel .panel-head .select { width: 100%; }
  .share-toolbar { align-items: flex-start; flex-direction: column; }
  .share-pitch-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
  .share-actions { grid-template-columns: 1fr 1fr; }
}
