:root {
  --bg: #13131c;
  --card: #1c1c28;
  --card-border: #2a2a3a;
  --text: #d8a438;
  --text-dim: #8d8d9c;
  --accent: #2ad572;
  --accent-dark: #15a352;
  --gold: #d8a438;
  --topbar-h: 52px;
  --bottomnav-h: 58px;
  --page-max: 1280px;
  --page-pad: 16px;
}

@media (min-width: 768px) {
  :root { --page-pad: 28px; --topbar-h: 58px; }
}
@media (min-width: 1100px) {
  :root { --page-pad: 48px; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: var(--bg);
  border-bottom: 1px solid var(--card-border);
  z-index: 10;
  display: flex;
  align-items: center;
  padding-left: var(--page-pad);
  padding-right: var(--page-pad);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  color: var(--text);
}

@media (min-width: 768px) {
  .topbar-brand { font-size: 1.1rem; }
}

.maple { display: inline-flex; align-items: center; }
.maple-leaf { width: 1.05em; height: 1.05em; fill: var(--gold); flex: none; }

.cfc-crest { width: 1.2em; height: 1.2em; flex: none; }
.topbar-brand .cfc-crest { width: 2.3em; height: 2.3em; }

.nav-icon-line {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topbar-logout-form { display: flex; }
.topbar-logout,
.topbar-notify {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  padding: 0;
  color: var(--text-dim);
  cursor: pointer;
}
.topbar-logout:hover,
.topbar-notify:hover { color: var(--text); }

.notify-icon-on { display: none; }
.topbar-notify.subscribed { color: var(--accent); }
.topbar-notify.subscribed .notify-icon-off { display: none; }
.topbar-notify.subscribed .notify-icon-on { display: block; }

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: calc(var(--topbar-h) + env(safe-area-inset-top) + 16px) var(--page-pad) calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 24px);
  min-height: 100vh;
}

.bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  background: var(--card);
  border-top: 1px solid var(--card-border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}

.bottomnav-inner {
  display: flex;
  width: 100%;
  max-width: var(--page-max);
}

.bottomnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.7rem;
}

@media (min-width: 768px) {
  .bottomnav-item { font-size: 0.78rem; padding: 10px 0; }
}

.bottomnav-icon { font-size: 1.2rem; display: flex; }
.bottomnav-icon svg { display: block; }

.bottomnav-item.active { color: var(--accent); }

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 4px 0 12px;
}

.subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: -6px 0 14px;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

/* date strip */
.matches-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.date-strip {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 8px;
  scrollbar-width: none;
  /* Re-declares horizontal panning for this specific scroll container --
     .tab-viewport (an ancestor when this sits inside a tab panel) restricts
     touch to pan-y only for its own swipe-between-tabs gesture, which would
     otherwise also block this strip's own native horizontal scroll. */
  touch-action: pan-x;
}
.date-strip::-webkit-scrollbar { display: none; }

.matches-toolbar-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  font-size: 1rem;
  text-decoration: none;
  flex: none;
}
.icon-btn.active { color: var(--accent); border-color: var(--accent); }
.date-jump-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.date-chip {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  white-space: nowrap;
}

.date-chip.is-today { border-color: var(--accent); }

.date-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #08230f;
  font-weight: 700;
}

/* competition groups */
.comp-group { margin-bottom: 18px; }

.comp-group-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 6px;
  margin: 0 0 8px;
}

.empty-state {
  color: var(--text-dim);
  text-align: center;
  padding: 24px 12px;
  font-size: 0.9rem;
}

.error-state .error-detail {
  font-size: 0.75rem;
  font-family: monospace;
  word-break: break-word;
}

/* match rows */
.match-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  text-decoration: none;
  font-size: 0.88rem;
}

