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

html {
  font-size: 13px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

html.view-desktop {
  overflow-x: clip;
  overflow-y: visible;
  scrollbar-gutter: stable;
}

html.view-mobile {
  overflow: hidden;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  background-image: var(--gradient-bg);
  color: var(--text-primary);
  line-height: 1.4;
  min-height: 100vh;
}

body.view-desktop {
  overflow-x: clip;
  overflow-y: visible;
}

body.view-mobile {
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
ul { list-style: none; }

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  height: var(--header-height);
  overflow: visible;
}

.header-inner {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 var(--site-gap);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  /* visible — overflow-x:auto used to clip the language dropdown */
  overflow: visible;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity var(--transition);
}

.logo:hover { opacity: 0.92; }

.logo-full {
  height: 38px;
  width: auto;
  max-width: min(220px, 46vw);
  display: block;
  flex-shrink: 0;
}

.logo-compact {
  display: none;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 7px;
}

.logo-dot {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* PC: search + language align with #pc-content edge; do not overflow right banner */
body.view-desktop .header-nav-block {
  padding-right: calc(var(--ad-rail-width) + var(--site-gap));
  box-sizing: border-box;
}

body.view-desktop .nav-tabs {
  flex: 1 1 0;
  min-width: 0;
}

body.view-desktop .header-actions {
  flex-shrink: 0;
}

body.view-desktop .search-input {
  width: 130px;
  max-width: 130px;
}

body.view-desktop .search-input:focus {
  width: 150px;
  max-width: 150px;
}

.nav-tabs {
  display: flex;
  gap: 2px;
  flex: 0 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color var(--transition), background var(--transition);
}

.nav-tab:hover { color: var(--text-primary); background: var(--bg-card); }
a.nav-tab {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.nav-tab.active {
  color: var(--accent-primary);
  background: var(--accent-primary-dim);
  box-shadow: inset 0 -2px 0 var(--accent-primary);
}

/* Mobile tab bar — 5-column grid inside 390px frame */
.mobile-tab-bar {
  display: none;
  align-items: stretch;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 4px var(--site-gap);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  scrollbar-width: none;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.mobile-tab-bar::-webkit-scrollbar { display: none; }

.mobile-tab-bar .nav-tab {
  flex: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 5px 2px;
  font-size: clamp(0.48rem, 2.5vw, 0.54rem);
  font-weight: 600;
  justify-content: center;
  align-items: center;
  text-align: center;
  white-space: nowrap;
  line-height: 1.15;
  letter-spacing: -0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  box-sizing: border-box;
}

.mobile-tab-bar .nav-tab.active {
  color: var(--accent-primary);
  background: var(--accent-primary-dim);
  border-color: var(--live-bar-border);
  box-shadow: none;
}

.mobile-tab-bar .nav-tab[data-tab="live"] {
  flex-direction: row;
  gap: 3px;
}

.mobile-tab-bar .nav-tab .live-dot {
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  margin-top: 0;
}

body.view-mobile .mobile-tab-bar,
body:not(.view-desktop) .mobile-tab-bar {
  display: grid;
  /* Fixed below header — avoid sticky jump when zoom triggers media queries */
  position: sticky;
  top: 0;
  z-index: 90;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-inline: var(--site-gap);
  box-sizing: border-box;
}

body.view-mobile .header-nav-block .nav-tabs,
body:not(.view-desktop) .header-nav-block .nav-tabs {
  display: none !important;
}

/* Do not use @media to change tab sticky — zoom would shift tabs */

body.view-mobile .match-list-header,
body:not(.view-desktop) .match-list-header {
  display: none;
}

/* PC Today tab: hide title + match count (tab bar + LIVE/UPCOMING blocks already show) */
body.view-desktop[data-tab="today"] .match-list-header {
  display: none;
}

/* Mobile header: Logo | PC/Mobile | Search | lang — flush to .win */
body.view-mobile .header-inner,
body:not(.view-desktop) .header-inner {
  gap: 0;
  justify-content: flex-start;
}

/* SVG logo has trailing padding after .win — pull controls flush to win */
body.view-mobile .logo,
body:not(.view-desktop) .logo {
  margin-right: -12px;
}

body.view-mobile .logo-full,
body:not(.view-desktop) .logo-full {
  /* Trim empty viewBox on the right so .win sits closer to controls */
  max-width: min(142px, 36vw);
}

body.view-mobile .header-nav-block,
body:not(.view-desktop) .header-nav-block {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  max-width: none;
  justify-content: flex-start;
  gap: 2px;
  margin: 0;
  padding-left: 0;
}

body.view-mobile .header-actions,
body:not(.view-desktop) .header-actions {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  margin: 0;
  justify-content: flex-start;
  gap: 6px;
}

body.view-mobile .view-toggle,
body:not(.view-desktop) .view-toggle {
  flex-shrink: 0;
}

body.view-mobile .search-wrap,
body:not(.view-desktop) .search-wrap {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  margin-left: 0;
}

body.view-mobile .lang-switcher,
body:not(.view-desktop) .lang-switcher {
  flex-shrink: 0;
  margin-left: 0;
}

/* Narrow header / zoom: shrink PC/Mobile label to icon only (buttons stay visible) */
body.view-mobile .view-btn span,
body:not(.view-desktop) .view-btn span {
  display: none;
}

body.view-mobile .view-btn,
body:not(.view-desktop) .view-btn {
  padding: 5px 7px;
}

body.view-mobile .search-input,
body:not(.view-desktop) .search-input {
  width: 100%;
  font-size: 0.72rem;
}

body.view-mobile .search-input:focus,
body:not(.view-desktop) .search-input:focus {
  width: 100%;
}

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

/* PC header: LIVE tab uses camera icon (matches LIVE section block) */
body.view-desktop .header-nav-block .nav-tab[data-tab="live"] .live-dot {
  display: none;
}

body.view-desktop .header-nav-block .nav-tab[data-tab="live"]::before {
  content: '';
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background: url('../assets/icons/live-stream.png?v=1') center / contain no-repeat;
}

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

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

/* View toggle (PC / Mobile) — always visible (even when zoom makes CSS viewport < 769) */
.view-toggle {
  display: flex;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 4px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.view-btn:hover { color: var(--text-secondary); }
.view-btn.active {
  color: var(--accent-primary);
  background: var(--accent-primary-dim);
}

.data-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-badge.api {
  color: var(--accent-primary);
  background: var(--accent-primary-dim);
  border: 1px solid var(--border-glow);
}

.data-badge.mock {
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.data-badge.loading {
  color: var(--accent-secondary);
  background: rgba(212, 120, 44, 0.12);
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 8px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 180px;
  padding: 6px 8px 6px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: border-color var(--transition), width var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  width: 220px;
}

.search-input::placeholder { color: var(--text-muted); }

.lang-switcher {
  position: relative;
  z-index: 120;
  flex-shrink: 0;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: border-color var(--transition);
}

.lang-btn:hover { border-color: var(--border-light); }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  min-width: 140px;
  z-index: 250;
  overflow: hidden;
}

.lang-dropdown li {
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.lang-dropdown li:hover,
.lang-dropdown li.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ===== PC layout: hero banner aligned with twin towers + side rails ===== */
#partner-top-zone {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: var(--site-max);
  margin-left: auto;
  margin-right: auto;
  padding: 10px var(--site-gap) 6px;
  box-sizing: border-box;
  background: transparent;
  border-bottom: none;
}

/* Top banner hidden on PC — remove this block to re-enable */
body.view-desktop #partner-top-zone {
  display: none !important;
}

#partner-top-zone .partner-card {
  width: 100%;
  max-width: 728px;
  margin: 0 auto;
}

#partner-top-zone .site-hero-banner {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.site-hero-banner {
  position: relative;
  height: 106px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--live-bar-border);
  box-shadow: var(--shadow);
  background: var(--gradient-live-bar);
}

.site-hero-pitch-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  opacity: 0.92;
}

.site-hero-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.site-hero-ball {
  position: absolute;
  right: 26%;
  bottom: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff 0%, #f8fafc 18%, #e2e8f0 40%, #cbd5e1 100%);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
  opacity: 0.45;
}

.site-hero-ball::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background:
    conic-gradient(from 20deg, transparent 0 55deg, rgba(15,23,42,0.07) 55deg 110deg, transparent 110deg 180deg, rgba(15,23,42,0.07) 180deg 235deg, transparent 235deg 300deg, rgba(15,23,42,0.07) 300deg 360deg);
}

.site-hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 0 14px;
  box-sizing: border-box;
}

.site-hero-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  min-width: 0;
}

.site-hero-icon {
  flex-shrink: 0;
  border-radius: 11px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.18);
}

.site-hero-brand-text {
  min-width: 0;
}

.site-hero-wordmark {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  white-space: nowrap;
}

.site-hero-wordmark .footer-brand-live {
  color: var(--brand-live);
}

.site-hero-wordmark .footer-brand-scores {
  color: var(--brand-scores);
}

.site-hero-wordmark .footer-brand-win {
  background: var(--gradient-win);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-hero-tagline {
  margin-top: 2px;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.2;
  white-space: nowrap;
}

.site-hero-pillars {
  display: flex;
  align-items: stretch;
  gap: 6px;
  flex: 1;
  min-width: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
}

.site-hero-pillar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  backdrop-filter: blur(4px);
  min-width: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.site-hero-pillar-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.site-hero-pillar-text strong {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  white-space: nowrap;
}

.site-hero-pillar-text small {
  font-size: 0.52rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.1;
  white-space: nowrap;
}

.site-hero-pillar-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--bg-elevated) center / 14px 14px no-repeat;
}

.site-hero-pillar--live .site-hero-pillar-icon {
  background-color: var(--live-red-glow);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23dc2626'%3E%3Ccircle cx='12' cy='12' r='6'/%3E%3C/svg%3E");
}

.site-hero-pillar--today .site-hero-pillar-icon {
  background-color: var(--accent-primary-dim);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M3 11h18'/%3E%3C/svg%3E");
}

.site-hero-pillar--world .site-hero-pillar-icon {
  background-color: var(--accent-green-dim);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.5 3 2.5 15 0 18M12 3c-2.5 3-2.5 15 0 18'/%3E%3C/svg%3E");
}

.site-hero-board {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  min-width: 118px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--live-bar-border);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.08);
}

.site-hero-board-league {
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--live-bar-accent);
  text-transform: uppercase;
}

.site-hero-board-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.site-hero-board-team em {
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--score-blue);
  margin-left: 2px;
}

.site-hero-board-team:first-child em {
  margin-left: 4px;
}

.site-hero-board-sep {
  color: var(--text-muted);
  font-weight: 600;
}

.site-hero-board-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.52rem;
  font-weight: 800;
  color: var(--live-red);
  letter-spacing: 0.04em;
}

.site-hero-board-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--live-red);
  box-shadow: 0 0 6px var(--live-red-glow);
  animation: site-hero-pulse 1.4s ease-in-out infinite;
}

@keyframes site-hero-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.site-hero-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #229ed9 0%, #0088cc 100%);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(34, 158, 217, 0.28);
  transition: transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.site-hero-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(34, 158, 217, 0.38);
}

body.view-mobile #partner-top-zone .site-hero-banner {
  display: none;
}

#pc-page-wrap {
  display: flex;
  width: 100%;
  max-width: var(--site-max);
  margin: 0 auto;
  gap: var(--site-gap);
  padding: 10px var(--site-gap) 16px;
  align-items: flex-start;
  position: relative;
}

body.view-desktop #pc-page-wrap {
  align-items: stretch;
}

#partner-col-left,
#partner-col-right {
  display: flex;
  flex-direction: column;
  gap: var(--site-gap);
  width: var(--ad-rail-width);
  flex-shrink: 0;
  align-self: stretch;
}

body.view-desktop #partner-col-left,
body.view-desktop #partner-col-right {
  position: relative;
  z-index: 5;
}

body.view-desktop #partner-col-left .partner-tower,
body.view-desktop #partner-col-right .partner-tower,
body.view-desktop #partner-col-left > .partner-card,
body.view-desktop #partner-col-right > .partner-card {
  position: relative;
  width: var(--ad-rail-width);
  flex-shrink: 0;
  align-self: flex-start;
  z-index: 50;
}

body.view-desktop .partner-tower-spacer {
  display: none;
  flex-shrink: 0;
  pointer-events: none;
}

body.view-desktop .partner-tower.is-partner-fixed {
  position: fixed;
  z-index: 50;
}

body.view-desktop #partner-col-left .partner-tower.is-partner-bottom,
body.view-desktop #partner-col-right .partner-tower.is-partner-bottom,
body.view-desktop #partner-col-left > .partner-card.is-partner-bottom,
body.view-desktop #partner-col-right > .partner-card.is-partner-bottom {
  position: absolute;
  top: auto;
  bottom: 0;
  z-index: 5;
}

body.view-desktop #partner-col-left .partner-tower.is-partner-bottom,
body.view-desktop #partner-col-left > .partner-card.is-partner-bottom {
  left: 0;
  right: auto;
}

