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

/* ── CSS variables ── */
:root {
  --bg:       #fafafa;
  --surface:  #f4f4f5;
  --border:   #e4e4e7;
  --text:     #09090b;
  --muted:    #3f3f46;
  --green:    #10b981;
  --green-dk: #059669;
  --coral:    #ff4d6d;
  --amber:    #f59e0b;
  --sky:      #38bdf8;
  --pitch:    #22c55e;
  --pitch-dk: #16a34a;

  /* ── Type scale ── */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;

  /* ── Spacing ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  /* ── Squad selector design tokens ── */
  --ss-bg:            #f4f4f5;
  --ss-border:        #e4e4e7;
  --ss-green:         #059669;
  --ss-green-light:   #d1fae5;
  --ss-red:           #be123c;
  --ss-red-light:     #fee2e2;
  --ss-card-radius:   14px;
  --ss-badge-gk:      #F97316;
  --ss-badge-def:     #3B82F6;
  --ss-badge-mid:     #22C55E;
  --ss-badge-fwd:     #F59E0B;
  --ss-font-cond:     'Barlow Condensed', sans-serif;
  --ss-font-body:     'Barlow', sans-serif;
}

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

/* ── Base ── */
html, body { overflow-x: hidden; max-width: 100%; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Nav ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  nav { padding: 18px 32px; }
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.nav-logo svg {
  display: block;
  flex-shrink: 0;
}

.nav-logo-wordmark {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #1a1a1a;
}

.nav-logo-accent {
  color: #10b981;
}

.nav-beta-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  background: #f97316;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.4;
  align-self: center;
}

/* ── Hamburger (visible on mobile only) ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ── Nav overlay (mobile backdrop) ── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
}
.nav-overlay.open { display: block; }

/* ── Nav links ── */
.nav-links { display: flex; gap: 8px; align-items: center; }

@media (max-width: 767px) {
  .nav-hamburger { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 240px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 72px 20px 32px;
    background: var(--bg);
    border-left: 1px solid var(--border);
    z-index: 1000;
    overflow-y: auto;
  }
  .nav-links.open { display: flex; }

  .nav-link, .nav-link-admin, .nav-link-logout {
    width: 100%;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
  }
}

@media (min-width: 768px) {
  .nav-hamburger { display: none; }
  .nav-links { display: flex; flex-direction: row; position: static; width: auto; padding: 0; border: none; background: none; }
}

.nav-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  background: var(--surface);
  padding: 7px 16px;
  border-radius: 100px;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--text); color: #fff; }
