/* ===========================
   Reset & Base
   =========================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* Shared loading shapes. Size with --skeleton-width / --skeleton-height. */
.skeleton {
  display: block;
  width: var(--skeleton-width, 100%);
  height: var(--skeleton-height, 1em);
  max-width: 100%;
  border-radius: var(--border-radius-btn);
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-highlight) 50%, var(--skeleton-base) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s linear infinite;
  pointer-events: none;
}

.skeleton-text { height: var(--skeleton-height, 1em); }
.skeleton-circle {
  width: var(--skeleton-width, 3em);
  height: var(--skeleton-height, 3em);
  border-radius: 50%;
  flex-shrink: 0;
}
.skeleton-block { height: var(--skeleton-height, 8em); }
.skeleton-pill {
  height: var(--skeleton-height, 2.5em);
  border-radius: var(--border-radius-pill);
}

@keyframes skeleton {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===========================
   Layout
   =========================== */
.news-column-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* position: sticky; */
  top: 80px;
  align-self: flex-start;
  /* max-height: calc(100vh - 100px); */
  /* overflow-y: auto; */
  scrollbar-width: none;
}
.news-column-inner::-webkit-scrollbar {
  display: none;
}

/* ===========================
   Top Bar
   =========================== */
.top-bar {
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-color);
  padding: 6px 0;
}

.top-bar-live {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 2px 10px;
  background: var(--accent-red-bg);
  border: 1px solid var(--accent-red-border);
  border-radius: var(--border-radius-pill);
  cursor: pointer;
}

.top-bar-live .live-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.top-bar-live .live-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--accent-red);
}

/* Hidden state for live-count badges when no matches are live */
.no-live {
  display: none !important;
}

.top-bar-link {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 11px;
  color: var(--text-secondary);
  text-decoration: none;
}

.top-bar-link:hover {
  color: var(--text-primary);
}

/* The top-bar language control is now .lang-menu (settings-popup.css). */

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

/* ===========================
   Header
   =========================== */
.site-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-secondary);
  z-index: 1000;
}

.site-logo img {
  height: 36px;
}

.main-nav .nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: all 0.2s;
}

.main-nav .nav-link:hover {
  color: var(--text-primary);
}

.main-nav .nav-link.active {
  /* background: var(--accent-primary);
  color: var(--text-on-accent); */
  background: var(--accent-primary-bg);
  color: var(--accent-primary);
}

.nav-more-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  width: 265px;
  min-width: 0;
  height: 36px;
  background: var(--bg-card-header);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-btn);
  cursor: pointer;
}

.header-search i {
  color: var(--text-secondary);
  font-size: 16px;
  flex-shrink: 0;
}

.header-search span {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header .btn-settings {
  width: 36px;
  height: 36px;
  display: flex;
  padding: 0px!important;
  font-size: var(--font-size-base)!important;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-btn);
  color: var(--text-secondary);
  text-decoration: none;
}

.btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  background: var(--accent-primary);
  border: none;
  border-radius: var(--border-radius-btn);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--text-on-accent);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.15s;
}

.btn-login:hover {
  filter: brightness(0.92);
}

/* Keep the auth slot at its natural width when the header gets tight (tablet
   range): as a shrinkable flex item it let the button label wrap onto two
   lines. The search trigger (min-width: 0 + ellipsis) absorbs the squeeze. */
#headerAuthSlot {
  flex: 0 0 auto;
}

.header-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  transition: var(--transition-fast);
}

.header-btn:hover {
  color: var(--text-primary);
}

.mobile-menu-btn {
  display: none; /* Bootstrap d-md-none handles visibility */
}

/* Logo theme visibility */
.logo-light {
  display: inline-block;
}

.logo-dark {
  display: none;
}

[data-theme="dark"] .logo-light {
  display: none;
}

[data-theme="dark"] .logo-dark {
  display: inline-block;
}

/* Mobile Navigation — always visible as horizontal scrollable bar */
.mobile-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  background: var(--bg-header);
  border-top: 1px solid var(--border-color);
  padding: 6px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.mobile-nav.show {
  display: flex;
}