.match-team {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.match-team span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.match-team.home { justify-content: flex-end; text-align: right; }
.match-team.away { justify-content: flex-start; text-align: left; }

.match-center {
  flex: 0 0 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.match-score, .match-time { font-weight: 700; font-size: 0.95rem; }
.match-status {
  font-size: 0.62rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* live matches: clock to the left of the score instead of stacked below it */
.match-center.is-live { flex: 0 0 84px; flex-direction: row; gap: 6px; }
.match-live-clock {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
}
.match-live-clock::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: live-pulse 1.4s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.crest { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.crest-sm { width: 18px; height: 18px; }
.crest-lg { width: 40px; height: 40px; }
.crest-xl { width: 56px; height: 56px; }

/* match detail */
.match-hero {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 22px 14px;
  text-align: center;
  margin-bottom: 14px;
}
.match-hero-comp {
  color: var(--text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.match-hero-date {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin: 2px 0 20px;
}
.match-hero-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.match-hero-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.match-hero-team span {
  font-weight: 600;
  font-size: 0.92rem;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-hero-score {
  font-size: 1.7rem;
  font-weight: 800;
  flex: 0 0 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.match-hero-live-clock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.match-hero-live-clock::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: live-pulse 1.4s ease-in-out infinite;
}
.match-hero-status {
  margin-top: 18px;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* match info bar */
.match-info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 14px;
}
.match-info-item { display: flex; flex-direction: column; gap: 2px; }
.match-info-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.match-info-val { font-size: 0.85rem; font-weight: 600; }

/* match events timeline */
.timeline { display: flex; flex-direction: column; gap: 2px; }
.timeline-row {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--card-border);
}
.timeline-row:last-child { border-bottom: none; }
.timeline-minute {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
}
.timeline-side { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 0.82rem; }
.timeline-home { justify-content: flex-end; text-align: right; }
.timeline-away { justify-content: flex-start; text-align: left; }
.timeline-home .timeline-text { order: -1; }
.timeline-icon { flex-shrink: 0; font-size: 0.9rem; }
.timeline-card { display: inline-block; width: 10px; height: 14px; border-radius: 2px; }
.timeline-card.yellow { background: #e6c419; }
.timeline-card.red { background: #e6473f; }
.timeline-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.timeline-player { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-sub { font-size: 0.7rem; color: var(--text-dim); }

/* match stats comparison bars */
.stat-group { margin-bottom: 16px; }
.stat-group-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin: 0 0 8px;
}
.stat-compare-row {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.82rem;
}
.stat-compare-val { text-align: center; font-weight: 700; }
.stat-compare-mid { display: flex; flex-direction: column; gap: 4px; }
.stat-compare-title { font-size: 0.72rem; color: var(--text-dim); text-align: center; }
.stat-compare-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--card-border);
}
.stat-compare-bar-home { background: var(--accent); }
.stat-compare-bar-away { background: var(--text-dim); }

/* lineups */
.lineup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px) {
  .lineup-grid { grid-template-columns: 1fr 1fr; }
}
.lineup-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin: 10px 0 4px;
}
.lineup-player {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--card-border);
}
.lineup-player.unused { opacity: 0.5; }
.lineup-shirt {
  flex: 0 0 20px;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-dim);
}
.lineup-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lineup-sub-tag { font-size: 0.65rem; color: var(--text-dim); }
.lineup-rating {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

/* rating color bands, shared by pitch and substitute ratings */
.rating-red { background: #e6473f; color: #fff; }
.rating-orange { background: #e0942f; color: #1a1207; }
.rating-green { background: var(--accent); color: #0c0c12; }
.rating-blue { background: #3b82f6; color: #fff; }

/* club page: recent-form row (replaces the old standings-position block) */
.form-row { display: flex; gap: 8px; }
.form-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  flex: none;
}
.form-dot.form-win { background: var(--accent); color: #0c0c12; }
.form-dot.form-loss { background: #e6473f; color: #fff; }
.form-dot.form-draw { background: #6b6b7a; color: #fff; }

/* on-field formation pitch */
.pitch-heads {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.pitch-team-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 0;
}
.pitch-team-head span:not(.pitch-formation) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pitch-team-head.away { flex-direction: row-reverse; text-align: right; }
.pitch-formation { font-size: 0.68rem; font-weight: 400; color: var(--text-dim); flex-shrink: 0; }
.pitch-coaches {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin: -4px 0 12px;
}
.pitch-coaches span:last-child { text-align: right; }

.pitch-full {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  margin-bottom: 10px;
  background:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px) 0 0 / 100% 20%,
    repeating-linear-gradient(to bottom, #1e5c34, #1e5c34 10%, #226640 10%, #226640 20%);
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 8px;
  overflow: hidden;
}
.pitch-halfway-line {
  /* not too intrusive -- pitch markings sit at 50% opacity throughout */
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 2px;
  background: rgba(255,255,255,0.5);
  transform: translateY(-1px);
}
.pitch-halfway-circle {
  position: absolute;
  top: 50%; left: 50%;
  width: 24%;
  aspect-ratio: 1;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.pitch-box {
  position: absolute;
  left: 22%;
  right: 22%;
  height: 11%;
  border: 2px solid rgba(255,255,255,0.5);
}
.pitch-box.top { top: 0; border-top: none; border-radius: 0 0 4px 4px; }
.pitch-box.bottom { bottom: 0; border-bottom: none; border-radius: 4px 4px 0 0; }
.pitch-player {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 19%;
}
.pitch-jersey {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-dark);
  border: 2px solid #fff;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.45);
  flex-shrink: 0;
}
.pitch-jersey img { width: 100%; height: 100%; object-fit: cover; }
.pitch-jersey.away { background: var(--gold); }
.pitch-rating {
  margin-top: -8px;
  align-self: flex-end;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 0 3px;
  border-radius: 3px;
  line-height: 1.3;
}
.pitch-player-name {
  margin-top: 2px;
  font-size: 0.6rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
}
.pitch-number { color: rgba(255,255,255,0.7); font-weight: 700; }
.pitch-sub-tag {
  font-size: 0.55rem;
  color: var(--text-dim);
  background: rgba(0,0,0,0.55);
  padding: 0 3px;
  border-radius: 3px;
}
.pitch-player.subbed-out .pitch-jersey { opacity: 0.5; }
.pitch-player.subbed-out .pitch-player-name { opacity: 0.6; }
.pitch-player, .lineup-player { cursor: pointer; }

/* player info popup -- tap a pitch/substitute player in the lineups tab */
.player-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
}
/* Author CSS setting `display` always beats the UA stylesheet's own
   [hidden] { display: none }, regardless of the hidden attribute being
   present -- without this override, the rule above alone means the modal
   is actually visible (and, at position:fixed/inset:0/z-index:200,
   capturing every touch on the page) from the moment the page loads,
   confirmed 2026-07 as the real cause of a match page looking dimmed and
   completely unresponsive to horizontal touches. */
.player-modal-backdrop[hidden] { display: none; }
@media (min-width: 640px) {
  .player-modal-backdrop { align-items: center; }
}
.player-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px 16px 0 0;
  padding: 20px;
}
@media (min-width: 640px) {
  .player-modal { border-radius: 16px; }
}
.player-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--bg);
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.player-modal-close:hover { color: #fff; }
.player-modal-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  padding-right: 30px;
}
.player-modal-meta {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.player-modal-meta span:not(:last-child)::after { content: '·'; margin-left: 10px; color: var(--card-border); }
.player-modal-section-label {
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.player-modal-club-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--card-border);
  font-size: 0.86rem;
}
.player-modal-club-row:first-child { border-top: none; }
.player-modal-club-team { color: #fff; }
.player-modal-club-years { color: var(--text-dim); flex: none; white-space: nowrap; }
.player-modal-loading, .player-modal-error { color: var(--text-dim); font-size: 0.86rem; padding: 4px 0; }

.player-modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.player-modal-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  text-align: center;
}
.player-modal-stat-value { font-size: 1.05rem; font-weight: 700; color: var(--gold); }
.player-modal-stat-label { font-size: 0.65rem; color: var(--text-dim); line-height: 1.2; }

/* list cards (competitions, teams) */
.list-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  text-decoration: none;
  font-size: 0.95rem;
}
.chevron { margin-left: auto; color: var(--text-dim); font-size: 1.2rem; }

/* news feed */
.news-feed { display: flex; flex-direction: column; gap: 10px; }
.news-card {
  display: flex;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px;
  text-decoration: none;
  color: var(--text);
}
.news-thumb {
  width: 88px;
  height: 66px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--card-border);
}
.news-card-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.news-card-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.7rem;
  color: var(--text-dim);
}
.news-badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.news-badge-cpl { background: var(--gold); color: #13131c; }
.news-badge-player { background: var(--accent-dark); color: #fff; }
.news-players { font-size: 0.72rem; color: var(--text-dim); }

/* standings table */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -2px;
  touch-action: pan-x; /* see .date-strip -- same reasoning */
}
.standings {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.standings th, .standings td { padding: 8px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.standings th {
  color: var(--text-dim);
  font-size: 0.68rem;
  text-transform: uppercase;
  text-align: center;
  border-bottom: 1px solid var(--card-border);
}
.standings td.num, .standings th.num { text-align: center; width: 9.5%; }
.standings td.num:first-child, .standings th.num:first-child { width: 7%; }
.standings .teamcol { text-align: left; }
.team-link { display: flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; min-width: 0; }
.team-link .team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.standings tbody tr { border-bottom: 1px solid var(--card-border); background: var(--card); }
.standings td.pts { font-weight: 700; color: var(--accent); }

/* club comparison cards */
.club-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  text-decoration: none;
}
.club-card-head { display: flex; align-items: center; gap: 10px; }
.club-card-name { font-weight: 700; font-size: 1.02rem; }
.club-card-sub { color: var(--text-dim); font-size: 0.78rem; }

.club-card-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--card-border);
}
.club-card-stats.standalone { border-top: none; padding-top: 0; margin-top: 0; }
.club-card-stats > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-val { font-weight: 700; font-size: 0.95rem; }
.stat-val.pts { color: var(--accent); }
.stat-label { color: var(--text-dim); font-size: 0.62rem; text-transform: uppercase; }

.club-card-row { font-size: 0.82rem; color: var(--text); margin-top: 8px; }
.club-card-row-label {
  display: inline-block;
  background: var(--card-border);
  color: var(--text-dim);
  font-size: 0.62rem;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
}

/* ── Home page team logo grid ─────────────────────────────────────────────── */
.home-teams-section {
  margin-bottom: 28px;
}

.team-logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

@media (min-width: 520px) {
  .team-logo-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

.team-logo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.12s;
  cursor: pointer;
}

.team-logo-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* 3D stage: the crest floats above a podium disc, tilted in perspective */
.tlc-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 78px;
  perspective: 500px;
}

@media (min-width: 768px) {
  .tlc-stage { height: 86px; }
}

.tlc-float {
  transform-style: preserve-3d;
  animation: tlcFloat 3.2s ease-in-out infinite;
}

/* stagger the bob (and its podium's shadow-pulse) so a grid of crests
   doesn't all float in unison */
.team-logo-card:nth-child(5n+1) .tlc-float, .team-logo-card:nth-child(5n+1) .tlc-podium { animation-delay: -0.1s; }
.team-logo-card:nth-child(5n+2) .tlc-float, .team-logo-card:nth-child(5n+2) .tlc-podium { animation-delay: -0.7s; }
.team-logo-card:nth-child(5n+3) .tlc-float, .team-logo-card:nth-child(5n+3) .tlc-podium { animation-delay: -1.4s; }
.team-logo-card:nth-child(5n+4) .tlc-float, .team-logo-card:nth-child(5n+4) .tlc-podium { animation-delay: -2.1s; }
.team-logo-card:nth-child(5n+5) .tlc-float, .team-logo-card:nth-child(5n+5) .tlc-podium { animation-delay: -2.7s; }

.tlc-img {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
  transform-style: preserve-3d;
  filter: drop-shadow(0 0 0 transparent);
  transition: filter 0.25s ease;
}

@media (min-width: 768px) {
  .tlc-img { width: 60px; height: 60px; }
}

.team-logo-card:hover .tlc-img {
  filter:
    drop-shadow(0 0 2px var(--accent))
    drop-shadow(0 0 6px var(--accent))
    drop-shadow(0 0 14px var(--accent-dark));
  animation: tlcSpin 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) 1;
}

/* podium: a glowing 3D disc the crest hovers above */
.tlc-podium {
  width: 62%;
  height: 12px;
  margin-top: -2px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(42, 213, 114, 0.4) 0%, rgba(42, 213, 114, 0.14) 45%, transparent 75%);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: tlcPodiumPulse 3.2s ease-in-out infinite;
}

