/* ── Google Fonts: Geist & Geist Mono ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800;900&family=Geist+Mono:wght@400;500;600;700&display=swap');

/* ── Reset & Core Variables (Stella Design System) ────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

:root {
  /* Color Canvas */
  --bg: #07080c;
  --surface: #0b0d13;
  --surface2: #10141f;
  --surface3: #161b2a;
  --surface-hover: #141825;

  /* Borders & Hairlines */
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-active: #3b82f6;
  --border-highlight: rgba(255, 255, 255, 0.12);

  /* Accents */
  --accent: #2563eb;              /* Stella Electric Sport Blue */
  --accent-light: #60a5fa;
  --accent-glow: rgba(37, 99, 235, 0.35);
  --accent-subtle: rgba(37, 99, 235, 0.12);

  --emerald: #10b981;             /* Success / Winner / Synced */
  --rose: #f43f5e;                /* Live pulse / Alerts */
  --amber: #f59e0b;               /* Trophies / Pinned */

  /* Typography */
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-faint: #475569;

  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, Menlo, Monaco, Consolas, monospace;

  /* Layout & Radii */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-bento: inset 0 1px 0 0 rgba(255, 255, 255, 0.07), 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.2);
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
html {
  color-scheme: dark;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  /* Stella technical background: fine grid + ambient top spotlight */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle 800px at 50% -120px, rgba(37, 99, 235, 0.18), transparent 70%);
  background-size: 36px 36px, 36px 36px, 100% 100%;
  background-position: 0 0, 0 0, 0 0;
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: all 0.15s ease;
}
a:hover {
  color: #fff;
}

/* Vector Icon Base */
.icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.icon-sm {
  width: 14px;
  height: 14px;
}
.icon-lg {
  width: 20px;
  height: 20px;
}

/* ── Floating Navbar (Stella Style) ───────────────────────────────────────── */
.header {
  position: sticky;
  top: 1rem;
  z-index: 100;
  padding: 0 1.25rem;
  background: transparent;
  border-bottom: none;
}

.header-inner {
  max-width: 1060px;
  margin: 0 auto;
  background: rgba(11, 13, 19, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.45rem 0.6rem 0.45rem 1.15rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none !important;
  color: #fff;
}

.brand-symbol {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: #fff;
}

.brand-symbol svg {
  width: 16px;
  height: 16px;
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent-light);
  border: 1px solid rgba(37, 99, 235, 0.3);
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-full);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* ── Hero Section (Stella High-Converting Style) ──────────────────────────── */
.hero {
  text-align: center;
  padding: 4.5rem 1.5rem 2.5rem;
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.hero-compact {
  padding: 3rem 1.5rem 1.5rem;
}

/* Pre-title Badge */
.stella-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.28);
  color: var(--accent-light);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.15);
}

.stella-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 8px #60a5fa;
}

.hero h1, .stella-hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 1rem;
}

.stella-gradient-text {
  background: linear-gradient(135deg, #ffffff 30%, #93c5fd 80%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub, .stella-hero-sub {
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 2rem;
  font-size: 1rem;
  line-height: 1.6;
}

/* Hero CTA Group */
.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 2.75rem;
}

/* Hero Metrics Ticker Strip */
.hero-metrics-bar {
  display: inline-flex;
  align-items: center;
  background: rgba(11, 13, 19, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.65rem 1.75rem;
  gap: 1.5rem;
  box-shadow: var(--shadow-bento);
  max-width: 100%;
  overflow-x: auto;
}

.metric-item {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  white-space: nowrap;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

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

.metric-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
}

/* ── Buttons (Stella Elite Design) ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none !important;
  white-space: nowrap;
}

/* White Solid Primary Button (Stella's flagship CTA) */
.btn-primary, .btn-stella-primary {
  background: #ffffff;
  color: #07080c;
  border: 1px solid #ffffff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.btn-primary:hover, .btn-stella-primary:hover {
  background: #f1f5f9;
  border-color: #f1f5f9;
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(255, 255, 255, 0.25);
  color: #000;
}

/* Electric Blue Secondary Button */
.btn-electric {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-electric:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
  color: #fff;
}

/* Dark Glass Ghost Button */
.btn-ghost, .btn-stella-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover, .btn-stella-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
  color: #fff;
  transform: translateY(-2px);
}

.btn-notify {
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.btn-notify:hover {
  background: rgba(245, 158, 11, 0.16);
  border-color: #fbbf24;
  color: #fff;
}

.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  border-radius: var(--radius-full);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
}

