/* The score is a button; the live score remains the authoritative fixture score. */
.hero .hs .football-details-trigger { display: block; position: relative; margin: -6px auto 3px; padding: 6px 24px 8px; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 14px; cursor: pointer; font: inherit; transition: background .16s, border-color .16s, transform .16s; }
.hero .hs .football-details-trigger:hover { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-1px); }
.hero .hs .football-details-trigger:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 3px; }
.football-details-hint { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 2px; color: var(--accent-ink); font: 600 10px/1.4 var(--font); letter-spacing: .015em; }
.football-details-hint svg { width: 12px; height: 12px; }
.football-details { width: min(760px, calc(100vw - 32px)); max-width: none; max-height: min(900px, calc(100dvh - 48px)); margin: auto; padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 28px 100px #0009; overflow: hidden; font: 14px/1.5 var(--font); }
.football-details[open] { display: flex; flex-direction: column; animation: fd-enter .18s ease-out; }
.football-details::backdrop { background: #090311b8; backdrop-filter: blur(5px); }
.football-details *, .football-details *::before, .football-details *::after { box-sizing: border-box; }
.football-details [hidden] { display: none !important; }
.football-details button { font-family: inherit; }
.football-details button:focus-visible, .fd-panel:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: -3px; }
.fd-topbar { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 19px 24px 14px; }
.fd-eyebrow { font-size: 9px; font-weight: 800; letter-spacing: .16em; color: var(--accent-ink); }
.fd-topbar h2 { margin: 3px 0 0; font: 800 17px/1.3 var(--font-head); }
.fd-actions { display: flex; gap: 7px; }
.fd-icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 7px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--muted); cursor: pointer; }
.fd-icon-button:hover { color: var(--text); border-color: var(--accent); }
.fd-icon-button svg { width: 19px; height: 19px; }
.fd-icon-button:disabled { opacity: .5; cursor: wait; }
.fd-summary { display: grid; flex-shrink: 0; grid-template-columns: minmax(0, 1fr) 154px minmax(0, 1fr); align-items: center; gap: 14px; padding: 16px 28px 8px; background: linear-gradient(180deg, var(--accent-soft), transparent); }
.fd-team { display: flex; flex-direction: column; align-items: center; gap: 9px; min-width: 0; text-align: center; }
.fd-team > b { font: 750 14px/1.35 var(--font); overflow-wrap: anywhere; }
.fd-crest { display: grid; place-items: center; width: 50px; height: 50px; }
.fd-crest .team-crest, .fd-crest img { width: 48px; height: 48px; }
.fd-crest .team-crest { border-radius: 13px; }
.fd-crest img { object-fit: contain; }
.fd-crest-fallback { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-3); color: var(--accent-ink); font-weight: 800; }
.fd-scoreboard { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.fd-scoreboard > strong { white-space: nowrap; font: 700 42px/1.1 var(--font-cond); letter-spacing: .04em; }
.fd-period { min-height: 20px; font-size: 12px; font-weight: 800; color: var(--muted); }
.fd-period.is-live { color: var(--live); }
.fd-scoreboard small { font-size: 10px; min-height: 15px; color: var(--muted); }
.fd-score-stamp { flex-shrink: 0; min-height: 19px; margin: 3px 20px 12px; color: var(--muted); font-size: 10px; text-align: center; }
.fd-tabs { display: flex; flex-shrink: 0; gap: 4px; margin: 0 20px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.fd-tabs button { flex: 1; min-width: 0; display: flex; justify-content: center; align-items: center; gap: 7px; padding: 10px 6px; border: 0; border-radius: 9px; font-size: 12px; font-weight: 750; color: var(--muted); background: transparent; cursor: pointer; }
.fd-tabs button[aria-selected="true"] { color: var(--accent-ink); background: var(--surface-3); box-shadow: 0 1px 3px #0002; }
.fd-tabs button:hover { color: var(--text); }
.fd-tabs button > span { font-size: 16px; font-weight: 400; line-height: 1; }
.fd-scroll { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.fd-panel { padding: 16px 24px 22px; min-height: 190px; }
.fd-section-state { margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.fd-section-state.is-empty { margin: 18px 0; padding: 22px 20px; border: 1px dashed var(--line); border-radius: 13px; text-align: center; font-size: 12px; }
.fd-section-state.is-stale { color: #d8a85a; }
:root[data-theme="light"] .fd-section-state.is-stale { color: #8a5c13; }
.fd-footer { flex-shrink: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 12px 24px 15px; border-top: 1px solid var(--line); color: var(--muted); background: var(--surface-2); font-size: 10px; line-height: 1.6; }
.fd-source { flex-shrink: 0; font-weight: 750; color: var(--accent-ink); }
.fd-connection { flex-basis: 100%; color: var(--muted); }
.fd-connection:empty { display: none; }
/* Events keep a stable home/away orientation; a provider event is never a score. */
.fd-event-legend { display: flex; justify-content: space-between; gap: 20px; padding: 0 4px 10px; color: var(--muted); font-size: 10px; }
.fd-event-legend span:last-child { text-align: right; }
.fd-events { position: relative; list-style: none; margin: 0; padding: 0; }
.fd-events::before { content: ""; position: absolute; top: 10px; bottom: 10px; left: 50%; width: 1px; background: var(--line); }
.fd-event { position: relative; display: grid; grid-template-columns: 1fr 56px 1fr; align-items: center; gap: 9px; padding: 9px 0; }
.fd-event-time { grid-column: 2; position: relative; z-index: 1; align-self: center; padding: 5px 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--muted); text-align: center; font-size: 11px; font-weight: 800; }
.fd-event-card { min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.fd-event.is-home .fd-event-card { grid-column: 1; grid-row: 1; text-align: right; }
.fd-event.is-away .fd-event-card { grid-column: 3; grid-row: 1; }
.fd-event.is-neutral .fd-event-card { grid-column: 1 / 4; grid-row: 2; text-align: center; margin-top: 2px; }
.fd-event.is-neutral .fd-event-time { grid-row: 1; }
.fd-event.is-goal .fd-event-card { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--accent-soft); }
.fd-event.is-goal .fd-event-time { color: var(--accent-ink); }
.fd-event-title { display: flex; align-items: center; justify-content: flex-start; gap: 6px; font-size: 11px; font-weight: 800; color: var(--text); }
.fd-event.is-home .fd-event-title { justify-content: flex-end; }
.fd-event.is-neutral .fd-event-title { justify-content: center; }
.fd-event-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 18px; height: 18px; font-size: 14px; }
.fd-event-player { margin-top: 3px; font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.fd-event-meta { margin-top: 3px; font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.fd-event-meta.is-in { color: var(--good); }
.fd-event-meta.is-out { color: var(--muted); }
.fd-section-teams { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 1px 0 12px; font-size: 11px; font-weight: 800; }
.fd-section-teams > :last-child { text-align: right; color: #80ccb8; }
:root[data-theme="light"] .fd-section-teams > :last-child { color: #287a67; }
/* Provider grid is the only source for placement. No grid means a player list. */
.fd-pitch { position: relative; isolation: isolate; margin: 0 auto 18px; padding: 8px 8px; max-width: 520px; min-height: 590px; border: 1px solid #6b997d88; border-radius: 14px; background: repeating-linear-gradient(180deg, #1f4f3c 0, #1f4f3c 65px, #245641 65px, #245641 130px); color: #fff; overflow: hidden; }
.fd-pitch-markings { position: absolute; inset: 12px; z-index: -1; border: 1px solid #cae5d966; border-radius: 2px; }
.fd-pitch-markings::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; border-top: 1px solid #cae5d966; }
.fd-pitch-markings::after { content: ""; position: absolute; width: 28%; aspect-ratio: 1; left: 36%; top: 50%; transform: translateY(-50%); border: 1px solid #cae5d966; border-radius: 50%; }
.fd-goal-area { position: absolute; left: 23%; width: 54%; height: 14%; border: 1px solid #cae5d966; }
.fd-goal-area.is-top { top: 0; border-top: 0; }
.fd-goal-area.is-bottom { bottom: 0; border-bottom: 0; }
.fd-goal-area::after { content: ""; position: absolute; left: 24%; width: 52%; height: 47%; border: 1px solid #cae5d966; }
.fd-goal-area.is-top::after { top: 0; border-top: 0; }
.fd-goal-area.is-bottom::after { bottom: 0; border-bottom: 0; }
.fd-pitch-half { display: flex; flex-direction: column; justify-content: space-around; min-height: 288px; padding: 8px 0; gap: 14px; }
.fd-pitch-line { display: flex; justify-content: space-around; align-items: flex-start; gap: 2px; }
.fd-pitch-player { display: flex; flex: 0 1 20%; flex-direction: column; align-items: center; min-width: 0; max-width: 98px; gap: 3px; text-align: center; }
.fd-shirt { display: grid; place-items: center; position: relative; width: 32px; height: 30px; color: #fff; background: #9c48c2; clip-path: polygon(24% 0, 38% 6%, 62% 6%, 76% 0, 100% 22%, 89% 42%, 77% 37%, 77% 100%, 23% 100%, 23% 37%, 11% 42%, 0 22%); font-size: 11px; font-weight: 900; line-height: 1; padding-top: 4px; filter: drop-shadow(0 2px 1px #0004); }
.fd-pitch-half.is-away .fd-shirt { background: #b4ead7; color: #164d3d; }
.fd-player-name { width: 100%; border-radius: 4px; background: #0b241d85; padding: 2px 3px; color: #fff; font-size: 9px; line-height: 1.25; overflow-wrap: anywhere; }
.fd-player-events { display: flex; justify-content: center; flex-wrap: wrap; gap: 1px 3px; font-size: 9px; line-height: 1.1; min-height: 1px; }
.fd-lineups-note { padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 11px; }
.fd-lineups-meta { margin: 0 0 14px; font-size: 10px; line-height: 1.7; color: var(--muted); }
.fd-squad-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.fd-squad { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.fd-squad h3 { margin: 0 0 6px; font-size: 12px; color: var(--accent-ink); }
.fd-squad.is-away h3 { color: #80ccb8; }
:root[data-theme="light"] .fd-squad.is-away h3 { color: #287a67; }
.fd-squad h4 { margin: 18px 0 7px; font-size: 10px; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; }
.fd-coach { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.fd-player-list { list-style: none; padding: 0; margin: 0; }
.fd-player-list li { display: flex; align-items: baseline; gap: 7px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.fd-player-list li:last-child { border-bottom: 0; }
.fd-player-number { min-width: 23px; color: var(--accent-ink); font-size: 10px; font-weight: 800; }
.fd-player-position { margin-left: auto; color: var(--muted); font-size: 9px; }
.fd-squad-empty { color: var(--muted); font-size: 11px; }
/* Missing statistics stay unknown. Zero and an unavailable value are distinct. */
.fd-stat { padding: 11px 0 13px; border-bottom: 1px solid var(--line); }
.fd-stat:last-child { border-bottom: 0; }
.fd-stat-name { margin-bottom: 7px; color: var(--muted); text-align: center; font-size: 11px; }
.fd-stat-values { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 10px; }
.fd-stat-number { font-size: 13px; font-weight: 800; }
.fd-stat-number:last-child { text-align: right; }
.fd-stat-number.is-unknown { color: var(--muted); font-weight: 400; }
.fd-stat-track { display: flex; width: 100%; height: 6px; gap: 3px; border-radius: 10px; overflow: hidden; background: var(--surface-3); }
.fd-stat-fill { height: 100%; border-radius: 8px; min-width: 0; }
.fd-stat-fill.is-home { background: var(--accent); }
.fd-stat-fill.is-away { background: #80ccb8; }
.fd-stat-track.is-unknown { background: repeating-linear-gradient(90deg, var(--surface-3) 0, var(--surface-3) 4px, transparent 4px, transparent 7px); }
.fd-stat-track.is-zero { background: var(--surface-3); }
@keyframes fd-enter { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 580px) {
  .football-details { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 17px; }
  .fd-topbar { padding: 14px 16px 10px; }
  .fd-topbar h2 { font-size: 15px; }
  .fd-eyebrow { font-size: 8px; }
  .fd-summary { grid-template-columns: minmax(0, 1fr) 104px minmax(0, 1fr); gap: 8px; padding: 15px 14px 8px; }
  .fd-team > b { font-size: 11px; }
  .fd-scoreboard > strong { font-size: 35px; }
  .fd-period { font-size: 10px; }
  .fd-crest, .fd-crest .team-crest, .fd-crest img { width: 40px; height: 40px; }
  .fd-tabs { margin: 0 12px; }
  .fd-tabs button { font-size: 10px; gap: 5px; }
  .fd-panel { padding: 14px 14px 18px; }
  .fd-event { grid-template-columns: 1fr 44px 1fr; gap: 6px; }
  .fd-event-card { padding: 8px; }
  .fd-event-title { font-size: 9px; gap: 4px; }
  .fd-event-player { font-size: 10px; }
  .fd-event-meta { font-size: 9px; }
  .fd-event-time { font-size: 10px; }
  .fd-footer { padding: 10px 16px; font-size: 9px; }
  .fd-pitch { min-height: 540px; padding: 7px 3px; }
  .fd-pitch-half { min-height: 264px; gap: 12px; }
  .fd-player-name { font-size: 8px; }
  .fd-shirt { width: 28px; height: 27px; font-size: 10px; }
  .fd-squad-grid { gap: 8px; }
  .fd-squad { padding: 10px; }
  .fd-player-list li { gap: 4px; font-size: 10px; }
  .fd-stat-values { grid-template-columns: 35px minmax(0, 1fr) 35px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .football-details[open] { animation: none; } .hero .hs .football-details-trigger { transition: none; } }