.team-logo-card:hover .tlc-podium {
  background: radial-gradient(ellipse at center, rgba(42, 213, 114, 0.65) 0%, rgba(42, 213, 114, 0.22) 45%, transparent 75%);
}

@keyframes tlcFloat {
  0%, 100% { transform: translateY(0) rotateX(8deg); }
  50%      { transform: translateY(-7px) rotateX(-6deg); }
}

@keyframes tlcPodiumPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50%      { transform: scale(0.82); opacity: 0.55; }
}

@keyframes tlcSpin {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(1080deg); }
}

@media (prefers-reduced-motion: reduce) {
  .tlc-float, .tlc-podium { animation: none; }
  .team-logo-card:hover .tlc-img { animation: none; }
}

.tlc-name {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.3;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Stats & Matches tab bar ──────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 2px solid var(--card-border);
  margin-bottom: 0;
  position: sticky;
  top: calc(var(--topbar-h) + env(safe-area-inset-top));
  background: var(--bg);
  z-index: 5;
  margin-left: calc(-1 * var(--page-pad));
  margin-right: calc(-1 * var(--page-pad));
  padding-left: var(--page-pad);
  padding-right: var(--page-pad);
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 0 0 auto;
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-btn:hover:not(.active) { color: var(--text); }

.tab-viewport {
  overflow: hidden;
  width: 100%;
  margin-left: calc(-1 * var(--page-pad));
  margin-right: calc(-1 * var(--page-pad));
  /* Without this, a real touch browser is free to treat a horizontal drag
     as its own gesture (overscroll navigation, edge swipe-back) instead of
     handing it to app.js's initTabSwipe -- pan-y keeps vertical scrolling
     untouched but tells the browser this element owns horizontal touches. */
  touch-action: pan-y;
}

.tab-track {
  display: flex;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.tab-panel {
  flex: 0 0 100%;
  min-width: 0;
  padding: 16px var(--page-pad) 0;
}

.standings-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* ── Home page two-column layout ─────────────────────────────────────────── */
.home-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 1060px) {
  .home-layout {
    grid-template-columns: 1fr 296px;
    align-items: start;
    gap: 20px;
  }
}

/* Section label — same style as .widget-header so both columns top-align */
.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 2px 0 10px;
}