.mobile-nav a {
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.mobile-nav a:hover,
.mobile-nav a:active {
  color: var(--text-primary);
  background: var(--bg-card);
}

@media (min-width: 768px) {
  .mobile-nav {
    display: none;
  }
}

/* ===== Date Navigation ===== */
.date-nav {
    background: var(--bg-primary);
    padding: 16px 0;
}
.date-nav-container {
    width: 100%;
}
/* Home page variant: nav lives inside the matches column as two rows
   (info+actions on top, pills full width below), rendered as a card to
   match the league/country panels. The base .date-nav-pills uses flex:1
   for the single-row band, which would stretch row 2 vertically inside
   the flex-column container. */
.home-date-nav {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-card);
    padding: 8px 10px;
}
.home-date-nav .date-nav-pills {
    flex: none;
    width: 100%;
}
/* Pills/arrows share the card surface otherwise: use the secondary tone
   so they stay visually distinct on top of the card background. */
.home-date-nav .date-pill {
    background: var(--bg-secondary);
}
.date-nav-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    white-space: nowrap;
}
.date-nav-day {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
}
.date-nav-info-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}
.date-nav-date {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
}
.date-nav-live {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 2px 10px;
    background: var(--accent-red-bg);
    border: 1px solid var(--accent-red-border);
    border-radius: var(--border-radius-pill);
    cursor: pointer;
}
.date-nav-live .live-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-red);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}
.date-nav-live .live-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.05em;
    color: var(--accent-red);
}
/* Active/pressed state: the live-only filter is currently applied.
   Fills the pill with the accent red so the toggle state is obvious. */
.date-nav-live.live-badge-active {
    background: var(--accent-red);
    border-color: var(--accent-red);
}
.date-nav-live.live-badge-active .live-dot {
    background: var(--text-white);
}
.date-nav-live.live-badge-active .live-text {
    color: var(--text-white);
}
.date-nav-pills {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex: 1;
    overflow: hidden;
}
.date-nav-arrow {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-tertiary);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}
.date-nav-arrow:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}
.date-pills-track {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}
.date-pills-track::-webkit-scrollbar {
    display: none;
}
.date-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 5px 14px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-pill);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
}
.date-pill-day {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 12px;
    line-height: 1.3;
    color: var(--text-tertiary);
}
.date-pill-num {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 12px;
    line-height: 1.3;
    color: var(--text-tertiary);
}
.date-pill:hover {
    border-color: var(--text-secondary);
}
.date-pill.active {
    background: var(--accent-primary-bg);
    border-color: var(--accent-primary);
}
.date-pill.active .date-pill-day,
.date-pill.active .date-pill-num {
    color: var(--accent-primary);
}
.date-nav-actions {
    display: flex;
    gap: 8px;
    /* Positioning context for the anchored date picker popover. */
    position: relative;
}
/* #datePickerHidden is now only Flatpickr's binding target: the calendar renders
   inline into #datePickerBody, so the invisible absolutely-positioned anchor that
   used to hand Flatpickr a bounding rect is no longer needed. Bootstrap's .d-none
   keeps it out of layout. */
.date-nav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s;
}
.date-nav-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}
/* Non-default state dots. The calendar button (date != today) and the filter
   button (prefs != defaults) share one rule so they signal identically.
   `--accent` was an undefined placeholder silently falling back to off-brand
   teal; --accent-primary is the real brand token (see variables.css). */
.date-nav-btn.filter-active,
.date-nav-btn.date-active {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    position: relative;
}
.date-nav-btn.filter-active::after,
.date-nav-btn.date-active::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 7px;
    height: 7px;
    background: var(--accent-primary);
    border-radius: 50%;
    border: 1px solid var(--bg-primary);
}

/* ===========================
   League Sections
   =========================== */
.league-group {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  overflow: hidden;
}

.league-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card-header);
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
}

.league-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.league-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.league-info {
  display: flex;
  flex-direction: column;
}

.league-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
  line-height: 1.4;
}

.league-name:hover {
  color: var(--accent-primary);
}

