/* ============================================
   SportsMatrix — Public site (prototype-inspired)
   ============================================ */

/* Dark theme (default) — match homepage: same gradient, section/card colors */
:root,
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-deep: #0a0e12;
  --surface: rgba(15, 23, 42, 0.6);
  --surface-elevated: rgba(30, 41, 59, 0.85);
  --border: rgba(255, 255, 255, 0.15);
  --border-glow: rgba(255, 255, 255, 0.3);
  --text: #f1f5f9;
  --text-muted: rgba(255, 255, 255, 0.75);
  --accent: #c24141;
  --live: #3fb950;
  --live-glow: rgba(63, 185, 80, 0.25);
  --winner: #7ee787;
  --font-sans: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --glass-bg: rgba(15, 23, 42, 0.5);
  --glass-border: 1px solid rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg-deep: #f1f5f9;
  --surface: #ffffff;
  --surface-elevated: #f0f2f5;
  --border: rgba(0, 0, 0, 0.1);
  --border-glow: #c24141;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #c24141;
  --live: #1a7f37;
  --live-glow: rgba(26, 127, 55, 0.2);
  --winner: #1a7f37;
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: 1px solid rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;   /* root-level safety net for horizontal overflow */
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #1c1917 100%);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: var(--safe-bottom);
}

[data-theme="light"] body {
  background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 50%, #f8fafc 100%);
}

