/* ============================================================
   FPLMan redesign — Fixtures per-screen styles
   Ported from the handoff fixtures.css and adapted to the live
   data: a day-grouped match list (left) + an HTMX-swapped featured
   match panel (right) with scoreboard, top returns and stat tables.
   Layers on top of redesign.css.
   ============================================================ */

/* overall layout */
.fx-grid { display: grid; grid-template-columns: 352px minmax(0, 1fr); gap: 30px; align-items: start; }
@media (max-width: 1080px) { .fx-grid { grid-template-columns: 1fr; } }

.fx-empty { padding: 64px 20px; text-align: center; color: var(--text-3); font-size: 14px; }

/* ---------- left: fixture list ---------- */
.fx-list { display: flex; flex-direction: column; gap: 6px; }
.gw-panel { display: none; }
.gw-panel.active { display: block; }
.fx-day {
  font-size: 11.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
  color: var(--text-3); margin: 18px 4px 9px;
}
.fx-day:first-child { margin-top: 0; }

.fixture-card-link { display: block; color: inherit; }
.match {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.match:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.fixture-card-link.selected .match { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-tint), var(--shadow-sm); }

.match-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.mt-team { display: flex; align-items: center; gap: 9px; min-width: 0; }
.mt-team.away { flex-direction: row-reverse; text-align: right; }
.mt-kit { flex-shrink: 0; display: grid; place-items: center; }
.mt-name { flex: 1 1 auto; min-width: 0; font-size: 14.5px; font-weight: 700; letter-spacing: -.01em;
  line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-name.loser { color: var(--text-3); font-weight: 600; }
.mt-score { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0 4px; }
.mt-score .sc { font-family: var(--mono); font-size: 21px; font-weight: 700; letter-spacing: .02em; line-height: 1; white-space: nowrap; }
.mt-score .sc .d { color: var(--text-4); margin: 0 3px; font-weight: 600; }
.mt-score .ft { font-size: 9.5px; font-weight: 700; letter-spacing: .1em; color: var(--text-3); }
.mt-score .vs { font-size: 13px; font-weight: 600; color: var(--text-3); }

/* strength dots */
.match-mid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 8px; }
.dots5 { display: flex; gap: 4px; }
.dots5.dots-away { justify-content: flex-end; }
.dots5 .d5 { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.d5.red { background: var(--red); }
.d5.amber { background: var(--amber); }
.d5.green { background: var(--green); }

/* win probability (upcoming) */
.match-prob { margin-top: 11px; display: flex; flex-direction: column; gap: 5px; }
.match-prob .track { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.match-prob .track span { display: block; height: 100%; }
.match-prob .lbl { text-align: center; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.seg-green { background: var(--green); }
.seg-red { background: var(--red); }
.seg-neutral { background: var(--border-strong); }

/* notable picks (upcoming) */
.notables { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 12px;
  border-top: 1px solid var(--border); padding-top: 11px; }
.notable { display: flex; align-items: center; gap: 6px; min-width: 0; }
.notable.away { flex-direction: row-reverse; text-align: right; }
.notable .notable-name { font-size: 12.5px; font-weight: 600; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ntag { font-size: 9px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 999px;
  flex-shrink: 0; text-transform: uppercase; }
.ntag.captain { background: var(--amber); color: #3a2400; }
.ntag.pod { background: var(--purple-tint); color: var(--purple); }
.ntag.rising { background: var(--green-tint); color: var(--green-deep); }

/* scorers (finished) */
.scorers { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 12px;
  border-top: 1px solid var(--border); padding-top: 11px; }
.sc-col { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.sc-col.away { align-items: flex-end; }
.sc-item { display: flex; align-items: center; gap: 7px; min-width: 0; width: 100%; }
.sc-col.away .sc-item { flex-direction: row-reverse; }
.sc-item .scorer-name { flex: 1 1 auto; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-og { font-size: 9.5px; font-weight: 700; color: var(--text-3); flex-shrink: 0; }
.ico { width: 14px; height: 14px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; }
.ico.goal { background: var(--text); }
.ico.goal::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #fff; }
.ico.assist { border: 1.6px solid var(--text-4); font-size: 8px; font-weight: 800; color: var(--text-3); }

/* ---------- right: featured match ---------- */
.featured { display: flex; flex-direction: column; }
.fixture-detail-panel { transition: opacity .2s; }
.fixture-detail-panel.htmx-request { opacity: .5; }
.fixture-detail-empty-state {
  min-height: 320px; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 32px 20px; color: var(--text-3); font-size: 14px;
  border: 1px dashed var(--border-2); border-radius: var(--radius); background: var(--surface-2);
}
.feat-top { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; margin-bottom: 22px; }
@media (max-width: 880px) { .feat-top { grid-template-columns: 1fr; } .feat-top .rt-scroll { max-height: none; } }

/* scoreboard */
.scoreboard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 26px 18px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
}
.sb-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; }
.sb-team { display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; }
.sb-team .nm { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.sb-fdr { font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; }
.sb-fdr.easy { background: var(--fdr1-bg); color: var(--fdr1-fg); }
.sb-fdr.medium { background: var(--fdr3-bg); color: var(--fdr3-fg); }
.sb-fdr.hard { background: var(--fdr5-bg); color: var(--fdr5-fg); }
.sb-score { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sb-score .nums { font-family: var(--mono); font-size: 38px; font-weight: 700; letter-spacing: .01em; line-height: 1; white-space: nowrap; }
.sb-score .nums .d { color: var(--text-4); font-weight: 600; margin: 0 7px; }
.sb-score .nums.vs { font-size: 22px; color: var(--text-3); }
.sb-score .badge { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; color: var(--green-deep);
  background: var(--green-tint); padding: 4px 10px; border-radius: 999px; }

.sb-goal-line { display: flex; flex-direction: column; align-items: center; gap: 5px;
  border-top: 1px solid var(--border); padding-top: 13px; }
.sb-goal { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-2); }
.sb-goal b { font-weight: 700; color: var(--text); }
.sb-goal .ico { width: 15px; height: 15px; }
.sb-goal .detail { font-weight: 500; color: var(--text-3); font-size: 12.5px; }
.sb-goal .detail::before { content: "·"; margin-right: 7px; color: var(--text-4); }

/* xG / xA compare bars */
.sb-stats { display: flex; flex-direction: column; gap: 13px; }
.cmp { display: flex; flex-direction: column; gap: 6px; }
.cmp-top { display: flex; align-items: center; justify-content: space-between; }
.cmp-top .v { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--text-2); }
.cmp-top .lbl { font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--text-3); }
.cmp-bar { display: flex; height: 7px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.cmp-bar span { display: block; height: 100%; }

.sb-venue { text-align: center; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border); padding-top: 13px; }

/* top-returns panel */
.returns {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px 14px; display: flex; flex-direction: column;
}
.rt-head { margin: 0 2px 8px; }
.rt-head .t { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.rt-scroll { min-height: 0; max-height: var(--rt-cap, none); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
.rt-scroll::-webkit-scrollbar { width: 6px; }
.rt-scroll::-webkit-scrollbar-track { background: transparent; }
.rt-scroll::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 999px; }
.rt-scroll::-webkit-scrollbar-thumb:hover { background: var(--text-4); }
.rt-team { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--border); }
.rt-team:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.rt-team-h { display: flex; align-items: center; gap: 9px; margin: 0 2px 6px; }
.rt-team-h .rt-kit { display: grid; place-items: center; flex-shrink: 0; }
.rt-team-h .nm { font-size: 14.5px; font-weight: 800; letter-spacing: -.01em; }
.rt-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; padding: 6px 2px; }
.rt-rank { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--text-4); text-align: center; }
.rt-mid { min-width: 0; }
.rt-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-detail { font-size: 11px; color: var(--text-3); }
.rt-pts { font-family: var(--mono); font-weight: 700; font-size: 13.5px; color: var(--green-deep); white-space: nowrap; }
.rt-pts .u { font-size: 9.5px; color: var(--text-3); font-weight: 600; margin-left: 3px; }
.rt-empty { padding: 14px 2px; color: var(--text-3); font-size: 13px; }

/* ---------- team stat tables ---------- */
.teamtables { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 1360px) { .teamtables { grid-template-columns: 1fr; } }
.teamcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 18px 14px; min-width: 0;
}
.tc-head { display: flex; align-items: center; gap: 11px; margin: 0 2px 14px; }
.tc-head .nm { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.tc-head .sc { margin-left: auto; font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--text-2); }

.statcols { --grid: 34px minmax(116px, 1.3fr) 26px 16px 16px 20px 18px 18px 28px 26px 36px 36px; }
.st-head, .st-row { display: grid; grid-template-columns: var(--grid); gap: 3px; align-items: center; }
.st-head { padding: 0 2px 9px; border-bottom: 1px solid var(--border); }
.st-head span { font-size: 9.5px; font-weight: 700; letter-spacing: .05em; color: var(--text-3); text-align: center; }
.st-head .pl { text-align: left; grid-column: 1 / 3; padding-left: 2px; }
.st-row { padding: 7px 2px; border-top: 1px solid var(--border); }
.st-row:first-of-type { border-top: none; }
.st-row.sub { opacity: .5; }
.st-pos { font-size: 8.5px; font-weight: 700; letter-spacing: .02em; padding: 2px 0; border-radius: 5px; text-align: center; line-height: 1; }
.st-pos.GK { background: var(--orange-tint); color: #9a6312; }
.st-pos.DEF { background: var(--blue-tint); color: var(--blue); }
.st-pos.MID { background: var(--green-tint); color: var(--green-deep); }
.st-pos.FWD { background: var(--red-tint); color: #b73a4d; }
.st-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.st-name .nm { flex: 1 1 auto; min-width: 0; font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-kit { flex-shrink: 0; display: grid; place-items: center; }
.st-num { font-family: var(--mono); font-size: 12.5px; text-align: center; color: var(--text); font-feature-settings: "tnum" 1; }
.st-num.z { color: var(--text-4); }
.st-num.pts { font-weight: 700; }
.st-num.bon { font-weight: 700; color: var(--purple); }
.st-num.bon.z { color: var(--text-4); font-weight: 400; }
.st-num.g, .st-num.a { color: var(--green-deep); font-weight: 700; }
.st-num.yc { color: var(--orange); font-weight: 700; }
.st-num.x { font-size: 11.5px; color: var(--text-2); }
.st-num.x.z { color: var(--text-4); }
.st-empty { padding: 14px 2px; color: var(--text-3); font-size: 13px; }

.st-divider { display: flex; align-items: center; gap: 10px; margin: 13px 2px 4px; }
.st-divider .l { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-4); }
.st-divider .rule { flex: 1; height: 1px; background: var(--border); }

.fx-updated { text-align: right; color: var(--text-3); font-size: 12.5px; margin: 18px 2px 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; font-size: 13.5px; margin: 0 0 16px; }
.back-link:hover { color: var(--text); }

/* upcoming projection table reuses the stat grid with fewer columns */
.statcols.proj { --grid: 34px minmax(116px, 1.3fr) 52px 52px 52px; }

@media (prefers-reduced-motion: reduce) {
  .match:hover { transform: none; }
}