.btn.copied {
  background: var(--emerald) !important;
  border-color: var(--emerald) !important;
  color: #fff !important;
}

/* ── Container ────────────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 5rem;
}

/* ── Mode Switcher Tabs (Per Equip vs Competició Sencera) ─────────────────── */
.mode-tabs {
  display: inline-flex;
  background: rgba(11, 13, 19, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
  margin: 0.5rem auto 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.mode-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1.25rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.mode-btn:hover {
  color: #fff;
}

.mode-btn.active {
  background: #ffffff;
  color: #07080c;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* ── Sport Filter Bar (Capsule Pills) ─────────────────────────────────────── */
.sports-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  align-items: center;
}

.sport-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.sport-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.sport-pill.active {
  background: rgba(37, 99, 235, 0.15);
  border-color: #3b82f6;
  color: #93c5fd;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.25);
}

#filterFavPill {
  border-color: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

#filterFavPill:hover, #filterFavPill.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  color: #fff;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
}

/* ── Search & Filter Inputs ───────────────────────────────────────────────── */
.search-wrap {
  margin-bottom: 1.75rem;
  position: relative;
}

.search-wrap input,
.filter-group input,
.filter-group select {
  background: rgba(11, 13, 19, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.search-wrap input {
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-full);
  padding-left: 1.25rem;
}

.search-wrap input:focus,
.filter-group input:focus,
.filter-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.search-wrap input::placeholder,
.filter-group input::placeholder {
  color: var(--text-dim);
}

/* ── Stella Bento Feature Grid (Homepage) ─────────────────────────────────── */
.bento-section {
  margin-top: 3.5rem;
  margin-bottom: 4rem;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
}

.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-bento);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bento-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.bento-card:hover {
  border-color: rgba(37, 99, 235, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8), 0 0 25px rgba(37, 99, 235, 0.15);
}

.bento-span-8 {
  grid-column: span 8;
}

.bento-span-4 {
  grid-column: span 4;
}

.bento-span-6 {
  grid-column: span 6;
}

.bento-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-light);
  margin-bottom: 0.85rem;
}

.bento-card h3 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 0.5rem;
}

.bento-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.bento-action {
  margin-top: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Favorites Section ────────────────────────────────────────────────────── */
.favorites-section {
  margin: 1.5rem 0 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-bento);
}

.fav-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.fav-title-group h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.fav-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.fav-empty-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.fav-empty-icon {
  width: 36px;
  height: 36px;
  color: var(--text-dim);
}

.fav-empty-banner strong {
  display: block;
  color: #fff;
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
}

.fav-empty-banner p {
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 0;
}

.fav-teams-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.fav-team-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.fav-team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.65rem;
}

.fav-team-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.fav-team-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.fav-team-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.fav-matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}

.fav-match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fav-match-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.fav-match-card.is-live {
  border-color: var(--rose);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.2);
}

.fav-match-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.fav-comp-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--accent-light);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.fav-round-tag {
  font-size: 0.72rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.fav-match-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
}

.fav-team-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
  text-align: center;
}

.fav-crest {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.fav-side-name {
  font-size: 0.82rem;
  font-weight: 600;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.fav-score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 80px;
}

.fav-score-digits {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.05em;
}

.fav-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-full);
}

.fav-time-badge {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-light);
}

.fav-date-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
}

.fav-match-footer {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.fav-match-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

/* ── Live Matches Section (Home / Partits) ────────────────────────────────── */
.live-dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 10px var(--rose);
  display: inline-block;
  animation: pulse-live 1.2s infinite;
  flex-shrink: 0;
}

@keyframes pulse-live {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.75; }
}

/* ── Single-Line Team Rows (Calendaris) ───────────────────────────────────── */
.teams-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.team-row-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-shadow: var(--shadow-bento);
}

.team-row-item:hover {
  border-color: var(--border-hover);
  background: var(--surface2);
}

.team-row-item.open {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(37, 99, 235, 0.25);
}

.team-row-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.15rem;
  cursor: pointer;
  user-select: none;
}

.team-fav-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.team-fav-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--amber);
  color: #fbbf24;
  transform: scale(1.1);
}

.team-fav-btn.is-favorite {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--amber);
  color: #fbbf24;
}