.league-country {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.league-country-flag {
  width: 16px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

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

.league-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.league-tab {
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  /* border-radius: 6px; */
  transition: all 0.2s;
}

.league-tab:hover {
  color: var(--text-primary);
}

.league-tab.active {
  color: var(--accent-primary);
}

.league-tab-more {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.league-round {
  padding: 2px 8px;
  background: var(--bg-pill);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.league-fav {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.league-fav:hover {
  color: var(--accent-yellow);
  border-color: var(--accent-yellow);
  background: rgba(255, 204, 0, 0.1);
}

.league-fav.is-fav {
  color: var(--accent-yellow);
  border-color: var(--accent-yellow);
}

.league-matches {
  display: flex;
  flex-direction: column;
}

/* ===========================
   Fixture Count Badges
   =========================== */
.fixture-count-badge {
  padding: 2px 8px;
  background: var(--bg-pill);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.fixture-count-badge.live {
  background: var(--accent-red-bg);
  border: 1px solid var(--accent-red-border);
  border-radius: var(--border-radius-pill);
  color: var(--accent-red);
}

/* ===========================
   Countries Accordion (home view)
   =========================== */
.home-top-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.countries-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.country-group {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  overflow: hidden;
}

.country-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card-header);
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.country-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.country-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.country-flag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.country-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.country-chevron,
.league-chevron {
  color: var(--text-secondary);
  font-size: 12px;
  transition: transform 0.2s;
}

.country-group.open > .country-header .country-chevron,
.league-accordion-item.open > .league-accordion-header .league-chevron {
  transform: rotate(180deg);
}

.country-group.open > .country-header {
  border-bottom: 1px solid var(--border-color);
}

.country-leagues {
  display: flex;
  flex-direction: column;
}

/* League rows inside a country */
.league-accordion-item + .league-accordion-item {
  border-top: 1px solid var(--border-color);
}

.league-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.league-accordion-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.league-accordion-item.open > .league-accordion-header {
  border-bottom: 1px solid var(--border-color);
}

/* Hide the count badge while a league is expanded — its fixtures are visible */
.league-accordion-item.open .league-accordion-right .fixture-count-badge {
  display: none;
}

.league-accordion-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.league-accordion-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.league-accordion-name:hover {
  color: var(--accent-primary);
}

.league-accordion-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.league-accordion-body {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
}

.league-accordion-empty {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.league-fixtures-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 16px;
}

/* ===========================
   Match Rows
   =========================== */
.match-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  transition: background 0.15s;
}

.match-row:last-child {
  border-bottom: none;
}

.match-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.match-team {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.match-team.away {
  justify-content: flex-end;
}

.match-team .team-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.match-team .team-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 90px;
  padding: 0 8px;
}

.match-score {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 20px;
  text-align: center;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.match-time {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-tertiary);
}

.match-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.match-badge.live {
  gap: 9px;
  padding: 2px 10px;
  background: var(--accent-red-bg);
  border: 1px solid var(--accent-red-border);
  border-radius: var(--border-radius-pill);
  color: var(--accent-red);
}

.match-badge.live .live-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.match-badge.ended {
  background: var(--border-color);
  color: var(--text-muted);
}

.match-badge.soon {
  background: var(--accent-primary-bg);
  color: var(--accent-primary);
}

.match-badge.suspended {
  /* background: var(--accent-yellow); */
  color: var(--accent-yellow);
  border-radius: var(--border-radius-pill, 12px);
}

.match-lineup-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 20px;
  border-radius: 4px;
  background: rgb(255 255 255);
  opacity: 0.55;
  flex-shrink: 0;
}

.match-lineup-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ===========================
   News Section
   =========================== */
.section-title-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-accent {
  width: 4px;
  height: 18px;
  background: var(--accent-primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.section-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 16px;
  color: var(--text-primary);
  margin: 0;
}

/* Featured Article */
.news-featured {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.2s;
}

.news-featured:hover {
  transform: translateY(-2px);
}

.news-featured-bg {
  position: relative;
  height: 180px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.news-featured-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(13, 0, 30, 0.9) 0%, rgba(13, 0, 30, 0) 60%);
}

.news-featured-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 1;
  padding: 12px;
  background: var(--accent-primary-bg);
  border-radius: 4px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-primary);
}

.news-featured-content {
  padding: 13px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.news-featured-title {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 0;
}

.news-featured-meta {
  font-size: 14px;
  color: var(--text-secondary);
}

/* News List */
.news-list {
  display: flex;
  flex-direction: column;
}

.news-list--compact {
  gap: 8px;
}

.news-list-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s;
}

.news-list-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.news-list-item--text {
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.news-list-item--text:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-secondary);
}

