/* FPL DYM v1.37 — compact horizontal match-up cards. Visual layer only. */
:root{--match-score-bg:#17001d;--match-score-fg:#fff;--match-live:#00a86b;--match-border:rgba(36,0,43,.12)}

/* Shared horizontal match card */
.fixture-list,.dbl-fixture-list,#fucl-fixtures,#olympics-fixtures{gap:.72rem!important}
.fixture-card{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(118px,160px) minmax(0,1fr)!important;
  grid-template-areas:"home score away" "actions actions actions";
  align-items:center!important;
  gap:.38rem .85rem!important;
  min-height:78px!important;
  padding:.68rem .9rem .55rem!important;
  border:1px solid var(--match-border)!important;
  border-radius:14px!important;
  background:#fff!important;
  box-shadow:0 5px 18px rgba(36,0,43,.045)!important;
}
.fixture-card:hover{border-color:rgba(76,0,85,.34)!important;box-shadow:0 8px 24px rgba(36,0,43,.08)!important}
.fixture-card .fixture-team{min-width:0!important;width:100%!important;display:flex!important;flex-direction:column!important;gap:.18rem!important;padding:.18rem .12rem!important;background:transparent!important}
.fixture-card .fixture-team.home{grid-area:home;align-items:flex-end!important;justify-content:center!important;text-align:right!important}
.fixture-card .fixture-team.away{grid-area:away;align-items:flex-start!important;justify-content:center!important;text-align:left!important}
.fixture-card .team-initials{display:none!important}
.fixture-card .fixture-team-name{display:block!important;max-width:100%!important;overflow:visible!important;text-overflow:clip!important;white-space:normal!important;font:800 clamp(.92rem,1.45vw,1.08rem)/1.15 "League Spartan","DM Sans",sans-serif!important;color:#241927!important}
.fixture-card .fixture-alias{display:block;max-width:100%;font:600 .72rem/1.2 "DM Sans",sans-serif;color:#817483;white-space:normal;overflow-wrap:anywhere}
.fixture-card .fixture-form{margin-top:.18rem!important;gap:3px!important}
.fixture-card .fixture-form i{width:18px!important;height:18px!important;font-size:8px!important}
.fixture-card .fixture-team.home .fixture-form{justify-content:flex-end!important}
.fixture-card .fixture-team.away .fixture-form{justify-content:flex-start!important}
.fixture-card .fixture-form.is-empty{display:none!important}

/* Strong, centred score treatment. Status sits above the score. */
.fixture-card .fixture-vs{
  grid-area:score!important;
  min-width:118px!important;
  width:100%!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:.3rem!important;
  padding:0!important;
  background:transparent!important;
  color:#6d6170!important;
  text-align:center!important;
  border-radius:0!important;
  font:800 .82rem/1 "League Spartan","DM Sans",sans-serif!important;
}
.fixture-card .fixture-vs>small,.fixture-card .fixture-score-meta,.match-status-pill{
  order:-1;display:inline-flex!important;align-items:center;justify-content:center;width:max-content;max-width:100%;
  margin:0 auto!important;padding:.25rem .48rem!important;border-radius:999px!important;background:#eee9ef!important;color:#675d69!important;
  font:800 .62rem/1 "DM Sans",sans-serif!important;text-transform:uppercase;letter-spacing:.06em
}
.fixture-card.ux-live .fixture-vs>small,.fixture-card.ux-live .fixture-score-meta{background:#dcfff2!important;color:#00764a!important}
.fixture-card.ux-final .fixture-vs>small,.fixture-card.ux-final .fixture-score-meta{background:#24002b!important;color:#fff!important}
.fixture-card .h2h-score-pair{display:flex!important;align-items:center!important;justify-content:center!important;gap:.32rem!important;white-space:nowrap}
.fixture-card .h2h-score-link,.fixture-card .h2h-score-value{
  display:grid!important;place-items:center!important;min-width:44px!important;height:38px!important;padding:0 .45rem!important;
  border-radius:5px!important;background:var(--match-score-bg)!important;color:var(--match-score-fg)!important;
  font:800 1.08rem/1 "League Spartan",sans-serif!important;text-decoration:none!important;box-shadow:inset 0 0 0 1px rgba(255,255,255,.07)
}
.fixture-card .h2h-score-link:hover{transform:translateY(-1px);background:#41004a!important}
.fixture-card .h2h-score-arrow{font-size:.56rem!important;position:absolute!important;opacity:.72!important;transform:translate(15px,-13px)}
.fixture-card .h2h-score-separator{font-size:.86rem!important;color:#857b88!important}
.fixture-card .h2h-history-mini{display:none!important}
.fixture-card .fixture-vs:not(:has(.h2h-score-pair)){font-size:.82rem!important}

/* Winner emphasis only; no noisy colour treatment. */
.fixture-card .fixture-team.is-winner .fixture-team-name{font-weight:900!important;color:#24002b!important}
.fixture-card .fixture-team.is-loser{opacity:.72}

/* Secondary actions live below the horizontal match-up. */
.fixture-card .match-actions{grid-area:actions;display:flex;align-items:center;justify-content:center;gap:.42rem;padding-top:.34rem;border-top:1px solid rgba(36,0,43,.065)}
.fixture-card .match-actions:empty{display:none}
.fixture-card .match-action,.fixture-card .match-actions .fixture-share-button{
  position:static!important;border:0!important;background:transparent!important;color:#5d4f60!important;padding:.22rem .42rem!important;
  border-radius:999px!important;font:800 .65rem/1 "DM Sans",sans-serif!important;text-decoration:none!important;cursor:pointer
}
.fixture-card .match-action:hover,.fixture-card .match-actions .fixture-share-button:hover{background:#f2edf4!important;color:#24002b!important}

/* Competition identity without changing the horizontal language. */
body.ux-domestic .fixture-card{border-left:4px solid #24002b!important}
body.ux-uefa .fixture-card{border-left:4px solid #6d4bc3!important;background:linear-gradient(90deg,#fff,#fbfaff)!important}
body.ux-uefa .fixture-card .group-badge{position:absolute!important;left:.7rem!important;top:.45rem!important;font-size:.58rem!important;padding:.22rem .42rem!important}
body.ux-uefa .fixture-card:has(.group-badge){padding-top:1.45rem!important}

/* Match Centre uses the same horizontal visual grammar. */
#match-centre .competition-block{margin-bottom:1.2rem}
#match-centre .match-card{
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(118px,160px) minmax(0,1fr)!important;
  grid-template-areas:"home score away" "actions actions actions";align-items:center;gap:.38rem .85rem;
  min-height:76px;padding:.66rem .9rem .52rem;margin:.65rem 0;border:1px solid var(--match-border);border-left:4px solid #24002b;border-radius:14px;background:#fff;box-shadow:0 5px 18px rgba(36,0,43,.045)
}
#match-centre .competition-block:has(h2:first-child) .match-card{}
#match-centre .match-card .home{grid-area:home;text-align:right;align-items:flex-end!important}
#match-centre .match-card .away{grid-area:away;text-align:left;align-items:flex-start!important}
#match-centre .match-card .home,#match-centre .match-card .away{display:flex;flex-direction:column;justify-content:center;min-width:0}
#match-centre .match-team{font:800 clamp(.92rem,1.45vw,1.08rem)/1.15 "League Spartan","DM Sans",sans-serif;color:#241927;white-space:normal;overflow-wrap:anywhere}
#match-centre .match-alias{margin-top:.18rem;font:600 .72rem/1.2 "DM Sans",sans-serif;color:#817483;white-space:normal;overflow-wrap:anywhere}
#match-centre .fpl-id-state{display:none!important}
#match-centre .live-score{grid-area:score;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:.3rem!important;min-width:118px;text-align:center}
#match-centre .live-score .live-state{order:-1;display:inline-flex;padding:.25rem .48rem;border-radius:999px;background:#eee9ef;color:#675d69;font:800 .62rem/1 "DM Sans",sans-serif;text-transform:uppercase;letter-spacing:.06em}
#match-centre .live-score .h2h-score-pair{display:flex;align-items:center;gap:.32rem;white-space:nowrap}
#match-centre .live-score .h2h-score-link,#match-centre .live-score .h2h-score-value{display:grid;place-items:center;min-width:44px;height:38px;padding:0 .42rem;border-radius:5px;background:#17001d;color:#fff;font:800 1.08rem/1 "League Spartan",sans-serif;text-decoration:none;position:relative}
#match-centre .live-score .h2h-score-separator{color:#857b88}
#match-centre .live-score .h2h-history-mini{font-size:.62rem;margin-left:.15rem}
#match-centre .match-card .match-actions{grid-area:actions;display:flex;justify-content:center;gap:.4rem;padding-top:.34rem;border-top:1px solid rgba(36,0,43,.065)}

/* My DYM fixture cards keep their state logic, but use the same horizontal visual density where possible. */
.mydym-fixture-card{border-radius:14px!important}

/* Optional desktop density. */
@media(min-width:901px){
  body.fixture-density-comfortable .fixture-card,body.fixture-density-comfortable #match-centre .match-card{min-height:98px!important;padding-top:.95rem!important;padding-bottom:.75rem!important}
  .fixture-density-toggle{display:inline-flex!important}
}
@media(max-width:900px){.fixture-density-toggle{display:none!important}}

/* Mobile must REMAIN horizontal — this intentionally overrides v1.31's stacked mobile fixture rule. */
@media(max-width:760px){
  .fixture-card{
    grid-template-columns:minmax(0,1fr) 92px minmax(0,1fr)!important;
    grid-template-areas:"home score away" "actions actions actions"!important;
    gap:.42rem .48rem!important;min-height:92px!important;padding:.78rem .62rem .58rem!important;text-align:initial!important
  }
  .fixture-card .fixture-team{width:100%!important;min-width:0!important;padding:.18rem 0!important}
  .fixture-card .fixture-team.home{grid-area:home!important;order:initial!important;align-items:flex-end!important;justify-content:center!important;text-align:right!important}
  .fixture-card .fixture-team.away{grid-area:away!important;order:initial!important;align-items:flex-start!important;justify-content:center!important;text-align:left!important}
  .fixture-card .fixture-vs{grid-area:score!important;order:initial!important;width:100%!important;min-width:0!important;justify-content:center!important;text-align:center!important;border-radius:0!important;padding:0!important}
  .fixture-card .fixture-team-name{font-size:.82rem!important;line-height:1.08!important}
  .fixture-card .fixture-alias{font-size:.61rem!important;line-height:1.1!important}
  .fixture-card .fixture-form{gap:2px!important;margin-top:.18rem!important}.fixture-card .fixture-form i{width:15px!important;height:15px!important;font-size:7px!important}
  .fixture-card .h2h-score-link,.fixture-card .h2h-score-value{min-width:35px!important;height:34px!important;font-size:1rem!important;padding:0 .3rem!important}
  .fixture-card .h2h-score-arrow{display:none!important}.fixture-card .h2h-score-separator{font-size:.72rem!important}
  .fixture-card .fixture-vs>small,.fixture-card .fixture-score-meta,.match-status-pill{font-size:.52rem!important;padding:.2rem .35rem!important}
  .fixture-card .match-actions{padding-top:.35rem!important;gap:.28rem!important}.fixture-card .match-action,.fixture-card .match-actions .fixture-share-button{font-size:.58rem!important;padding:.2rem .32rem!important}
  body.ux-uefa .fixture-card .group-badge{left:.45rem!important;top:.3rem!important;font-size:.5rem!important}
  #match-centre .match-card{grid-template-columns:minmax(0,1fr) 92px minmax(0,1fr)!important;grid-template-areas:"home score away" "actions actions actions";gap:.42rem .48rem;min-height:92px;padding:.78rem .62rem .58rem}
  #match-centre .match-team{font-size:.82rem;line-height:1.08}#match-centre .match-alias{font-size:.61rem;line-height:1.1}
  #match-centre .live-score{min-width:0}#match-centre .live-score .h2h-score-link,#match-centre .live-score .h2h-score-value{min-width:35px;height:34px;font-size:1rem;padding:0 .3rem}
  #match-centre .live-score .h2h-history-mini{display:none}
}
@media(max-width:390px){
  .fixture-card,#match-centre .match-card{grid-template-columns:minmax(0,1fr) 82px minmax(0,1fr)!important;gap:.35rem!important;padding-left:.48rem!important;padding-right:.48rem!important}
  .fixture-card .fixture-team-name,#match-centre .match-team{font-size:.76rem!important}
}
/* v1.38 — alias-safe form/history + stable mobile deep links */
.team-display-label{display:inline}
#match-centre .home .fixture-form,#match-centre .away .fixture-form{display:flex;gap:3px;margin-top:.28rem}
#match-centre .home .fixture-form{justify-content:flex-end}
#match-centre .away .fixture-form{justify-content:flex-start}
#match-centre .fixture-form i{display:grid;place-items:center;width:18px;height:18px;border-radius:50%;font:800 8px/1 "DM Sans",sans-serif;font-style:normal}
#match-centre .fixture-form .form-w{background:#dff8ea;color:#087a43}.fixture-form .form-d{background:#eee8f1;color:#67556c}.fixture-form .form-l{background:#ffe4e7;color:#b32437}
@media(max-width:680px){html{scroll-behavior:auto!important}#gameweek-panel,#dbl-gameweek-panel,#fucl-fixtures,#olympics-fixtures{scroll-margin-top:14px}.match-actions .h2h-history-mini{white-space:nowrap}}

/* v1.60.1 — unified Match Centre card */
#match-centre .smart-match-card{
  position:relative!important;
  grid-template-columns:minmax(0,1fr) minmax(132px,170px) minmax(0,1fr)!important;
  grid-template-areas:"home score away" "actions actions actions"!important;
  min-height:112px!important;
  padding:2.55rem 1.1rem 2.75rem!important;
  gap:.55rem 1rem!important;
  overflow:hidden;
}
#match-centre .smart-match-status{
  position:absolute;
  inset:.72rem .95rem auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  color:#716576;
  font:800 .65rem/1 "DM Sans",sans-serif;
  letter-spacing:.09em;
  text-transform:uppercase;
}
#match-centre .smart-match-card.is-live .smart-match-status span{color:#008653}
#match-centre .smart-match-card.is-final .smart-match-status span{color:#641772}
#match-centre .smart-match-team{min-width:0;gap:.36rem}
#match-centre .smart-team-link{display:block;max-width:100%;color:#241927;text-decoration:none}
#match-centre .smart-team-link:hover .match-team{text-decoration:underline;text-underline-offset:3px}
#match-centre .smart-match-score{
  grid-area:score;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap:.38rem;
  min-width:0;
  text-align:center;
}
#match-centre .smart-match-score>small{
  flex-basis:100%;
  color:#746878;
  font:700 .62rem/1.2 "DM Sans",sans-serif;
}
#match-centre .smart-vs{
  display:grid;
  place-items:center;
  min-width:62px;
  min-height:38px;
  padding:0 .55rem;
  border-radius:10px;
  background:#f0ebf2;
  color:#4f4053;
  font:900 .82rem/1 "League Spartan",sans-serif;
  letter-spacing:.12em;
}
#match-centre .smart-score{
  box-sizing:border-box;
  min-width:48px;
  height:42px;
  padding:0 .48rem;
  align-items:center;
  justify-content:center;
  border-radius:10px;
}
#match-centre .smart-score-divider{color:#796d7c;font-weight:900}
#match-centre .smart-match-actions{
  position:absolute;
  inset:auto .95rem .62rem;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:.75rem;
  padding-top:.5rem;
  border-top:1px solid #eee7ef;
  color:#837587;
  font-size:.66rem;
}
#match-centre .smart-match-actions a{color:#641772;font-weight:900;text-decoration:none;white-space:nowrap}
#match-centre .smart-match-actions a:hover{text-decoration:underline}
#match-centre .smart-match-card>.match-actions{display:none!important}

@media(max-width:620px){
  #match-centre{padding-bottom:6.5rem}
  #match-centre .smart-match-card{
    grid-template-columns:minmax(0,1fr) 92px minmax(0,1fr)!important;
    min-height:126px!important;
    padding:2.45rem .68rem 2.7rem!important;
    gap:.4rem .42rem!important;
  }
  #match-centre .smart-match-status{inset:.68rem .78rem auto;font-size:.62rem}
  #match-centre .smart-match-team .match-team{font-size:.8rem!important;line-height:1.08!important}
  #match-centre .smart-match-score{gap:.22rem}
  #match-centre .smart-match-score>small{font-size:.54rem;line-height:1.15}
  #match-centre .smart-vs{min-width:50px;min-height:34px;font-size:.72rem}
  #match-centre .smart-score{min-width:36px;height:36px;padding:0 .25rem;font-size:1rem}
  #match-centre .smart-match-actions{inset:auto .75rem .58rem;justify-content:flex-end}
  #match-centre .smart-match-actions span{display:none}
  #match-centre .home .fixture-form,#match-centre .away .fixture-form{gap:2px}
  #match-centre .fixture-form i{width:16px;height:16px;font-size:7px}
}