.team-logo-wrap {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.row-team-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-fallback-sm {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 2px 5px;
  border-radius: 4px;
}

.team-name-col {
  display: flex;
  flex-direction: column;
  min-width: 160px;
  max-width: 280px;
}

.team-name-text {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-city-text {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-comps-col {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  flex: 1;
}

.badge-mini {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.team-expand-col {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.chevron-arrow {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: transform 0.2s ease, color 0.2s ease;
}

.team-row-item.open .chevron-arrow {
  transform: rotate(180deg);
  color: var(--accent-light);
}

.team-inline-panel {
  border-top: 1px solid var(--border);
  background: rgba(11, 13, 19, 0.9);
  padding: 1.25rem 1.35rem;
  animation: fadeInDown 0.2s ease-out;
}

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

.panel-header-sub h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
}

.panel-header-sub .hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.comp-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.comp-checkbox-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.comp-checkbox-item:hover {
  background: var(--surface3);
  border-color: var(--accent);
}

.comp-checkbox-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.comp-checkbox-item label, .comp-checkbox-item span {
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
}

.feed-url-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  overflow-x: auto;
}

.feed-url-box code {
  color: #34d399;
  font-size: 0.84rem;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.accordion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

/* ── Competitions Grid ────────────────────────────────────────────────────── */
.competitions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.comp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.15rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-bento);
}

.comp-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.7);
  background: var(--surface2);
}

.comp-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.comp-logo {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.comp-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.comp-icon-fallback {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.comp-sport-tag {
  font-size: 0.7rem;
  color: var(--accent-light);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.comp-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.015em;
  margin-top: 0.15rem;
}

.comp-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.comp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ── Partits & Resultats (Telemetry Scoreboards) ──────────────────────────── */
.filters-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-bento);
}

.sub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-group label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.round-nav-banner {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.15rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-bento);
}

.round-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.round-current-title {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.round-current-title h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.round-pill-badge {
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: var(--accent-light);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.12rem 0.6rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}

.round-nav-actions {
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

/* Global Bar per a Rondes */
.rounds-global-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.rounds-global-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rounds-global-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.current-round-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.current-round-jump-btn:hover {
  background: rgba(37, 99, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.6);
  color: #ffffff;
  transform: translateY(-1px);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 8px #60a5fa;
  animation: pulseDotAnim 2s infinite ease-in-out;
}

@keyframes pulseDotAnim {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.round-pill-current {
  background: rgba(37, 99, 235, 0.22) !important;
  border-color: rgba(59, 130, 246, 0.5) !important;
  color: #93c5fd !important;
}


.round-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-bento);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.round-section.is-current-round {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25), 0 8px 24px -4px rgba(37, 99, 235, 0.12);
}

.round-section.is-current-round .round-section-header {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.14) 0%, rgba(37, 99, 235, 0.04) 100%);
}

.badge-current-round {
  background: rgba(37, 99, 235, 0.25);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.45);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.badge-current-round .current-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 6px #3b82f6;
}

.round-section-header {
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  background: var(--surface2);
  user-select: none;
  border-bottom: 1px solid var(--border);
  min-height: 48px;
  height: auto;
}

.round-section-header * {
  pointer-events: none;
}

.round-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  flex-wrap: wrap;
  row-gap: 0.35rem;
}

.round-header-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.round-toggle-chevron {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  flex-shrink: 0 !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  transform: rotate(90deg);
  display: inline-block;
}

.round-section.collapsed .round-toggle-chevron {
  transform: rotate(0deg) !important;
}

.round-section.collapsed .round-section-header {
  border-bottom: none;
}

.round-section.collapsed .round-matches-content {
  display: none !important;
}

.round-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

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

.match-row-item {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}
.match-row-item:last-child {
  border-bottom: none;
}
.match-row-item:hover {
  background: rgba(255, 255, 255, 0.02);
}
.match-row-item.open {
  background: rgba(37, 99, 235, 0.04);
}

.match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 1.25rem;
  cursor: pointer;
  user-select: none;
}