/* Hide scrollbars app-wide; sections remain scrollable (touch, wheel, keyboard) */
html,
body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Utility: scrollable area with hidden scrollbar; use on any overflow container */
.scrollable-hidden-scrollbar {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-y: contain;
}
.scrollable-hidden-scrollbar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Common header – same as homepage .top-banner (blue-to-red gradient, height) */
.header-wrapper {
  position: relative;
}
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(90deg, #1a2a6c, #b21f1f);
  min-height: 60px;
  padding: 10px 20px;
  padding-top: calc(10px + var(--safe-top));
  box-sizing: border-box;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

[data-theme="light"] .header {
  background: linear-gradient(90deg, #2a3a7c 0%, #c23030 100%);
  border-bottom-color: rgba(0,0,0,0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.theme-toggle {
  flex-shrink: 0;
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--text);
  border-color: var(--text-muted);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.header-nav {
  display: none;
  align-items: center;
  gap: 4px;
}
@media (min-width: 640px) {
  .header-nav { display: flex; }
  .nav-toggle { display: none; }
}
.header-nav-link {
  color: #fff;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}
.header-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .header-nav-link {
  color: #fff;
}
[data-theme="light"] .header-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.header-user-name {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 6px 8px 14px;
  margin-right: 2px;
}
.header-logout {
  opacity: 0.9;
}
.header-register {
  background: rgba(255, 255, 255, 0.2);
}
.header-register:hover {
  background: rgba(255, 255, 255, 0.3);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
}
.logo-img {
  height: 48px;
  max-height: 70px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
}
.logo-text {
  color: inherit;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

/* Ribbon: Home + Sports — full width across screen, pill tabs centered */
.sports-nav {
  position: relative;
  z-index: 9;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background: linear-gradient(90deg, #1a2a6c, #b21f1f);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  box-sizing: border-box;
}

.sports-nav::-webkit-scrollbar {
  display: none;
}

.sports-nav-inner {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 4px;
  min-width: min-content;
}

.sports-nav .sport-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  color: #1e293b;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 20px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.sports-nav .sport-tab:hover,
.sports-nav .sport-tab:focus-visible {
  background: #fff;
  color: #0f172a;
  font-weight: 700;
}

.sports-nav .sport-tab.active {
  background: #c24141;
  color: #fff;
  border-color: rgba(255,255,255,0.35);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sports-nav .sport-tab.active:hover,
.sports-nav .sport-tab.active:focus-visible {
  background: #d64545;
  color: #fff;
}

.sports-nav .sport-tab i {
  font-size: 14px;
  opacity: 0.9;
}

/* Mobile: accordion menu — Contact, News, Login/Profile, etc.; desktop: hide */
.mobile-accordion {
  display: none;
}
@media (max-width: 639px) {
  .mobile-accordion {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(90deg, #1a2a6c, #b21f1f);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .mobile-accordion.open {
    max-height: min(85vh, 400px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-accordion .mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: 8px 0 16px;
    min-height: min-content;
  }
  .mobile-nav-link {
    display: block;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    border-radius: 0;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
  }
  /* Ribbon always visible, horizontally scrollable */
  .sports-nav {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    flex-wrap: nowrap;
    padding: 12px 16px;
  }
  .sports-nav-inner {
    flex-wrap: nowrap;
    min-width: min-content;
  }
}

/* Homepage: hero video — full width, preserve aspect ratio */
.home-hero-video-wrap {
  width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  position: relative;
}
.hero-mute-btn {
  position: absolute;
  bottom: 14px;
  right: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.hero-mute-btn:hover {
  background: rgba(0, 0, 0, 0.78);
  transform: scale(1.08);
}
.hero-mute-btn svg {
  pointer-events: none;
  display: block;
}
.home-hero-video {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  align-self: start;
}
@media (max-width: 768px) {
  .home-hero-video {
    max-height: 50vh;
    object-fit: contain;
  }
}

/* Homepage: content breakout so hero is full width when inside .main */
.main .home-hero-video-wrap {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  max-width: 100vw;
  box-sizing: border-box;
}
.main .home-main-wrap.home-main {
  max-width: min(720px, 100%);
  width: 100%;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 20px) clamp(1rem, 4vw, 16px) clamp(1.25rem, 4vw, 24px);
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
@media (min-width: 1024px) {
  .main .home-main-wrap.home-main {
    max-width: 960px;
    padding: 24px 20px 32px;
  }
}

/* Homepage: card list uses same rules as base .card-list / .match-card-link (no overrides) */
.home-main .card-link.hidden {
  display: none;
}
.home-main .live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(194, 65, 65, 0.4);
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.home-main .section-placeholder {
  padding: 16px;
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}
.home-main .section-placeholder a {
  color: var(--accent);
}
[data-theme="light"] .home-main .section {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .home-main .section-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .home-main .section-title {
  color: var(--text-muted);
}

/* Homepage: Sports News section – same container as .section (padding, border, background) */
.home-main .news-section,
.news-section {
  margin-top: 0;
  margin-bottom: 24px;
  margin-left: 0;
  margin-right: 0;
  padding: 20px 16px 24px 16px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  overflow: visible;
  display: block;
  box-sizing: border-box;
}
.home-main .news-section .news-section-title,
.news-section .news-section-title,
.home-main .news-section h2,
.news-section h2 {
  margin: 0 0 16px 0;
  padding: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}
.home-main .news-grid,
.news-section .news-grid,
#news.news-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  row-gap: 28px;
  column-gap: 28px;
  gap: 28px;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.home-main .news-card,
.section.news-section .news-card {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
}
.home-main .news-card:hover,
.section.news-section .news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.35);
}
.home-main .news-card-img,
.section.news-section .news-card-img {
  height: 160px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}
.home-main .news-card-img img,
.section.news-section .news-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.home-main .news-card-body,
.section.news-section .news-card-body {
  padding: 18px;
}
.home-main .news-card-title,
.section.news-section .news-card-title {
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.35;
  display: block;
}
.home-main .news-card-meta,
.section.news-section .news-card-meta {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 8px;
}
.home-main .news-loading,
.home-main .news-error,
.section.news-section .news-loading,
.section.news-section .news-error {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}
@media (max-width: 768px) {
  .home-main .news-section,
  .news-section {
    padding: 16px 12px 20px 12px;
  }
  .home-main .news-grid,
  .news-section .news-grid,
  #news.news-grid {
    grid-template-columns: 1fr;
    row-gap: 22px;
    column-gap: 22px;
    gap: 22px;
  }
  .home-main .news-section .news-section-title,
  .news-section .news-section-title,
  .home-main .news-section h2,
  .news-section h2 {
    font-size: 1.35rem;
    margin-bottom: 12px;
  }
  .home-main .news-card-body,
  .news-section .news-card-body {
    padding: 14px;
  }
  .home-main .news-card-img,
  .news-section .news-card-img {
    height: 140px;
  }
}

.main {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  box-sizing: border-box;
}

/* Dashboard organization: section heading (icon + title) */
.section-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
}
.section-head-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.section-head-icon i {
  font-size: 1rem;
}
.section-head .section-title {
  margin: 0;
}
.section-head .live-dot {
  margin-left: 0.25rem;
}

/* Sport section pages: separate pages, no in-page scroll; content full width with slight margins */
.sport-section-page {
  /* Use padding instead of margin for horizontal inset so width:100% never overflows */
  padding: 0 1rem 2rem;
  box-sizing: border-box;
  width: 100%;
}
.sport-section-page .section-content {
  overflow: visible;
  max-height: none;
  /* Remove the extra inner padding — the parent already provides horizontal inset */
  padding: 0 0 1rem;
  box-sizing: border-box;
}

.tournament-list,
.team-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  padding: 0 0.75rem;
  box-sizing: border-box;
}
.tournament-list-item,
.team-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  box-sizing: border-box;
  width: 100%;
}
.tournament-list-item:hover,
.team-list-item:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tournament-list-item-logo,
.team-list-item-logo {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: #0f172a;
  padding: 3px;
  box-sizing: border-box;
}
.team-list-item-text {
  flex: 1;
  min-width: 0;
}
.team-list-item-meta {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}
.team-list-item:hover .team-list-item-meta {
  color: rgba(255, 255, 255, 0.9);
}
.tournament-list-item-text {
  flex: 1;
  min-width: 0;
  text-align: left;
}

/* ========== Tournament detail page: hero, bracket diagram, grouped fixtures ========== */
.tournament-detail-page {
  margin: 0 1rem 2rem;
  max-width: 80rem;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}
.tournament-detail-hero {
  background: linear-gradient(90deg, #1a2a6c, #b21f1f);
  border-radius: 1.25rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.25);
}
[data-theme="light"] .tournament-detail-hero {
  background: linear-gradient(90deg, #2a3a7c 0%, #c23030 100%);
  border-color: rgba(0, 0, 0, 0.08);
}
.tournament-detail-hero-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.tournament-detail-logo {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 0.5rem;
  background: #0f172a;
  padding: 4px;
  box-sizing: border-box;
}
.tournament-detail-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}
.tournament-detail-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
}
.tournament-section {
  margin-bottom: 2rem;
}
.tournament-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tournament-section-title i {
  color: var(--accent);
}

/* ========== Bracket section: header + diagram (theme-aligned, with jerseys) ========== */
.bracket-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
[data-theme="dark"] .bracket-section {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
}
.bracket-section-head {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem 0.75rem;
}
.bracket-section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 1rem;
  flex-shrink: 0;
}
.bracket-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.bracket-section-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  width: 100%;
  max-width: 36rem;
  padding-left: calc(2.25rem + 0.75rem);
  box-sizing: border-box;
}

/* Tabbed control for match type: All | Qualifiers | Group stage | Knockout | ... (horizontal scroll, single line) */
.bracket-type-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.35rem 0.25rem 0.4rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.bracket-type-tabs::-webkit-scrollbar {
  height: 10px;
}
.bracket-type-tabs::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 5px;
  margin: 0 0.5rem;
}
.bracket-type-tabs::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 5px;
}
.bracket-type-tabs::-webkit-scrollbar-thumb:hover {
  background: var(--text);
}
.bracket-type-tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.bracket-type-tab:hover {
  color: var(--text);
  background: var(--surface);
}
.bracket-type-tab.active {
  color: var(--bg);
  background: var(--accent);
}
.bracket-type-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.bracket-type-tab i {
  font-size: 0.9em;
  opacity: 0.9;
}

.bracket-diagram {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
.bracket-flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: min-content;
  width: max-content;
}
.bracket-diagram--tabbed .bracket-flow {
  width: 100%;
  max-width: 100%;
  justify-content: flex-start;
}
.bracket-diagram--tabbed.bracket-diagram--all .bracket-flow {
  width: max-content;
  min-width: min-content;
}
.bracket-connector {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  opacity: 0.7;
}
.bracket-diagram--tabbed .bracket-connector {
  display: none;
}
.bracket-diagram--tabbed.bracket-diagram--all .bracket-connector {
  display: flex;
}

.bracket-phase {
  flex: 0 0 auto;
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}
.bracket-phase-panel {
  display: none;
}
.bracket-phase-panel.active {
  display: block;
}
.bracket-diagram--tabbed.bracket-diagram--all .bracket-phase-panel {
  display: block;
}
[data-theme="dark"] .bracket-phase {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
}
.bracket-phase:not(:first-child) {
  border-left: none;
}
.bracket-phase-header {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  padding: 0.6rem 0.75rem;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.bracket-phase-icon {
  color: var(--accent);
  font-size: 0.75rem;
}
.bracket-phase-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.bracket-stage {
  border-radius: 8px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  overflow: hidden;
}
.bracket-stage-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
}
.bracket-match-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}
.bracket-match-slot {
  margin: 0 0 0.75rem 0;
  padding: 0 0.5rem;
}
.bracket-match-slot:last-child {
  margin-bottom: 0;
}
.bracket-match-link {
  display: block;
  text-decoration: none;
  color: var(--text);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.75rem 0.85rem;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.bracket-match-link:hover {
  border-color: var(--accent);
  background: var(--surface-elevated);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .bracket-match-link:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
/* Card row 1: Match Date and Time [ status period ] */
.bracket-match-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.bracket-match-time {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  flex: 1 1 auto;
  min-width: 0;
}
.bracket-match-status {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.bracket-match-status--live {
  color: #fff;
  background: var(--live, #22c55e);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.bracket-match-status--ft {
  color: var(--text-muted);
  background: var(--surface-elevated);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.bracket-result-pill {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-elevated);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid var(--border);
}
/* Card row 2: [Jersey] score [Jersey] */
.bracket-match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}
.bracket-match-jerseys {
  margin-bottom: 0.5rem;
}
.bracket-match-jerseys .bracket-team-jersey {
  flex: 0 0 auto;
  width: 40px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  overflow: hidden;
}
.bracket-match-jerseys .bracket-score-cell {
  flex: 0 0 auto;
  padding: 0 0.5rem;
}
.bracket-jersey-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.bracket-logo-img {
  padding: 3px;
}
.bracket-jersey-placeholder {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.bracket-score-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}
.bracket-score {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.bracket-vs {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
/* Card row 3: Team Name (left) Team Name (right) */
.bracket-match-names {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.bracket-match-names {
  align-items: flex-start;
}
.bracket-match-names .bracket-team-name {
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.bracket-match-names .bracket-team-name--1 {
  text-align: left;
  padding-right: 0.5rem;
}
.bracket-match-names .bracket-team-name--2 {
  text-align: right;
  padding-left: 0.5rem;
}
/* Group label shown below team name inside bracket cards */
.bracket-team-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.bracket-team-group {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted, #8b9cb0);
  letter-spacing: 0.03em;
  opacity: 0.85;
}
.bracket-match-names .bracket-team-name--1 .bracket-team-group { text-align: left; }
.bracket-match-names .bracket-team-name--2 .bracket-team-group { text-align: right; }
.bracket-live-pill {
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: var(--live, #22c55e);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Grouped fixtures on tournament detail */
.fixtures-phase {
  margin-bottom: 1.5rem;
}
.fixtures-phase-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.fixtures-stage {
  margin-bottom: 1.25rem;
}
.fixtures-stage-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem 0;
}
.fixtures-stage-list {
  padding: 0;
}
.tournament-detail-page .breadcrumb {
  margin-bottom: 1rem;
}

/* Tournament detail: mobile centering */
@media (max-width: 640px) {
  .tournament-detail-page {
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    max-width: 100%;
  }
  .bracket-section-head {
    text-align: center;
    justify-content: center;
  }
  .bracket-section-title {
    text-align: center;
    width: 100%;
  }
  .bracket-section-desc {
    padding-left: 0;
    text-align: center;
  }
  .bracket-type-tabs {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .bracket-diagram {
    margin-left: auto;
    margin-right: auto;
  }
  .bracket-diagram--tabbed .bracket-flow {
    justify-content: center;
  }
  .bracket-phase-panel.active {
    margin-left: auto;
    margin-right: auto;
  }
  .tournament-section-title,
  .fixtures-phase-title {
    text-align: center;
  }
}

.dashboard-section {
  margin-bottom: 2rem;
}
.dashboard-section:last-child {
  margin-bottom: 0;
}

/* Sport page hero (SportsMatrix theme: same as header) */
.page-hero-banner {
  border-radius: 1.25rem;
  padding: 1.5rem;
  color: #fff;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
  background: linear-gradient(90deg, #1a2a6c, #b21f1f);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .page-hero-banner {
  background: linear-gradient(90deg, #2a3a7c 0%, #c23030 100%);
  border-color: rgba(0, 0, 0, 0.08);
}
.page-hero-banner-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.page-hero-banner-icon {
  width: 3rem;
  height: 3rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.page-hero-banner h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}
.page-hero-banner .page-subtitle {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Sport page tab bar (SportsMatrix accent) */
.dashboard-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--surface-elevated);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.dashboard-tabs::-webkit-scrollbar { display: none; }
.dashboard-tab {
  flex: 1;
  min-width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}
.dashboard-tab:hover {
  background: var(--surface);
  color: var(--text);
}
.dashboard-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.dashboard-tab i {
  font-size: 1rem;
  opacity: 0.9;
}

.section {
  margin-bottom: 24px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

[data-theme="light"] .home-main .news-section,
[data-theme="light"] .news-section {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .section {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
}

.section-header {
  flex-shrink: 0;
  padding: 16px 20px;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.section-header .section-head {
  margin-bottom: 0;
}

/* Public section headings (admin match/team modals use .match-view-section .section-title in admin base) */
.section-title {
  margin: 0;
  font-size: clamp(0.75rem, 2vw, 0.8125rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="light"] .section-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .section-title {
  color: var(--text-muted);
}

.section-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.section-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.filter-chip.active {
  color: #0f172a;
  background: var(--accent);
  border-color: var(--accent);
}

[data-theme="light"] .filter-chip {
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.06);
  border-color: var(--border);
}

[data-theme="light"] .filter-chip:hover,
[data-theme="light"] .filter-chip:focus-visible {
  color: var(--text);
  border-color: var(--text-muted);
}

[data-theme="light"] .filter-chip.active {
  color: #fff;
}

/* ========== Common cards container (homepage, fixtures, any card list) ========== */
.section-scroll,
.section-scroll--full {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(50vh, 480px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-y: contain;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}
.section-scroll::-webkit-scrollbar,
.section-scroll--full::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.section-scroll-table {
  max-height: 38vh;
}

/* Padding between section-scroll and card-list */
.section-scroll,
.section-scroll--full {
  padding: 0.75rem 0;
  box-sizing: border-box;
}

/* Card list inside section-scroll: padding so cards don't touch edges; space from scroll container */
.section-scroll .card-list,
.section-scroll--full .card-list {
  padding: 0.5rem 1rem 1.25rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.card-link:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-link.hidden {
  display: none;
}

.standings-content.hidden {
  display: none !important;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 12px var(--live-glow);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Card list: single column; padding between list and cards, gap between each card */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0.75rem 0.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.card-list > .match-card-link,
.card-list > .card-link {
  flex: 0 0 auto;
  min-width: 0;
  margin: 0;
}
.card-list--center {
  align-items: center;
  margin-left: auto;
  margin-right: auto;
}
.card-list--center .match-card {
  width: 100%;
}

/* ========== Match card: .match-card-link is the card shell; no side margin (container padding handles inset) ========== */
.match-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  /* Card shell – same as inner card */
  border-radius: 1rem;
  overflow: hidden;
  padding: 1rem;
  min-height: 8.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  background: linear-gradient(to bottom right, #f8fafc, #f1f5f9);
  border: 1px solid rgba(100, 116, 139, 0.3);
  box-shadow: 0 10px 40px -10px rgba(71, 85, 105, 0.2);
}
.match-card-link:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* When link wraps the card, inner .match-card is content-only (no second box) */
.match-card-link .match-card {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  min-height: 0;
  border-radius: 0;
}
/* Standalone match card (e.g. detail page, no link): keeps full card shell */
.match-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-radius: 1rem;
  overflow: hidden;
  padding: 1rem;
  width: 100%;
  max-width: 100%;
  min-height: 8.5rem;
  box-sizing: border-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  background: linear-gradient(to bottom right, #f8fafc, #f1f5f9);
  border: 1px solid rgba(100, 116, 139, 0.3);
  box-shadow: 0 10px 40px -10px rgba(71, 85, 105, 0.2);
}
.match-card.match-detail-card {
  min-height: 0;
}
.match-card__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  gap: 0.5rem;
  text-align: center;
}
.match-card__sport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 0;
}
.match-card__sport-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: #64748b;
}
.match-card--live .match-card__sport-dot {
  animation: pulse 1.5s ease-in-out infinite;
  background: var(--live);
}
.match-card__sport-label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-card__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.match-card__meta-period {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.match-card__countdown {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--live);
  min-width: 2.5rem;
  text-align: center;
}
.match-card__time-pill {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  background: linear-gradient(to right, #64748b, #475569);
}
/* Winner badge on result cards */
.match-card__winner-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  vertical-align: middle;
  margin-left: 4px;
}
/* Teams: stacked rows */
.match-card__teams {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.match-card__team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(100, 116, 139, 0.25);
  box-sizing: border-box;
}
.match-card__footer {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(100, 116, 139, 0.2);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.match-card__footer-league,
.match-card__footer-venue {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-card__footer-sep {
  opacity: 0.7;
}
.match-card__team-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}
.match-card__jersey {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border-radius: 0.5rem;
  flex-shrink: 0;
  display: flex;
  background: #0f172a;
  align-items: center;
  justify-content: center;
  overflow: visible;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
}
.match-card__jersey-server-dot {
  display: none;
  position: absolute;
  top: -2px;
  right: -2px;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #64748b;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}
.match-card__jersey--serving .match-card__jersey-server-dot {
  display: block;
}
.match-card__jersey-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
  box-sizing: border-box;
}
.match-card__jersey-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: linear-gradient(to bottom right, #64748b, #475569);
  box-shadow: 0 0 0 1px rgba(71, 85, 105, 0.3);
}
.match-card__team-row--1 .match-card__jersey-placeholder {
  background: linear-gradient(to bottom right, #64748b, #475569);
  box-shadow: 0 0 0 1px rgba(71, 85, 105, 0.3);
}
.match-card__team-row--2 .match-card__jersey-placeholder {
  background: linear-gradient(to bottom right, #475569, #334155);
  box-shadow: 0 0 0 1px rgba(51, 65, 85, 0.3);
}
.match-card__team-name-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
  justify-content: center;
}
.match-card__team-name {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.875rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-card__team-sub {
  font-size: 0.6875rem;
  color: #64748b;
  line-height: 1.2;
}
.match-card__score {
  font-size: 1.75rem;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 2rem;
  text-align: right;
  line-height: 1.2;
  color: #334155;
}
.match-card__team-row--1 .match-card__score {
  color: #334155;
}
.match-card__team-row--2 .match-card__score {
  color: #475569;
}

/* Extended card sections (detail page only): half/quarter stats, quick stats, pickleball game status */
.match-card__half-stats,
.match-card__quarter-stats,
.match-card__game-status {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .match-card__half-stats,
[data-theme="dark"] .match-card__quarter-stats,
[data-theme="dark"] .match-card__game-status {
  border-top-color: rgba(255, 255, 255, 0.1);
}
.match-card__stats-grid {
  display: grid;
  gap: 0.25rem 0.5rem;
  font-size: 0.75rem;
}
.match-card__stats-grid--halves {
  grid-template-columns: auto 1fr 1fr;
}
.match-card__stats-grid--halves.match-card__stats-grid--has-et {
  grid-template-columns: auto 1fr 1fr 1fr 1fr;
}
.match-card__stats-grid--quarters {
  grid-template-columns: auto repeat(4, 1fr);
}
.match-card__stats-header-cell {
  color: #64748b;
  font-weight: 500;
  text-align: center;
}
.match-card__stats-header-cell:first-child {
  text-align: left;
}
.match-card__stats-row-label {
  font-weight: 600;
  color: #475569;
}
[data-theme="dark"] .match-card__stats-row-label { color: #94a3b8; }
.match-card__stats-cell {
  text-align: center;
  padding: 0.25rem 0.375rem;
  border-radius: 0.25rem;
  font-weight: 500;
  color: #334155;
}
[data-theme="dark"] .match-card__stats-cell { color: #e2e8f0; }
.match-card__stats-grid--halves .match-card__stats-cell:nth-child(5),
.match-card__stats-grid--halves .match-card__stats-cell:nth-child(6) { background: rgba(100, 116, 139, 0.12); }
.match-card__stats-grid--halves .match-card__stats-cell:nth-child(8),
.match-card__stats-grid--halves .match-card__stats-cell:nth-child(9) { background: rgba(71, 85, 105, 0.12); }
.match-card__stats-grid--halves.match-card__stats-grid--has-et .match-card__stats-cell:nth-child(7),
.match-card__stats-grid--halves.match-card__stats-grid--has-et .match-card__stats-cell:nth-child(8),
.match-card__stats-grid--halves.match-card__stats-grid--has-et .match-card__stats-cell:nth-child(9),
.match-card__stats-grid--halves.match-card__stats-grid--has-et .match-card__stats-cell:nth-child(10) { background: rgba(100, 116, 139, 0.12); }
.match-card__stats-grid--halves.match-card__stats-grid--has-et .match-card__stats-cell:nth-child(12),
.match-card__stats-grid--halves.match-card__stats-grid--has-et .match-card__stats-cell:nth-child(13),
.match-card__stats-grid--halves.match-card__stats-grid--has-et .match-card__stats-cell:nth-child(14),
.match-card__stats-grid--halves.match-card__stats-grid--has-et .match-card__stats-cell:nth-child(15) { background: rgba(71, 85, 105, 0.12); }
.match-card__stats-grid--quarters .match-card__stats-cell:nth-child(7),
.match-card__stats-grid--quarters .match-card__stats-cell:nth-child(8),
.match-card__stats-grid--quarters .match-card__stats-cell:nth-child(9),
.match-card__stats-grid--quarters .match-card__stats-cell:nth-child(10) { background: rgba(100, 116, 139, 0.12); }
.match-card__stats-grid--quarters .match-card__stats-cell:nth-child(12),
.match-card__stats-grid--quarters .match-card__stats-cell:nth-child(13),
.match-card__stats-grid--quarters .match-card__stats-cell:nth-child(14),
.match-card__stats-grid--quarters .match-card__stats-cell:nth-child(15) { background: rgba(71, 85, 105, 0.12); }

.match-card__quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.match-card__quick-stat {
  padding: 0.5rem 0.5rem;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
[data-theme="dark"] .match-card__quick-stat {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}
.match-card__quick-stat-label {
  font-size: 0.6875rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.match-card__quick-stat-val {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #334155;
}
[data-theme="dark"] .match-card__quick-stat-val { color: #e2e8f0; }

.match-card__game-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.match-card__game-status-title {
  font-size: 0.75rem;
  color: #64748b;
}
.match-card__game-status-playing-to {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}
.match-card__games-won {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.match-card__games-won-box {
  padding: 0.625rem;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  text-align: center;
}
.match-card__games-won-box:first-child { border-color: rgba(100, 116, 139, 0.35); }
[data-theme="dark"] .match-card__games-won-box {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}
.match-card__games-won-val {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #475569;
}
.match-card__games-won-box:last-child .match-card__games-won-val { color: #475569; }
[data-theme="dark"] .match-card__games-won-box:last-child .match-card__games-won-val { color: #94a3b8; }
.match-card__games-won-label {
  display: block;
  font-size: 0.6875rem;
  color: #64748b;
  margin-top: 0.125rem;
}
.match-card__match-history {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  font-size: 0.75rem;
  text-align: center;
}
.match-card__match-history-item {
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(241, 245, 249, 0.6);
}
.match-card__match-history-item--current {
  border-color: rgba(100, 116, 139, 0.5);
  background: rgba(100, 116, 139, 0.12);
}
.match-card__match-history-game {
  display: block;
  font-weight: 500;
  color: #475569;
}
.match-card__match-history-score {
  display: block;
  margin-top: 0.25rem;
  font-weight: 700;
  color: #475569;
}
.match-card__match-history-item:not(.match-card__match-history-item--current) .match-card__match-history-score {
  color: #64748b;
}

/* One design for all sports; modifiers (--football, --basketball, --pickleball, --live, --fixture, --result) are for semantics only */
.match-card:hover {
  filter: brightness(0.98);
}
.match-card-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 48px -12px rgba(0, 0, 0, 0.15);
}
.match-card-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 1rem;
}
[data-theme="dark"] .match-card-link {
  background: linear-gradient(to bottom right, #1e293b, #0f172a);
  border-color: rgba(100, 116, 139, 0.35);
}
[data-theme="dark"] .match-card__team-name { color: #f1f5f9; }
[data-theme="dark"] .match-card__team-sub { color: #94a3b8; }
[data-theme="dark"] .match-card { background: linear-gradient(to bottom right, #1e293b, #0f172a); border-color: rgba(100, 116, 139, 0.35); }
[data-theme="dark"] .match-card .match-card__team-row { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .match-card__sport-label { color: #94a3b8; }
[data-theme="dark"] .match-card__time-pill { background: linear-gradient(to right, #475569, #334155); }
[data-theme="dark"] .match-card__jersey-placeholder { background: linear-gradient(to bottom right, #475569, #334155); }
[data-theme="dark"] .match-card__score { color: #e2e8f0; }
/* Match card uses same size everywhere (see .match-card above) */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.standings-table {
  width: 100%;
  min-width: 320px;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.standings-table th,
.standings-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.standings-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.standings-table th:last-child,
.standings-table td:last-child {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
}

.standings-table tbody tr:last-child td {
  border-bottom: none;
}

.standings-table tbody tr:nth-child(1) td:first-child {
  color: var(--accent);
}

/* ========== League standings page (tabular layout) ========== */
.standings-page {
  max-width: 100%;
  box-sizing: border-box;
}

.standings-page .standings-section {
  margin-bottom: 0;
}

.standings-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.standings-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
}

[data-theme="dark"] .standings-title {
  color: rgba(255, 255, 255, 0.95);
}

.standings-league-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.standings-league-nav::-webkit-scrollbar {
  display: none;
}

.standings-league-chip {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-decoration: none;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.standings-league-chip:hover,
.standings-league-chip:focus-visible {
  color: var(--text);
  border-color: var(--accent);
  background: var(--surface);
}

.standings-league-chip.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

[data-theme="light"] .standings-league-chip.active {
  color: #fff;
}

.standings-content {
  padding: 1.25rem 20px 24px;
}

.standings-empty {
  margin: 0;
  padding: 24px 16px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.standings-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-elevated);
}

.standings-page .standings-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.standings-page .standings-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
}

.standings-page .standings-table th {
  padding: 12px 10px;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

.standings-page .standings-table .col-rank {
  width: 36px;
  min-width: 36px;
  text-align: center;
  padding-left: 12px;
}

.standings-page .standings-table .col-team {
  text-align: left;
  min-width: 140px;
  padding-left: 12px;
  padding-right: 16px;
}

.standings-page .standings-table .col-num {
  width: 40px;
  min-width: 40px;
  text-align: center;
}

.standings-page .standings-table .col-pts {
  font-weight: 700;
  min-width: 44px;
}

.standings-page .standings-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.standings-page .standings-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .standings-page .standings-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.04);
}

.standings-page .standings-table tbody tr:last-child {
  border-bottom: none;
}

.standings-page .standings-table td {
  padding: 10px;
  vertical-align: middle;
}

.standings-page .standings-table .col-rank {
  font-weight: 700;
  color: var(--text-muted);
}

.standings-page .standings-table .standings-row--top .col-rank {
  color: var(--accent);
  font-weight: 800;
}

.standings-page .standings-table .col-num {
  font-variant-numeric: tabular-nums;
}

.standings-page .standings-table .col-pts {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.standings-team-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}

.standings-team-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 5px;
  background: #0f172a;
  padding: 2px;
  box-sizing: border-box;
}

.standings-team-name {
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

[data-theme="dark"] .standings-team-name {
  color: rgba(255, 255, 255, 0.95);
}

/* Mobile: compact table and card-like rows for very small screens */
@media (max-width: 640px) {
  .standings-header {
    padding: 12px 16px 10px;
  }

  .standings-title {
    font-size: 0.9rem;
  }

  .standings-content {
    padding: 1rem 16px 20px;
  }

  .standings-page .standings-table {
    min-width: 360px;
    font-size: 0.8125rem;
  }

  .standings-page .standings-table th,
  .standings-page .standings-table td {
    padding: 10px 8px;
  }

  .standings-page .standings-table .col-team {
    min-width: 120px;
  }

  .standings-team-logo {
    width: 24px;
    height: 24px;
  }
}

.footer {
  padding: 20px 16px;
  padding-bottom: calc(20px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  text-align: center;
  max-width: 100%;
}

.footer p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (min-width: 641px) {
  .nav-toggle {
    display: none;
  }
  .header-inner,
  .main {
    max-width: 720px;
  }
  .sports-nav {
    justify-content: center;
    width: 100%;
  }
  .main {
    padding: 24px 20px 32px;
  }
  .section {
    margin-bottom: 32px;
  }
  .section-scroll-table {
    max-height: min(38vh, 360px);
  }
  .match-card-link:hover {
    border-color: var(--accent);
  }
}

@media (min-width: 1024px) {
  .header-inner,
  .main {
    max-width: 960px;
  }
  .sports-nav {
    width: 100%;
  }
  .section-filters {
    flex-wrap: wrap;
    gap: 8px;
  }
  .section-scroll-table {
    max-height: min(38vh, 400px);
  }
  .logo {
    font-size: 1.35rem;
  }
  .logo-img {
    height: 40px;
  }
  .footer {
    max-width: 960px;
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot {
    animation: none;
  }
  .match-card,
  .sport-tab {
    transition: none;
  }
}

/* ============================================
   Match details page (prototype-style)
   ============================================ */
.main.details-page-main,
.details-page-inner {
  max-width: 640px;
  margin: 0 auto;
}
.details-page-inner {
  padding: 0 clamp(1rem, 4vw, 16px) clamp(1.25rem, 4vw, 24px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}
@media (min-width: 641px) {
  .details-page-inner {
    padding: 0 20px 32px;
  }
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.back-link:hover {
  text-decoration: underline;
}
.details-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 20px;
}
.details-card.live {
  border-left: 4px solid var(--live);
}
.details-league {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.details-tournament-logo {
  height: 28px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 5px;
  background: #0f172a;
  padding: 3px;
  box-sizing: border-box;
}
.details-team-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
  min-height: 32px;
}
.details-team-logo {
  height: 32px;
  width: auto;
  max-width: 40px;
  object-fit: contain;
  border-radius: 5px;
  background: #0f172a;
  padding: 3px;
  box-sizing: border-box;
}
.details-team-jersey {
  height: 32px;
  width: auto;
  max-width: 40px;
  object-fit: contain;
}
.details-team-jersey {
  max-height: 32px;
}
.match-stage-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: var(--accent);
  color: var(--bg);
  border-radius: 4px;
}
.fixture-stage-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent);
  margin-left: 4px;
}
.details-score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 20px 0;
}
.details-team {
  text-align: center;
  min-width: 100px;
}
.details-team-name {
  font-weight: 700;
  font-size: 1.1rem;
}
.details-score {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
}
.details-vs {
  color: var(--text-muted);
  font-weight: 600;
}
.details-status {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.details-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 20px 0 10px;
}
.details-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.details-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.details-list li:last-child {
  border-bottom: none;
}
.details-placeholder {
  color: var(--text-muted);
  text-align: center;
  padding: 40px 20px;
}

/* Info / blocks */
.details-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.details-block h3 {
  margin: 0 0 12px 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.details-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
}
.details-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.details-info-item .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.details-info-item .value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

/* Stats comparison bars */
.details-stats-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.details-stats-row:last-child {
  margin-bottom: 0;
}
.details-stats-row .team1-val {
  width: 48px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.details-stats-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}
.details-stats-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-elevated);
}
.details-stats-bar.team1 {
  background: var(--accent);
  opacity: 0.9;
}
.details-stats-bar.team2 {
  background: var(--text-muted);
}
.details-stats-row .team2-val {
  width: 48px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.details-stats-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-align: center;
}

/* Stats / Teams / Scorecard cards: use app theme (var(--surface), var(--text), etc.) */
.details-block-stats { padding: 0; }
.stats-card,
.details-page-inner .stats-card,
.details-page-inner .football-match-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.stats-card-bg {
  position: absolute;
  inset: 0;
  background: var(--surface);
  pointer-events: none;
}
.stats-card-inner {
  position: relative;
  z-index: 1;
  padding: 20px 24px 24px;
  color: var(--text);
}
.stats-card-header {
  text-align: center;
  margin-bottom: 20px;
}
.stats-card-time {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.stats-card-score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.stats-card-team {
  flex: 1;
  min-width: 100px;
  max-width: 180px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stats-card-team-left { justify-content: center; }
.stats-card-team-right { justify-content: center; }
.stats-card-team-flag {
  width: 28px;
  height: 20px;
  object-fit: contain;
  margin-right: 8px;
  border-radius: 2px;
}
.stats-card-team-right .stats-card-team-flag { margin-right: 0; margin-left: 8px; order: 1; }
.stats-card-team-jersey {
  width: 32px;
  height: 40px;
  object-fit: contain;
  margin-right: 8px;
  flex-shrink: 0;
}
.stats-card-team-right .stats-card-team-jersey { margin-right: 0; margin-left: 8px; order: 1; }
.stats-card-team-name {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
}
.stats-card-score {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
  min-width: 70px;
  text-align: center;
}
.stats-card-score .stats-card-score-sep { font-weight: 700; opacity: 0.95; }
.stats-card-status {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 8px;
}
.stats-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stats-card-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text);
}
.stats-card-row:last-child { border-bottom: none; }
.stats-card-val {
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: center;
}
.stats-card-row .stats-card-val:first-child { text-align: right; }
.stats-card-row .stats-card-val:last-child { text-align: left; }
.stats-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: center;
}
.stats-card-empty {
  position: relative;
  z-index: 1;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 16px;
  margin: 0;
  font-size: 0.9rem;
}

/* Stats card: resize and align on mobile */
@media (max-width: 640px) {
  .stats-card {
    border-radius: 10px;
    overflow: hidden;
  }
  .stats-card-inner {
    padding: 14px 16px 18px;
  }
  .stats-card-header {
    margin-bottom: 14px;
  }
  .stats-card-time {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }
  .stats-card-score-row {
    gap: 6px;
    flex-wrap: nowrap;
  }
  .stats-card-team {
    min-width: 0;
    max-width: none;
    flex: 1 1 0;
    padding: 8px 6px;
  }
  .stats-card-team-name {
    font-size: 0.6rem;
    letter-spacing: 0.05em;
  }
  .stats-card-score {
    font-size: 1.2rem;
    min-width: 52px;
    flex-shrink: 0;
  }
  .stats-card-body .stats-card-row {
    padding: 8px 0;
    font-size: 0.85rem;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }
  .stats-card-label {
    font-size: 0.65rem;
  }
}

/* Scorecard timeline */
.details-scorecard-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.details-scorecard-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.details-scorecard-list li:last-child {
  border-bottom: none;
}
.details-scorecard-time {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 36px;
}
.details-scorecard-detail {
  flex: 1;
}
.details-scorecard-detail .event {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}
.details-scorecard-detail .sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.details-scorecard-side {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}
.details-scorecard-side.team2 {
  color: var(--text-muted);
}

/* Formation */
.details-formation-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.details-formation-team {
  background: var(--surface-elevated);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--border);
}
.details-formation-team h4 {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.details-formation-shape {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}
.details-formation-lineup {
  font-size: 0.875rem;
  color: var(--text);
}
.formation-lineup-group {
  margin-bottom: 14px;
}
.formation-lineup-group:last-child {
  margin-bottom: 0;
}
.formation-lineup-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.formation-lineup-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.formation-lineup-row:last-child {
  margin-bottom: 0;
}
.formation-lineup-row:hover {
  border-color: var(--text-muted);
}
.formation-lineup-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.formation-lineup-info {
  flex: 1;
  min-width: 0;
}
.formation-lineup-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  display: block;
}
.formation-lineup-pos {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.formation-lineup-captain {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: rgba(88, 166, 255, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
}

/* Penalties */
.details-penalties-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.details-penalties-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.details-penalties-list li:last-child {
  border-bottom: none;
}
.details-penalties-list .team-badge {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text);
}
.details-penalties-list .outcome {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
}
.details-penalties-list .outcome.scored {
  color: var(--live);
}
.details-penalties-list .outcome.saved {
  color: var(--text-muted);
}
.details-penalty-shootout-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Tabs */
.details-tabs {
  display: flex;
  gap: 2px;
  margin-top: 5px;
  margin-bottom: 0;
  padding: 0 4px;
  background: var(--surface-elevated);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: wrap;
  touch-action: manipulation;
}
.details-tabs::-webkit-scrollbar {
  display: none;
}
.details-tab {
  flex-shrink: 0;
  min-height: 44px;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(234, 179, 8, 0.2);
}
.details-tab:hover {
  color: var(--text);
  background: var(--surface);
}
.details-tab.active {
  color: var(--bg);
  background: var(--accent);
}
.details-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.details-panels {
  margin-top: 12px;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.details-panel {
  display: none;
  animation: detailsFade 0.2s ease;
  min-height: 0;
}
.details-panel.active {
  display: block;
  overflow-x: hidden;
}
@keyframes detailsFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Formation: single pitch, both teams, circular number markers (ref: isometric pitch, red/blue GK, grey 2–11) */
.formation-pitch-wrap {
  margin-bottom: 20px;
  padding: 12px;
  background: rgba(0,0,0,0.35);
  border-radius: 12px;
  perspective: 120px;
  overflow: hidden;
}
.formation-pitch-unified {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  aspect-ratio: 70/105;
  background: linear-gradient(165deg, #2a7d2a 0%, #228b22 35%, #1e7a1e 70%, #1a6b1a 100%);
  border: 3px solid rgba(255,255,255,0.9);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), inset 0 0 0 2px rgba(0,0,0,0.1);
  transform: rotateX(4deg);
}
.pitch-line {
  position: absolute;
  background: rgba(255,255,255,0.85);
}
.pitch-halfway {
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
}
.pitch-center-circle {
  left: 50%;
  top: 50%;
  width: 26%;
  height: 26%;
  margin-left: -13%;
  margin-top: -13%;
  border: 3px solid rgba(255,255,255,0.8);
  border-radius: 50%;
  background: transparent;
}
.pitch-penalty-area {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 68%;
  height: 17%;
  border: 2px solid rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.08);
}
.pitch-pa-top { top: 0; border-top: none; border-radius: 0 0 8px 8px; }
.pitch-pa-bottom { bottom: 0; border-bottom: none; border-radius: 8px 8px 0 0; }
.pitch-six-yard {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 48%;
  height: 6%;
  border: 2px solid rgba(255,255,255,0.75);
  background: transparent;
}
.pitch-six-top { top: 0; border-top: none; border-radius: 0 0 4px 4px; margin-top: 0; }
.pitch-six-bottom { bottom: 0; border-bottom: none; border-radius: 4px 4px 0 0; }
.pitch-goal-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255,255,255,0.95);
}
.pitch-gl-top { top: 0; }
.pitch-gl-bottom { bottom: 0; }
/* Jersey-image markers: kit fills the circle, number label sits below */
.formation-player-marker {
  position: absolute;
  width: 38px;
  height: 38px;
  margin-left: -19px;
  margin-top: -19px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 2px 8px rgba(0,0,0,0.55);
  z-index: 2;
  overflow: visible;
  /* fallback background when no jersey image */
  background: rgba(71,85,105,0.85);
}
/* GK: distinct ring colour */
.formation-player-marker.team1.gk {
  border-color: #ef4444;
  box-shadow: 0 2px 8px rgba(0,0,0,0.55), 0 0 0 2px rgba(239,68,68,0.55);
  background: rgba(194,65,65,0.7);
}
.formation-player-marker.team2.gk {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(0,0,0,0.55), 0 0 0 2px rgba(59,130,246,0.55);
  background: rgba(37,99,235,0.7);
}
/* Jersey kit image — fills the circle */
.formation-marker-kit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  padding: 3px;
  box-sizing: border-box;
}
/* Jersey number — small label below the circle */
.formation-marker-num {
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,1), 0 0 5px rgba(0,0,0,0.9);
  white-space: nowrap;
  line-height: 1;
  pointer-events: none;
}
/* Formation team sub-tabs: show only selected team on pitch + lineup */
.formation-sub-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.formation-sub-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.formation-sub-tab:hover { color: #fff; background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.35); }
.formation-sub-tab.active { color: #fff; background: rgba(229,9,20,0.6); border-color: rgba(229,9,20,0.8); }

/* Light mode: formation team buttons use theme so they stay visible */
[data-theme="light"] .formation-sub-tab {
  color: var(--text);
  background: var(--surface-elevated);
  border-color: var(--border);
}
[data-theme="light"] .formation-sub-tab:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="light"] .formation-sub-tab.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.formation-tab-kit {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}
.formation-pitch-unified[data-formation-active-team="1"] .formation-marker-team2 { display: none; }
.formation-pitch-unified[data-formation-active-team="2"] .formation-marker-team1 { display: none; }
.formation-lineup-team-panel { display: none; }
.formation-lineup-team-panel.active { display: block; grid-column: 1 / -1; }
/* Two-column player lists below pitch; theme-aligned panels */

.formation-lineups-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.formation-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow: hidden;
}
.formation-panel h4 {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  color: var(--text);
}
.formation-panel .details-formation-shape {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.formation-panel .formation-lineup-row {
  background: transparent;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 6px;
}
.formation-panel .formation-lineup-row-alt {
  background: var(--surface-elevated);
}
.formation-panel .formation-lineup-name {
  color: var(--text);
}
.formation-panel .formation-lineup-pos {
  color: var(--text-muted);
}
.formation-panel .formation-lineup-num {
  background: var(--surface-elevated);
  color: var(--text);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
@media (max-width: 640px) {
  .formation-lineups-two-col { grid-template-columns: 1fr; }
}

/* Teams tab */
.teams-sub-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--surface-elevated);
  padding: 4px;
  border-radius: var(--radius-sm);
  touch-action: manipulation;
}
.teams-sub-tab {
  flex: 1;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(234, 179, 8, 0.2);
}
.teams-sub-tab:hover {
  color: var(--text);
  background: var(--surface);
}
.teams-sub-tab.active {
  color: var(--bg);
  background: var(--accent);
}
.team-sub-panel {
  display: none;
}
.team-sub-panel.active {
  display: block;
}
.team-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
  margin-bottom: 20px;
}
.team-details-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.team-details-item .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.team-details-item .value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.team-players-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.team-players-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.team-players-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.team-players-list li:last-child {
  border-bottom: none;
}
.team-players-list .jersey {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
.team-player-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.team-player-jersey-wrap {
  position: relative;
  width: 40px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-elevated, #21262d);
  border-radius: 6px;
  overflow: hidden;
}
.team-player-jersey-img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.team-player-jersey-num {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.team-players-list .player-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}
.team-players-list .player-pos {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Teams tab: team stats (tabbed) */
.teams-sub-tabs { display: flex; gap: 4px; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.teams-sub-tab { padding: 10px 16px; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); background: transparent; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; border-radius: 6px 6px 0 0; transition: color 0.2s, background 0.2s; }
.teams-sub-tab:hover { color: var(--text); background: var(--surface-elevated); }
.teams-sub-tab.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--surface-elevated); }
.team-stats-sub-panel { display: none; padding: 1rem 0; }
.team-stats-sub-panel.active { display: block; }
.team-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.team-stats-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--surface-elevated); border-radius: 8px; border: 1px solid var(--border); }
.team-stats-item .label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.team-stats-item .value { font-size: 1.1rem; font-weight: 700; color: var(--text); }

/* Players tab */
.players-sub-tabs { display: flex; gap: 4px; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0; touch-action: manipulation; }
.players-sub-tab { min-height: 44px; padding: 10px 16px; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); background: transparent; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; border-radius: 6px 6px 0 0; transition: color 0.2s, background 0.2s; touch-action: manipulation; -webkit-tap-highlight-color: rgba(234, 179, 8, 0.2); }
.players-sub-tab:hover { color: var(--text); background: var(--surface-elevated); }
.players-sub-tab.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--surface-elevated); }
.players-sub-panel { display: none; }
.players-sub-panel.active { display: block; }
.match-players-list { list-style: none; padding: 0; margin: 0; }
.match-player-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.2s; border-radius: 8px; margin-bottom: 4px; }
.match-player-row:hover { background: var(--surface-elevated); }
.match-player-row:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.match-player-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.match-player-info .player-name { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.match-player-info .player-pos { font-size: 0.75rem; color: var(--text-muted); }
.match-player-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; align-items: center; }
.match-player-stat { font-size: 0.7rem; font-weight: 600; padding: 2px 6px; border-radius: 4px; line-height: 1.2; }
.match-player-stat--goal { background: rgba(34, 197, 94, 0.25); color: #22c55e; }
.match-player-stat--assist { background: rgba(59, 130, 246, 0.25); color: #3b82f6; }
.match-player-stat--yellow { background: rgba(234, 179, 8, 0.3); color: #eab308; }
.match-player-stat--double-yellow { background: rgba(234, 179, 8, 0.4); color: #facc15; }
.match-player-stat--red { background: rgba(239, 68, 68, 0.3); color: #ef4444; }

/* Player card modal – theme-aware (light/dark); uses app accent and surface vars */
/* Standalone player card page (/player/<id>) */
.player-card-page { max-width: 520px; margin: 0 auto; padding: 20px 16px 40px; }
.player-card-page .player-card-page-back { display: inline-block; margin-bottom: 20px; }
.player-card-page button.player-card-page-back { background: none; border: none; cursor: pointer; font: inherit; padding: 0; }
.player-card-standalone-wrap { width: 100%; display: flex; flex-direction: column; align-items: center; }

.player-card-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; overflow: auto; }
.player-card-overlay[hidden] { display: none !important; }
.player-card-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(10px); }
.player-card-wrap { position: relative; z-index: 1; width: 100%; max-width: 500px; max-height: 88vh; padding: 0 56px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; }
.player-card { position: relative; background: var(--surface); border: 2px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--glass-shadow), 0 20px 60px rgba(0,0,0,0.25); text-align: left; max-height: 88vh; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; color: var(--text); }
.player-card::-webkit-scrollbar { display: none; }
.player-card-header-strip { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--bg-deep); color: var(--text); border-bottom: 1px solid var(--border); }
.player-card-sport { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.player-card-header-strip .player-card-jersey-num { position: static; min-width: 46px; height: 46px; padding: 0 14px; display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-size: 1.3rem; font-weight: 800; border-radius: 12px; border: 1px solid var(--accent); }
.player-card-body { position: relative; display: flex; align-items: center; justify-content: center; gap: 0; min-height: 260px; padding: 20px 16px; background: var(--surface); }
.player-card-photo-block { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; min-width: 0; margin: 12px; }
.player-card-photo-wrap { position: relative; width: 180px; height: 180px; border-radius: 14px; overflow: hidden; border: 2px solid var(--border); flex-shrink: 0; background: var(--surface-elevated); }
.player-card-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.player-card-team-name { margin-top: 10px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text); text-align: center; line-height: 1.25; max-width: 140px; word-wrap: break-word; overflow-wrap: break-word; }
.player-card-side { display: flex; flex-direction: column; justify-content: center; gap: 10px; flex-shrink: 0; }
.player-card-side-left { align-items: center; }
.player-card-attr-circle { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; font-size: 0.6rem; line-height: 1.1; border: 1px solid var(--accent); }
.player-card-attr-circle .attr-label { font-size: 0.5rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.9; }
.player-card-attr-circle .attr-value { font-size: 0.9rem; }
.player-card-side-right { align-items: flex-end; text-align: right; min-width: 60px; }
.player-card-country { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; max-width: 80px; line-height: 1.25; }
.player-card-footer-strip { padding: 16px 18px; background: var(--bg-deep); color: var(--text); border-top: 1px solid var(--border); }
.player-card-name { margin: 0 0 6px 0; font-size: 1.2rem; font-weight: 800; color: var(--text); letter-spacing: 0.02em; text-transform: uppercase; line-height: 1.2; }
.player-card-meta { font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.player-card-rating { display: inline-flex; gap: 2px; letter-spacing: 0.1em; }
.player-card-rating .star { color: var(--accent); }
.player-card-rating .star.empty { color: var(--text-muted); opacity: 0.5; }
.player-card-progress-bars { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.player-card-progress-item { display: flex; align-items: center; gap: 10px; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text); }
.player-card-progress-item .p-label { min-width: 76px; }
.player-card-progress-item .p-bar-wrap { flex: 1; height: 7px; background: var(--surface-elevated); border-radius: 4px; overflow: hidden; border: 1px solid var(--border); }
.player-card-progress-item .p-bar { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s ease; }
.player-card-progress-item .p-bar--yellow { background: #eab308; }
.player-card-progress-item .p-bar--red { background: #ef4444; }
.player-card-progress-item .p-value { font-weight: 700; min-width: 30px; text-align: right; color: var(--accent); }
.player-card-tabs { display: flex; gap: 6px; padding: 12px 18px; background: var(--surface-elevated); border-top: 1px solid var(--border); justify-content: center; }
.player-card-tab { padding: 8px 16px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); background: transparent; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: color 0.2s, background 0.2s, border-color 0.2s; }
.player-card-tab:hover { color: var(--accent); background: var(--surface); border-color: var(--accent); }
.player-card-tab.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.player-card-tabpanels { padding: 14px 18px; min-height: 84px; background: var(--surface-elevated); border-top: 1px solid var(--border); }
.player-card-tabpanel { display: none; text-align: left; }
.player-card-tabpanel.active { display: block; }
#playerCardProfile { display: flex; flex-wrap: wrap; gap: 8px; }
.player-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.player-card-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.player-card-stat .label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.player-card-stat .value { font-size: 1rem; font-weight: 700; color: var(--text); }
.player-card-stat.none { grid-column: 1 / -1; color: var(--text-muted); font-size: 0.8rem; }
.player-card-attr { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 0.75rem; }
.player-card-attr .attr-label { color: var(--text-muted); }
.player-card-attr .attr-value { font-weight: 700; color: var(--text); }
.player-card-close { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border: none; background: var(--surface-elevated); color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer; border-radius: 50%; z-index: 3; transition: background 0.2s, color 0.2s; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--border); }
.player-card-close:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.player-card-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border: none; background: var(--surface-elevated); color: var(--text); font-size: 1.3rem; cursor: pointer; border-radius: 50%; z-index: 2; transition: background 0.2s, color 0.2s; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--border); }
.player-card-nav:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.player-card-nav:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.player-card-prev { left: 10px; }
.player-card-next { right: 10px; }

[data-theme="light"] .player-card-backdrop { background: rgba(0, 0, 0, 0.5); }
[data-theme="light"] .player-card-header-strip .player-card-jersey-num { color: #fff; }
@media (max-width: 480px) {
  .player-card-wrap { max-width: 100%; max-height: 85vh; padding: 0 52px; }
  .player-card { max-width: 420px; margin: 0 auto; max-height: 85vh; }
  .player-card-photo-block { margin: 10px; }
  .player-card-photo-wrap { width: 150px; height: 150px; border-radius: 12px; }
  .player-card-team-name { font-size: 0.65rem; max-width: 120px; margin-top: 8px; }
}

@media (max-width: 380px) {
  .details-info-grid,
  .team-details-grid {
    grid-template-columns: 1fr;
  }
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding: 0 4px;
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb-sep {
  margin: 0 6px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Coming soon page */
.coming-soon-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.coming-soon-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
}
.coming-soon-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  line-height: 1;
}
.coming-soon-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.coming-soon-text {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 24px;
  line-height: 1.5;
}
.coming-soon-text a {
  color: var(--accent);
  text-decoration: none;
}
.coming-soon-text a:hover {
  text-decoration: underline;
}
.btn-primary {
  display: inline-block;
  padding: 12px 24px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Page hero (fixtures and similar) */
.page-hero {
  margin-bottom: 24px;
}
.page-hero h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.page-hero .page-subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

/* Fixtures page layout: flex column so section-scroll can shrink and scroll */
.fixtures-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 20px) clamp(2rem, 6vw, 40px);
  box-sizing: border-box;
}
.fixtures-page .page-hero-banner {
  margin-bottom: 1.5rem;
}
.fixtures-page .page-hero {
  margin-bottom: clamp(1.25rem, 4vw, 28px);
  flex-shrink: 0;
}
.fixtures-page .page-hero h1 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  line-height: 1.2;
}
.fixtures-page .page-hero .page-subtitle {
  font-size: clamp(0.8125rem, 2.2vw, 0.9375rem);
}
.fixtures-page .breadcrumb {
  margin-bottom: 16px;
  padding: 0;
  flex-shrink: 0;
}
.fixtures-page .fixtures-tournament-bar {
  margin-bottom: clamp(1.25rem, 4vw, 28px);
  padding: 0 0 clamp(1rem, 3vw, 20px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.fixtures-page .section {
  margin-bottom: clamp(1.25rem, 4vw, 32px);
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.fixtures-page .section:last-of-type {
  margin-bottom: 0;
}
.fixtures-page .section-scroll--full {
  padding: 1rem 0 0.5rem;
}
.fixtures-page .section-empty {
  text-align: center;
  padding: clamp(1rem, 4vw, 24px) clamp(1rem, 4vw, 20px);
  margin: 0;
  font-size: clamp(0.8125rem, 2.2vw, 0.9375rem);
  color: var(--text-muted);
  line-height: 1.5;
}
/* Fixtures uses same .section-scroll container (no overrides) */
.fixtures-tournament-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.fixtures-tournament-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.fixtures-tournament-bar .section-filters {
  flex: 1;
  min-width: 0;
}
.fixtures-tournament-bar .filter-chip {
  text-decoration: none;
  color: inherit;
}
.fixtures-tournament-bar .filter-chip.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}
.subsection-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 16px 0 8px;
  padding-left: 4px;
}
.subsection-label:first-child {
  margin-top: 0;
}
.section-empty {
  padding: 20px 16px;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

/* Fixtures: League table (football) — list across container, left below label; logo + centered text */
.league-table-section {
  width: 100%;
}
.league-table-section .section-header.league-table-section-header {
  margin-bottom: 12px;
  text-align: left;
  width: 100%;
}
.league-table-section .section-title {
  text-align: left;
}
.league-list-wrap {
  width: 100%;
  padding: 0 16px;
  box-sizing: border-box;
}
.league-list-scroll {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: stretch;
  gap: 10px;
  max-height: min(280px, 40vh);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-y: contain;
}
.league-list-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.league-list-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  flex-shrink: 0;
  padding: 12px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: inherit;
  text-align: center;
}
.league-list-item-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 5px;
  background: #0f172a;
  padding: 2px;
  box-sizing: border-box;
}
.league-list-item-text {
  text-align: center;
  line-height: 1.2;
}
.league-list-item:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.league-table-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.league-table-overlay.is-open {
  opacity: 1;
  visibility: visible;
}
.league-table-overlay.is-open .league-table-popup {
  transform: scale(1);
}
.league-table-popup {
  width: 100%;
  width: 92%;
  max-width: 960px;
  min-height: 72vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-elevated);
  border: var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: scale(0.95);
  transition: transform 0.25s ease;
  overflow: hidden;
}
/* Tournament hero / advertisement-style header */
.league-table-popup-hero {
  position: relative;
  flex-shrink: 0;
  padding: 40px 56px 36px 28px;
  background: linear-gradient(135deg, var(--bg-deep) 0%, rgba(255, 255, 255, 0.04) 50%, var(--accent) 100%);
  background-size: 200% 200%;
  border-bottom: 2px solid var(--accent);
  text-align: center;
}
.league-table-popup-hero-inner {
  max-width: 560px;
  margin: 0 auto;
}
.league-table-popup-hero-logo {
  width: 220px;
  height: 220px;
  object-fit: contain;
  margin: 0 auto 20px;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}
.league-table-popup-hero-title {
  margin: 0 0 6px;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}
.league-table-popup-hero-subtitle {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.league-table-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.league-table-popup-close:hover {
  background: var(--accent);
  color: #fff;
}
.league-popup-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 16px 24px 0;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.league-popup-tab {
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.league-popup-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.league-popup-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.league-popup-panel {
  display: none;
  min-height: 0;
}
.league-popup-panel.active {
  display: block;
}
.league-popup-empty {
  margin: 0;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.league-table-popup-body .league-fixture-table a {
  color: var(--accent);
  text-decoration: none;
}
.league-table-popup-body .league-fixture-table a:hover {
  text-decoration: underline;
}
.league-table-popup-body {
  padding: 24px;
  overflow: auto;
  min-height: 0;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.league-table-loading,
.league-table-error {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.league-table-error {
  color: var(--accent);
}
.league-table-content {
  overflow-x: auto;
}
/* League/group table – dashboard pattern: dark banner header + card-like team rows */
.league-table-content .table-wrap {
  padding: 0;
  overflow-x: auto;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.league-table-content .leaderboard {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  border-radius: 0;
  overflow: hidden;
  min-width: 480px;
  border: none;
}
.league-table-content .leaderboard thead {
  display: table-header-group;
}
.league-table-content .leaderboard thead tr {
  background: linear-gradient(90deg, #1a2a6c 0%, #152a45 100%);
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}
.league-table-content .leaderboard th {
  padding: 12px 10px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: none;
}
.league-table-content .leaderboard th:first-child {
  text-align: left;
  padding-left: 16px;
}
.league-table-content .leaderboard th:nth-child(2) {
  text-align: left;
  padding-left: 12px;
}
.league-table-content .leaderboard tbody tr {
  background: rgba(30, 41, 59, 0.5);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.league-table-content .leaderboard tbody tr:hover {
  background: rgba(30, 41, 59, 0.8);
}
.league-table-content .leaderboard tbody tr:last-child {
  border-bottom: none;
}
.league-table-content .leaderboard td {
  padding: 12px 10px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text);
  border: none;
}
.league-table-content .leaderboard td:first-child {
  font-weight: 700;
  min-width: 44px;
  color: var(--text-muted);
}
.league-table-content .leaderboard th:nth-child(2),
.league-table-content .leaderboard td:nth-child(2) {
  text-align: left;
  padding-left: 14px;
}
.league-table-content .leaderboard .team-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  font-weight: 600;
}
.league-table-content .leaderboard .team-cell img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* League popup – Teams tab: dropdown, team detail, player detail */
.league-teams-container {
  min-height: 0;
}
.league-teams-view {
  padding: 0;
}
.league-teams-dropdown-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  text-align: center;
}
.league-teams-dropdown-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.league-teams-dropdown {
  min-width: 220px;
  max-width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.league-teams-back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 16px;
  padding: 8px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.league-teams-back:hover {
  text-decoration: underline;
}
.league-team-stats-title {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.league-team-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.league-team-stats-item {
  text-align: center;
}
.league-team-stats-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.league-team-stats-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.league-teams-subtitle {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}
.league-team-players {
  margin-top: 8px;
}
.league-player-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.league-player-list li {
  margin-bottom: 6px;
}
.league-player-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
  text-align: left;
  color: var(--text);
  text-decoration: none;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s;
}
.league-player-list-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
}
.league-player-list-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.league-player-list-name {
  flex: 1;
  font-weight: 500;
}
.league-player-list-number {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ============================================
   Contact page (extends base_public)
   ============================================ */
.contact-page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}
.contact-banner {
  margin: 20px 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.contact-banner .banner-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}
.contact-divider-line {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 30px 0;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin: 0 auto 40px;
  padding: 0;
}
.contact-card {
  background: var(--surface-elevated);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  padding: 24px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: var(--glass-border);
}
.contact-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.contact-card i {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 16px;
  display: block;
}
.contact-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--text);
}
.contact-card .value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  display: block;
  margin-bottom: 6px;
  transition: color 0.2s ease;
}
.contact-card .value:hover {
  color: var(--accent);
}
.contact-card .address {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}
.contact-card .address p {
  margin: 4px 0;
}
.sports-sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(90deg, #1a2a6c, #b21f1f);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.sports-sticky-bar-inner {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.sports-sticky-bar a {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.95);
  color: #1e293b;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sports-sticky-bar a:hover {
  background: #fff;
}
@media (max-width: 768px) {
  .sports-sticky-bar {
    display: block;
  }
  .contact-page-wrap {
    padding-bottom: 100px;
  }
}

/* ============================================
   News page (extends base_public)
   ============================================ */
.news-page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}
.news-category-strip {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 16px;
}
.news-category-strip::-webkit-scrollbar {
  display: none;
}
.news-category-strip .genre-filter {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
  border: 1px solid var(--border);
}
.news-category-strip .genre-filter:hover,
.news-category-strip .genre-filter.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.news-feed-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.news-feed-time-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}
.news-feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.news-feed-card {
  background: var(--surface-elevated);
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--glass-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.news-feed-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glass-shadow);
}
.news-feed-card.hidden {
  display: none;
}
.news-feed-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.news-feed-card .feed-body {
  padding: 16px;
}
.news-feed-card .feed-body h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.35;
}
.news-feed-card .feed-body .meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.news-feed-card .feed-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}
.news-feed-card .feed-title-link {
  color: var(--text);
  text-decoration: none;
}
.news-feed-card .feed-title-link:hover {
  color: var(--accent);
  text-decoration: underline;
}
.news-no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  display: none;
}
.news-no-results.visible {
  display: block;
}
@media (max-width: 768px) {
  .news-feed-grid {
    grid-template-columns: 1fr;
  }
  .news-page-wrap {
    padding-bottom: 100px;
  }
}

/* ============================================
   Image page (extends base_public)
   ============================================ */
.image-page-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px;
  text-align: center;
}
.image-page-wrap .image-fullscreen {
  max-width: 100%;
  margin: 0 auto;
}
.image-page-wrap .image-fullscreen img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius);
}

/* ============================================
   Auth pages (Login / Register) — same look as rest of app
   ============================================ */
.auth-page-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}
.auth-card-wide {
  max-width: 420px;
}
@media (min-width: 640px) {
  .auth-card-wide {
    max-width: 440px;
  }
}
.auth-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--glass-shadow);
}
[data-theme="light"] .auth-card {
  background: var(--surface);
  border-color: var(--border);
}
.auth-title {
  margin: 0 0 20px 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  letter-spacing: -0.02em;
}
.auth-flash-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}
.auth-flash {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.auth-flash:last-child {
  margin-bottom: 0;
}
.auth-flash-success {
  background: rgba(63, 185, 80, 0.2);
  color: var(--live);
}
.auth-flash-danger,
.auth-flash-error {
  background: rgba(194, 65, 65, 0.2);
  color: var(--accent);
}
.auth-flash-info {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
}
[data-theme="light"] .auth-flash-success {
  background: rgba(26, 127, 55, 0.15);
  color: var(--live);
}
[data-theme="light"] .auth-flash-danger,
[data-theme="light"] .auth-flash-error {
  background: rgba(194, 65, 65, 0.12);
  color: var(--accent);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.auth-label {
  display: block;
  margin-top: 14px;
  margin-bottom: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.auth-label:first-of-type {
  margin-top: 0;
}
.auth-optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.auth-input,
.auth-select {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}
.auth-input::placeholder {
  color: var(--text-muted);
}
.auth-input:focus,
.auth-select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-elevated);
}
.auth-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.auth-select option {
  background: var(--bg-deep);
  color: var(--text);
}
.auth-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 8px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}
.auth-checkbox {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.auth-btn {
  margin-top: 24px;
  padding: 12px 20px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.auth-btn:hover {
  background: #a63535;
  transform: translateY(-1px);
}
.auth-btn:active {
  transform: translateY(0);
}
.auth-footer {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.auth-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.auth-link:hover {
  text-decoration: underline;
}

/* ============================================
   Player Leaderboard (Stats panel)
   ============================================ */
.plb-wrap {
  margin-top: 24px;
}
.plb-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 12px 0;
}
.plb-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.plb-tab {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.plb-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.plb-tab--active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.plb-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border);
}
.plb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.plb-th {
  padding: 8px 10px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface-elevated, var(--surface));
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.plb-th--stat, .plb-td--stat {
  text-align: center;
}
.plb-th--num, .plb-td--num {
  width: 36px;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.plb-td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.plb-row:last-child .plb-td {
  border-bottom: none;
}
.plb-row:hover {
  background: var(--surface-elevated, var(--surface));
}
.plb-td--name {
  min-width: 130px;
}
.plb-player-name {
  display: block;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.plb-player-role {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.plb-team-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.plb-team-badge--team1 {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}
.plb-team-badge--team2 {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.plb-highlight {
  font-weight: 700;
  color: var(--accent);
}
@media (max-width: 480px) {
  .plb-col-rating { display: none; }
}

/* ============================================
   News grid gap fix (end of file to override any other rules)
   ============================================ */
.section.news-section .news-grid,
#news.news-grid,
.home-main .news-section .news-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  row-gap: 28px !important;
  column-gap: 28px !important;
  gap: 28px !important;
}
@media (max-width: 768px) {
  .news-section .news-grid,
  #news.news-grid {
    row-gap: 22px !important;
    column-gap: 22px !important;
    gap: 22px !important;
  }
}

/* ============================================================
   TOURNAMENT DETAIL v2  (.td2-*)
   ============================================================ */

/* ── Page wrapper ── */
.td2-page {
  max-width: 92rem;
  width: 100%;
  margin: 0 auto 3rem;
  padding: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* ── HERO BANNER ── */
.td2-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  margin: 0 1rem 1.75rem;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, #080c14 0%, #0f172a 45%, #0a0f1e 100%);
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}
[data-theme="light"] .td2-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0c1a3a 100%);
}

/* Real photo background when tournament has a cover image */
.td2-hero-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  z-index: 0;
}
.td2-hero-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(9, 17, 38, 0.55) 0%,
    rgba(9, 17, 38, 0.72) 60%,
    rgba(9, 17, 38, 0.92) 100%
  );
  z-index: 1;
}
/* When cover exists, suppress blobs so image shows through */
.td2-hero--has-cover .td2-hero-blob { opacity: 0; }
.td2-hero--has-cover .td2-hero-grid { opacity: 0.06; }

/* Animated blob background */
.td2-hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}
.td2-hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  animation: td2-blob-float 9s ease-in-out infinite;
}
.td2-hero-blob--1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #3b82f6, transparent 65%);
  top: -250px;
  left: -120px;
  animation-delay: 0s;
}
.td2-hero-blob--2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #8b5cf6, transparent 65%);
  top: -80px;
  right: 5%;
  animation-delay: -3.5s;
}
.td2-hero-blob--3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #f59e0b, transparent 65%);
  bottom: -120px;
  left: 38%;
  animation-delay: -6s;
}
@keyframes td2-blob-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-18px) scale(1.04); }
}
.td2-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Breadcrumb above hero */
.td2-crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.8125rem;
  margin: 0 1rem 0.75rem;
}
.td2-crumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.td2-crumb a:hover { color: var(--text); }
.td2-crumb span:not(.td2-crumb-cur) { color: var(--text-muted); opacity: 0.6; }
.td2-crumb-cur { color: var(--text); font-weight: 600; }