body.view-desktop #partner-col-right .partner-tower.is-partner-bottom,
body.view-desktop #partner-col-right > .partner-card.is-partner-bottom {
  right: 0;
  left: auto;
}

#pc-content {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.partner-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
  background: #fff;
  line-height: 0;
  transition: box-shadow var(--transition), transform var(--transition);
}

.partner-card:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.partner-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.partner-leader {
  width: 100%;
  max-width: 728px;
  height: 90px;
  min-height: 90px;
}

.partner-tower {
  width: var(--ad-rail-width);
  height: var(--ad-tower-height);
  min-height: var(--ad-tower-height);
}

/* ===== Tower 160×460 — left ad · right brand ===== */
.partner-tower-card {
  line-height: 1.35;
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-color: var(--border);
  overflow: hidden;
}

.partner-tower-card:hover {
  border-color: var(--live-bar-border);
}

.partner-tower-card .tower-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--gradient-accent);
}

.partner-tower-card .tower-head--live {
  color: #1e40af;
  background: var(--gradient-live-bar);
  border-bottom: 1px solid var(--live-bar-border);
}

.partner-tower-card .tower-head-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live-red);
  box-shadow: 0 0 6px var(--live-red-glow);
  animation: site-hero-pulse 1.4s ease-in-out infinite;
}

.partner-tower-card .tower-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 10px 10px;
  box-sizing: border-box;
  text-align: center;
  min-height: 0;
}

.partner-tower--ad .tower-slot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 0;
  margin-bottom: 12px;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  border: 2px dashed #bfdbfe;
  background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
  box-sizing: border-box;
}

.partner-tower--ad .tower-slot-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.partner-tower--ad .tower-slot-size {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent-primary);
}

.partner-tower-card .tower-lead {
  margin: 0 0 4px;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.partner-tower-card .tower-sub {
  margin: 0;
  font-size: 0.56rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.35;
}

.partner-tower-card .tower-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 8px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--gradient-accent);
  box-sizing: border-box;
}

.partner-tower-card:hover .tower-foot {
  filter: brightness(1.04);
}

.partner-tower--ad {
  padding: 0;
  overflow: hidden;
  background: transparent;
  border-color: var(--border);
}

.partner-tower--ad .partner-tower-ad-img {
  display: block;
  width: 160px;
  height: var(--ad-tower-height);
  max-width: none;
  object-fit: fill;
  image-rendering: auto;
}

.partner-tower--ad:hover {
  border-color: var(--live-bar-border);
}

.partner-tower--brand {
  padding: 0;
  overflow: hidden;
  background: var(--bg-card);
  border-color: var(--border);
}

.partner-tower--brand .partner-tower-brand-img {
  display: block;
  width: 160px;
  height: var(--ad-tower-height);
  max-width: none;
  object-fit: fill;
  image-rendering: auto;
  background: #fff;
}

.partner-tower--brand:hover {
  border-color: var(--live-bar-border);
}

.partner-tower--brand:hover .partner-tower-brand-img {
  filter: brightness(1.02);
}

body.view-mobile #partner-top-zone,
body.view-mobile #partner-col-left,
body.view-mobile #partner-col-right {
  display: none !important;
}

body.view-mobile #pc-page-wrap {
  display: block !important;
  max-width: min(390px, 100vw);
  width: 100%;
  margin: 0 auto;
  padding: 8px var(--site-gap) 16px;
  box-sizing: border-box;
  overflow-x: hidden;
}

body.view-desktop .mobile-only,
body.view-desktop #banner-mobile-top,
body.view-desktop #banner-mobile-bottom {
  display: none !important;
}

/* PC — fixed 1180px frame; side banners stay visible when zooming */
body.view-desktop {
  min-width: var(--site-max);
}

body.view-desktop #pc-page-wrap {
  min-width: var(--site-max);
  max-width: var(--site-max);
  width: 100%;
}

body.view-desktop #partner-col-left,
body.view-desktop #partner-col-right {
  display: flex !important;
  flex-shrink: 0;
  width: var(--ad-rail-width);
}

#banner-mobile-top {
  display: none !important;
}

#banner-mobile-bottom {
  display: none;
}

body.view-mobile #banner-mobile-top {
  display: none !important;
}

body.view-mobile #banner-mobile-bottom {
  display: block !important;
  position: fixed !important;
  bottom: 0;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  transform: none;
  z-index: 180;
  width: 100%;
  max-width: min(390px, 100vw);
  /* Same frame inset — do not push banner / close button outside edge */
  padding: 0 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
  overflow: hidden;
}

body.view-mobile .mob-ad-inner {
  position: relative;
  background: transparent;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

/* Close button inside banner frame — no negative offset (avoids clip on mobile right edge) */
body.view-mobile .mob-ad-close,
body:not(.view-desktop) .mob-ad-close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}

body.view-mobile .mob-ad-close:hover,
body:not(.view-desktop) .mob-ad-close:hover {
  background: rgba(15, 23, 42, 0.95);
}

body.view-mobile #banner-mobile-bottom.is-dismissed,
body.view-mobile .mob-partner-card.is-dismissed {
  display: none !important;
}

html.mob-banner-dismissed #banner-mobile-bottom {
  display: none !important;
}

html.mob-banner-dismissed body.view-mobile {
  padding-bottom: 0 !important;
}

body.view-mobile.mob-bottom-ad-hidden {
  padding-bottom: 0 !important;
}

body.view-mobile.mob-bottom-ad-hidden #mobile-scroll-col {
  padding-bottom: 0;
}

/* Banner padding-bottom on #mobile-scroll-col (not body — avoids tab jump on zoom) */
body.view-mobile {
  min-width: 0;
}

/* PC: normal wrapper (sticky rail needs boxed ancestor; no display:contents) */
#mobile-scroll-col {
  display: contents;
}

body.view-desktop #mobile-scroll-col {
  display: block;
  width: 100%;
  max-width: var(--site-max);
  margin: 0 auto;
  overflow: visible;
}

body.view-mobile #mobile-scroll-col {
  display: block;
  width: 100%;
  max-width: min(390px, 100vw);
  margin: 0 auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  body:not(.view-desktop) #mobile-scroll-col {
    display: block;
    width: 100%;
    max-width: min(390px, 100vw);
    margin: 0 auto;
    overflow-x: hidden;
    box-sizing: border-box;
  }
}

/* Mobile view: fixed frame — zoom scales only; header/tab position unchanged */
body.view-mobile {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding-bottom: 0;
  min-width: 0;
}

body.view-mobile .header {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: min(390px, 100vw);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

body.view-mobile .header-inner {
  max-width: min(390px, 100vw);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

body.view-mobile #mobile-scroll-col {
  display: block;
  width: 100%;
  max-width: min(390px, 100vw);
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 70px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  box-shadow: 0 0 24px rgba(15, 23, 42, 0.08);
  background: var(--bg-primary);
  box-sizing: border-box;
}

body.view-mobile #banner-mobile-bottom .mob-banner-sub {
  display: none;
}

body.view-mobile #banner-mobile-bottom .mob-banner--livescores {
  min-width: 0;
  height: 52px;
  gap: 6px;
  padding: 0 8px;
  padding-right: 26px;
  box-shadow: none;
}

body.view-mobile #banner-mobile-bottom .mob-banner-logo {
  height: 24px;
  max-width: min(118px, 36vw);
}

body.view-mobile #banner-mobile-bottom .mob-banner-cta {
  padding: 6px 8px;
  font-size: 0.62rem;
  gap: 4px;
  box-shadow: 0 1px 6px rgba(37, 99, 235, 0.22);
}

body.view-mobile #banner-mobile-bottom .mob-ad-close {
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  font-size: 12px;
}

/* Heavy zoom-in: keep search visible in Mobile preview mode */
body.view-mobile .search-wrap {
  display: flex !important;
}

body.view-mobile .mob-partner-card.is-dismissed {
  display: none !important;
}

body.view-mobile .mob-banner {
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  box-sizing: border-box;
}

body.view-mobile .mob-banner:not(.mob-banner--livescores) {
  display: block;
  line-height: 0;
  height: 50px;
  border: 2px solid #2563eb;
}

body.view-mobile .mob-banner.mob-banner--livescores {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  line-height: 1.2;
  gap: 8px;
  padding-right: 8px;
}

body.view-mobile .mob-banner > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.view-mobile .mob-banner--livescores img.mob-banner-logo {
  width: auto;
  height: 28px;
  max-width: min(170px, 52vw);
  object-fit: contain;
}

/* Livescores.win mobile promo → Telegram @ibet888_bot
   Light background + logo-horizontal.svg: Live black / Scores gray / .win green (matches header) */
.mob-banner--livescores {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 56px;
  padding: 0 12px;
  line-height: 1.2;
  background: linear-gradient(118deg, #f8fafc 0%, #eff6ff 45%, #e0f2fe 100%);
  border: 1px solid rgba(37, 99, 235, 0.22);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  text-decoration: none;
  color: var(--brand-live);
  overflow: hidden;
}

.mob-banner-pattern {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(37, 99, 235, 0.04) 0,
      rgba(37, 99, 235, 0.04) 1px,
      transparent 1px,
      transparent 18px
    ),
    radial-gradient(circle at 88% 50%, rgba(6, 182, 212, 0.18) 0%, transparent 42%);
  pointer-events: none;
}

.mob-banner--livescores::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, transparent 48%);
  pointer-events: none;
}

.mob-banner-brand {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.mob-banner-logo {
  display: block;
  width: auto;
  height: 28px;
  max-width: min(170px, 52vw);
  object-fit: contain;
  object-position: left center;
  flex-shrink: 1;
}

.mob-banner-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  flex: 1;
}

.mob-banner-sub {
  font-size: 0.64rem;
  font-weight: 500;
  color: var(--brand-scores);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mob-banner-cta {
  position: relative;
  z-index: 1;
  flex-shrink: 1;
  min-width: 0;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--gradient-win);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.28);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mob-banner-tg {
  flex-shrink: 0;
  color: #fff;
}

.mob-banner--compact {
  height: 50px;
  padding: 0 10px;
  gap: 8px;
}

.mob-banner--compact .mob-banner-logo {
  height: 24px;
  max-width: min(150px, 48vw);
}

.mob-banner--compact .mob-banner-sub {
  font-size: 0.58rem;
}

.mob-banner--compact .mob-banner-cta {
  padding: 7px 10px;
  font-size: 0.62rem;
}

/* ===== Site Layout (legacy) ===== */
.site-layout {
  width: 100%;
  margin: 0 auto;
  padding: 8px;
}

.site-main {
  width: 100%;
  min-width: 0;
}

/* ===== Page Shell (legacy) ===== */
.page-shell {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 8px;
}

.page-center {
  width: 100%;
  min-width: 0;
}

/* ===== Ad Rails ===== */
.ad-rail {
  flex-direction: column;
  gap: 8px;
  scrollbar-width: none;
}
.ad-rail::-webkit-scrollbar { display: none; }

/* ===== Advertisements ===== */
.ad-top-bar,
.ad-top-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 90px;
}

.ad-top-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.ad-unit,
.ad-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.25);
  border: 3px solid #2563eb;
  display: block;
  line-height: 0;
  background: #fff;
}

.ad-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #e2e8f0;
}

.ad-unit .ad-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 5px;
  overflow: hidden;
  text-align: center;
  padding: 10px;
}

.ad-unit .ad-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background: radial-gradient(circle at 85% 15%, rgba(255,255,255,0.45), transparent 55%);
  pointer-events: none;
}

.ad-ball {
  font-size: 1.6rem;
  opacity: 0.35;
  position: absolute;
  right: 10px;
  bottom: 6px;
  z-index: 0;
}

.ad-970x90 { width: 100%; max-width: 970px; height: 90px; min-height: 90px; }
.ad-728x90 { width: 100%; max-width: 728px; height: 90px; min-height: 90px; }
.ad-468x60 { width: 468px; max-width: 100%; height: 60px; min-height: 60px; }
.ad-300x600 { width: 300px; height: 600px; min-height: 600px; }
.ad-160x600 { width: 160px; height: 600px; min-height: 600px; }
.ad-300x250 { width: 300px; height: 250px; min-height: 250px; }
.ad-300x100 { width: 300px; height: 100px; min-height: 100px; }
.ad-320x50 { width: 320px; max-width: 100%; height: 50px; min-height: 50px; }

/* Mobile: banner full width of phone frame */
body.view-mobile #banner-mobile-top .mob-banner:not(.mob-banner--livescores),
body.view-mobile #banner-mobile-bottom .mob-banner:not(.mob-banner--livescores) {
  width: 100%;
  max-width: 100%;
  height: 50px;
  margin: 0 auto;
}

body.view-mobile #banner-mobile-top .mob-banner--livescores,
body.view-mobile #banner-mobile-bottom .mob-banner--livescores {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.ad-tag {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.85;
  z-index: 1;
}