.news-thumb-wrapper {
  width: 90px;
  height: 67px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.news-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-item-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.news-item-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.43;
  color: var(--text-primary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item-meta {
  font-size: 10px;
  color: var(--text-secondary);
}

/* ===== Standings Widget (homepage right rail) =====
   Client-rendered by assets/js/home-standings-widget.js via the shared
   StandingsRenderer (standings.css). The widget supplies its own header
   (league dropdown button) and foot-note link, so the renderer runs in
   "widget mode" with its card head / legend / dividers / foot-note
   suppressed. The inner .standings-table-wrapper card shell is neutralized
   below to avoid a double card inside the widget. */
.standings-widget {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  /* visible so the dropdown popup can escape the card */
  overflow: auto;
  width: 100%;
}

/* Header: single dropdown button (league logo + name + caret) */
.standings-widget-header {
  position: relative;
  padding: 10px 14px;
  background: var(--bg-card-header);
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--border-radius-card) var(--border-radius-card) 0 0;
}

.standings-widget-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 4px 6px;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-primary);
  transition: var(--transition-fast);
  /* Anchor for the .standings-widget-button-skeleton overlay while the
     picker fetch is in flight. */
  position: relative;
}

.standings-widget-button:hover {
  background: var(--bg-secondary);
}

.standings-widget-button-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
}

.standings-widget-button-name {
  flex: 1 1 auto;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  text-align: start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.standings-widget-caret {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-secondary);
  transition: transform var(--transition-fast);
}

.standings-widget-button[aria-expanded="true"] .standings-widget-caret {
  transform: rotate(180deg);
}

/* Popup league list */
.standings-widget-popup {
  position: absolute;
  inset-inline-start: 14px;
  inset-inline-end: 14px;
  top: calc(100% + 4px);
  z-index: 30;
  display: none;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.standings-widget-popup.open {
  display: block;
}

.standings-widget-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
}

.standings-widget-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-primary);
  text-align: start;
  transition: var(--transition-fast);
}

.standings-widget-option:hover {
  background: var(--bg-secondary);
}

.standings-widget-option.active {
  background: var(--bg-secondary);
  color: var(--accent-primary);
}

.standings-widget-option-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 auto;
}

.standings-widget-option-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Table mount: neutralize the renderer's own card shell so the table sits
   flush inside the widget card (no double border / background / radius). */
.standings-widget-table .standings-cards {
  gap: 0;
}

.standings-widget-table .standings-table-wrapper {
  background: transparent;
  border: 0;
  border-radius: 0;
}

/* Foot-note: dynamic "<League> Standings >" link to the league page tab */
.standings-widget-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.standings-widget-foot-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-primary);
  text-decoration: none;
}

.standings-widget-foot-link:hover {
  text-decoration: underline;
}

/* ===== Standings Widget skeleton loader =====
   Three independently-gated pieces:
     • .standings-widget-button-skeleton — absolute overlay inside the
       dropdown button; shown only while `data-loading="true"` sits on the
       widget root, and the real logo/name/caret children are hidden with
       visibility so the button keeps its box and click target.
     • .standings-widget-skeleton-table — always visible while present in
       the DOM. It ships in the SSR markup AND is re-emitted by
       StandingsRenderer via the `loadingHtml` option (see
       home-standings-widget.js), so the shimmer persists seamlessly from
       first paint through the standings fetch.
     • .standings-widget-skeleton-foot — shown only while
       `data-loading="true"`, mirroring the button treatment.
   Shimmer uses --bg-secondary → --bg-card-hover so it reads against
   --bg-card in both themes (matches the .poll-skeleton-bar idiom). */
.standings-widget-button-skeleton {
  position: absolute;
  inset: 4px 6px;
  display: none;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.standings-widget[data-loading="true"] .standings-widget-button-skeleton {
  display: flex;
}

/* Hide the real (still-empty) button children under the skeleton without
   collapsing the button box or breaking the popup positioning. */
.standings-widget[data-loading="true"] .standings-widget-button-logo,
.standings-widget[data-loading="true"] .standings-widget-button-name,
.standings-widget[data-loading="true"] .standings-widget-caret {
  visibility: hidden;
}

.standings-widget-skeleton-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
  pointer-events: none;
}

.standings-widget-skeleton-row {
  display: grid;
  grid-template-columns: 18px 20px minmax(0, 1fr) repeat(7, 26px);
  gap: 6px;
  align-items: center;
}