.nav-link.active { background: var(--text); color: #fff; }

.nav-link-admin {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  background: var(--amber);
  padding: 7px 16px;
  border-radius: 100px;
  transition: opacity 0.15s;
}
.nav-link-admin:hover { opacity: 0.85; }
.nav-link-admin.active { opacity: 0.85; }

.nav-link-logout {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  background: var(--surface);
  padding: 7px 16px;
  border-radius: 100px;
  transition: background 0.15s, color 0.15s;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.nav-link-logout:hover { background: #ffe4e6; color: #be123c; }

.nav-form { display: inline; }

/* ── Alerts ── */
.alert {
  font-size: 12px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.alert-error   { background: #ffe4e6; color: #be123c; }
.alert-success { background: #dcfce7; color: #15803d; }

/* ── Form elements ── */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 11px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus { border-color: var(--text); }

/* ── Buttons ── */
.btn-primary {
  padding: 10px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--text);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.85; }

.btn-danger {
  padding: 10px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #be123c;
  background: #ffe4e6;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn-danger:hover { opacity: 0.85; }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  padding: 10px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: border-color 0.15s;
}
.btn-ghost:hover { border-color: #c0c0c0; }

.btn-lg {
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  min-height: 44px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  transition: opacity 0.15s, background 0.15s;
  font-family: 'DM Sans', sans-serif;
}

/* ── Position pills ── */
.pos-pill {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}
.pos-GK  { background: #fff3cd; color: #b45309; }
.pos-DEF { background: #dbeafe; color: #1d4ed8; }
.pos-MID { background: #dcfce7; color: #15803d; }
.pos-FWD { background: #ffe4e6; color: #be123c; }

/* ── Roster search ── */
.roster-search {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
  margin-top: 8px;
}
.roster-search::placeholder { color: var(--muted); }
.roster-search:focus { border-color: var(--muted); }

/* ── Recommendation badges ── */
.rec-BUY     { background: #dcfce7; color: #15803d; }
.rec-SELL    { background: #ffe4e6; color: #be123c; }
.rec-CAPTAIN { background: #fef9c3; color: #854d0e; }
.rec-HOLD    { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }

/* ── Premier League table ── */
.pl-table { width: 100%; border-collapse: collapse; }
.pl-table th {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  text-align: right;
  padding: 0 0 6px 4px;
}
.pl-table th:first-child { text-align: left; padding-left: 0; }
.pl-table td {
  font-size: 11px;
  padding: 5px 0 5px 4px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: middle;
}
.pl-table tr:last-child td { border-bottom: none; }
.pl-table td:first-child { text-align: left; padding-left: 0; }
.pl-pos {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  width: 14px;
  display: inline-block;
}
.pl-pos.zone-cl  { color: #2563eb; font-weight: 700; }
.pl-pos.zone-el  { color: #f97316; font-weight: 700; }
.pl-pos.zone-rel { color: #ef4444; font-weight: 700; }
.pl-team-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.pl-team-link:hover { color: var(--green-dk); }
.pl-record { font-size: 10px; color: var(--muted); font-family: 'DM Mono', monospace; }
.pl-pts    { font-weight: 700; font-family: 'DM Mono', monospace; }

/* ── Pitch visualization ── */
.pitch-wrap {
  position: relative;
  width: 100%;
  background: var(--pitch);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(34,197,94,0.2);
}
.pitch-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0, transparent 50px,
    rgba(0,0,0,0.04) 50px, rgba(0,0,0,0.04) 100px
  );
  border-radius: 12px;
  pointer-events: none;
}
.pitch-lines { position: absolute; inset: 0; pointer-events: none; }
.pitch-lines svg { width: 100%; height: 100%; }
.player-token {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  z-index: 2;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.token-jersey {
  width: 36px;
  height: 40px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
  transition: transform 0.15s;
}
.token-jersey:hover { transform: scale(1.1); }
.token-info {
  display: flex;
  align-items: center;
  gap: 4px;
}
.token-name {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
  white-space: nowrap;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.token-opponent {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  white-space: nowrap;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.token-pts {
  font-size: 10px;
  font-weight: 700;
  color: #fbbf24;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  white-space: nowrap;
  line-height: 1;
}
.token-pts.blurred { filter: blur(4px); user-select: none; }
.token-chip {
  background: rgba(0,0,0,0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: 20px;
  padding: 2px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 68px;
}
.token-chip .token-name {
  font-size: 7px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 64px;
  text-shadow: none;
}
.token-chip .token-opponent {
  font-size: 7px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  text-shadow: none;
}

/* ── Locked paywall overlays ── */
.locked-placeholder {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}
.locked-blur-content {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
  opacity: 0.6;
}
.locked-dummy-card {
  height: 64px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}
.locked-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255,255,255,0.75);
}
.locked-icon { display: flex; align-items: center; justify-content: center; }
.locked-label { font-size: 11px; font-weight: 700; color: var(--text); }
.locked-cta {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--text);
  padding: 6px 16px;
  border-radius: 100px;
  text-decoration: none;
}
.locked-cta:hover { opacity: 0.85; }

/* ── Skeleton loading shimmer ── */
@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
#player-detail-panel.htmx-request {
  position: relative;
  min-height: 200px;
  pointer-events: none;
}
#player-detail-panel.htmx-request > * { visibility: hidden; }
#player-detail-panel.htmx-request::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

/* ── Empty states ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  text-align: center;
}
.empty-state-icon { font-size: 28px; line-height: 1; }
.empty-state-msg  { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ── Checkbox label ── */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}

/* ── Muted small text utility ── */
.text-muted-sm { font-size: 12px; color: var(--muted); }

/* ── Show more button ── */
.show-more-btn {
  display: block;
  margin: 12px auto 0;
  padding: 6px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.show-more-btn:hover {
  background: var(--bg);
  color: var(--text);
}
.show-more-btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}


/* ── Differential badge ── */
.differential-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--amber);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
  line-height: 1;
}

/* Data freshness indicator */
.data-freshness {
  text-align: right;
  font-size: var(--text-xs);
  color: var(--muted);
  padding: var(--space-2) var(--space-4) var(--space-4);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-6) var(--space-4);
  margin-top: auto;
}
.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  max-width: 1200px;
  margin: 0 auto;
  font-size: var(--text-xs);
  color: var(--muted);
}
.site-footer__link {
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms ease;
}
.site-footer__link:hover { color: var(--text); }

/* ── Team logos ── */
.team-logo {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  flex-shrink: 0;
}
.team-logo--xs { width: 16px; height: 16px; }
.team-logo--sm { width: 20px; height: 20px; }
.team-logo--md { width: 28px; height: 28px; }
.team-logo--lg { width: 40px; height: 40px; }

/* ── Player hover card (desktop only) ──────────────────────────────────────── */
@media (hover: hover) {
  #player-hover-card-container {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    display: none;
    width: 290px;
  }

  #player-hover-card-container.phc-visible {
    display: block;
    pointer-events: auto;
  }

  .phc-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    overflow: hidden;
    font-size: 13px;
  }

  .phc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--border);
  }

  .phc-status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
  .phc-status-available { background: var(--green); }
  .phc-status-doubtful  { background: var(--amber); }
  .phc-status-injured   { background: var(--coral); }

  .phc-pos-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    color: #fff;
  }

  .phc-pos-gk  { background: #f59e0b; }
  .phc-pos-def { background: #3b82f6; }
  .phc-pos-mid { background: #10b981; }
  .phc-pos-fwd { background: #ef4444; }

  .phc-name { font-size: 14px; color: var(--text); }

  .phc-team {
    font-size: 12px;
    color: var(--muted);
    margin-left: auto;
    white-space: nowrap;
  }

  .phc-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    border-bottom: 1px solid var(--border);
  }

  .phc-stat {
    padding: 12px 0;
    text-align: center;
    border-right: 1px solid var(--border);
  }

  .phc-stat:last-child { border-right: none; }

  .phc-stat-value {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    line-height: 1.2;
  }

  .phc-stat-label {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-top: 3px;
  }

  .phc-section-label {
    font-size: 11px;
    font-weight: 600;
    color: #3f3f46;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 8px;
  }

  .phc-form {
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--border);
  }

  .phc-bars {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 56px;
  }

  .phc-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex: 1;
  }

  .phc-bar-pts { font-size: 10px; font-weight: 700; color: var(--text); }

  .phc-bar {
    width: 100%;
    border-radius: 3px 3px 0 0;
    min-height: 3px;
  }

  .phc-bar-gw { font-size: 10px; color: var(--muted); }

  .phc-mentions {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
  }

  .phc-mention-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
  }

  .phc-mention-row:last-child { margin-bottom: 0; }

  .phc-rec-badge {
    font-size: 9px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .phc-rec-buy  { background: var(--green); }
  .phc-rec-hold { background: var(--amber); }
  .phc-rec-sell { background: var(--coral); }

  .phc-mention-source {
    font-size: 12px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .phc-gate {
    padding: 16px 14px;
    position: relative;
    border-bottom: 1px solid var(--border);
    min-height: 64px;
  }

  .phc-gate-blur {
    filter: blur(4px);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .phc-gate-placeholder {
    height: 12px;
    background: var(--surface);
    border-radius: 4px;
    width: 100%;
  }

  .phc-gate-placeholder--short { width: 70%; }

  .phc-gate-cta {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #09090b;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 20px;
    text-decoration: none;
    white-space: nowrap;
  }

  .phc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--surface);
  }

  .phc-footer-label { font-size: 12px; color: var(--muted); font-weight: 500; }

  .phc-footer-pts {
    font-weight: 700;
    color: var(--green);
    font-size: 15px;
  }
}

/* ══════════════════════════════════════════════════════════
   Fixture Detail Panel — shared styles for both the full
   fixture-detail page and the HTMX-injected detail panel
   ══════════════════════════════════════════════════════════ */

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); }

/* ── Match header ── */
.match-header {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  margin-bottom: 0;
  text-align: center;
}
.match-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.match-meta-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.match-meta-sep {
  font-size: 10px;
  color: var(--border);
}
.match-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.match-team {
  flex: 1;
  max-width: 180px;
}
.match-team.home { text-align: right; }
.match-team.away { text-align: left; }
.match-team-row {
  display: grid;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.match-team-row--home {
  grid-template-columns: minmax(0, 1fr) 40px;
}
.match-team-row--away {
  grid-template-columns: 40px minmax(0, 1fr);
}
.match-team-logo-slot {
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.match-team-name-slot {
  min-width: 0;
}
.match-team-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .match-team-row--home {
    grid-template-columns: minmax(0, 1fr) 32px;
  }
  .match-team-row--away {
    grid-template-columns: 32px minmax(0, 1fr);
  }
  .match-team-logo-slot {
    width: 32px;
  }
  .match-team-name { font-size: 14px; }
}
.match-team-fdr {
  margin-top: 6px;
}
.fdr-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 100px;
}
.fdr-easy   { background: #dcfce7; color: #15803d; }
.fdr-medium { background: #fef9c3; color: #a16207; }
.fdr-hard   { background: #fee2e2; color: #b91c1c; }

.match-score-block {
  flex-shrink: 0;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.match-score {
  font-size: 32px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  color: var(--text);
  letter-spacing: 2px;
  line-height: 1;
}
.match-score-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 4px;
}
.match-vs {
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
}

/* ── Section header ── */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.section-team-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ── Two-column team layout ── */
.teams-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 700px) {
  .teams-grid { grid-template-columns: 1fr 1fr; }
}

.team-panel {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.team-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ── Stats table ── */
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.stats-table thead th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.stats-table thead th.num { text-align: center; }
.stats-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.stats-table tbody tr:last-child { border-bottom: none; }
.stats-table tbody tr:hover { background: var(--bg, #f9f9f8); }
.stats-table tbody td {
  padding: 9px 10px;
  color: var(--text);
  vertical-align: middle;
}
.stats-table tbody td.num { text-align: center; color: var(--muted); }
.stats-table tbody td.num.highlight { color: var(--text); font-weight: 600; }

.player-cell {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ── Overflow for mobile tables ── */
.table-scroll { overflow-x: auto; }

/* ── Match highlights card ── */
.match-section { margin-bottom: 28px; }
.match-highlights {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  margin-top: 8px;
  overflow: hidden;
}
.highlights-team-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.highlights-team-header span {
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: center;
}
.highlights-team-header span:first-child { border-right: 1px solid var(--border); }
.highlights-body {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
}
.highlights-divider { background: var(--border); }
.highlights-col { padding: 10px 14px; }
.highlight-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.highlight-row:last-child { border-bottom: none; }
.highlight-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.highlight-icon.goal   { background: #dcfce7; }
.highlight-icon.assist { background: #dbeafe; }
.highlight-icon.star   { background: #fef9c3; }
.highlight-info { flex: 1; min-width: 0; }
.highlight-player {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.highlight-detail { font-size: 11px; color: var(--muted); }
.highlight-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  flex-shrink: 0;
  white-space: nowrap;
}
.badge-green { background: #dcfce7; color: #15803d; }
.badge-blue  { background: #dbeafe; color: #1d4ed8; }
.badge-amber { background: #fef9c3; color: #a16207; }
.highlight-empty {
  padding: 16px 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 480px) {
  .highlights-col { padding: 8px 10px; }
  .highlight-player { font-size: 11px; }
  .highlight-badge { font-size: 10px; padding: 2px 5px; }
}

/* ── Fixture detail: position badge (plain grey, used in stats tables) ── */
.pos-badge {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 100px;
  background: var(--border);
  color: var(--muted);
}

/* ── Fixture detail: empty state within panels ── */
.fixture-panel-empty {
  padding: 32px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ── Fixture detail: full-height no-data placeholder ── */
.detail-no-data {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 520px;
  flex: 1;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
}