/* Hero body: halo logo + text */
.td2-hero-body {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 2.25rem;
  padding: 1.75rem 2rem 1rem;
  flex: 1;
}
.td2-hero-logo-halo {
  position: relative;
  flex-shrink: 0;
  width: 108px;
  height: 108px;
}
.td2-hero-logo-halo::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #3b82f6, #8b5cf6, #ec4899, #f59e0b, #3b82f6);
  animation: td2-halo-spin 5s linear infinite;
  opacity: 0.55;
}
.td2-hero-logo-halo::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: #0f172a;
}
@keyframes td2-halo-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.td2-hero-logo {
  position: relative;
  z-index: 1;
  width: 108px;
  height: 108px;
  object-fit: contain;
  border-radius: 50%;
  background: #0f172a;
  padding: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.td2-hero-info { flex: 1; min-width: 0; }
.td2-hero-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.td2-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.td2-tag--sport {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.td2-tag--live {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
  animation: td2-live-glow-tag 2s ease-in-out infinite;
}
@keyframes td2-live-glow-tag {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.3); }
  50%       { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
}
.td2-blink-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: td2-blink 1.1s ease-in-out infinite;
}
.td2-blink-dot.small { width: 5px; height: 5px; }
@keyframes td2-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}
.td2-hero-title {
  font-size: clamp(1.8rem, 4.5vw, 3.25rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.4rem;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}
.td2-hero-desc {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
  letter-spacing: 0.02em;
}

/* Stats bar at bottom of hero */
.td2-hero-stats {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: stretch;
  padding: 1rem 2rem 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-wrap: wrap;
  gap: 0;
}
.td2-hst {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 1;
  min-width: 90px;
  padding: 0.25rem 0;
}
.td2-hst-icon {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}
.td2-hst-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
}
.td2-hst-lbl {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.38);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
}
.td2-hst-sep {
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.07);
  margin: 0 1.25rem;
  flex-shrink: 0;
}