.m-col-status {
  width: 130px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.status-label-live {
  color: #fb7185;
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
}

.status-label-fin {
  color: #34d399;
  font-weight: 600;
  font-size: 0.78rem;
}

.status-label-fin-mobile {
  display: none;
}

.status-time {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.m-col-teams {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-width: 0;
}

.team-side {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}

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

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

.team-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-side.winner .team-name {
  font-weight: 800;
  color: #fff;
}

.score-box {
  background: var(--surface2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  min-width: 72px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.score-box.score-live {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fb7185;
}

.m-col-meta {
  width: 210px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.row-tv-pill {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: #93c5fd;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 175px;
}

.match-drawer {
  display: none;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem 1.25rem;
}

.match-row-item.open .match-drawer {
  display: block;
}

.drawer-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.drawer-info-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.drawer-info-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.drawer-info-val {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
}

/* ── Goals & Incidents in Match Drawer (2-column scoreboard) ──────────────── */
.drawer-goals-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.goals-header {
  margin-bottom: 0.85rem;
}

.goals-header-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.goals-header-title svg {
  color: var(--accent);
}

.goals-scoreboard {
  background: rgba(11, 13, 19, 0.65);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  position: relative;
}

.goals-teams-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  padding-bottom: 0.65rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}

.goals-team-heading {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.goals-team-home {
  text-align: right;
  padding-right: 0.5rem;
}

.goals-team-away {
  text-align: left;
  padding-left: 0.5rem;
}

.goals-teams-header-mid {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 0.5rem;
}

.goals-scoreboard-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: stretch;
}

.goals-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.goals-col-home {
  align-items: flex-end;
}

.goals-col-away {
  align-items: flex-start;
}

.goals-vertical-line {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}

.goal-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.86rem;
  line-height: 1.3;
}

.goal-item-home {
  justify-content: flex-end;
  text-align: right;
}

.goal-item-away {
  justify-content: flex-start;
  text-align: left;
}

.goal-info {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.goal-item-home .goal-info {
  justify-content: flex-end;
}

.goal-item-away .goal-info {
  justify-content: flex-start;
}

.goal-scorer {
  font-weight: 600;
  color: #fff;
}

.goal-assist {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-weight: 400;
}

.goal-time {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.3);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.goal-ball-icon {
  font-size: 0.75rem;
  line-height: 1;
}

.goal-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.goal-badge-pen {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.goal-badge-og {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.goals-empty-side {
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 0.4rem 0;
}

.goals-empty, .goals-loading {
  color: var(--text-dim);
  font-size: 0.82rem;
  text-align: center;
  padding: 0.75rem 0;
  font-style: italic;
}

@media (max-width: 640px) {
  .goals-teams-header {
    gap: 0.5rem;
  }
  .goals-scoreboard-grid {
    gap: 0.5rem;
  }
  .goal-item {
    font-size: 0.78rem;
    gap: 0.35rem;
  }
  .goal-time {
    font-size: 0.72rem;
    padding: 0.1rem 0.35rem;
  }
}

/* ── Classificació (Standings) ────────────────────────────────────────────── */
.standings-wrapper {
  margin-top: 1.5rem;
  transition: opacity 0.2s ease;
}

.standings-comp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.comp-select-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.comp-select-pill:hover {
  background: var(--surface2);
  color: #fff;
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.comp-select-pill.active {
  background: rgba(37, 99, 235, 0.15);
  border-color: #3b82f6;
  color: #93c5fd;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.3);
}

.comp-pill-logo {
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  object-fit: contain;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.standings-comp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-bento);
}

.comp-header-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.standings-comp-logo {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.standings-comp-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent-light);
  flex-shrink: 0;
}

.standings-comp-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0;
}

.standings-comp-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.standings-source-badge .badge-source {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.group-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.group-tab-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.group-tab-btn:hover {
  background: var(--surface2);
  color: #fff;
  border-color: var(--border-hover);
}

.group-tab-btn.active {
  background: rgba(37, 99, 235, 0.15);
  color: #93c5fd;
  border-color: var(--accent);
}

.group-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #fff;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-bento);
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}

.standings-table th {
  background: var(--surface2);
  padding: 0.75rem 0.65rem;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.standings-table td {
  padding: 0.65rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.standings-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.th-pos, .td-pos {
  width: 44px;
  text-align: center;
}

.pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--surface2);
  color: var(--text-muted);
}

.pos-badge.pos-ucl {
  background: rgba(37, 99, 235, 0.18);
  color: #60a5fa;
  border-left: 3px solid #3b82f6;
}

.pos-badge.pos-playoff {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-left: 3px solid #10b981;
}

.pos-badge.pos-playin {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-left: 3px solid #f59e0b;
}

.pos-badge.pos-relegation {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border-left: 3px solid #ef4444;
}

.th-team, .td-team {
  min-width: 160px;
}

.team-flex {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.team-logo-sm {
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  object-fit: contain;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.team-fallback-sm {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-light);
  flex-shrink: 0;
}

.team-name-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.team-name-full {
  font-weight: 600;
  color: #fff;
}

.team-name-short {
  display: none;
  font-weight: 600;
  color: #fff;
}

.team-note-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: rgba(37, 99, 235, 0.15);
  color: #93c5fd;
  white-space: nowrap;
  font-weight: 600;
}

.th-stat, .td-stat {
  text-align: center;
  width: 44px;
  font-family: var(--font-mono);
}

.td-win {
  color: #34d399;
  font-weight: 600;
}

.td-draw {
  color: #fbbf24;
}

.td-loss {
  color: #f87171;
}

.td-diff {
  font-weight: 600;
  font-family: var(--font-mono);
}

.diff-pos {
  color: #34d399;
}

.diff-neg {
  color: #f87171;
}

.th-pts, .td-pts {
  text-align: center;
  width: 54px;
  font-family: var(--font-mono);
}

.td-pts strong {
  font-size: 0.95rem;
  color: #fff;
}

.th-streak, .td-streak {
  text-align: center;
  width: 80px;
}

.streak-text {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

/* ── Modals (Glassmorphism Pro) ───────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(37, 99, 235, 0.18);
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.25rem;
  cursor: pointer;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: #fff;
}

.modal h3 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 0.75rem;
}

.modal p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.modal-steps {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.modal-step {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.badge {
  min-width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-light);
}

.topic-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.75rem 0;
  word-break: break-all;
}

.topic-box code {
  font-size: 0.84rem;
  color: var(--emerald);
  font-family: var(--font-mono);
  flex: 1;
}

.mobile-cal-tip-box {
  background: rgba(16, 20, 31, 0.85);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.15rem;
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-cal-tip-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.84rem;
  color: #93c5fd;
}

.mobile-cal-tip-body {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.84rem;
}

.footer a {
  color: var(--text-muted);
}
.footer a:hover {
  color: #fff;
}

/* ── PWA Floating Button & Banner ─────────────────────────────────────────── */
.pwa-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #07080c;
  border: 1px solid #ffffff;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  margin-left: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

.pwa-nav-btn:hover {
  transform: translateY(-1px);
  background: #f1f5f9;
}

.pwa-install-banner {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border-highlight);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(37, 99, 235, 0.25);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pwa-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.pwa-banner-text strong {
  font-size: 0.85rem;
  color: #fff;
}

.pwa-banner-text span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Responsive Rules ─────────────────────────────────────────────────────── */
@media (max-width: 840px) {
  .bento-span-8, .bento-span-4, .bento-span-6 {
    grid-column: span 12;
  }
}

@media (max-width: 768px) {
  .header {
    top: 0.5rem;
    padding: 0 0.75rem;
  }
  .header-inner {
    border-radius: var(--radius);
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
  }
  .nav {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 0.25rem;
  }
  .hero {
    padding: 3rem 1rem 2rem;
  }
  .hero-metrics-bar {
    border-radius: var(--radius);
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
  }
  .metric-divider {
    display: none;
  }
}

@media (max-width: 680px) {
  .m-col-status {
    width: auto;
  }
  .status-label-live,
  .status-label-fin {
    display: none;
  }
  .status-label-fin-mobile {
    display: inline;
    font-size: 0.72rem;
    color: #34d399;
    font-weight: 700;
  }
  .team-name-full {
    display: none;
  }
  .team-name-short {
    display: inline;
    font-size: 0.85rem;
  }
  .score-box {
    padding: 0.2rem 0.45rem;
    font-size: 0.92rem;
    min-width: 48px;
  }
  .m-col-meta, .row-tv-pill {
    display: none;
  }
  .team-comps-col {
    display: none;
  }
  .team-name-col {
    min-width: 120px;
    max-width: 180px;
  }
  .expand-label {
    display: none;
  }
  .th-optional {
    display: none;
  }
}


/* Fix per les imatges de competició a standings */
.standings-comp-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
}
.standings-comp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.comp-header-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.standings-comp-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}
.standings-comp-meta {
  font-size: 0.85rem;
  color: var(--text-dim);
}

img.standings-comp-logo {
  max-width: 50px !important;
  max-height: 50px !important;
  object-fit: contain !important;
}

/* ── Favorites Chips & Chronological Grid ────────────────────────────────── */
.fav-teams-pills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}

.fav-team-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  transition: all 0.15s ease;
}

.fav-team-chip:hover {
  border-color: var(--accent);
}

.fav-chip-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.fav-chip-name {
  white-space: nowrap;
}

.fav-chip-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
  margin-left: 0.2rem;
  transition: color 0.15s ease;
}

.fav-chip-remove:hover {
  color: var(--rose);
}

.fav-chronological-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