/* stat grid: always 2 columns once there's enough room */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 520px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.stat-card-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px 9px;
  border-bottom: 1px solid var(--card-border);
}

.stat-card-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.stat-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0;
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

/* stacked competition + season selects */
.stat-filters {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  align-items: flex-end;
}

.filter-select {
  appearance: none;
  background: var(--bg);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  font-size: 0.68rem;
  padding: 3px 20px 3px 7px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5'%3E%3Cpath d='M0 0l4.5 5L9 0z' fill='%238d8d9c'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  width: 130px;
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-select:focus { outline: none; border-color: var(--accent); }
.filter-select:disabled { opacity: 0.5; cursor: default; }

.stat-table-wrap {
  flex: 1;
  overflow: hidden;
}

.stat-loading {
  padding: 28px 14px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* stat table (player rankings) */
.stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.stat-table th {
  color: var(--text-dim);
  font-size: 0.68rem;
  text-transform: uppercase;
  text-align: center;
  padding: 6px 8px;
  border-bottom: 1px solid var(--card-border);
}

.stat-table th:nth-child(2) { text-align: left; }

.stat-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--card-border);
  vertical-align: middle;
}

.stat-table tbody tr:last-child td { border-bottom: none; }
.stat-table tbody tr:hover { background: rgba(255,255,255,0.025); }