.standings-widget-skeleton-row.is-head {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2px;
}

.standings-widget-skeleton-foot {
  display: none;
  justify-content: flex-end;
  pointer-events: none;
}

.standings-widget[data-loading="true"] .standings-widget-skeleton-foot {
  display: flex;
}

/* Hide the real foot link while its skeleton stands in for it. */
.standings-widget[data-loading="true"] .standings-widget-foot-link {
  visibility: hidden;
}

.stw-sk {
  display: block;
  background: linear-gradient(90deg,
    var(--bg-secondary) 25%,
    var(--bg-card-hover) 50%,
    var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: standings-widget-shimmer 1.5s infinite;
  border-radius: 4px;
}

/* Button-skeleton shapes: match the real 24px logo, flex-fill name and
   12px chevron so the swap doesn't shift the button's optical layout. */
.stw-sk-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.stw-sk-name {
  flex: 0 1 auto;
  width: 55%;
  max-width: 60%;
  height: 10px;
}

.stw-sk-caret {
  width: 12px;
  height: 10px;
  flex: 0 0 auto;
  margin-inline-start: auto;
}

/* Table-skeleton shapes */
.stw-sk-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.stw-sk-pos {
  width: 14px;
  height: 10px;
}

.stw-sk-line {
  height: 10px;
  min-width: 20px;
}

.stw-sk-line-sm {
  height: 8px;
  min-width: 16px;
}

@keyframes standings-widget-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 575.98px) {
  .standings-widget-skeleton-row {
    grid-template-columns: 14px 18px minmax(0, 1fr) repeat(7, 18px);
    gap: 4px;
  }

  .standings-widget-skeleton-table {
    padding: 10px 10px 12px;
  }
}

/* Respect reduced-motion: freeze the shimmer on the first frame. */
@media (prefers-reduced-motion: reduce) {
  .stw-sk {
    animation: none;
  }
}

/* ===========================
   App Download Banner
   =========================== */
.app-banner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 220px;
  padding: 32px 40px;
  background-color: var(--bg-topbar);
  background-image: var(--bg-app-banner-overlay), url('../images/app-banner-bg.png');
  background-size: auto, cover;
  background-position: center, right center;
  background-repeat: no-repeat, no-repeat;
  border-radius: var(--border-radius-card);
  overflow: hidden;
}

.app-banner-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  max-width: 60%;
}

.app-banner-logo img {
  width: 49px;
  height: 49px;
  object-fit: contain;
  border-radius: 12px;
}

.app-banner-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.app-banner-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  color: var(--text-white);
  margin: 0;
}

.app-banner-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
  line-height: 1.5;
}

.app-banner-badges {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.app-badge img {
  height: 40px;
  border-radius: 6px;
  display: block;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--bg-footer);
    position: relative;
    overflow: hidden;
}
.site-footer::before {
    content: '';
    position: absolute;
    left: -42px;
    top: -65px;
    width: 467px;
    height: 415px;
    background-image: url('../images/footer-watermark.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: top left;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}
.site-footer .container {
    position: relative;
    z-index: 1;
}
.footer-about {
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.footer-logo-img {
    height: 49px;
    width: auto;
}
.footer-description {
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-secondary);
    margin: 0;
}
.footer-social {
    display: flex;
    gap: 8px;
    padding-top: 7px;
}
.footer-social .social-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 16px;
    transition: color 0.2s;
}
.footer-social .social-icon:hover {
    color: var(--accent-primary);
}
.footer-col-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-lime);
    margin: 0;
}
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.footer-links a {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--text-primary);
}
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
}
.footer-bottom span {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===========================
   Filter / Dropdown
   =========================== */
.filter-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--accent-teal);
  color: var(--text-primary);
}

/* Filter Popover
   Anchored under #filterBtn with the same position, card surface and unfold
   transition as .date-picker-popover below, so the two panels read as siblings.
   These rules are duplicated rather than shared through a common base class by
   explicit decision — keep both blocks in sync when editing either one.
   The former full-screen .filter-modal-overlay scrim is gone: the panel is
   non-blocking, and main.js closes it on outside click / Escape / its X button. */