.ad-brand {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  z-index: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.ad-brand-sm {
  font-size: 0.82rem;
  font-weight: 700;
  z-index: 1;
}

.ad-cta {
  font-size: 0.72rem;
  font-weight: 700;
  z-index: 1;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(0,0,0,0.25);
}

.ad-size {
  font-size: 0.58rem;
  opacity: 0.55;
  z-index: 1;
}

.ad-theme-gold .ad-inner { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #d97706 100%); color: #fff; }
.ad-theme-red .ad-inner { background: linear-gradient(135deg, #ef4444 0%, #f87171 50%, #dc2626 100%); color: #fff; }
.ad-theme-blue .ad-inner { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #1d4ed8 100%); color: #fff; }
.ad-theme-green .ad-inner { background: linear-gradient(135deg, #059669 0%, #10b981 50%, #047857 100%); color: #fff; }
.ad-theme-purple .ad-inner { background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 50%, #6d28d9 100%); color: #fff; }

/* ===== Main Content ===== */
.match-section {
  width: 100%;
  min-width: 0;
}

.match-list-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 0 2px;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.match-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== League Group ===== */
.league-group {
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Today: each league = separate rounded card (same as Upcoming / Finished tabs) */
.today-section-list .league-group {
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  background: var(--bg-card);
}

.today-section-list .league-group:last-child {
  margin-bottom: 0;
}

.today-section-live .today-section-list .league-group {
  border-color: #bfdbfe;
}

.today-section-upcoming .today-section-list .league-group {
  border-color: var(--border);
}

.today-section-finished .today-section-list .league-group {
  border-color: #fecaca;
}

.league-group > .league-header {
  display: none;
}

.league-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  border-left: 3px solid var(--accent-primary);
}

.league-flag {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  object-fit: cover;
  background: var(--bg-card);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.league-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex: 1;
}

.league-country {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ===== Today tab — section headers + league card list ===== */
.today-section {
  margin-bottom: 12px;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

.today-section-header {
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.today-section-live .today-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e40af;
  border-color: #bfdbfe;
}

.today-section-live .today-section-header::before {
  content: '';
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: url('../assets/icons/live-stream.png?v=1') center / contain no-repeat;
}

body.view-mobile .today-section-live .today-section-header::before,
body:not(.view-desktop) .today-section-live .today-section-header::before {
  width: 18px;
  height: 18px;
}

/* UPCOMING — neutral slate (plan A: brand-aligned, no green) */
.today-section-upcoming .today-section-header {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  color: #475569;
  border-color: #e2e8f0;
}

.today-section-finished .today-section-header {
  background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%);
  color: #991b1b;
  border-color: #fecaca;
}

.today-section-live .today-section-list {
  border-color: #bfdbfe;
}

.today-section-upcoming .today-section-list {
  border-color: #e2e8f0;
}

.today-section-finished .today-section-list {
  border-color: #fecaca;
}

.today-section-list {
  border: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.today-match-wrap + .today-match-wrap .match-league-line {
  border-top: 1px solid var(--border);
}

.match-league-line {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  border-left: 3px solid #94a3b8;
}

.match-league-line--group {
  border: none;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid #94a3b8;
  border-radius: 0;
}

/* League row — LIVE uses former UPCOMING blue tint */
.today-section-live .match-league-line--group,
.league-group:has(.match-item-wrap.match-live) > .match-league-line--group {
  background: linear-gradient(90deg, #dbeafe 0%, #eff6ff 100%);
  border-color: #bfdbfe;
  border-left-color: #3b82f6;
  color: #1e40af;
}

.today-section-live .match-league-line--group .match-league-name,
.league-group:has(.match-item-wrap.match-live) > .match-league-line--group .match-league-name {
  color: #1e40af;
  font-weight: 700;
}

/* League row — UPCOMING (light slate) */
.today-section-upcoming .match-league-line--group,
.league-group:has(.match-item-wrap.match-upcoming):not(:has(.match-item-wrap.match-finished)):not(:has(.match-item-wrap.match-live)) > .match-league-line--group {
  background: linear-gradient(90deg, #f1f5f9 0%, #f8fafc 100%);
  border-color: #e2e8f0;
  border-left-color: #94a3b8;
  color: #475569;
}

.today-section-upcoming .match-league-line--group .match-league-name,
.league-group:has(.match-item-wrap.match-upcoming):not(:has(.match-item-wrap.match-finished)):not(:has(.match-item-wrap.match-live)) > .match-league-line--group .match-league-name {
  color: #475569;
  font-weight: 600;
}

/* League row — FINISHED uses former LIVE red tint */
.today-section-finished .match-league-line--group,
.league-group:has(.match-item-wrap.match-finished):not(:has(.match-item-wrap.match-upcoming)):not(:has(.match-item-wrap.match-live)) > .match-league-line--group {
  background: linear-gradient(90deg, #fef2f2 0%, #fff1f2 45%, #ffffff 100%);
  border-color: #fecaca;
  border-left: 3px solid var(--live-red);
  color: #991b1b;
}

.today-section-finished .match-league-line--group .match-league-name,
.league-group:has(.match-item-wrap.match-finished):not(:has(.match-item-wrap.match-upcoming)):not(:has(.match-item-wrap.match-live)) > .match-league-line--group .match-league-name {
  color: #991b1b;
  font-weight: 700;
}

.match-meta-line {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 2px 10px 4px;
  background: inherit;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.match-meta-kickoff {
  font-size: 0.63rem;
  font-weight: 700;
  color: #2563eb;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.match-live .match-meta-kickoff {
  color: var(--live-red);
}

.match-kickoff-group {
  position: relative;
  width: 50px;
  min-width: 50px;
  flex-shrink: 0;
  margin-right: auto;
  align-self: center;
}

.match-kickoff-group .match-meta-kickoff {
  display: block;
  width: 100%;
  min-width: 0;
  margin-right: 0;
  text-align: center;
}

.match-meta-clock.live-clock-sprite,
.match-meta-clock.live-clock-static {
  --clock-w: calc(10px * 1.3);
  width: var(--clock-w);
  height: var(--clock-w);
  flex-shrink: 0;
}

.match-kickoff-group .match-stream-link {
  position: absolute;
  left: calc(100% + 2px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

/* Fixed camera slot — same size with or without icon */
.match-stream-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  line-height: 0;
}

.match-stream-slot.is-empty {
  visibility: hidden;
  pointer-events: none;
}

body.view-mobile .match-stream-slot,
body:not(.view-desktop) .match-stream-slot {
  width: 18px;
  height: 18px;
}

.match-stream-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  flex-shrink: 0;
  opacity: 0.95;
  transition: opacity var(--transition), transform var(--transition);
}

.match-kickoff-group .match-stream-link:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.06);
}

.match-stream-link:hover {
  opacity: 1;
  transform: scale(1.06);
}

.match-stream-icon {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
}

body.view-desktop .match-stream-icon {
  width: 22px;
  height: 22px;
}

/* Mobile: slightly smaller to balance with kickoff time */
body.view-mobile .match-stream-icon,
body:not(.view-desktop) .match-stream-icon {
  width: 18px;
  height: 18px;
}

.match-meta-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  flex-shrink: 0;
}

.match-meta-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-shrink: 0;
  width: 38px;
  min-width: 38px;
  margin-left: var(--stats-tools-gap, 5px);
}

/* Fixed chart slot — reserve space without chart so star stays aligned */
.match-timeline-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  font-size: 0.82rem;
  line-height: 1;
}

.match-timeline-slot.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.match-timeline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  line-height: 1;
  text-decoration: none;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.match-timeline-link:hover {
  opacity: 0.85;
}

.mobile-meta-favorite {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  flex-shrink: 0;
}

.mobile-meta-favorite svg {
  width: 11px;
  height: 11px;
}

.league-group .match-item-wrap {
  border-left: none;
  border-right: none;
  border-bottom: none;
}

.league-group > .match-item-wrap:last-child {
  border-bottom: none;
  border-radius: 0;
  overflow: hidden;
}

.league-group > .match-item-wrap + .match-item-wrap {
  border-top: 1px solid #e8edf2;
}

/* Zebra by match order (league rows excluded) — children inherit wrap background */
.league-group .match-item-wrap .match-row,
.league-group .match-item-wrap .match-meta-line {
  background: inherit;
}

/* Zebra by match type — white + light tint matching each section header */
.league-group > .match-item-wrap:nth-child(odd of .match-item-wrap),
.today-section-list .match-item-wrap:nth-child(odd of .match-item-wrap) {
  background: #ffffff;
}

/* LIVE — white / very light blue */
.today-section-live .match-item-wrap:nth-child(even of .match-item-wrap),
.league-group .match-item-wrap.match-live:nth-child(even of .match-item-wrap) {
  background: #f0f7ff;
}

.today-section-live .match-item-wrap:nth-child(odd of .match-item-wrap):hover,
.league-group .match-item-wrap.match-live:nth-child(odd of .match-item-wrap):hover {
  background: #f8fbff;
}

.today-section-live .match-item-wrap:nth-child(even of .match-item-wrap):hover,
.league-group .match-item-wrap.match-live:nth-child(even of .match-item-wrap):hover {
  background: #e8f2ff;
}

/* UPCOMING — white / light slate (same family as Finished) */
.today-section-upcoming .match-item-wrap:nth-child(even of .match-item-wrap),
.league-group .match-item-wrap.match-upcoming:nth-child(even of .match-item-wrap) {
  background: #f8fafc;
}

.today-section-upcoming .match-item-wrap:nth-child(odd of .match-item-wrap):hover,
.league-group .match-item-wrap.match-upcoming:nth-child(odd of .match-item-wrap):hover {
  background: #fafafa;
}

.today-section-upcoming .match-item-wrap:nth-child(even of .match-item-wrap):hover,
.league-group .match-item-wrap.match-upcoming:nth-child(even of .match-item-wrap):hover {
  background: #f1f5f9;
}

/* FINISHED — white / warm light gray */
.today-section-finished .match-item-wrap:nth-child(even of .match-item-wrap),
.league-group .match-item-wrap.match-finished:nth-child(even of .match-item-wrap) {
  background: #f8fafc;
}

.today-section-finished .match-item-wrap:nth-child(odd of .match-item-wrap):hover,
.league-group .match-item-wrap.match-finished:nth-child(odd of .match-item-wrap):hover {
  background: #fafafa;
}

.today-section-finished .match-item-wrap:nth-child(even of .match-item-wrap):hover,
.league-group .match-item-wrap.match-finished:nth-child(even of .match-item-wrap):hover {
  background: #f1f5f9;
}

.league-group .match-item-wrap .match-row:hover,
.league-group .match-item-wrap .match-meta-line:hover {
  background: inherit;
  box-shadow: none;
}

.league-group .match-item-wrap .match-row {
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.league-group > .match-item-wrap:last-child .match-row {
  border-radius: 0;
}

.match-live .match-league-line,
.today-match-wrap.match-live .match-league-line,
.match-item-wrap.match-live .match-league-line {
  background: #eff6ff;
  border-left-color: #bfdbfe;
  color: var(--text-secondary);
}

.match-live .match-league-ht,
.today-match-wrap.match-live .match-league-ht,
.match-item-wrap.match-live .match-league-ht {
  color: var(--text-secondary);
}

.match-upcoming .match-league-line--group,
.league-group.match-upcoming .match-league-line--group {
  background: linear-gradient(90deg, #f1f5f9 0%, #f8fafc 100%);
  border-left-color: #94a3b8;
}

.match-finished .match-league-line--group,
.league-group .match-finished + .match-league-line--group {
  background: linear-gradient(90deg, #fef2f2 0%, #fff1f2 45%, #ffffff 100%);
  border-left-color: var(--live-red);
}

.match-item-wrap .match-row,
.today-match-wrap .match-row {
  border-top: none;
}

.league-group > .match-item-wrap:last-child .match-row,
.today-section-list > .today-match-wrap:last-child .match-row {
  border-radius: 0;
}

.match-league-flag {
  display: none;
}

.match-league-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-league-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.match-league-ht {
  display: inline-flex;
  align-items: baseline;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--live-red);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.match-league-ht .match-ht-label {
  font-size: inherit;
  font-weight: inherit;
  margin-right: 1px; /* H1: extra 1px gap before (0-1) */
}

.match-league-ht .match-ht-score {
  font-size: inherit;
  font-weight: inherit;
}

/* Finished tab: H1 same blue as corners / cards stats */
.match-finished .match-league-ht,
.today-match-wrap.match-finished .match-league-ht,
.match-item-wrap.match-finished .match-league-ht,
.today-section-finished .match-league-ht {
  color: var(--score-blue);
}

.match-league-stats {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.match-league-stats .match-stat {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--score-blue);
  font-variant-numeric: tabular-nums;
}

/* Yellow card: column right-align; red card: column left-align */
.match-league-stats .match-stat--yc {
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  margin-right: 5px;
  justify-content: flex-end;
}

.match-league-stats .match-stat--rc {
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  margin-right: -1px;
  justify-content: flex-start;
}

.match-league-stats .match-stat--yc .stat-val,
.match-league-stats .match-stat--rc .stat-val {
  width: 1ch;
  min-width: 1ch;
  text-align: left;
}

/* Corners: fixed emoji, max 2 digits — do not push chart column */
.match-league-stats .match-stat--corner .stat-icon.corner {
  width: 1.15em;
  min-width: 1.15em;
  flex-shrink: 0;
  text-align: center;
}

.match-league-stats .match-stat--corner .stat-val {
  width: 2ch;
  min-width: 2ch;
  max-width: 2ch;
  text-align: left;
  overflow: hidden;
}

.match-league-stats .stat-icon {
  font-size: 0.75rem;
}

.match-league-stats .stat-icon.yellow,
.match-league-stats .stat-icon.red {
  font-size: calc(0.95rem * 1.1);
  transform: none;
}

.match-league-stats .stat-icon.corner {
  font-size: 0.88rem;
}

.today-match-wrap + .today-match-wrap .match-league-line,
.match-item-wrap + .match-item-wrap .match-league-line {
  border-top: 1px solid var(--border);
}

.match-row-stats-cards,
.match-row-stats,
.match-actions-extra,
.match-ht-mobile {
  display: none !important;
}

.action-spacer { width: 24px; }

.match-ht {
  display: none;
}

.today-section-list .match-row {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.today-section-list .match-row:last-child {
  border-radius: 0;
}

/* ===== Match Row ===== */
.match-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-top: none;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  font-size: 0.82rem;
  box-shadow: var(--shadow-glow);
}

.match-scoreline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.match-team {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  border-radius: 2px;
  padding: 2px 4px;
  transition: background 0.15s ease;
}

.match-team.has-scored {
  background: #ffc0c0;
}

.match-live .match-team.has-scored {
  background: #ffc0c0;
}

.match-team.home.has-scored {
  padding-right: 6px;
}

.match-team.away.has-scored {
  padding-left: 6px;
}

.match-team.home {
  justify-content: flex-end;
  text-align: right;
}

.match-team.away {
  justify-content: flex-start;
  text-align: left;
}

.match-row:last-child {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.match-row:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-glow);
}

.league-group .match-item-wrap .match-row:hover {
  background: inherit;
  box-shadow: none;
}

.match-row.goal-flash { animation: goalFlash 1.2s ease; }

@keyframes goalFlash {
  0%, 100% { background: var(--gradient-card); }
  30% { background: rgba(37, 99, 235, 0.12); }
}

.match-status {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  width: 100%;
}

.match-status-kickoff {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 5ch;
  text-align: left;
  line-height: 1;
}

.live-status {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  line-height: 1;
  font-size: 0.72rem;
  width: auto;
  max-width: 100%;
}

.live-kickoff {
  color: var(--live-red);
  margin-right: 2ch;
  min-width: 5ch;
}

.match-finished-time {
  color: var(--text-secondary);
  margin-right: 2ch;
  min-width: 5ch;
}

.match-finished-date {
  color: var(--text-secondary);
  font-size: 0.62rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-right: 3px;
  line-height: 1;
}

.live-status-main {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  width: max-content;
  max-width: 100%;
}

.live-time {
  display: inline-grid;
  /* PC + Mobile: keep 70' tight to H2 — no fixed 4.2ch/4.5ch column (creates gap) */
  grid-template-columns: max-content max-content max-content;
  align-items: center;
  column-gap: 2px;
  white-space: nowrap;
  width: max-content;
  max-width: 100%;
}

.live-time .live-minute {
  grid-column: 1;
  justify-self: start;
}

.live-time .live-period {
  grid-column: 2;
  justify-self: start;
}

.live-time .live-status-stream,
.live-time .match-stream-slot {
  grid-column: 3;
  margin-left: 1ch;
  justify-self: start;
}

/* HT: col 1 = hidden spacer (width like "99'") — HT col 2 — camera col 3 aligns with H1/H2 */
.live-time--ht .live-minute-spacer {
  grid-column: 1;
  justify-self: start;
  overflow: hidden;
  width: max-content;
  color: transparent;
  user-select: none;
  pointer-events: none;
}

.live-time--ht .live-minute-spacer::before {
  content: '99\'';
  visibility: hidden;
}

.live-time--ht .live-period-only {
  grid-column: 2;
  justify-self: start;
}

.live-ball-spin {
  display: block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  object-fit: contain;
  image-rendering: auto;
  animation: liveBallRoll 1.1s linear infinite;
}

.live-clock-spin {
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  image-rendering: auto;
  overflow: hidden;
  background: transparent;
}

.live-clock-sprite {
  --clock-frames: 5;
  --clock-w: 11.7px;
  display: block;
  flex-shrink: 0;
  overflow: hidden;
  width: var(--clock-w);
  height: var(--clock-w);
  background-image: url('../assets/live-clock-sprite.png?v=8');
  background-repeat: no-repeat;
  background-size: calc(var(--clock-w) * var(--clock-frames)) var(--clock-w);
  background-position: 0 0;
  animation: liveClockSteps 1.1s steps(5) infinite;
  animation-timing-function: steps(5, end);
}

@keyframes liveClockSteps {
  to { background-position: calc(-1 * var(--clock-w) * (var(--clock-frames) - 1)) 0; }
}

.match-meta-clock-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--clock-w, 11.7px);
  width: var(--clock-w, 11.7px);
  height: var(--clock-w, 11.7px);
  overflow: hidden;
  position: relative;
  z-index: 2;
  line-height: 0;
}

.live-clock-static {
  display: inline-block;
  flex-shrink: 0;
  object-fit: contain;
  vertical-align: middle;
}

.live-kickoff-clock.live-clock-sprite,
.live-kickoff-clock.live-clock-static {
  --clock-w: 0.75em;
  display: inline-block;
  width: var(--clock-w);
  height: var(--clock-w);
  vertical-align: middle;
  margin-right: 2px;
}

body.view-desktop .match-status-kickoff.live-kickoff {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 700;
}

body.view-desktop .live-kickoff-clock.live-clock-sprite,
body.view-desktop .live-kickoff-clock.live-clock-static {
  --clock-w: 11px;
  width: var(--clock-w);
  height: var(--clock-w);
}

body.view-desktop .match-finished-time {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

@keyframes liveBallRoll {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.live-minute {
  font-size: 0.72rem;
  font-weight: 600;
  color: #666666;
  font-variant-numeric: tabular-nums;
}

.live-period {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--live-red);
  letter-spacing: 0.01em;
}

.live-period-only {
  color: var(--live-red);
  font-weight: 700;
}

.match-status.live {
  color: #666666;
}
.match-status.finished {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  line-height: 1.15;
  font-weight: 700;
}

.match-finished-time {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: left;
  line-height: 1;
}

.match-ft-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--live-red);
  white-space: nowrap;
}
.match-status.upcoming {
  color: #2563eb;
  font-weight: 700;
}
.match-status.ht { color: var(--live-red); }

.team-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.team-name.winner { font-weight: 700; }

.team-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.match-score {
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 44px;
  padding: 0 4px;
  color: var(--score-blue);
}

.match-score .score-part {
  color: var(--score-blue);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
}

.match-score .score-part.scored {
  color: var(--live-red);
  font-size: 1.08rem;
  font-weight: 800;
}

.match-live .match-score .score-part.scored {
  color: var(--live-red);
  font-size: 1.08rem;
  font-weight: 800;
}

.match-score .score-sep {
  color: var(--score-blue);
  font-weight: 700;
  padding: 0 1px;
}

.match-score.live-score {
  color: var(--score-blue);
}

.match-live .match-score .score-part:not(.scored),
.match-live .match-score .score-sep {
  color: var(--score-blue);
}

/* Finished: draw = blue like H1; winner score red, loser score blue */
.match-finished .match-score,
.today-match-wrap.match-finished .match-score,
.match-item-wrap.match-finished .match-score {
  color: var(--score-blue);
}

.match-finished .match-score .score-part.win,
.today-match-wrap.match-finished .match-score .score-part.win,
.match-item-wrap.match-finished .match-score .score-part.win {
  color: var(--live-red);
}

.match-finished .match-score .score-part.lose,
.match-finished .match-score .score-part.draw,
.match-finished .match-score .score-sep,
.today-match-wrap.match-finished .match-score .score-part.lose,
.today-match-wrap.match-finished .match-score .score-part.draw,
.today-match-wrap.match-finished .match-score .score-sep,
.match-item-wrap.match-finished .match-score .score-part.lose,
.match-item-wrap.match-finished .match-score .score-part.draw,
.match-item-wrap.match-finished .match-score .score-sep {
  color: var(--score-blue);
}

.match-finished .team-name.winner,
.today-match-wrap.match-finished .team-name.winner,
.match-item-wrap.match-finished .team-name.winner {
  color: var(--live-red);
  font-weight: 700;
}

.match-upcoming .match-score,
.today-match-wrap.match-upcoming .match-score,
.match-item-wrap.match-upcoming .match-score {
  color: #2563eb;
  font-weight: 600;
}

.match-ht {
  display: none;
}

.match-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--score-blue);
  font-variant-numeric: tabular-nums;
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.stat-icon.corner {
  color: var(--score-blue);
  font-size: 0.9rem;
  opacity: 0.9;
}

.stat-icon.yellow {
  color: var(--yellow-card);
  font-size: 0.85rem;
  transform: scale(1.5);
}

.stat-icon.red {
  color: var(--red-card);
  font-size: 0.85rem;
  transform: scale(1.5);
}

.match-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.match-inline-stats {
  display: none;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

body.view-desktop .match-inline-stats {
  display: flex;
}

body.view-desktop .match-meta-line.mobile-only {
  display: none !important;
}

body.view-desktop .match-row {
  grid-template-columns: 118px minmax(0, 1fr) 236px;
  gap: 8px;
  padding: 6px 10px;
}

body.view-desktop .match-status {
  width: 118px;
  min-width: 118px;
  justify-self: start;
  justify-content: flex-start;
  text-align: left;
}

/* PC: LIVE / kickoff / FINISHED time same size + left-aligned */
body.view-desktop .match-status.upcoming,
body.view-desktop .match-status.finished,
body.view-desktop .match-status.live {
  justify-content: flex-start;
  text-align: left;
}

body.view-desktop .match-status-kickoff,
body.view-desktop .match-status-kickoff.live-kickoff,
body.view-desktop .live-kickoff,
body.view-desktop .match-finished-time {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: left;
  min-width: 5ch;
  line-height: 1;
}

body.view-desktop .match-finished-date {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-right: 4px;
}

body.view-desktop .match-scoreline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 6px;
  row-gap: 0;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

/* PC LIVE + Today tabs: nudge team names + score right (--pc-score-nudge)
 * padding-inline-start invisible when .match-scoreline has margin:0 auto + max-width:480px
 * (grid 1fr|auto|1fr eats column; score center barely moves). Nudge whole block with translateX. */
html.view-desktop,
body.view-desktop {
  --pc-score-nudge: 20px;
}

body.view-desktop[data-tab="live"] .match-row > .match-scoreline,
body.view-desktop[data-tab="today"] .today-section .match-row > .match-scoreline,
body.view-desktop .today-section .match-row > .match-scoreline {
  transform: translateX(var(--pc-score-nudge));
}

body.view-desktop .match-team {
  padding: 2px 0;
}

body.view-desktop .match-score {
  min-width: 0;
  width: auto;
  padding: 0;
  font-size: 0.92rem;
}

/* PC finished match: draw blue; winner = red score + name, loser score blue */
body.view-desktop .match-finished .match-score,
body.view-desktop .today-match-wrap.match-finished .match-score,
body.view-desktop .match-item-wrap.match-finished .match-score {
  color: var(--score-blue) !important;
}

body.view-desktop .match-finished .match-score .score-part.win,
body.view-desktop .today-match-wrap.match-finished .match-score .score-part.win,
body.view-desktop .match-item-wrap.match-finished .match-score .score-part.win {
  color: var(--live-red) !important;
}

body.view-desktop .match-finished .match-score .score-part.lose,
body.view-desktop .match-finished .match-score .score-part.draw,
body.view-desktop .match-finished .match-score .score-sep,
body.view-desktop .today-match-wrap.match-finished .match-score .score-part.lose,
body.view-desktop .today-match-wrap.match-finished .match-score .score-part.draw,
body.view-desktop .today-match-wrap.match-finished .match-score .score-sep,
body.view-desktop .match-item-wrap.match-finished .match-score .score-part.lose,
body.view-desktop .match-item-wrap.match-finished .match-score .score-part.draw,
body.view-desktop .match-item-wrap.match-finished .match-score .score-sep {
  color: var(--score-blue) !important;
}

body.view-desktop .match-finished .team-name.winner,
body.view-desktop .today-match-wrap.match-finished .team-name.winner,
body.view-desktop .match-item-wrap.match-finished .team-name.winner {
  color: var(--live-red) !important;
  font-weight: 700 !important;
}

body.view-desktop .match-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  width: 236px;
  min-width: 236px;
  max-width: 236px;
}

body.view-desktop .match-inline-stats {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
  gap: 6px;
  overflow: hidden;
}

body.view-desktop .match-row-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  width: 50px;
  min-width: 50px;
  justify-content: flex-end;
  margin-left: var(--stats-tools-gap, 5px);
}

body.view-desktop .match-inline-stats .match-league-ht {
  font-size: 0.62rem;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--live-red);
  font-weight: 600;
}

body.view-desktop .match-finished .match-inline-stats .match-league-ht,
body.view-desktop .today-match-wrap.match-finished .match-inline-stats .match-league-ht,
body.view-desktop .match-item-wrap.match-finished .match-inline-stats .match-league-ht,
body.view-desktop .today-section-finished .match-inline-stats .match-league-ht {
  color: var(--score-blue);
}

body.view-desktop .match-inline-stats .match-league-stats {
  gap: 0;
  flex-shrink: 0;
}

body.view-desktop .match-inline-stats .match-stat {
  font-size: 0.66rem;
  align-items: center;
}

body.view-desktop .match-inline-stats .match-league-stats .stat-icon.yellow,
body.view-desktop .match-inline-stats .match-league-stats .stat-icon.red {
  font-size: calc(0.66rem * 1.35 * 1.1);
  transform: none;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

body.view-desktop .match-inline-stats .match-league-stats .stat-icon.corner {
  font-size: calc(0.66rem * 1.35);
  transform: none;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

body.view-desktop .live-status {
  gap: 4px;
}

body.view-desktop .live-status .live-status-stream .match-stream-icon {
  width: 22px;
  height: 22px;
}

body.view-desktop .match-row-tools .desktop-timeline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 0.82rem;
  line-height: 1;
  flex-shrink: 0;
}

body.view-desktop .timeline-btn {
  display: none !important;
}

body.view-desktop .live-kickoff {
  color: var(--live-red);
  font-size: 0.72rem;
  font-weight: 700;
}

/* PC: keep 70' tight to H2 like mobile (camera stays col 3 + margin-left) */
body.view-desktop .live-time {
  grid-template-columns: max-content max-content max-content;
  column-gap: 2px;
}

body.view-desktop .live-minute,
body.view-desktop .live-period {
  font-size: 0.72rem;
}

body.view-desktop .match-finished-time {
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 700;
}

body.view-desktop .match-status.upcoming .match-status-kickoff {
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 700;
}

body.view-desktop .team-name {
  font-size: 0.82rem;
  font-weight: 400;
  text-transform: capitalize;
}

/* Finished matches only: winning team bold (see .match-finished .winner) */
body.view-desktop .team-name.winner {
  font-weight: 400;
}

body.view-desktop .match-finished .team-name.winner,
body.view-desktop .today-match-wrap.match-finished .team-name.winner,
body.view-desktop .match-item-wrap.match-finished .team-name.winner {
  font-weight: 700 !important;
}

.action-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.7rem;
  transition: color var(--transition), background var(--transition);
}

.action-btn:hover { color: var(--text-primary); background: var(--bg-secondary); }
.action-btn.favorited { color: var(--warning); }

.action-btn svg { width: 12px; height: 12px; }

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}

.empty-icon { font-size: 2rem; display: block; margin-bottom: 8px; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding: 16px 12px;
  margin-bottom: 60px;
}

.footer-inner {
  max-width: var(--site-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.footer-links a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--accent-primary); }

.footer-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.footer-brand {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.footer-brand-live {
  color: var(--brand-live);
}

.footer-brand-scores {
  color: var(--brand-scores);
}

.footer-brand-win {
  background: var(--gradient-win);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-logo,
.footer-logo-icon {
  flex-shrink: 0;
  border-radius: 4px;
  opacity: 0.9;
}

.footer-logo-full {
  display: none;
  flex-shrink: 0;
  height: 24px;
  width: auto;
  max-width: min(158px, 40vw);
}

body.view-desktop .footer-inner {
  justify-content: flex-start;
  gap: 20px;
}

body.view-desktop .footer-copy {
  flex: 0 1 auto;
  font-size: 0.92rem;
}

body.view-desktop .footer-links a {
  font-size: 0.92rem;
  color: var(--text-primary);
}

body.view-desktop .footer-links a:hover {
  color: var(--accent-primary);
}

/* ===== Language picker (first visit) ===== */
.lang-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lang-picker-overlay.is-visible {
  display: flex !important;
}

.lang-picker-overlay[hidden] {
  display: none !important;
}

body.lang-picker-open {
  overflow: hidden;
}

html.lang-picker-open {
  overflow: hidden;
}

.lang-picker {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  animation: langPickerIn 0.32s ease;
}

@keyframes langPickerIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.lang-picker-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 20px 10px;
}

.lang-picker-logo-full {
  height: 38px;
  width: auto;
  max-width: min(240px, 88vw);
  display: block;
  flex-shrink: 0;
}

.lang-picker-title {
  margin: 0;
  padding: 4px 20px 18px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.lang-picker-options {
  display: grid;
  gap: 10px;
  padding: 0 20px 22px;
}

.lang-picker-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 96px;
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform 0.15s ease;
}

.lang-picker-option:hover,
.lang-picker-option:focus-visible {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--accent-primary-dim);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.lang-picker-flag {
  font-size: 1.6rem;
  line-height: 1;
}

.lang-picker-labels {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.lang-picker-native {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.lang-picker-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* PC: horizontal card, 3 columns (EN / VI / ZH) */
body.view-desktop .lang-picker {
  max-width: 560px;
}

body.view-desktop .lang-picker-options {
  grid-template-columns: repeat(3, 1fr);
}

body.view-desktop .lang-picker-hint {
  display: block;
}

/* Mobile: centered card, vertical list */
body.view-mobile .lang-picker-overlay {
  align-items: center;
  justify-content: center;
  padding: 16px 14px;
  background: rgba(15, 23, 42, 0.45);
}

body.view-mobile .lang-picker {
  max-width: 360px;
  width: 100%;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  border-bottom: 1px solid var(--border);
  animation: langPickerIn 0.32s ease;
}

body.view-mobile .lang-picker-brand {
  padding-top: 18px;
}

body.view-mobile .lang-picker-logo-full {
  height: 34px;
}

body.view-mobile .lang-picker-title {
  font-size: 1.05rem;
  padding-bottom: 14px;
}

body.view-mobile .lang-picker-options {
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0 14px 20px;
}

body.view-mobile .lang-picker-option {
  flex-direction: row;
  justify-content: flex-start;
  gap: 14px;
  min-height: 0;
  padding: 14px 16px;
  border-radius: 12px;
}

body.view-mobile .lang-picker-flag {
  font-size: 1.45rem;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

body.view-mobile .lang-picker-labels {
  align-items: flex-start;
  text-align: left;
}

body.view-mobile .lang-picker-native {
  font-size: 0.95rem;
}

body.view-mobile .lang-picker-hint {
  font-size: 0.72rem;
}

@media (max-width: 768px) {
  body:not(.view-desktop) .lang-picker-overlay {
    align-items: center;
    justify-content: center;
    padding: 16px 14px;
    background: rgba(15, 23, 42, 0.45);
  }

  body:not(.view-desktop) .lang-picker {
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    border-bottom: 1px solid var(--border);
    animation: langPickerIn 0.32s ease;
  }

  body:not(.view-desktop) .lang-picker-brand {
    padding-top: 18px;
  }

  body:not(.view-desktop) .lang-picker-logo-full {
    height: 34px;
  }

  body:not(.view-desktop) .lang-picker-title {
    font-size: 1.05rem;
    padding-bottom: 14px;
  }

  body:not(.view-desktop) .lang-picker-options {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0 14px 20px;
  }

  body:not(.view-desktop) .lang-picker-option {
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    min-height: 0;
    padding: 14px 16px;
    border-radius: 12px;
  }

  body:not(.view-desktop) .lang-picker-flag {
    font-size: 1.45rem;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
  }

  body:not(.view-desktop) .lang-picker-labels {
    align-items: flex-start;
    text-align: left;
  }

  body:not(.view-desktop) .lang-picker-native {
    font-size: 0.95rem;
  }

  body:not(.view-desktop) .lang-picker-hint {
    font-size: 0.72rem;
  }
}

/* ===== Live stream — PC floating windows + mobile inline panel ===== */
.stream-popup-layer {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  overflow: visible;
}

.stream-popup-window {
  position: fixed;
  pointer-events: auto;
  width: min(480px, 92vw);
  max-width: 520px;
  min-width: 280px;
  height: auto;
}

.stream-popup-window.is-dragging {
  opacity: 0.98;
}

.stream-popup-window .stream-popup {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.28), 0 4px 16px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  animation: modalIn 0.22s ease;
}

.stream-popup-drag-handle {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.stream-popup-window.is-dragging .stream-popup-drag-handle {
  cursor: grabbing;
}

.stream-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 2px 6px 2px 4px;
  border-bottom: 1px solid var(--live-bar-border);
  flex-shrink: 0;
  background: var(--gradient-live-bar);
  color: var(--live-bar-text);
  cursor: grab;
  user-select: none;
  box-shadow: none;
}

.stream-popup-window.is-fullscreen {
  left: 10px !important;
  top: 10px !important;
  width: calc(100vw - 20px) !important;
  max-width: none !important;
  min-width: 0 !important;
  height: calc(100vh - 20px) !important;
}

.stream-popup-window.is-fullscreen .stream-popup {
  height: 100%;
}

.stream-popup-window.is-fullscreen .stream-popup-body {
  flex: 1 1 auto;
  aspect-ratio: auto;
  height: auto;
  min-height: 0;
}

.stream-popup-window.is-fullscreen .stream-popup-header {
  cursor: default;
}

.stream-popup-drag-icon {
  display: none;
}

.stream-bar-ball {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  object-fit: contain;
  pointer-events: none;
  /* PNG + CSS: control spin speed (legacy GIF was too fast) */
  animation: liveBallRoll 2.4s linear infinite;
}

.stream-popup-header {
  gap: 5px;
}

.match-stream-panel-header .stream-bar-ball {
  width: 12px;
  height: 12px;
}

.match-stream-panel-header {
  gap: 5px;
  justify-content: flex-start;
}

/* Mobile stream title: flush to ball like PC (needs flex:1 — avoid space-between centering) */
body.view-mobile .match-stream-panel-header .stream-bar-ball,
body:not(.view-desktop) .match-stream-panel-header .stream-bar-ball {
  animation-duration: 2.4s;
}

.match-stream-panel-title {
  flex: 1;
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--live-bar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stream-popup-window.is-dragging .stream-popup-drag-icon {
  cursor: grabbing;
}

.stream-popup-title {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--live-bar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stream-popup-close {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--live-bar-text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.stream-popup-close:hover {
  background: rgba(59, 130, 246, 0.12);
  color: #1e3a8a;
}

.stream-popup-body {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 0;
  background: #000;
  position: relative;
  overflow: hidden;
}

.stream-popup-body iframe,
.stream-popup-body .stream-embed-iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.stream-yt-fallback {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  min-height: 180px;
  padding: 12px;
  background: #0f172a;
  box-sizing: border-box;
  text-align: center;
}

.stream-yt-fallback-thumb {
  display: block;
  width: 100%;
  max-height: 55vh;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  margin: 0 auto;
}

.stream-yt-fallback-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.stream-yt-fallback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.78rem;
  text-decoration: none;
  text-align: center;
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
}

.stream-yt-fallback-btn--primary {
  background: #2563eb;
  color: #fff;
}

.stream-yt-fallback-btn--primary:hover {
  background: #1d4ed8;
  color: #fff;
}

.stream-yt-fallback-btn--secondary {
  background: #dc2626;
  color: #fff;
}

.stream-yt-fallback-btn--secondary:hover {
  background: #b91c1c;
  color: #fff;
}

.stream-yt-fallback-hint {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.45;
  color: #94a3b8;
}

.stream-yt-fallback-hint code {
  font-size: 0.64rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 4px;
  border-radius: 3px;
}

.match-stream-panel-video .stream-embed-iframe,
.match-stream-panel-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.match-stream-panel-video .stream-yt-fallback {
  position: absolute;
  inset: 0;
  min-height: 0;
  overflow-y: auto;
}

.match-stream-panel {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
  animation: modalIn 0.2s ease;
}

.match-stream-panel-inner {
  display: flex;
  flex-direction: column;
}

.match-stream-panel-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 2px 6px;
  border-bottom: 1px solid var(--live-bar-border);
  background: var(--gradient-live-bar);
  color: var(--live-bar-text);
  box-shadow: none;
}

.match-stream-panel-title {
  flex: 1;
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--live-bar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-stream-panel-close {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--live-bar-text);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.match-stream-panel-close:hover {
  color: #1e3a8a;
  background: rgba(59, 130, 246, 0.12);
}

.match-stream-panel-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.match-stream-panel-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

body.view-desktop .match-stream-panel {
  display: none !important;
}

body.view-mobile .match-stream-panel {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 4px 0 6px;
  box-sizing: border-box;
}

body.view-mobile .match-stream-panel-video {
  width: 100%;
  min-height: 0;
}

body:not(.view-desktop) .match-stream-panel {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 4px 0 6px;
  box-sizing: border-box;
}

body.view-mobile .stream-popup-layer {
  display: none !important;
}

.stream-protocol-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px 40px 8px 12px;
  background: #fef3c7;
  border-bottom: 1px solid #f59e0b;
  color: #92400e;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
}

.stream-protocol-banner a {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

.stream-protocol-banner a:hover {
  text-decoration: underline;
}

.stream-protocol-banner-close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #92400e;
  font-size: 1.2rem;
  cursor: pointer;
}

body:has(.stream-protocol-banner) {
  padding-top: 42px;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 12px 20px;
  overflow-y: auto;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow), var(--shadow-glow);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-league {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.modal-close:hover { background: var(--bg-card); color: var(--text-primary); }

.modal-scoreboard {
  padding: 20px 16px;
  text-align: center;
}

.modal-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.modal-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.modal-team-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.modal-team-name {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.modal-score-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.modal-score {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--score-blue);
}

.modal-status {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--live-red);
}

.modal-status.finished { color: var(--text-muted); }
.modal-status.upcoming { color: var(--text-secondary); }

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.modal-tab {
  flex: 1;
  padding: 10px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.modal-tab:hover { color: var(--text-secondary); }
.modal-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.modal-body {
  padding: 16px;
  max-height: min(520px, 60vh);
  overflow-y: auto;
}

/* Overview Tab */
.overview-grid {
  display: grid;
  gap: 0;
}

.overview-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}

.overview-row:last-child { border-bottom: none; }
.overview-label { color: var(--text-muted); }
.overview-value { font-weight: 500; text-align: right; }

.score-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.score-period {
  text-align: center;
  padding: 8px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}

.score-period-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.score-period-value {
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Timeline Tab */
.timeline-list { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

.timeline-item:last-child { border-bottom: none; }

.timeline-minute {
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 32px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.timeline-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
}

.timeline-icon.goal { background: rgba(232, 168, 56, 0.15); color: var(--accent-primary); }
.timeline-icon.yellow { background: rgba(251, 191, 36, 0.15); color: var(--yellow-card); }
.timeline-icon.red { background: rgba(239, 68, 68, 0.15); color: var(--red-card); }
.timeline-icon.sub { background: rgba(201, 149, 107, 0.15); color: var(--accent-blue); }
.timeline-icon.var { background: rgba(168, 85, 247, 0.15); color: #A855F7; }
.timeline-icon.penalty { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.timeline-icon.period { background: var(--bg-card); color: var(--text-muted); }

.timeline-text { flex: 1; }
.timeline-team { font-weight: 600; }

/* Odds Tab */
.odds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.odds-table th {
  padding: 8px;
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.odds-table td {
  padding: 10px 8px;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.odds-table tr:hover td { background: var(--bg-card); }

.odds-value {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  min-width: 48px;
}

.odds-value.best { color: var(--accent-primary); border: 1px solid var(--border-glow); }

.odds-bookmaker {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.odds-unavailable {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Match stats bars */
.stats-list { display: flex; flex-direction: column; gap: 12px; }
.stats-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.stats-side:last-child { text-align: right; }
.stats-row { display: flex; flex-direction: column; gap: 4px; }
.stats-vals {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}
.stats-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.stats-num:last-child { text-align: right; }
.stats-name { text-align: center; color: var(--text-muted); font-size: 0.75rem; }
.stats-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  height: 6px;
}
.stats-bar-home {
  height: 100%;
  border-radius: 3px 0 0 3px;
  background: var(--accent-primary);
  margin-left: auto;
}
.stats-bar-away {
  height: 100%;
  border-radius: 0 3px 3px 0;
  background: var(--accent-blue, #5b8def);
  margin-left: 0;
}

/* Form strip */
.form-strip-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.form-strip-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.form-strip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
}
.form-strip-team {
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.form-pills { display: flex; gap: 4px; flex-shrink: 0; }
.form-pill {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
}
.form-pill.form-W { background: #22c55e; }
.form-pill.form-D { background: #94a3b8; }
.form-pill.form-L { background: #ef4444; }
.form-pill.form-U { background: var(--border); color: var(--text-muted); }

/* H2H */
.h2h-summary {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.h2h-sum-col { display: flex; flex-direction: column; gap: 4px; }
.h2h-sum-col:last-child { text-align: right; }
.h2h-sum-team { font-weight: 700; font-size: 0.82rem; margin-bottom: 4px; }
.h2h-sum-stat { font-size: 0.78rem; color: var(--text-muted); }
.h2h-sum-stat span { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.h2h-sum-mid {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 4px;
  text-transform: uppercase;
  font-weight: 600;
}
.h2h-meetings { display: flex; flex-direction: column; gap: 0; }
.h2h-meeting {
  display: grid;
  grid-template-columns: 72px 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}
.h2h-meeting:last-child { border-bottom: none; }
.h2h-date { color: var(--text-muted); font-size: 0.72rem; }
.h2h-home { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h2h-away { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h2h-score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: center;
}


/* ===== Mobile — compact match row ===== */
@media (max-width: 768px) {
  body:not(.view-desktop) .today-section {
    margin-bottom: 8px;
  }

  body:not(.view-desktop) .today-section-header {
    padding: 5px 8px;
    font-size: 0.68rem;
  }

  body:not(.view-desktop) .match-league-line {
    padding: 3px 6px;
    gap: 4px;
    font-size: 0.62rem;
    border-left-width: 2px;
  }

  body:not(.view-desktop) .match-meta-line {
    padding: 0 5px 2px 5px;
  }

  body:not(.view-desktop) .match-meta-line {
    justify-content: flex-start;
  }

  body:not(.view-desktop) .match-meta-kickoff {
    width: 50px;
    min-width: 50px;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.63rem;
  }

  body:not(.view-desktop) .match-meta-status-col {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    width: var(--mob-col-status);
    min-width: var(--mob-col-status);
    overflow: hidden;
    position: relative;
    z-index: 2;
    isolation: isolate;
  }

  body:not(.view-desktop) .match-meta-clock-slot {
    --clock-w: calc(9px * 1.3);
    flex: 0 0 var(--clock-w);
    width: var(--clock-w);
    height: var(--clock-w);
  }

  body:not(.view-desktop) .match-meta-clock.live-clock-sprite,
  body:not(.view-desktop) .match-meta-clock.live-clock-static {
    --clock-w: calc(9px * 1.3);
    width: var(--clock-w);
    height: var(--clock-w);
  }

  body:not(.view-desktop) .match-meta-status-col .match-meta-kickoff {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
  }

  body:not(.view-desktop) .match-meta-status-col .match-kickoff-group {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    width: auto !important;
    min-width: 0 !important;
    max-width: none;
    grid-column: unset !important;
    grid-row: unset !important;
    position: static;
    flex: 0 1 auto;
    margin-left: var(--mob-live-ball-slot);
  }

  body:not(.view-desktop) .match-meta-status-col .match-kickoff-group .match-meta-kickoff {
    display: inline;
    width: auto;
    min-width: 0;
    text-align: left;
  }

  body:not(.view-desktop) .match-meta-status-col .match-kickoff-group .match-stream-link {
    position: static;
    transform: none;
    flex-shrink: 0;
  }

  body:not(.view-desktop) .match-meta-status-col > .match-meta-kickoff {
    width: auto;
    min-width: 0;
    text-align: left;
    margin-left: var(--mob-live-ball-slot);
  }

  body:not(.view-desktop) .match-meta-clock.live-clock-sprite,
  body:not(.view-desktop) .match-meta-clock.live-clock-static {
    max-width: var(--clock-w);
    max-height: var(--clock-w);
    flex-shrink: 0;
  }

  body:not(.view-desktop) .match-meta-line .match-meta-right {
    margin-left: auto;
    margin-right: 4px;
    gap: 0;
    --stats-tools-gap: 1px;
  }

  body:not(.view-desktop) .match-meta-right .match-league-ht {
    font-size: 0.63rem;
    font-weight: 600 !important;
    color: var(--live-red);
    width: auto;
    min-width: auto;
    text-align: right;
    flex-shrink: 0;
    margin-right: 4px;
  }

  body:not(.view-desktop) .match-finished .match-meta-right .match-league-ht,
  body:not(.view-desktop) .today-section-finished .match-meta-right .match-league-ht {
    color: var(--score-blue);
  }

  body:not(.view-desktop) .match-league-stats {
    gap: 0;
    flex-shrink: 0;
  }

  body:not(.view-desktop) .match-league-stats .match-stat {
    font-size: 0.63rem;
  }

  body:not(.view-desktop) .match-league-stats .stat-icon.yellow,
  body:not(.view-desktop) .match-league-stats .stat-icon.red {
    font-size: calc(0.63rem * 1.35 * 1.1);
    transform: none;
    vertical-align: middle;
    position: relative;
    top: -1px;
  }

  body:not(.view-desktop) .match-league-stats .stat-icon.corner {
    font-size: calc(0.63rem * 1.35);
    transform: none;
    vertical-align: middle;
    position: relative;
    top: -1px;
  }

  body:not(.view-desktop) .match-row {
    grid-template-columns: subgrid;
    gap: 0 var(--mob-team-score-gap);
    padding: 3px 5px;
    font-size: 0.63rem;
    box-shadow: none;
  }

  body:not(.view-desktop) .match-actions {
    display: none !important;
  }

  body:not(.view-desktop) .match-status {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    justify-content: flex-start;
    text-align: left;
    font-size: 0.63rem;
  }

  body:not(.view-desktop) .match-status.upcoming {
    font-size: 0.63rem;
    justify-content: flex-start;
    text-align: left;
  }

  body:not(.view-desktop) .match-status.finished {
    justify-content: flex-start;
    gap: 2px;
    font-size: 0.63rem;
    text-align: left;
  }

  /* Finished mobile: main rules outside @media (body.view-mobile + data-tab) */
  body:not(.view-desktop) .match-status.finished .match-finished-date {
    display: none !important;
  }

  body:not(.view-desktop) .match-meta-finished {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
  }

  body:not(.view-desktop) .match-meta-finished .match-meta-finished-date {
    font-size: 0.58rem;
    margin-right: 2px;
    color: var(--text-secondary);
  }

  body:not(.view-desktop) .match-meta-finished .match-meta-ft-label {
    font-size: 0.63rem;
    color: var(--live-red);
  }

  body:not(.view-desktop) .live-status {
    justify-content: flex-start;
    gap: 1px;
    font-size: 0.63rem;
  }

  body:not(.view-desktop) .live-minute,
  body:not(.view-desktop) .live-period {
    font-size: 0.63rem;
  }

  /* Mobile: upcoming / finished / live time same size + left-aligned */
  body:not(.view-desktop) .match-status-kickoff,
  body:not(.view-desktop) .match-finished-time,
  body:not(.view-desktop) .match-meta-kickoff {
    font-size: 0.63rem;
    font-weight: 700;
    text-align: left;
    line-height: 1;
  }

  body:not(.view-desktop) .live-kickoff {
    display: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    pointer-events: none !important;
  }

  body:not(.view-desktop) .live-status .live-status-stream {
    display: none !important;
  }

  body:not(.view-desktop) .live-ball-spin {
    width: 11px;
    height: 11px;
  }

  body:not(.view-desktop) .match-team {
    padding: 2px 0;
  }

  body:not(.view-desktop) .match-team.home {
    min-width: 0;
    justify-content: flex-end;
    text-align: right;
    padding-right: 0;
    padding-left: 0;
  }

  body:not(.view-desktop) .match-team.away {
    min-width: 0;
    justify-content: flex-start;
    text-align: left;
    padding-left: 0;
    padding-right: 0;
  }

  body:not(.view-desktop) .match-team.home.has-scored {
    padding-right: 0;
  }

  body:not(.view-desktop) .match-team.away.has-scored {
    padding-left: 0;
  }

  body:not(.view-desktop) .match-score {
    flex: 0 0 auto;
    text-align: center;
    min-width: 0;
    width: auto;
    padding: 0;
    margin: 0;
  }

  body:not(.view-desktop) .team-name {
    font-size: 0.63rem;
    font-weight: 400 !important;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-transform: capitalize;
  }

  body:not(.view-desktop) .team-name.winner {
    font-weight: 400 !important;
  }

  body:not(.view-desktop) .match-finished .team-name.winner,
  body:not(.view-desktop) .today-match-wrap.match-finished .team-name.winner,
  body:not(.view-desktop) .match-item-wrap.match-finished .team-name.winner {
    font-weight: 700 !important;
  }

  body:not(.view-desktop) .match-row-long-names .team-name {
    font-size: 0.63rem;
  }

  body:not(.view-desktop) .match-score {
    font-size: 0.63rem;
    font-weight: 600;
  }

  body:not(.view-desktop) .match-score .score-part,
  body:not(.view-desktop) .match-score .score-sep {
    font-size: 0.63rem;
    font-weight: 600;
    padding: 0;
  }

  body:not(.view-desktop) .match-live .match-score .score-part.scored {
    font-size: 0.63rem;
    font-weight: 600;
  }

  body:not(.view-desktop) .match-timeline-link {
    font-size: 0.63rem;
  }

  body:not(.view-desktop) .action-btn {
    width: 16px;
    height: 16px;
  }

  body:not(.view-desktop) .action-btn svg {
    width: 9px;
    height: 9px;
  }

  body:not(.view-desktop) .timeline-btn,
  body:not(.view-desktop) .odds-btn,
  body:not(.view-desktop) .action-spacer {
    display: none;
  }
}

@media (min-width: 769px) {
  body.view-mobile {
    padding-left: 0;
    padding-right: 0;
  }

  body.view-mobile .today-section {
    margin-bottom: 8px;
  }

  body.view-mobile .today-section-header {
    padding: 5px 8px;
    font-size: 0.68rem;
  }

  body.view-mobile .match-league-line {
    padding: 3px 6px;
    gap: 4px;
    font-size: 0.62rem;
    border-left-width: 2px;
  }

  body.view-mobile .match-meta-line {
    padding: 0 5px 2px 5px;
  }

  body.view-mobile .match-meta-line {
    justify-content: flex-start;
  }

  body.view-mobile .match-meta-kickoff {
    width: 50px;
    min-width: 50px;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.63rem;
  }

  body.view-mobile .match-meta-line .match-meta-right {
    margin-left: auto;
    margin-right: 4px;
    gap: 0;
    --stats-tools-gap: 1px;
  }

  body.view-mobile .match-meta-right .match-league-ht {
    font-size: 0.63rem;
    font-weight: 600 !important;
    color: var(--live-red);
    width: auto;
    min-width: auto;
    text-align: right;
    flex-shrink: 0;
    margin-right: 4px;
  }

  body.view-mobile .match-finished .match-meta-right .match-league-ht,
  body.view-mobile .today-section-finished .match-meta-right .match-league-ht {
    color: var(--score-blue);
  }

  body.view-mobile .match-league-stats {
    gap: 0;
    flex-shrink: 0;
  }

  body.view-mobile .match-league-stats .match-stat {
    font-size: 0.63rem;
  }

  body.view-mobile .match-league-stats .stat-icon.yellow,
  body.view-mobile .match-league-stats .stat-icon.red {
    font-size: calc(0.63rem * 1.35 * 1.1);
    transform: none;
    vertical-align: middle;
    position: relative;
    top: -1px;
  }

  body.view-mobile .match-league-stats .stat-icon.corner {
    font-size: calc(0.63rem * 1.35);
    transform: none;
    vertical-align: middle;
    position: relative;
    top: -1px;
  }

  body.view-mobile .match-row {
    grid-template-columns: subgrid;
    gap: 0 var(--mob-team-score-gap);
    padding: 3px 5px;
    font-size: 0.63rem;
    box-shadow: none;
  }

  body.view-mobile .match-status {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    justify-content: flex-start;
    text-align: left;
    font-size: 0.63rem;
  }

  body.view-mobile .match-status.upcoming {
    font-size: 0.63rem;
    justify-content: flex-start;
    text-align: left;
  }

  body.view-mobile .match-status.finished {
    justify-content: flex-start;
    gap: 2px;
    font-size: 0.63rem;
    text-align: left;
  }

  /* Finished mobile: main rules outside @media (body.view-mobile + data-tab) */
  body.view-mobile .match-status.finished .match-finished-date {
    display: none !important;
  }

  body.view-mobile .match-meta-finished {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
  }

  body.view-mobile .match-meta-finished .match-meta-finished-date {
    font-size: 0.58rem;
    margin-right: 2px;
    color: var(--text-secondary);
  }

  body.view-mobile .match-meta-finished .match-meta-ft-label {
    font-size: 0.63rem;
    color: var(--live-red);
  }

  body.view-mobile .live-status {
    justify-content: flex-start;
    gap: 1px;
    font-size: 0.63rem;
  }

  body.view-mobile .live-minute,
  body.view-mobile .live-period {
    font-size: 0.63rem;
  }

  body.view-mobile .match-status-kickoff,
  body.view-mobile .match-finished-time,
  body.view-mobile .match-meta-kickoff {
    font-size: 0.63rem;
    font-weight: 700;
    text-align: left;
    line-height: 1;
  }

  body.view-mobile .live-kickoff {
    display: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    pointer-events: none !important;
  }

  body.view-mobile .live-status .live-status-stream {
    display: none !important;
  }

  body.view-mobile .live-ball-spin {
    width: 11px;
    height: 11px;
  }

  body.view-mobile .match-team {
    padding: 2px 0;
  }

  body.view-mobile .match-team.home {
    min-width: 0;
    justify-content: flex-end;
    text-align: right;
    padding-right: 0;
    padding-left: 0;
  }

  body.view-mobile .match-team.away {
    min-width: 0;
    justify-content: flex-start;
    text-align: left;
    padding-left: 0;
    padding-right: 0;
  }

  body.view-mobile .match-team.home.has-scored {
    padding-right: 0;
  }

  body.view-mobile .match-team.away.has-scored {
    padding-left: 0;
  }

  body.view-mobile .match-score {
    flex: 0 0 auto;
    text-align: center;
    min-width: 0;
    width: auto;
    padding: 0;
    margin: 0;
  }

  body.view-mobile .team-name {
    font-size: 0.63rem;
    font-weight: 400 !important;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-transform: capitalize;
  }

  body.view-mobile .team-name.winner {
    font-weight: 400 !important;
  }

  body.view-mobile .match-finished .team-name.winner,
  body.view-mobile .today-match-wrap.match-finished .team-name.winner,
  body.view-mobile .match-item-wrap.match-finished .team-name.winner {
    font-weight: 700 !important;
  }

  body.view-mobile .match-row-long-names .team-name {
    font-size: 0.63rem;
  }

  body.view-mobile .match-score {
    font-size: 0.63rem;
    font-weight: 600;
    min-width: 0;
    width: auto;
    padding: 0;
    margin: 0;
  }

  body.view-mobile .match-score .score-part,
  body.view-mobile .match-score .score-sep {
    font-size: 0.63rem;
    font-weight: 600;
    padding: 0;
  }

  body.view-mobile .match-live .match-score .score-part.scored {
    font-size: 0.63rem;
    font-weight: 600;
  }

  body.view-mobile .match-timeline-link {
    font-size: 0.63rem;
  }

  body.view-mobile .match-actions {
    display: none !important;
  }

  body.view-mobile .action-btn {
    width: 16px;
    height: 16px;
  }

  body.view-mobile .action-btn svg {
    width: 9px;
    height: 9px;
  }

  body.view-mobile .timeline-btn,
  body.view-mobile .odds-btn,
  body.view-mobile .action-spacer {
    display: none;
  }
}

/* ===== PC Mobile Preview Mode ===== */
@media (min-width: 769px) {
  body.view-mobile .site-layout {
    max-width: 390px;
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: 0 0 24px rgba(15, 23, 42, 0.08);
  }

  body.view-mobile .header-inner { max-width: 390px; width: 100%; }

  body.view-mobile #banner-mobile-top,
  body.view-mobile #banner-mobile-bottom {
    max-width: 390px;
  }

  body.view-mobile .footer {
    max-width: 390px;
    margin-left: auto;
    margin-right: auto;
    padding: 14px 12px 16px;
  }

  body.view-mobile .footer-inner {
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
  }

  body.view-mobile .footer-copy {
    font-size: 0.78rem;
    flex: 1;
    min-width: 0;
    gap: 5px;
  }

  body.view-mobile .footer-logo-icon,
  body.view-mobile .footer-brand-text {
    display: none;
  }

  body.view-mobile .footer-logo-full {
    display: block;
    height: 22px;
    max-width: min(148px, 38vw);
  }

  body.view-mobile .footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
  }

  body.view-mobile .footer-links a {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    white-space: nowrap;
  }

  body.view-mobile .footer-links a:hover {
    color: var(--accent-secondary);
  }

  /* Mobile: show full LiveScores.win (not LS icon only) — flush to controls */
  body.view-mobile .logo-full {
    display: block;
    height: 28px;
    max-width: min(142px, 36vw);
  }
  body.view-mobile .logo-compact { display: none; }
}

/* ===== Responsive (small viewport; do not override PC preview mode) ===== */
@media (max-width: 768px) {
  html { font-size: 12px; }

  body:not(.view-desktop) .header-inner { gap: 0; }
  body:not(.view-desktop) .logo-full {
    display: block;
    height: 28px;
    max-width: min(142px, 36vw);
  }
  body:not(.view-desktop) .logo-compact { display: none; }

  .nav-tabs .nav-tab { padding: 6px 8px; font-size: 0.78rem; }

  .page-center { max-width: 100%; margin: 0 auto; }

  .footer { margin-bottom: 8px; padding: 14px 10px; }

  body:not(.view-desktop) .footer-inner {
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
  }

  body:not(.view-desktop) .footer-copy {
    flex: 1;
    min-width: 0;
    font-size: 0.78rem;
    gap: 5px;
  }

  body:not(.view-desktop) .footer-logo-icon,
  body:not(.view-desktop) .footer-brand-text {
    display: none;
  }

  body:not(.view-desktop) .footer-logo-full {
    display: block;
    height: 22px;
    max-width: min(148px, 38vw);
  }

  body:not(.view-desktop) .footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
  }

  body:not(.view-desktop) .footer-links a {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    white-space: nowrap;
  }

  body:not(.view-desktop) .footer-links a:hover {
    color: var(--accent-secondary);
  }

  .modal-overlay { padding: 20px 8px; }
}

@media (max-width: 480px) {
  /* Hide search only on narrow PC; Mobile preview always keeps search */
  body.view-desktop .search-wrap { display: none; }
}

/* Compact tablet match row (mobile viewport only) */
@media (min-width: 769px) and (max-width: 1200px) {
  body:not(.view-desktop) .match-row {
    grid-template-columns: 78px minmax(0, 1fr);
  }
}

/* ===== Mobile — 4-col subgrid: name | 1ch | score | 1ch | name; H1 aligned to score column ===== */
body.view-mobile,
body:not(.view-desktop) {
  /* live ball 11px + gap 2px — kickoff time aligns under minute 70' */
  --mob-live-ball-slot: calc(11px + 2px);
  --mob-col-status: 58px;
  --mob-team-score-gap: 1ch;
  /* Nudge left team names + score + H1 cluster (Mobile only) */
  --mob-score-nudge: -20px;            /* LIVE */
  --mob-score-nudge-finished: -30px;  /* Finished (+10 vs Live; +4 Jul 8) */
  --mob-score-nudge-upcoming: -32px;  /* Upcoming (+12 vs Live) */
}

body.view-mobile .match-item-wrap,
body:not(.view-desktop) .match-item-wrap {
  display: grid;
  grid-template-columns: var(--mob-col-status) minmax(0, 1fr) max-content minmax(0, 1fr);
  column-gap: var(--mob-team-score-gap);
  max-width: 100%;
  overflow: hidden;
}

body.view-mobile .match-row,
body:not(.view-desktop) .match-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: center;
  gap: 0 var(--mob-team-score-gap);
  padding: 3px 5px;
  font-size: 0.63rem;
}

@supports not (grid-template-columns: subgrid) {
  body.view-mobile .match-row,
  body:not(.view-desktop) .match-row {
    grid-template-columns: var(--mob-col-status) minmax(0, 1fr) max-content minmax(0, 1fr);
  }
}

body.view-mobile .match-scoreline,
body:not(.view-desktop) .match-scoreline {
  display: contents;
}

body.view-mobile .match-status,
body:not(.view-desktop) .match-status {
  grid-column: 1;
  grid-row: 1;
}

body.view-mobile .match-team,
body:not(.view-desktop) .match-team {
  padding: 2px 0;
  min-width: 0;
}

body.view-mobile .match-team.home,
body:not(.view-desktop) .match-team.home {
  grid-column: 2;
  grid-row: 1;
  justify-content: flex-end;
  text-align: right;
  padding-right: 0;
  padding-left: 0;
  transform: translateX(var(--mob-score-nudge)) !important;
}

body.view-mobile .match-score,
body:not(.view-desktop) .match-score,
body.view-mobile .match-item-wrap .match-score,
body:not(.view-desktop) .match-item-wrap .match-score {
  grid-column: 3;
  grid-row: 1;
  justify-self: center;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 0;
  margin: 0;
  transform: translateX(var(--mob-score-nudge)) !important;
}

body.view-mobile .match-team.away,
body:not(.view-desktop) .match-team.away {
  grid-column: 4;
  grid-row: 1;
  justify-content: flex-start;
  text-align: left;
  padding-left: 0;
  padding-right: 0;
  transform: translateX(var(--mob-score-nudge)) !important;
}

/* Mobile Finished: name/score/H1 cluster → --mob-score-nudge-finished */
body.view-mobile .match-item-wrap.match-finished .match-team.home,
body:not(.view-desktop) .match-item-wrap.match-finished .match-team.home,
body.view-mobile .today-section-finished .match-team.home,
body:not(.view-desktop) .today-section-finished .match-team.home {
  transform: translateX(var(--mob-score-nudge-finished)) !important;
}

body.view-mobile .match-item-wrap.match-finished .match-score,
body:not(.view-desktop) .match-item-wrap.match-finished .match-score,
body.view-mobile .today-section-finished .match-score,
body:not(.view-desktop) .today-section-finished .match-score {
  transform: translateX(var(--mob-score-nudge-finished)) !important;
}

body.view-mobile .match-item-wrap.match-finished .match-team.away,
body:not(.view-desktop) .match-item-wrap.match-finished .match-team.away,
body.view-mobile .today-section-finished .match-team.away,
body:not(.view-desktop) .today-section-finished .match-team.away {
  transform: translateX(var(--mob-score-nudge-finished)) !important;
}

body.view-mobile .match-item-wrap.match-finished .match-meta-ht,
body:not(.view-desktop) .match-item-wrap.match-finished .match-meta-ht,
body.view-mobile .today-section-finished .match-meta-ht,
body:not(.view-desktop) .today-section-finished .match-meta-ht {
  transform: translateX(var(--mob-score-nudge-finished)) !important;
}

/* Mobile Upcoming: name/score cluster → --mob-score-nudge-upcoming */
body.view-mobile .match-item-wrap.match-upcoming .match-team.home,
body:not(.view-desktop) .match-item-wrap.match-upcoming .match-team.home,
body.view-mobile .today-section-upcoming .match-team.home,
body:not(.view-desktop) .today-section-upcoming .match-team.home {
  transform: translateX(var(--mob-score-nudge-upcoming)) !important;
}

body.view-mobile .match-item-wrap.match-upcoming .match-score,
body:not(.view-desktop) .match-item-wrap.match-upcoming .match-score,
body.view-mobile .today-section-upcoming .match-score,
body:not(.view-desktop) .today-section-upcoming .match-score {
  transform: translateX(var(--mob-score-nudge-upcoming)) !important;
}

body.view-mobile .match-item-wrap.match-upcoming .match-team.away,
body:not(.view-desktop) .match-item-wrap.match-upcoming .match-team.away,
body.view-mobile .today-section-upcoming .match-team.away,
body:not(.view-desktop) .today-section-upcoming .match-team.away {
  transform: translateX(var(--mob-score-nudge-upcoming)) !important;
}

/* Mobile Upcoming: slightly larger team names (row stays 0.63rem — .match-team only) */
body.view-mobile .match-item-wrap.match-upcoming .match-team,
body:not(.view-desktop) .match-item-wrap.match-upcoming .match-team,
body.view-mobile .today-section-upcoming .match-team,
body:not(.view-desktop) .today-section-upcoming .match-team {
  font-size: 0.70rem;
}

body.view-mobile .match-meta-line,
body:not(.view-desktop) .match-meta-line {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: center;
  justify-content: stretch;
  padding: 0 5px 2px;
  /* Same gap as wrap — keep column 3 aligned with score row */
  column-gap: var(--mob-team-score-gap);
  row-gap: 0;
}

@supports not (grid-template-columns: subgrid) {
  body.view-mobile .match-meta-line,
  body:not(.view-desktop) .match-meta-line {
    grid-template-columns: var(--mob-col-status) minmax(0, 1fr) max-content minmax(0, 1fr);
  }
}

body.view-mobile .match-meta-status-col,
body:not(.view-desktop) .match-meta-status-col {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  width: var(--mob-col-status);
  min-width: var(--mob-col-status);
  overflow: hidden;
  position: relative;
  z-index: 2;
  isolation: isolate;
}

/*
 * Finished mobile:
 * - Today tab: FT red on top · kickoff blue below (no date)
 * - Finished tab: FT red on top · `10:40 08/07` below (blue / gray)
 * Keep colors; do not change size.
 */
body.view-mobile .match-status.finished .match-finished-date,
body:not(.view-desktop) .match-status.finished .match-finished-date {
  display: none !important;
}

/* FT red on status row (Today + Finished) — column-aligned with kickoff times */
body.view-mobile .match-status.finished .match-ft-label,
body:not(.view-desktop) .match-status.finished .match-ft-label {
  display: inline !important;
  color: var(--live-red) !important;
  font-size: 0.63rem;
  font-weight: 700;
  margin-left: var(--mob-live-ball-slot);
}

/* Time/date not on status row — shown on meta row */
body.view-mobile .match-status.finished .match-finished-time,
body:not(.view-desktop) .match-status.finished .match-finished-time {
  display: none !important;
}

body.view-mobile .match-meta-finished,
body:not(.view-desktop) .match-meta-finished {
  display: inline-flex !important;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  width: auto;
  max-width: 100%;
  overflow: visible;
}

/* Finished tab: left column fits `10:40 08/07` */
body.view-mobile[data-tab="finished"],
body:not(.view-desktop)[data-tab="finished"] {
  --mob-col-status: 78px;
}

body.view-mobile[data-tab="finished"] .match-meta-finished,
body:not(.view-desktop)[data-tab="finished"] .match-meta-finished {
  width: auto;
  min-width: 0;
}

body.view-mobile[data-tab="finished"] .match-meta-status-col.match-meta-finished,
body:not(.view-desktop)[data-tab="finished"] .match-meta-status-col.match-meta-finished {
  overflow: visible;
}

body.view-mobile .match-meta-finished .match-meta-kickoff,
body.view-mobile .match-meta-finished .match-finished-time,
body:not(.view-desktop) .match-meta-finished .match-meta-kickoff,
body:not(.view-desktop) .match-meta-finished .match-finished-time {
  display: inline !important;
  color: #2563eb !important; /* kickoff blue */
  font-size: 0.63rem;
  font-weight: 700;
  margin: 0;
  min-width: 5ch;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

body.view-mobile .match-meta-finished .match-finished-date,
body.view-mobile .match-meta-finished .match-meta-finished-date,
body:not(.view-desktop) .match-meta-finished .match-finished-date,
body:not(.view-desktop) .match-meta-finished .match-meta-finished-date {
  display: inline !important;
  color: var(--text-secondary) !important; /* date gray */
  font-size: 0.58rem;
  margin-right: 0;
}

body.view-mobile .match-meta-finished .match-ft-label,
body.view-mobile .match-meta-finished .match-meta-ft-label,
body:not(.view-desktop) .match-meta-finished .match-ft-label,
body:not(.view-desktop) .match-meta-finished .match-meta-ft-label {
  display: inline !important;
  color: var(--live-red) !important; /* FT red */
  font-size: 0.63rem;
}

/* Mobile: kickoff aligns under 70' (indented by ball + gap) */
body.view-mobile .match-meta-status-col .match-kickoff-group,
body:not(.view-desktop) .match-meta-status-col .match-kickoff-group,
body.view-mobile .match-meta-status-col > .match-meta-kickoff:not(.match-finished-time),
body:not(.view-desktop) .match-meta-status-col > .match-meta-kickoff:not(.match-finished-time) {
  margin-left: var(--mob-live-ball-slot);
}

/* Mobile Upcoming: start time column-aligned with LIVE kickoff */
body.view-mobile .match-status.upcoming .match-status-kickoff,
body:not(.view-desktop) .match-status.upcoming .match-status-kickoff,
body.view-mobile .today-section-upcoming .match-status .match-status-kickoff,
body:not(.view-desktop) .today-section-upcoming .match-status .match-status-kickoff {
  margin-left: var(--mob-live-ball-slot);
  min-width: 5ch;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

/* Mobile Today results (+ Finished tab): time under FT aligns with kickoff column */
body.view-mobile .match-meta-finished,
body:not(.view-desktop) .match-meta-finished,
body.view-mobile .today-section-finished .match-meta-finished,
body:not(.view-desktop) .today-section-finished .match-meta-finished {
  margin-left: var(--mob-live-ball-slot) !important;
}

body.view-mobile .match-meta-finished > .match-meta-kickoff,
body.view-mobile .match-meta-finished > .match-finished-time,
body:not(.view-desktop) .match-meta-finished > .match-meta-kickoff,
body:not(.view-desktop) .match-meta-finished > .match-finished-time {
  margin-left: 0;
}

body.view-mobile .match-meta-clock-slot {
  --clock-w: calc(9px * 1.3);
  flex: 0 0 var(--clock-w);
  width: var(--clock-w);
  height: var(--clock-w);
}

body.view-mobile .match-meta-status-col .match-kickoff-group {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  width: auto !important;
  min-width: 0 !important;
  max-width: none;
  flex: 0 1 auto;
  position: static;
  grid-column: unset !important;
  grid-row: unset !important;
}

body.view-mobile .match-meta-status-col .match-kickoff-group .match-meta-kickoff {
  display: inline;
  width: auto;
  min-width: 0;
  text-align: left;
}

body.view-mobile .match-meta-status-col .match-kickoff-group .match-stream-link {
  position: static;
  transform: none;
  flex-shrink: 0;
}

body.view-mobile .match-meta-status-col > .match-meta-kickoff {
  width: auto;
  min-width: 0;
  text-align: left;
}

body.view-mobile .match-meta-status-col .match-meta-kickoff {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}

body.view-mobile .match-meta-clock.live-clock-sprite,
body.view-mobile .match-meta-clock.live-clock-static {
  --clock-w: calc(9px * 1.3);
  width: var(--clock-w);
  height: var(--clock-w);
  max-width: var(--clock-w);
  max-height: var(--clock-w);
  flex-shrink: 0;
  vertical-align: middle;
}

/*
 * HT below score: only .match-meta-ht-score (digits without parens) sets center —
 * same center as .match-score. Label + parens absolute; do not shift center.
 */
body.view-mobile .match-meta-ht,
body:not(.view-desktop) .match-meta-ht {
  grid-column: 3;
  grid-row: 1;
  justify-self: center;
  align-self: center;
  position: relative;
  display: block;
  width: max-content;
  margin: 0;
  padding: 0;
  line-height: 1;
  color: var(--live-red);
  /* same size as .match-score — optically parallel to score */
  font-size: 0.63rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translateX(var(--mob-score-nudge)) !important;
}

/* Mobile Finished: H1 (0-0) red */
body.view-mobile .match-finished .match-meta-ht,
body:not(.view-desktop) .match-finished .match-meta-ht,
body.view-mobile .today-match-wrap.match-finished .match-meta-ht,
body:not(.view-desktop) .today-match-wrap.match-finished .match-meta-ht,
body.view-mobile .match-item-wrap.match-finished .match-meta-ht,
body:not(.view-desktop) .match-item-wrap.match-finished .match-meta-ht,
body.view-mobile .today-section-finished .match-meta-ht,
body:not(.view-desktop) .today-section-finished .match-meta-ht {
  color: var(--live-red);
}

body.view-mobile .match-meta-ht-score,
body:not(.view-desktop) .match-meta-ht-score {
  display: block;
  text-align: center;
  line-height: 1;
  font-size: inherit;
  font-weight: inherit;
}

body.view-mobile .match-meta-ht-label,
body:not(.view-desktop) .match-meta-ht-label {
  position: absolute;
  /* 0.55em + 1px: extra 1px before H1 ( */
  right: calc(100% + 0.55em + 1px);
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  font-weight: inherit;
  font-size: inherit; /* balance with (0-1) */
  white-space: nowrap;
  pointer-events: none;
}

body.view-mobile .match-meta-ht-o,
body:not(.view-desktop) .match-meta-ht-o {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

body.view-mobile .match-meta-ht-c,
body:not(.view-desktop) .match-meta-ht-c {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

body.view-mobile .match-meta-ht[aria-hidden="true"],
body:not(.view-desktop) .match-meta-ht[aria-hidden="true"] {
  visibility: hidden;
  width: 0;
  max-width: 0;
  overflow: hidden;
}

/* Hide duplicate HT in actions column (shown under score) */
body.view-mobile .match-meta-right > .match-league-ht,
body:not(.view-desktop) .match-meta-right > .match-league-ht {
  display: none !important;
}

body.view-mobile .match-meta-right,
body:not(.view-desktop) .match-meta-right {
  grid-column: 4;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  margin-left: 0;
  margin-right: 0;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  --stats-tools-gap: 1px;
}

body.view-mobile .match-meta-right .match-league-stats {
  flex-shrink: 0;
}

body.view-mobile .match-meta-right .match-meta-tools {
  flex-shrink: 0;
  margin-left: var(--stats-tools-gap, 5px);
}

body.view-mobile .league-group {
  max-width: 100%;
  overflow: hidden;
}

body.view-mobile .today-section-list {
  max-width: 100%;
  overflow: visible;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

[hidden] { display: none !important; }