.stat-table td.num, .stat-table th.num { text-align: center; }

.rank {
  color: var(--text-dim);
  font-size: 0.75rem;
  width: 28px;
}

.player-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.player-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  display: block;
}

.player-team {
  color: var(--text-dim);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  display: block;
}

.stat-val-col {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ── Matches widget (home page right sidebar) ────────────────────────────── */
.matches-widget {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1060px) {
  .matches-widget {
    position: sticky;
    top: calc(var(--topbar-h) + env(safe-area-inset-top) + 16px);
    max-height: calc(100vh - var(--topbar-h) - var(--bottomnav-h) - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--card-border) transparent;
  }
  .matches-widget::-webkit-scrollbar { width: 4px; }
  .matches-widget::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 2px; }
}

.widget-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 2px 12px 10px;
  flex-shrink: 0;
}

/* date strip */
.widget-date-strip {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 5px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--card-border);
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}
.widget-date-strip::-webkit-scrollbar { display: none; }
.widget-date-strip.dragging { cursor: grabbing; }

.widget-date-chip {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-dim);
  padding: 4px 7px;
  min-width: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  pointer-events: auto;
}

.widget-date-chip:hover { border-color: var(--text-dim); }

.widget-date-chip.has-match:not(.active) {
  border-color: rgba(42, 213, 114, 0.4);
}