.filter-modal {
  position: absolute;
  top: calc(100% + 8px);
  /* Logical inset: anchors under the filter button in LTR and flips with it in
     Arabic without needing an extra rtl.css rule. */
  inset-inline-end: 0;
  /* Above the sticky header (1000). Both nav popovers share this layer — only one
     is ever open at a time, so they cannot stack on each other. */
  z-index: 1040;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-popover);
  /* Closed means display:none, not visibility:hidden: the panel leaves the render
     tree entirely, so it cannot be hit by pointer events, read out by a screen
     reader or linger as an invisible 320px box under the control row. */
  display: none;
  opacity: 0;
  /* Same 0.2s ease timing and unfold offset as the date picker popover. */
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.2s ease, transform 0.2s ease;
  /* allow-discrete lets display take part in the transition: it flips to block at
     the start of the open animation and back to none only once the collapse has
     finished. Declared second so unsupported browsers keep the plain fade above. */
  transition: opacity 0.2s ease, transform 0.2s ease, display 0.2s allow-discrete;
}

.filter-modal.show {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Coming out of display:none leaves no before-change style to interpolate from,
   so the open state has to be restated as the animation's starting point —
   otherwise the panel snaps straight to its unfolded position. */
@starting-style {
  .filter-modal.show {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
}

/* Shared with the date picker popover: same chrome, so a future tweak to the
   filter modal's header/footer/buttons automatically keeps the two in step. */
.filter-modal-header,
.date-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.filter-modal-header h5,
.date-picker-header h5 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.filter-modal-close,
.date-picker-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.filter-modal-close:hover,
.date-picker-close:hover {
  color: var(--text-primary);
}

.filter-modal-body {
  padding: 20px;
}

.filter-section {
  margin-bottom: 20px;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-section-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.filter-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.filter-radio:hover {
  border-color: var(--accent-teal);
  color: var(--text-primary);
}

.filter-radio input[type="radio"] {
  display: none;
}

.filter-radio:has(input:checked) {
  background: var(--accent-teal);
  border-color: var(--accent-teal);
  color: var(--text-on-accent);
  font-weight: 600;
}

.filter-modal-footer,
.date-picker-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

.filter-reset-btn,
.date-picker-today-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-reset-btn:hover,
.date-picker-today-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.filter-apply-btn,
.date-picker-apply-btn {
  background: var(--accent-teal);
  border: none;
  color: var(--text-on-accent);
  padding: 8px 24px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.filter-apply-btn:hover,
.date-picker-apply-btn:hover {
  opacity: 0.85;
}

/* ===========================
   Date Picker Popover
   ===========================
   Anchored sibling of .filter-modal: the header/footer/buttons are shared with it
   above, so this block only owns (a) the popover's positioning + card surface and
   (b) the re-themed Flatpickr grid. Flatpickr is mounted with inline + appendTo
   (date-navigation.js) and renders ONLY the day grid inside .date-picker-body —
   its own card, pointer arrow and light theme are stripped here. Every color,
   radius and font resolves to a variables.css token so both themes work. */
.date-picker-popover {
  position: absolute;
  top: calc(100% + 8px);
  /* Logical inset: anchors right in LTR and flips to the left in Arabic without
     an extra rtl.css rule. */
  inset-inline-end: 0;
  /* Above the sticky header (1000). Shared with .filter-modal — the two popovers
     are mutually exclusive, so they never compete for this layer. */
  z-index: 1040;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-popover);
  /* Closed means display:none, not visibility:hidden: the panel leaves the render
     tree entirely, so it cannot be hit by pointer events, read out by a screen
     reader or linger as an invisible 320px box under the control row. */
  display: none;
  opacity: 0;
  /* Same 0.2s ease timing as .filter-modal, but unfolding from the corner nearest
     the calendar button rather than floating up 20px from nowhere. */
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.2s ease, transform 0.2s ease;
  /* allow-discrete lets display take part in the transition: it flips to block at
     the start of the open animation and back to none only once the collapse has
     finished. Declared second so unsupported browsers keep the plain fade above. */
  transition: opacity 0.2s ease, transform 0.2s ease, display 0.2s allow-discrete;
}

.date-picker-popover.show {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Coming out of display:none leaves no before-change style to interpolate from,
   so the open state has to be restated as the animation's starting point —
   otherwise the panel snaps straight to its unfolded position. */
@starting-style {
  .date-picker-popover.show {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
}

.date-picker-body {
  padding: 10px 16px 14px;
}

/* ── Strip Flatpickr's own card chrome ─────────────────────────────────────── */
.date-picker-popover .flatpickr-calendar {
  width: 100%;
  background: transparent;
  border: none;
  box-shadow: none;
  font-family: var(--font-family);
  animation: none;
}

.date-picker-popover .flatpickr-calendar.inline {
  position: relative;
  top: 0;
}

/* The popover is positioned by CSS above, not by Flatpickr, so its pointer arrow
   would float detached from any edge. */
.date-picker-popover .flatpickr-calendar::before,
.date-picker-popover .flatpickr-calendar::after {
  display: none;
}

.date-picker-popover .flatpickr-innerContainer,
.date-picker-popover .flatpickr-rContainer,
.date-picker-popover .flatpickr-days {
  width: 100%;
  border: none;
  justify-content: flex-start;
}

/* ── Month header: localized static label + prev/next chevrons ───────────────
   monthSelectorType is 'static', so the month is a span fed from
   date_nav.month_names. Flatpickr has NO yearSelectorType option, so the year is
   still an editable numInput — JS marks it readOnly and these rules strip its
   chrome so it reads as part of the same static label. */
.date-picker-popover .flatpickr-months {
  align-items: center;
  padding: 2px 0 10px;
}

.date-picker-popover .flatpickr-months .flatpickr-month {
  height: 28px;
  background: transparent;
  color: var(--text-primary);
  fill: currentColor;
}

.date-picker-popover .flatpickr-current-month {
  /* Flatpickr centres this absolutely; as a flex item it sits in the flexible
     middle column instead, leaving room for the two chevrons. */
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  left: auto;
  padding: 0;
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 28px;
  color: var(--text-primary);
}

.date-picker-popover .numInputWrapper {
  width: auto;
  background: transparent;
  border: none;
}

.date-picker-popover .numInputWrapper:hover {
  background: transparent;
}

/* Hide the year spinner arrows. */
.date-picker-popover .numInputWrapper span {
  display: none;
}

.date-picker-popover .numInput {
  /* width: auto !important; */
  min-width: 4ch;
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}

.date-picker-popover .flatpickr-months .flatpickr-prev-month,
.date-picker-popover .flatpickr-months .flatpickr-next-month {
  /* Static, so the chevrons join the flex row instead of pinning to the corners. */
  position: static;
  top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
  color: var(--text-tertiary);
  transition: var(--transition-fast);
}

.date-picker-popover .flatpickr-months .flatpickr-prev-month:hover,
.date-picker-popover .flatpickr-months .flatpickr-next-month:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* Bootstrap Icons replace Flatpickr's inline SVG arrows (prevArrow/nextArrow in
   date-navigation.js) so they match .date-nav-arrow. */
.date-picker-popover .flatpickr-prev-month .bi,
.date-picker-popover .flatpickr-next-month .bi {
  font-size: var(--font-size-md);
  line-height: 1;
}

/* ── Weekday row ──────────────────────────────────────────────────────────── */
.date-picker-popover .flatpickr-weekdays {
  height: auto;
  background: transparent;
  align-items: center;
}

.date-picker-popover .flatpickr-weekdaycontainer {
  display: flex;
  width: 100%;
}

.date-picker-popover span.flatpickr-weekday {
  flex: 1 1 0;
  width: auto;
  height: auto;
  float: none;
  display: block;
  background: transparent;
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: 600;
  line-height: 24px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ── Day grid ───────────────────────────────────────────────────────────────
   Flatpickr hard-codes a 307.875px container and 39px-wide cells. Switching the
   container to a 7-column grid lets it fill the popover at any width (and lets
   the mobile rules in responsive.css stretch it edge to edge) while keeping real
   gutters between cells. */
.date-picker-popover .dayContainer {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

.date-picker-popover .flatpickr-day {
  height: 36px;
  max-width: none;
  width: 100%;
  margin: 0;
  flex: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--border-radius-btn);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: 34px;
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.date-picker-popover .flatpickr-day:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color);
  color: var(--text-primary);
}

/* Adjacent-month days stay clickable, so mute rather than hide them. */
.date-picker-popover .flatpickr-day.prevMonthDay,
.date-picker-popover .flatpickr-day.nextMonthDay {
  color: var(--text-tertiary);
  opacity: 0.55;
}

/* Today: a thin accent ring, so it stays findable after browsing to another
   month. Declared before .selected so the solid fill wins when both apply. */
.date-picker-popover .flatpickr-day.today {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.date-picker-popover .flatpickr-day.today:hover {
  background: var(--accent-primary-subtle);
}

/* Selected: solid brand fill with on-accent text — the same treatment as
   .filter-radio:has(input:checked) in the filter modal. */
.date-picker-popover .flatpickr-day.selected,
.date-picker-popover .flatpickr-day.startRange,
.date-picker-popover .flatpickr-day.endRange {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-on-accent);
  font-weight: 700;
}

.date-picker-popover .flatpickr-day.selected:hover,
.date-picker-popover .flatpickr-day.startRange:hover,
.date-picker-popover .flatpickr-day.endRange:hover {
  background: var(--accent-primary);
  color: var(--text-on-accent);
}

.date-picker-popover .flatpickr-day.flatpickr-disabled,
.date-picker-popover .flatpickr-day.flatpickr-disabled:hover {
  background: transparent;
  border-color: transparent;
  color: var(--text-tertiary);
  opacity: 0.35;
  cursor: not-allowed;
}

/* Visible keyboard focus for every interactive node in the dialog. */
.date-picker-popover .flatpickr-day:focus-visible,
.date-picker-close:focus-visible,
.date-picker-today-btn:focus-visible,
.date-picker-apply-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Time Group Headers */
.time-group {
  margin-bottom: 16px;
}

.time-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-inline-start: 3px solid transparent;
  border-radius: 4px;
  margin-bottom: 8px;
}

.time-group-header.live {
  color: var(--accent-red);
  border-inline-start-color: var(--accent-red);
  background: rgba(231, 76, 60, 0.06);
}

.time-group-header.upcoming {
  color: var(--accent-teal);
  border-inline-start-color: var(--accent-teal);
  background: rgba(57, 219, 191, 0.06);
}

.time-group-header.ended {
  color: var(--text-muted);
  border-inline-start-color: var(--text-muted);
  background: rgba(136, 136, 136, 0.06);
}

.time-group-header i {
  font-size: 0.9rem;
}

.time-group-content {
  /* No extra styling needed — league groups handle their own spacing */
}

/* ===========================
   Utility Classes
   =========================== */
.text-live {
  color: var(--accent-green);
}

.text-ended {
  color: var(--accent-red);
}

.badge-live {
  background: var(--accent-green);
  color: var(--text-on-accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.badge-ht {
  background: var(--accent-yellow);
  color: var(--text-on-accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.badge-ft {
  background: var(--accent-red);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.view-all-link {
  display: block;
  text-align: center;
  padding: 12px;
  color: var(--accent-teal);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: var(--transition-fast);
}

.view-all-link:hover {
  color: var(--text-white);
}

/* ===========================
   Fixture Status Labels
   =========================== */
.fixture-status-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--accent-yellow);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fixture-score-suspended,
.team-match-suspended {
  color: var(--accent-yellow);
  font-weight: 600;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}


/* ==========================================
   PENALTY BADGE FOR FIXTURE CARDS
   ========================================== */

.penalty-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 4px;
    border-radius: 4px;
    margin-top: 3px;
    font-weight: 500;
    line-height: 1.2;
}

.penalty-badge .pen-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.75;
}

.penalty-badge .pen-score {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.match-pen-indicator {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

/* ===========================
   User Avatar Menu (Header)
   =========================== */
.user-avatar-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--accent-teal);
    background: var(--bg-secondary);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color var(--transition-fast);
}

.user-avatar-btn:hover {
    border-color: var(--accent-primary);
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-avatar-letter {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-on-accent);
    background: var(--accent-teal);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.user-avatar-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 1060;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
}

.user-avatar-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-popup-name {
    display: block;
    padding: 12px 16px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background var(--transition-fast);
}

.user-popup-name:hover {
    background: var(--bg-card-hover);
    color: var(--accent-teal);
}

.user-popup-logout {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    border-top: 1px solid var(--border-color);
    color: var(--accent-red);
    font-size: var(--font-size-sm);
    font-weight: 500;
    font-family: var(--font-family);
    text-align: start;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.user-popup-logout:hover {
    background: rgba(229, 57, 53, 0.08);
}