/* ── Phase Navigation ── */
.td2-nav-wrap {
  padding: 0 1rem;
  margin-bottom: 1.5rem;
}
.td2-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  padding: 0.375rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.td2-nav::-webkit-scrollbar { height: 4px; }
.td2-nav::-webkit-scrollbar-track { background: transparent; }
.td2-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.td2-nav-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 0.625rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.td2-nav-btn:hover {
  color: var(--text);
  background: var(--surface-elevated);
}
.td2-nav-btn.active {
  color: #fff;
  background: linear-gradient(135deg, #3b82f6 0%, #7c3aed 100%);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
.td2-nav-btn i { font-size: 0.88em; }

/* ── Phase panels ── */
.td2-content {
  padding: 0 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  /* overflow-x clips anything that sneaks past inner overflow:hidden rules */
  overflow-x: hidden;
}
.td2-phase { display: none; }
.td2-phase.td2-phase--visible {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

/* ── Section title bar ── */
.td2-section-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.td2-section-title > i {
  font-size: 1.3rem;
  color: #3b82f6;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.7rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.td2-section-title h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.td2-section-title p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0;
}

/* ── Scroll hint ── */
.td2-scroll-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1rem;
  opacity: 0.6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

/* ══════════════════════════════════════════════
   KNOCKOUT BRACKET
   ══════════════════════════════════════════════ */
.td2-ko-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 0;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
  min-width: 0;
  overflow: hidden;
}
[data-theme="dark"] .td2-ko-section {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.td2-ko-bracket {
  display: flex;
  align-items: stretch;
  gap: 2.75rem;
  overflow-x: auto;
  padding: 0.75rem 0.5rem 1.5rem;
  position: relative;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.td2-ko-bracket::-webkit-scrollbar        { height: 6px; }
.td2-ko-bracket::-webkit-scrollbar-track  { background: var(--surface-elevated); border-radius: 3px; }
.td2-ko-bracket::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 3px; }

.td2-ko-col {
  flex: 0 0 210px;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  animation: td2-fade-in 0.4s ease both;
}
.td2-ko-col:nth-child(2) { animation-delay: 0.05s; }
.td2-ko-col:nth-child(3) { animation-delay: 0.1s; }
.td2-ko-col:nth-child(4) { animation-delay: 0.15s; }
.td2-ko-col:nth-child(5) { animation-delay: 0.2s; }
@keyframes td2-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.td2-ko-col-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: center;
  padding: 0.55rem 0.5rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.td2-ko-col[data-stage="final"] .td2-ko-col-label {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.08));
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}
.td2-ko-col[data-stage="third_place"] .td2-ko-col-label {
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.15), transparent);
  border-color: rgba(100, 116, 139, 0.3);
}
.td2-ko-col-body {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
  gap: 0.75rem;
  min-height: 140px;
}