.widget-date-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #08230f;
}

.wdc-top {
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.wdc-bot {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

/* match list inside widget */
.widget-comp-group { border-bottom: 1px solid var(--card-border); }
.widget-comp-group:last-child { border-bottom: none; }

.widget-comp-title {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  padding: 6px 10px 4px;
  border-bottom: 1px solid var(--card-border);
}

.widget-match-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--card-border);
  text-decoration: none;
  color: var(--text);
  font-size: 0.76rem;
}
.widget-match-row:last-child { border-bottom: none; }
.widget-match-row:hover { background: rgba(255,255,255,0.03); }

.wmr-team {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
}
.wmr-team span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wmr-team.away { justify-content: flex-end; }

.wmr-center {
  flex: 0 0 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-align: center;
}
.wmr-score, .wmr-time { font-weight: 700; font-size: 0.8rem; }
.wmr-status { font-size: 0.55rem; color: var(--text-dim); text-transform: uppercase; }

.wmr-center.is-live { flex: 0 0 62px; flex-direction: row; gap: 4px; }
.wmr-live-clock {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--accent);
}
.wmr-live-clock::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: live-pulse 1.4s ease-in-out infinite;
}

/* recap tab */
.recap-date-heading {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 6px;
  margin: 20px 0 10px;
}
.recap-date-heading:first-child { margin-top: 0; }

.recap-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.recap-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.recap-card-teams {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  flex-wrap: wrap;
}

.recap-card-score {
  color: var(--accent);
  font-weight: 700;
  padding: 0 2px;
}

.recap-card-comp {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  white-space: nowrap;
}

.recap-headline {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.3;
}
.recap-headline a { color: var(--text); text-decoration: none; }
.recap-headline a:hover { color: var(--accent); }

.recap-summary {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-dim);
}

.load-more-btn {
  display: block;
  width: 100%;
  margin: 8px 0 20px;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.load-more-btn:hover { border-color: var(--accent); color: var(--accent); }
.load-more-btn:disabled { opacity: 0.6; cursor: default; }

/* ── Recap card's Recap/Full Article slider ──────────────────────────────── */
.recap-tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 10px;
}
.recap-tab-btn {
  flex: 0 0 auto;
  padding: 6px 10px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-dim);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.recap-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.recap-tab-btn:hover:not(.active) { color: var(--text); }

.recap-tab-viewport { overflow: hidden; width: 100%; }
.recap-tab-track { display: flex; transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
.recap-tab-panel { flex: 0 0 100%; min-width: 0; }

.article-hero { margin: 0 0 10px; }
.article-hero img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: var(--card-border);
}
.article-hero figcaption {
  font-size: 0.62rem;
  color: var(--text-dim);
  margin-top: 4px;
}
.article-hero figcaption a { color: var(--text-dim); }

.article-headline { margin: 0 0 8px; font-size: 1rem; line-height: 1.3; }
.article-para { font-size: 0.85rem; line-height: 1.65; color: var(--text); margin: 0 0 10px; }
.article-wordcount {
  font-size: 0.62rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── CPL history page ─────────────────────────────────────────────────────── */
.history-jumpnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.history-jumpnav a {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}
.history-jumpnav a:hover { border-color: var(--accent); color: var(--accent); }

.history-footnote {
  color: var(--text-dim);
  font-size: 0.76rem;
  margin-top: 8px;
  line-height: 1.4;
}

.history-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  scroll-margin-top: calc(var(--topbar-h) + 12px);
}
.history-card-folded { opacity: 0.85; }

.history-crest-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-border);
  border-radius: 50%;
  font-size: 1.4rem;
}

.history-nickname { color: var(--text-dim); font-weight: 500; font-size: 0.85rem; }

.history-former-names {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin: 8px 0 0;
  font-style: italic;
}

.history-info-bar { margin-top: 12px; }

.history-honours {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.history-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(42, 213, 114, 0.12);
  color: var(--accent);
}
.history-badge.shield { background: rgba(141, 141, 156, 0.15); color: var(--text); }
.history-badge.none { background: transparent; color: var(--text-dim); font-weight: 500; }

.history-transfer {
  font-size: 0.82rem;
  color: var(--text);
  margin: 12px 0 0;
  line-height: 1.4;
}

.history-facts-list {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.history-facts-list li { margin-bottom: 4px; }

/* ── Login page ────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  margin-bottom: 20px;
}
.login-crest { width: 84px; height: 84px; flex: none; }

.login-copy {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  margin: 0 0 16px;
  line-height: 1.4;
}

.login-error {
  background: rgba(230, 71, 63, 0.12);
  color: #e6473f;
  font-size: 0.82rem;
  padding: 8px 10px;
  border-radius: 8px;
  margin: 0 0 14px;
}


.login-btn {
  background: var(--accent);
  color: #08130d;
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
}

/* ── National team player cards ──────────────────────────────────────────── */
.player-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}

.player-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.player-summary::-webkit-details-marker { display: none; }
.player-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.player-thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  flex: none;
  background: var(--bg);
  border: 1px solid var(--card-border);
}

.player-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.player-num {
  font-weight: 700;
  font-size: 1rem;
  color: var(--card-border);
  min-width: 1.4em;
  text-align: center;
  flex: none;
}
.player-num.has-num { color: var(--accent); }

.player-summary-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.player-name {
  font-weight: 600;
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cap-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 3px;
  padding: 0 4px;
  vertical-align: middle;
}

.player-club {
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-summary-stats {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.player-card[open] .player-summary { border-bottom: 1px solid var(--card-border); }
.player-card[open] .player-num,
.player-card[open] .player-name { color: var(--accent); }

.player-detail {
  padding: 14px 16px 18px;
}

.player-photo-figure {
  margin: 0 0 14px;
}

.player-photo {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  object-position: top center;
  border-radius: 8px;
  display: block;
  border: 1px solid var(--card-border);
}

.player-photo-credit {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 5px;
}
.player-photo-credit a { color: var(--text-dim); text-decoration: underline; }
.player-photo-credit a:hover { color: var(--text); }

.player-detail p {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.55;
  margin: 0 0 10px;
}

.player-bio-line {
  color: var(--text-dim) !important;
  font-size: 0.8rem !important;
}

.player-detail-heading {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 16px 0 8px;
}
.player-detail-heading:first-of-type { margin-top: 0; }

.player-timeline {
  margin: 0 0 10px;
  padding-left: 16px;
  list-style: none;
  border-left: 2px solid var(--card-border);
}
.player-timeline li {
  position: relative;
  padding: 0 0 8px 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.player-timeline li::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--text-dim);
}
.player-timeline li:last-child::before { border-color: var(--accent); }

.player-flag {
  background: rgba(216, 164, 56, 0.1);
  border: 1px dashed var(--gold);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.8rem;
}
.player-flag strong {
  display: block;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.66rem;
  margin-bottom: 4px;
}
.player-flag p {
  margin: 0 0 4px;
  color: var(--text-dim);
  font-size: 0.8rem !important;
}
.player-flag p:last-child { margin-bottom: 0; }
.login-btn:hover { background: var(--accent-dark); }