/* Match card in bracket */
.td2-ko-match { width: 100%; }
.td2-ko-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.td2-ko-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.18);
  transform: translateY(-2px);
}
.td2-ko-card--live {
  border-color: #16a34a !important;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.25) !important;
  animation: td2-live-card 2.5s ease-in-out infinite;
}
@keyframes td2-live-card {
  0%, 100% { box-shadow: 0 0 8px rgba(34, 197, 94, 0.2); }
  50%       { box-shadow: 0 0 22px rgba(34, 197, 94, 0.45); }
}
.td2-ko-card--played { border-color: var(--border); }
.td2-ko-col[data-stage="final"] .td2-ko-card {
  border-color: rgba(245, 158, 11, 0.35);
}
.td2-ko-col[data-stage="final"] .td2-ko-card:hover {
  border-color: #f59e0b;
  box-shadow: 0 6px 28px rgba(245, 158, 11, 0.28);
}

/* Topbar: status / time */
.td2-ko-topbar {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.28rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.td2-ko-topbar--live {
  background: #15803d;
  color: #fff;
}
.td2-ko-topbar--ft {
  background: var(--surface);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.td2-ko-topbar--sched {
  background: var(--surface);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.td2-ko-pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: td2-blink 1s ease-in-out infinite;
}

/* Team row */
.td2-ko-team {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  transition: background 0.15s;
}
.td2-ko-team.winner { background: rgba(34, 197, 94, 0.07); }
.td2-ko-team.loser  { opacity: 0.45; }
.td2-ko-kit {
  width: 28px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 4px;
  background: #0f172a;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.td2-ko-kit img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
  box-sizing: border-box;
}
.td2-ko-tname {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.td2-ko-score {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 18px;
  text-align: right;
  flex-shrink: 0;
}
.td2-ko-score.win {
  color: var(--text);
  font-size: 0.9rem;
}
.td2-ko-team.winner .td2-ko-score { color: #22c55e; }
.td2-ko-sep {
  height: 1px;
  background: var(--border);
  margin: 0;
}

/* SVG connector overlay */
.td2-ko-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}
.td2-ko-connector {
  fill: none;
  stroke: var(--border);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  opacity: 0.55;
}
[data-theme="dark"] .td2-ko-connector { opacity: 0.35; }

/* ══════════════════════════════════════════════
   GROUP STAGE
   ══════════════════════════════════════════════ */
/*
 * Nesting: td2-content(pad 1rem) > td2-phase--visible > td2-groups-section
 *   > td2-groups-grid > td2-group-card > td2-group-hdr / td2-group-matches
 *   > td2-gm
 * DO NOT set width:100% on flex-column children — flex stretch handles it
 * and width:100% can resolve against the outer box in some browsers.
 */
.td2-groups-section {
  /* No width:100% — flex stretch is correct and avoids %-resolution bugs */
  margin-bottom: 0;
  min-width: 0;          /* allow shrinking inside a flex container */
}
.td2-groups-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.td2-group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  overflow: hidden;      /* clips border-radius corners and inner content */
  transition: box-shadow 0.2s;
  min-width: 0;          /* allow card to shrink below its content width */
}
.td2-group-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .td2-group-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
}
/* Card header: 14 px horizontal padding (well above 5 px minimum) */
.td2-group-hdr {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.875rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border);
  overflow: hidden;      /* prevent very long labels from widening the card */
}
.td2-group-hdr i { color: var(--accent); flex-shrink: 0; }
.td2-group-count {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.1rem 0.45rem;
}
/* Match grid: 10 px horizontal padding inside card (above 5 px minimum) */
.td2-group-matches {
  padding: 0.5rem 0.625rem;
  display: grid;
  /* clamp() prevents column min-width from overflowing a narrow card */
  grid-template-columns: repeat(auto-fill, minmax(clamp(160px, 45%, 280px), 1fr));
  gap: 0.4rem;
}

/* Group match link: no width:100% needed — grid cell stretch handles it */
.td2-gm {
  display: block;
  text-decoration: none;
  color: var(--text);
  border-radius: 0.5rem;
  padding: 0.6rem 0.65rem;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid var(--border);
  overflow: hidden;
  min-width: 0;
}
.td2-gm:hover { background: var(--surface-elevated); border-color: var(--accent); }
.td2-gm--live {
  background: rgba(34, 197, 94, 0.05);
  border-color: rgba(34, 197, 94, 0.2);
}
.td2-gm-header { margin-bottom: 0.35rem; }
.td2-gm-status {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.td2-gm-status.live { color: #22c55e; }
.td2-gm-status.ft   { color: var(--text-muted); }
.td2-gm-status.sched { color: var(--text-muted); }
.td2-gm-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  min-width: 0;
  overflow: hidden;    /* long team names truncate instead of widening the row */
}
.td2-gm-team {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.td2-gm-team--r { justify-content: flex-end; }
.td2-gm-kit {
  width: 20px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 3px;
  background: #0f172a;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.td2-gm-kit img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
  box-sizing: border-box;
}
.td2-gm-tname {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.td2-gm-tname.winner { color: var(--text); font-weight: 700; }
.td2-gm-team--r .td2-gm-tname { text-align: right; }
.td2-gm-scorebox {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.35rem;
}
.td2-gm-s {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 14px;
  text-align: center;
}
.td2-gm-s--w { color: var(--text); }
.td2-gm-dash {
  font-size: 0.75rem;
  color: var(--border);
  font-weight: 400;
}
.td2-gm-vs {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 0.25rem;
}

/* ══════════════════════════════════════════════
   OTHER PHASES (Qualifiers, etc.)
   ══════════════════════════════════════════════ */
.td2-other-section {
  margin-bottom: 0;
  min-width: 0;
  overflow: hidden;
}
.td2-other-stage   { margin-bottom: 1.25rem; min-width: 0; overflow: hidden; }
.td2-other-stage-hdr {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* ── Fallback (no phase_tree) ── */
.td2-fallback { padding: 0 1rem; }

/* ── Collapsible stages ── */
.td2-collapsible-hdr {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.td2-collapsible-hdr:hover {
  filter: brightness(1.12);
}
.td2-collapsible-body {
  overflow: hidden;
  transition: max-height 0.32s ease, opacity 0.28s ease;
  /* Expanded by default — JS sets max-height:none after init */
  max-height: none;
  opacity: 1;
}
.td2-chevron {
  margin-left: 0.5rem;
  font-size: 0.7rem;
  transition: transform 0.28s ease;
  flex-shrink: 0;
}
.td2-collapsible-hdr.td2-collapsed .td2-chevron {
  transform: rotate(-90deg);
}
/* Ensure other-stage header is flex so chevron aligns */
.td2-other-stage-hdr {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .td2-ko-bracket { gap: 2rem; }
  .td2-ko-col { flex: 0 0 190px; min-width: 190px; }
}
@media (max-width: 768px) {
  .td2-crumb { margin: 0 0.5rem 0.75rem; }
  .td2-hero {
    margin: 0 0.5rem 1.25rem;
    min-height: 300px;
    border-radius: 1rem;
  }
  .td2-hero-body   { padding: 1.25rem 1.25rem 0.75rem; gap: 1.25rem; }
  .td2-hero-logo   { width: 80px; height: 80px; }
  .td2-hero-logo-halo { width: 80px; height: 80px; }
  .td2-hero-logo-halo::before,
  .td2-hero-logo-halo::after { display: none; }
  .td2-hero-title  { font-size: 1.6rem; }
  .td2-hero-stats  { padding: 0.85rem 1.25rem 1.1rem; justify-content: center; align-items: center; }
  .td2-hst-sep     { margin: 0 0.7rem; }
  .td2-hst-val     { font-size: 1.2rem; }
  .td2-nav-wrap    { padding: 0 0.5rem; }
  .td2-content     { padding: 0 0.5rem; }
  .td2-ko-col      { flex: 0 0 175px; min-width: 175px; }
  .td2-ko-bracket  { gap: 1.75rem; }
  .td2-group-matches { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .td2-hero-body { flex-direction: column; align-items: center; text-align: center; }
  .td2-hero-tags { justify-content: center; }
  .td2-hero-stats { flex-wrap: wrap; gap: 0.5rem 0; justify-content: center; align-items: center; }
  .td2-hst { min-width: 80px; justify-content: center; align-items: center; flex-direction: column; gap: 0.2rem; text-align: center; }
  .td2-hst-icon { display: none; }
  .td2-hst-sep  { width: 1px; height: 36px; margin: 0 0.4rem; align-self: center; flex-shrink: 0; }
  .td2-ko-col   { flex: 0 0 160px; min-width: 160px; }
}

/* ══════════════════════════════════════════════
   MATCH DETAIL BREADCRUMB (old-style template)
   ══════════════════════════════════════════════ */
.match-detail-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.8rem;
  color: #b9b9b9;
  margin-bottom: 12px;
  padding: 8px 4px 4px;
}
.match-detail-breadcrumb a {
  color: #e50914;
  text-decoration: none;
}
.match-detail-breadcrumb a:hover { text-decoration: underline; }
.match-detail-breadcrumb span[aria-hidden] { margin: 0 2px; opacity: 0.6; }
.match-detail-breadcrumb > span:last-child {
  color: #fff;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* ══════════════════════════════════════════════
   TEAM DETAIL PAGE
   ══════════════════════════════════════════════ */
.team-detail-hero {
  position: relative;
  min-height: 200px;
  border-radius: var(--radius, 12px);
  overflow: hidden;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-end;
}
.team-detail-hero-bg {
  position: absolute;
  inset: 0;
  background: center/cover no-repeat;
  filter: blur(18px) brightness(0.35) saturate(1.4);
  transform: scale(1.08);
}
.team-detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(0,0,0,.75) 100%);
}
.team-detail-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 20px;
  width: 100%;
  flex-wrap: wrap;
}
.team-detail-hero-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 2px solid rgba(255,255,255,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.team-detail-hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}
.team-detail-hero-info { flex: 1; min-width: 0; }
.team-detail-hero-name {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 6px;
  line-height: 1.2;
}
.team-detail-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  padding: 3px 10px;
  color: var(--text-muted, #b9b9b9);
}
.team-detail-hero-kits {
  display: flex;
  gap: 12px;
}
.team-detail-kit-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.team-detail-kit-wrap img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.team-detail-kit-wrap span {
  font-size: 0.65rem;
  color: var(--text-muted, #b9b9b9);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Players grid */
.team-detail-section { margin-bottom: 24px; }
.team-detail-players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  padding: 0 4px;
  margin: 4px;
}
.team-detail-player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface, #1e1e1e);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.team-detail-player-card:hover {
  border-color: var(--accent, #e50914);
  background: rgba(229,9,20,.06);
}
.team-detail-player-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2, #2a2a2a);
  display: flex;
  align-items: center;
  justify-content: center;
}
.team-detail-player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.team-detail-player-initials {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted, #b9b9b9);
}
.team-detail-player-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.team-detail-player-no {
  font-size: 0.65rem;
  color: var(--accent, #e50914);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.team-detail-player-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-detail-player-pos {
  font-size: 0.7rem;
  color: var(--text-muted, #b9b9b9);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Recent matches */
/* ── Team Detail Matches v2 ── */
.team-detail-matches-v2 {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

/* Card — horizontal margin so cards don’t touch viewport edges (football, basketball, pickleball) */
/* ─── Recent Matches Card (team detail) ─────────────────────────────── */
.tdm-card {
  display: grid;
  /* cols: left-team | score | right-team */
  grid-template-columns: 1fr auto 1fr;
  /* rows: chap | date | teams+score | winner */
  align-items: center;
  column-gap: 12px;
  row-gap: 0;
  margin: 0 12px;
  background: var(--surface, #1e1e1e);
  border: 1px solid rgba(255,255,255,.07);
  border-left: 3px solid transparent;
  border-radius: 14px;
  padding: 11px 14px 9px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: box-shadow 0.18s, border-color 0.15s, transform 0.12s;
}
.tdm-card:hover {
  border-color: rgba(229,9,20,.5);
  box-shadow: 0 6px 28px rgba(0,0,0,.38);
  transform: translateY(-2px);
}
.tdm-card--live {
  border-left-color: #22c55e !important;
  background: linear-gradient(135deg, rgba(34,197,94,.06) 0%, var(--surface, #1e1e1e) 55%);
}
.tdm-card--w { border-left-color: #16a34a; }
.tdm-card--l { border-left-color: #dc2626; }
.tdm-card--d { border-left-color: #475569; }

/* Meta — competition pill */
.tdm-meta-top {
  grid-column: 1 / -1;
  text-align: center;
  padding-bottom: 1px;
}
.tdm-meta-chap {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--accent, #e50914);
  text-transform: uppercase;
  letter-spacing: .07em;
  background: rgba(229,9,20,.1);
  padding: 2px 9px;
  border-radius: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Meta — date/time row with bottom divider */
.tdm-meta-date-wrap {
  grid-column: 1 / -1;
  text-align: center;
  padding-bottom: 7px;
  margin-bottom: 5px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.tdm-meta-date {
  font-size: 0.67rem;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  color: var(--text-muted, #b9b9b9);
  letter-spacing: .01em;
  white-space: nowrap;
}

/* Side columns — flex-column so winner badge stacks above team name */
.tdm-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
  padding: 2px 0;
}
.tdm-side--left  { align-items: flex-start; }
.tdm-side--right { align-items: flex-end; }

/* Team: [Jersey] Name (left) | Name [Jersey] (right) */
.tdm-team {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.tdm-side--left  .tdm-team { justify-content: flex-start; }
.tdm-side--right .tdm-team { justify-content: flex-end; }

.tdm-team img,
.tdm-team .tdm-team-jersey {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255,255,255,.04);
}
.tdm-team-name {
  font-size: 0.82rem;
  color: var(--text-muted, #b9b9b9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 96px;
}
.tdm-team--self .tdm-team-name {
  color: var(--text, #f0f0f0);
  font-weight: 700;
}

/* Center — score pill or live indicator */
.tdm-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
}

/* Score pill */
.tdm-score {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255,255,255,.05);
  border-radius: 8px;
  padding: 5px 9px;
}
.tdm-score-num {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text, #f0f0f0);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  line-height: 1;
  min-width: 18px;
  text-align: center;
}
.tdm-score-num.tdm-score--win  { color: #4ade80; }
.tdm-score-num.tdm-score--lose { color: #f87171; }
.tdm-score-sep {
  font-size: 0.8rem;
  color: rgba(255,255,255,.25);
  font-weight: 500;
  padding: 0 1px;
}
.tdm-score-vs {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #b9b9b9);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Live time pill */
.tdm-live-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34,197,94,.1);
  border-radius: 8px;
  padding: 5px 10px;
}
.tdm-live-time .live-dot { flex-shrink: 0; }
.tdm-live-period {
  font-size: 0.72rem;
  font-weight: 700;
  color: #22c55e;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Winner badge — small medal chip inside the side column, above team name */
.tdm-badge--winner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.56rem;
  font-weight: 700;
  color: #eab308;
  background: rgba(234,179,8,.13);
  border: 1px solid rgba(234,179,8,.22);
  border-radius: 100px;
  padding: 2px 7px 2px 5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  line-height: 1.4;
}

/* Live dot */
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

@media (max-width: 560px) {
  .tdm-card { column-gap: 8px; padding: 10px 11px 8px; }
  .tdm-team-name { max-width: 76px; font-size: 0.76rem; }
  .tdm-score-num { font-size: 1.05rem; }
  .tdm-live-period { font-size: 0.65rem; }
  .tdm-meta-chap { font-size: 0.55rem; }
}
