:root {
  --bg: #0f141e;
  --bg-2: #161a23;
  --surface: #1e2430;
  --surface-2: #262e3d;
  --line: #2d3748;
  --text: #f0f4f9;
  --muted: #a0aec0;
  --accent: #00d4a7;
  --accent-2: #3182ce;
  --danger: #e53e3e;
  --gold: #ecc94b;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --header-height: 84px;
  --surface-2-rgb: 38, 46, 61;
}

body.light-theme {
  --bg: #f8fbff;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --line: #ced9e8;
  --text: #1a2335;
  --muted: #5e708c;
  --accent: #00d4a7;
  --accent-2: #2a7fff;
  --danger: #e53e3e;
  --gold: #ecc94b;
  --shadow: 0 4px 12px rgba(26, 47, 79, 0.08);
  --surface-2-rgb: 241, 245, 249;
  --link-primary: #3182ce;
  --link-hover: #00d4a7;
}

body:not(.light-theme) {
  --link-primary: #63b3ed; /* Lighter blue for dark mode visibility */
  --link-hover: #00f0bd;
}

/* End of initial root */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Inter", "Barlow", sans-serif;
  background-color: var(--bg);
  min-height: 100vh;
}

a {
  color: var(--link-primary);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover {
  color: var(--link-hover);
  text-decoration: none;
}

.entity-link {
  color: var(--text);
  font-weight: 800;
  border-bottom: 2px solid transparent;
  padding-bottom: 1px;
}

.entity-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.history-link {
  color: var(--link-primary);
  font-weight: 700;
}

.history-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.pitch-player-link {
  color: #ffffff !important;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.pitch-player-link:hover {
  color: var(--accent) !important;
}

.footer-link-group a {
  display: block;
  margin-bottom: 10px;
  color: var(--muted) !important;
  font-size: 0.92rem;
  font-weight: 500;
}

.footer-link-group a:hover {
  color: var(--text) !important;
  transform: translateX(4px);
}

.site-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 18px 44px;
}

.dropdown-menu {
  display: none;
  /* Hide by default */
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  overflow: hidden;
  padding: 6px 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform-origin: top right;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Global visibility rule for JS-managed dropdowns */
.dropdown.js-dropdown.is-open .dropdown-menu {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.dropdown-menu[hidden] {
  display: none !important;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.light-theme .dropdown-menu {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.topbar {
  display: block;
  width: 100%;
  padding: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
}

.topbar-container {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.logo-img {
  height: 64px;
  width: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.nav-icon-link {
  color: var(--muted);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 8px;
}

.nav-icon-link:hover {
  color: var(--text);
  background: var(--bg);
}

.nav-icon-link svg {
  width: 26px;
  height: 26px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.auth-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-form {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.lang-label {
  display: inline;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 600px) {
  .lang-label {
    display: none;
  }
}

.lang-select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 24px 6px 8px;
  min-width: 60px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 10px) calc(50% - 1px), calc(100% - 5px) calc(50% - 1px);
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

@media (max-width: 600px) {
  .lang-select {
    min-width: 48px;
    padding-right: 20px;
    font-size: 0.72rem;
  }
}

.lang-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(42, 127, 255, 0.15);
}

.brand-text {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text);
  margin-left: 8px;
}


.header-btn {
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.header-btn.btn-outline {
  border: 1px solid var(--line) !important;
  color: var(--text) !important;
}

.header-btn.btn-outline:hover {
  background: var(--bg);
  border-color: var(--accent) !important;
}

.header-btn.btn-ghost {
  border: 1px solid transparent !important;
  color: var(--muted) !important;
}

.header-btn.btn-ghost:hover {
  background: var(--bg);
  color: var(--text) !important;
}

.topbar .dropdown-trigger {
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  min-height: 42px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 12px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.topbar .dropdown-trigger:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.topbar .dropdown-trigger .dropdown-arrow {
  margin-left: 4px;
  opacity: 0.5;
  transition: transform 0.2s ease;
}

.topbar .dropdown.is-open .dropdown-trigger .dropdown-arrow {
  transform: rotate(180deg);
}

.theme-toggle-btn {
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  color: var(--accent);
  background: var(--surface);
  border-color: var(--accent);
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.lang-btn:hover,
.lang-dropdown.is-open .lang-btn {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--accent);
}

.lang-current {
  letter-spacing: 0.04em;
}

.lang-svg {
  opacity: 0.82;
}

body:not(.light-theme) .logo-img {
  filter: brightness(0) invert(1);
}

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .site-shell {
    padding: 16px 12px 32px;
  }

  .topbar-container {
    padding: 0 12px;
  }

  .topbar-right {
    gap: 4px;
  }

  .brand {
    gap: 6px;
  }

  .logo-img {
    height: 40px;
  }

  .nav-links {
    display: none;
  }

  .auth-block {
    gap: 4px;
    align-items: center;
  }

  .lang-form {
    padding: 2px;
  }

  .lang-select {
    min-width: 42px;
    padding: 0 16px 0 4px;
    font-size: 0.7rem;
    height: 28px;
  }

  .lang-label {
    display: none;
  }

  .header-btn,
  .auth-buttons .btn {
    padding: 5px 8px;
    font-size: 0.72rem;
    white-space: nowrap;
    min-width: fit-content;
  }

  .auth-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
  }

  .status-bar-wrapper {
    flex-direction: column;
    gap: 12px;
    padding: 12px 0;
    align-items: stretch;
    background: transparent;
    border: none;
  }

  .status-bar {
    padding: 0 12px;
    font-size: 0.88rem;
    text-align: center;
  }

  .status-bar-controls {
    justify-content: center;
  }

  .date-strip {
    display: flex;
    overflow-x: auto;
    padding: 4px 12px 12px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .date-strip::-webkit-scrollbar {
    display: none;
  }

  .date-strip-item {
    flex: 0 0 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 0;
    color: var(--muted);
    transition: all 0.2s;
    cursor: pointer;
    font-family: inherit;
  }

  .date-strip-item span {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
  }

  .date-strip-item strong {
    font-size: 1.05rem;
    font-weight: 800;
  }

  .date-strip-item.active {
    background: var(--accent-2);
    border-color: var(--accent-2);
    color: #fff;
    box-shadow: 0 4px 10px rgba(49, 130, 206, 0.4);
  }

  .status-date-input {
    display: none;
  }

  .widget-strip {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 4px;
  }

  .widget-card {
    padding: 14px 12px;
  }

  .widget-card h3 {
    font-size: 0.72rem;
    margin-bottom: 6px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .widget-card p {
    font-size: 0.9rem;
    font-weight: 700;
  }

  .widget-card:nth-child(3) {
    grid-column: span 2;
  }

  .fixtures-grid {
    gap: 12px;
  }

  .competition-section {
    padding: 12px;
  }

  .fixture-row {
    grid-template-columns: 50px minmax(0, 1fr) 85px 80px;
    gap: 8px;
    padding: 10px 8px;
    align-items: center;
  }

  .fixture-row-time {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
  }

  .fixture-row-teams {
    gap: 4px;
  }

  .team-name {
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .fixture-row-pick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    line-height: 1.1;
  }

  .pick-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--accent-2);
  }

  .pick-val {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text);
  }

  .fixture-row-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
  }

  .fixture-score {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--accent);
  }

  .fixture-status {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
  }

  .competition-title {
    font-size: 0.85rem;
  }
}

/* --- Team Page Custom Styles --- */
.team-hero {
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg-2) 100%);
    padding: 40px 30px;
}

.team-header-content {
    display: flex;
    align-items: center;
    gap: 24px;
}

.team-logo-container {
    width: 100px;
    height: 100px;
    background: #fff;
    padding: 10px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

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

.team-info-header h1 {
    font-size: 2.2rem;
    margin: 0 0 10px 0;
}

.team-subtitle {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.95rem;
}

.team-meta-badges {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.team-hero-metrics {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    max-width: 820px;
}

.hero-metric {
    background: color-mix(in srgb, var(--surface-2) 82%, transparent);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    min-width: 0;
}

.hero-metric .label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.hero-metric strong {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge {
    background: var(--surface-2);
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
}

.flag-mini {
    width: 20px;
    height: auto;
    border-radius: 2px;
}

.team-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.team-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.info-pair {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
}

.info-pair span {
    display: block;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 6px;
}

.info-pair strong {
    display: block;
    font-size: 0.98rem;
    color: var(--text);
}

.info-pair--wide {
    grid-column: 1 / -1;
}

.manager-card-content {
    padding: 10px 0;
}

.manager-name {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent);
}

.manager-stats {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 700;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
}

.rank-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent-2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 900;
    flex-shrink: 0;
}

.standing-card {
    display: flex;
    gap: 20px;
    align-items: center;
}

.standing-pts {
    color: var(--accent);
    font-weight: 800;
}

.form-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.form-pill {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--text);
}

.form-pill.is-win {
    background: rgba(26, 171, 120, 0.16);
    color: #45e4a7;
    border-color: rgba(26, 171, 120, 0.32);
}

.form-pill.is-loss {
    background: rgba(255, 94, 111, 0.14);
    color: #ff8393;
    border-color: rgba(255, 94, 111, 0.28);
}

.form-pill.is-draw {
    background: rgba(255, 193, 7, 0.14);
    color: #ffd86b;
    border-color: rgba(255, 193, 7, 0.25);
}

.form-match-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tm-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tm-stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.tm-stat.highlight .val {
    color: var(--gold);
    font-weight: 800;
}

.fixtures-vertical-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fixture-mini-row {
    display: grid;
    grid-template-columns: 80px 1fr 100px 120px;
    padding: 12px 16px;
    background: var(--bg-2);
    align-items: center;
    border-radius: 8px;
    font-size: 0.9rem;
    border-left: 4px solid transparent;
}

.fixture-mini-row.won { border-left-color: var(--accent); }
.fixture-mini-row.lost { border-left-color: var(--danger); }
.fixture-mini-row.draw { border-left-color: var(--gold); }

.fixture-mini-row .opp { font-weight: 700; }
.fixture-mini-row .score { font-weight: 800; text-align: center; color: var(--accent); }
.fixture-mini-row .league-tag { font-size: 0.75rem; color: var(--muted); text-align: right; }

.competition-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.competition-chip {
    display: inline-flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 999px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 700;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.schedule-box {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
}

.schedule-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.schedule-opponent {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

.schedule-time,
.schedule-meta {
    font-size: 0.88rem;
    color: var(--muted);
}

.injury-card {
    padding: 10px;
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px solid var(--line);
    margin-bottom: 8px;
}

.p-name { font-weight: 800; color: var(--danger); }
.p-reason { font-size: 0.85rem; padding: 4px 0; }
.p-return { font-size: 0.75rem; color: var(--muted); }

.metrics-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.metric-block {
    background: var(--bg-2);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--line);
    text-align: center;
}

.metric-block label {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 8px;
}

.metric-block .val {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--accent);
}

.metric-block .sub {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
}

.top-squad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.status-bar-wrapper {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 16px;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin-top: 32px !important;
  margin-bottom: 24px !important;
  width: 100% !important;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 900px) {
  .status-bar-wrapper {
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px;
  }

  .team-header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .team-hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .schedule-grid,
  .team-info-grid {
    grid-template-columns: 1fr;
  }

  .fixture-mini-row {
    grid-template-columns: 70px 1fr;
    gap: 6px 12px;
  }

  .fixture-mini-row .score,
  .fixture-mini-row .league-tag {
    text-align: left;
  }
}

.date-strip {
  display: flex;
  gap: 6px;
  background: color-mix(in srgb, var(--surface) 50%, transparent);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  overflow-x: auto;
  scrollbar-width: none;
  max-width: fit-content;
  margin: 0 auto;
}

.date-strip::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.date-strip-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 56px;
  height: 62px;
  background: transparent !important;
  border: 1.5px solid transparent !important;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--muted);
}

.date-strip-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text);
  transform: translateY(-2px);
}

.date-strip-item span {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.date-strip-item strong {
  font-size: 1.05rem;
  font-weight: 800;
}

.date-strip-item.active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 4px 15px rgba(42, 127, 255, 0.4);
}

body.light-theme .date-strip-item.active {
  background: var(--accent) !important;
  box-shadow: 0 4px 15px rgba(42, 127, 255, 0.25);
}

.status-bar {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.status-bar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-date-input {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
}

.status-date-input:focus {
  outline: none;
  border-color: var(--accent);
}

.hero {
  display: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.nav-links a:hover {
  color: var(--text);
}

.auth-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(42, 127, 255, 0.2);
  color: #c9dcff;
  font-weight: 700;
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  padding: 9px 13px;
  font-size: 0.88rem;
  text-decoration: none;
  transition: transform .15s ease, filter .15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: var(--accent-2);
}

.btn-ghost {
  color: #d5e4ff;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.hero {
  margin-top: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.hero h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 2rem;
}

.hero p {
  color: var(--muted);
  margin: 6px 0 0;
}

.hero.compact h1 {
  font-size: 1.7rem;
}

.hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.hero-actions input {
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0d1d33;
  color: var(--text);
  padding: 0 10px;
}

.status-bar {
  margin-top: 14px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-weight: 600;
}

.widget-strip {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.widget-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.widget-card h3 {
  margin: 0 0 8px;
  font-size: 0.84rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.widget-card p {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
}

.ad-slot {
  min-height: 92px;
}

.fixtures-grid {
  margin-top: 16px;
  display: grid;
  gap: 16px;
}

.competition-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.competition-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #cfe3ff;
  letter-spacing: 0.02em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
  user-select: none;
}

.competition-title:hover {
  background: rgba(255, 255, 255, 0.03);
}

.competition-title-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.league-toggle {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.competition-section.is-collapsed .league-toggle {
  transform: rotate(-90deg);
}

.competition-section.is-collapsed .competition-list {
  display: none;
}

.competition-country {
  color: #95baf0;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.competition-name {
  color: #e8f2ff;
  font-weight: 800;
}

.competition-count {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.competition-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.fixture-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 130px 95px;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.fixture-row:hover {
  background: rgba(42, 127, 255, 0.08);
}

.fixture-row:last-child {
  border-bottom: 0;
}

.fixture-row-time {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}

.fixture-row-teams {
  font-size: 0.88rem;
  font-weight: 700;
}

.fixture-row-pick {
  font-size: 0.78rem;
  color: var(--muted);
}

.fixture-row-status {
  text-align: right;
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: capitalize;
}

.live-dot {
  color: #80f0b5;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.fixture-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
  cursor: pointer;
}

.fixture-card:hover {
  transform: translateY(-2px);
  border-color: #2d5b95;
}

.fixture-card:focus {
  outline: 2px solid #2a7fff;
  outline-offset: 2px;
}

.fixture-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.league-pill {
  background: rgba(42, 127, 255, 0.2);
  color: #cce0ff;
  border: 1px solid rgba(94, 151, 255, 0.4);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: capitalize;
}

.teams {
  margin: 12px 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.teams div+div {
  margin-top: 6px;
}

.scoreline {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold);
}

.prob-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.prob-item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 8px;
  text-align: center;
}

.prob-item strong {
  display: block;
  font-size: 1rem;
}

.prob-item span {
  color: var(--muted);
  font-size: 0.74rem;
}

.pred-foot {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.pred-main {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
}

.edge-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.edge-list li {
  padding: 6px 8px;
  font-size: 0.8rem;
  border: 1px solid rgba(0, 212, 167, 0.22);
  background: rgba(0, 212, 167, 0.07);
  border-radius: 8px;
  margin-bottom: 6px;
}

.pick-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.pick-row button {
  flex: 1;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  padding: 16px;
}

.metric p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: .82rem;
}

.metric strong {
  font-size: 1.32rem;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #0f1d34;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap th,
.table-wrap td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  font-size: .86rem;
  text-align: left;
}

.table-wrap th {
  background: #132846;
  color: #d7e6ff;
}

.hit {
  color: #39da8a;
  font-weight: 800;
}

.miss {
  color: var(--danger);
  font-weight: 800;
}

.auth-panel {
  margin: 30px auto;
  max-width: 430px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form label {
  display: grid;
  gap: 5px;
  font-size: .83rem;
  font-weight: 700;
  color: #d4e2fb;
}

.auth-form input {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0c1930;
  color: var(--text);
  padding: 10px;
}

.flash-wrap {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.flash {
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
}

.flash-success {
  background: rgba(57, 218, 138, 0.15);
  color: #8df0bd;
}

.flash-danger {
  background: rgba(255, 95, 109, 0.17);
  color: #ffb1b7;
}

.flash-info {
  background: rgba(42, 127, 255, 0.17);
  color: #b6d2ff;
}

.match-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 16px;
  margin-top: 14px;
}

.match-main-panel,
.match-side-panel {
  display: grid;
  gap: 16px;
}

.match-main-panel {
  align-content: start;
}

.widget-card.large {
  padding: 16px;
}

.match-tabbar {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 20px;
}

.tabs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab-btn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 99px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.tab-btn:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--muted);
}

.tab-btn.active {
  color: #fff;
  background: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
}

.tab-panel.active {
  animation: fadeIn 0.3s ease-out;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 20px;
}

.player-subtabbar {
  margin-bottom: 12px;
}

.player-subpanel {
  display: none;
  gap: 12px;
}

.player-subpanel.active {
  display: grid;
}

.team-subtabbar {
  margin-bottom: 10px;
}

.team-subpanel {
  display: none;
}

.team-subpanel.active {
  display: block;
}

.history-subpanel {
  display: none;
}

.history-subpanel.active {
  display: block;
}

.history-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(10, 25, 44, 0.55);
  max-height: 560px;
  overflow-y: auto;
}

.history-comp-header {
  padding: 10px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
}

.history-row {
  display: grid;
  grid-template-columns: 80px 1fr 50px 30px;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  transition: background 0.2s ease;
}

.history-row.h2h-row {
  grid-template-columns: 80px 1fr;
}

.history-h2h-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.history-team-h2h {
  flex: 1;
  font-size: 0.93rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-team-h2h-home {
  text-align: right;
  color: #ebf4ff;
}

.history-team-h2h-away {
  text-align: left;
  color: #c9d9f5;
}

.history-score-h2h {
  font-weight: 800;
  color: var(--text);
  background: rgba(45, 55, 72, 0.7);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.history-row:last-child {
  border-bottom: 0;
}

.history-row:hover {
  background: rgba(35, 74, 122, 0.2);
}

.history-time {
  color: #c8d8f5;
  font-size: 0.79rem;
  font-weight: 700;
}

.history-match {
  min-width: 0;
}

.history-team {
  color: #ebf4ff;
  font-size: 0.93rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-team-away {
  color: #c9d9f5;
  font-weight: 600;
}

.history-score {
  color: #d9e9ff;
  font-weight: 800;
  text-align: right;
}


.history-result {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  justify-self: end;
}

.history-result-win {
  background: rgba(57, 218, 138, 0.2);
  color: #81efb8;
  border: 1px solid rgba(57, 218, 138, 0.5);
}

.history-result-loss {
  background: rgba(255, 95, 109, 0.2);
  color: #ffb0b8;
  border: 1px solid rgba(255, 95, 109, 0.45);
}

.history-result-draw {
  background: rgba(255, 207, 90, 0.2);
  color: #ffdf9d;
  border: 1px solid rgba(255, 207, 90, 0.45);
}

.history-result-pending {
  background: rgba(150, 170, 200, 0.18);
  color: #cfe0ff;
  border: 1px solid rgba(150, 170, 200, 0.35);
}

.history-row-click {
  cursor: pointer;
}

.history-inspect-btn {
  padding: 6px 10px;
  font-size: 0.76rem;
}

.history-link {
  color: #d8e9ff;
  text-decoration: none;
  font-weight: 700;
}

.history-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.player-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.action-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(42, 127, 255, 0.08);
  margin-bottom: 8px;
}

.action-main {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}

.action-meta {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 4px;
}

.lineup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.lineup-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(42, 127, 255, 0.08);
  padding: 10px;
}

.streak-block {
  background: linear-gradient(160deg, rgba(24, 46, 76, 0.78), rgba(12, 28, 50, 0.9));
}

.lineup-title {
  color: #cfe1ff;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

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

.lineup-row:last-child {
  border-bottom: 0;
}

.lineup-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.lineup-player-with-face {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lineup-player-with-face img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: contain;
  border: 1.5px solid rgba(219, 232, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.streak-board {
  display: grid;
  gap: 8px;
}

.streak-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(60, 94, 138, 0.6);
  border-radius: 10px;
  background: rgba(11, 27, 48, 0.88);
}

.streak-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dce9ff;
  font-size: 0.92rem;
  font-weight: 600;
}

.streak-side {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(56, 112, 189, 0.75);
  background: rgba(42, 127, 255, 0.18);
  color: #a4c9ff;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.streak-value {
  color: #9df8df;
  font-weight: 800;
  font-size: 0.96rem;
}

.pitch {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  padding: 16px;
}

.pitch-half-label {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  margin-bottom: 8px;
}

.pitch-gk,
.pitch-line {
  display: grid;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pitch-gk {
  grid-template-columns: repeat(1, minmax(0, 78px));
}

.pitch-line {
  grid-template-columns: repeat(var(--line-count, 4), minmax(0, 78px));
  align-items: start;
}

.pitch-player {
  width: 100%;
  text-align: center;
}

.pitch-face-wrap {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  margin: 0 auto 4px;
  overflow: hidden;
  border: 1.5px solid rgba(219, 232, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pitch-face {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pitch-name {
  font-size: 0.72rem;
  color: #dce9ff;
  line-height: 1.25;
}

.leaders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.leader-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(32, 216, 180, 0.08);
  padding: 8px;
}

.leader-title {
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
}

.leader-name {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 4px 0;
}

.leader-val {
  font-size: 0.88rem;
  color: #78f4d8;
  font-weight: 800;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.market-cell {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(42, 127, 255, 0.08);
  padding: 10px;
  text-align: center;
}

.market-cell strong {
  display: block;
  font-size: 0.98rem;
}

.market-cell span {
  font-size: 0.75rem;
  color: var(--muted);
}

.scoreline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
}

.scoreline-cell {
  border: 1px solid rgba(0, 212, 167, 0.25);
  background: rgba(0, 212, 167, 0.08);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.form-seq {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.form-pill {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.72rem;
}

.form-w {
  background: rgba(57, 218, 138, 0.2);
  color: #7bf0b2;
  border: 1px solid rgba(57, 218, 138, 0.4);
}

.form-d {
  background: rgba(255, 207, 90, 0.2);
  color: #ffdd8b;
  border: 1px solid rgba(255, 207, 90, 0.4);
}

.form-l {
  background: rgba(255, 95, 109, 0.2);
  color: #ffb1b7;
  border: 1px solid rgba(255, 95, 109, 0.4);
}

.form-avg {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.player-row:last-child {
  border-bottom: 0;
}

.muted {
  color: var(--muted);
  font-size: 0.82rem;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(44, 78, 126, 0.55);
  border-radius: 8px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(210, 232, 255, 0.42), transparent);
  animation: shimmer 1.05s linear infinite;
}

.skeleton-line {
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-line:last-child {
  margin-bottom: 0;
}

.skeleton-pill {
  height: 52px;
  border-radius: 10px;
}

.skeleton-line.lg {
  height: 16px;
}

.skeleton-line.xl {
  height: 22px;
}

.skeleton-w-20 {
  width: 20%;
}

.skeleton-w-30 {
  width: 30%;
}

.skeleton-w-40 {
  width: 40%;
}

.skeleton-w-50 {
  width: 50%;
}

.skeleton-w-60 {
  width: 60%;
}

.skeleton-w-70 {
  width: 70%;
}

.skeleton-w-80 {
  width: 80%;
}

.skeleton-w-90 {
  width: 90%;
}

.skeleton-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(42, 127, 255, 0.06);
}

.skeleton-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 130px 95px;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.skeleton-row:last-child {
  border-bottom: 0;
}

.skeleton-stack {
  display: grid;
  gap: 8px;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.comp-title {
  font-weight: 800;
  margin-bottom: 8px;
}

.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  color: #e4eeff;
}

.comp-table th,
.comp-table td {
  border-bottom: 1px solid rgba(43, 74, 118, 0.72);
  padding: 8px 8px;
  text-align: left;
}

.comp-table th {
  color: #cfe1ff;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: rgba(22, 45, 74, 0.78);
  position: sticky;
  top: 0;
  z-index: 1;
}

.comp-table tbody tr:nth-child(odd) td {
  background: rgba(20, 40, 67, 0.24);
}

.comp-table tbody tr:hover td {
  background: rgba(46, 95, 155, 0.2);
}

/* Explicitly disable hover on evaluation match summary rows if they use .comp-table */
#historyTableWrap .history-eval-panel .comp-table tbody tr:hover td {
  background: inherit !important;
}

.table-scroll {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(39, 70, 112, 0.7);
}

.history-table td:nth-child(1) {
  min-width: 110px;
  color: #c6d9f7;
}

.history-table td:nth-child(2) {
  min-width: 170px;
  color: #d9e8ff;
}

.history-table td:nth-child(3) {
  min-width: 280px;
  font-weight: 600;
  color: #f0f6ff;
}

.history-table td:nth-child(4),
.history-table td:nth-child(5) {
  min-width: 62px;
  font-weight: 700;
}

#watchalongWidget a {
  color: #7ec0ff;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.35;
}

#watchalongWidget a:hover {
  color: #b5dcff;
  text-decoration: underline;
}

.comp-controls {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.comp-toggle-btn.active {
  border-color: rgba(0, 212, 167, 0.5);
  color: #8df0db;
}

.cup-round {
  margin-bottom: 10px;
}

.cup-round strong {
  display: block;
  margin-bottom: 5px;
  color: #cfe3ff;
}

.cup-game {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}

@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions input,
  .hero-actions button {
    flex: 1;
  }

  .widget-strip {
    grid-template-columns: 1fr;
  }

  .match-layout {
    grid-template-columns: 1fr;
  }

  .history-row {
    grid-template-columns: 60px 1fr 40px 24px;
    padding: 10px;
    gap: 8px;
  }

  .history-row.h2h-row {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 6px;
  }

  .history-row.h2h-row .history-time {
    display: flex;
    justify-content: center;
    gap: 8px;
  }

  .history-team-h2h {
    font-size: 0.85rem;
  }

  .history-score-h2h {
    padding: 2px 8px;
  }

  .history-team {
    font-size: 0.84rem;
  }
}


@keyframes pageFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Theme + sticky header + motion polish */
/* Conflicting root variables removed to allow top priorities */

/* Redundant block removed */

body.light-theme {
  background-color: var(--bg);
}

body.light-theme {
  background-color: var(--bg);
}

/* Light theme topbar overrides removed */

body.light-theme .brand-text {
  color: var(--text);
}

body.light-theme .nav-links a {
  color: var(--muted);
}

body.light-theme .nav-links a:hover {
  color: var(--text);
  background: rgba(42, 127, 255, 0.08);
}

body.light-theme .user-chip {
  background: #e8f1ff;
  color: #193a67;
}

body.light-theme .hero {
  background: linear-gradient(145deg, #ffffff, #f6fbff);
  border-color: #d8e8ff;
}

body.light-theme .hero h1 {
  color: #102444;
}

body.light-theme .hero p {
  color: #496180;
}

body.light-theme .status-bar {
  color: #19395f;
  background: linear-gradient(145deg, #e8f4ff, #dff0ff);
  border-color: #c4dcfb;
}

body.light-theme .widget-card,
body.light-theme .fixture-card,
body.light-theme .competition-section,
body.light-theme .table-wrap,
body.light-theme .metric,
body.light-theme .auth-panel {
  background: var(--surface);
  border-color: var(--line);
}

body.light-theme .widget-card h3,
body.light-theme .competition-country,
body.light-theme .competition-count,
body.light-theme .status-pill,
body.light-theme .muted,
body.light-theme .form-avg {
  color: #5b7393;
}

body.light-theme .widget-card p,
body.light-theme .competition-title,
body.light-theme .competition-name,
body.light-theme .teams,
body.light-theme .fixture-row-teams,
body.light-theme .lineup-title,
body.light-theme .leader-name,
body.light-theme .comp-title,
body.light-theme .history-team {
  color: #132a4d;
}

body.light-theme .fixture-row {
  border-bottom-color: #d9e8ff;
}

body.light-theme .competition-list {
  background: #fbfdff;
  border-color: #d7e6fb;
}

body.light-theme .fixture-row:hover {
  background: rgba(42, 127, 255, 0.08);
}

body.light-theme .fixture-row-time,
body.light-theme .fixture-row-pick,
body.light-theme .fixture-row-status,
body.light-theme .history-time,
body.light-theme .history-team-away {
  color: #5a7394;
}

body.light-theme .prob-item,
body.light-theme .market-cell,
body.light-theme .scoreline-cell,
body.light-theme .lineup-block,
body.light-theme .leader-card,
body.light-theme .streak-item,
body.light-theme .table-scroll {
  background: #f6fbff;
  border-color: #d7e7ff;
}

body.light-theme .prob-item strong,
body.light-theme .market-cell strong,
body.light-theme .scoreline-cell strong,
body.light-theme .streak-label,
body.light-theme .history-score {
  color: #153561;
}

body.light-theme .prob-item span,
body.light-theme .market-cell span {
  color: #5f7697;
}

body.light-theme .comp-table {
  color: #16355d;
}

body.light-theme .comp-table th {
  color: #24466f;
  background: #edf5ff;
  border-bottom-color: #cfe0fa;
}

body.light-theme .comp-table td {
  border-bottom-color: #dce9fd;
}

body.light-theme .comp-table tbody tr:nth-child(odd) td {
  background: #f7fbff;
}

body.light-theme .comp-table tbody tr:hover td {
  background: #ebf4ff;
}

body.light-theme .history-list {
  background: #fbfdff;
  border-color: #d7e7ff;
}

body.light-theme .history-comp-header {
  color: #486482;
  background: #f0f6ff;
  border-bottom-color: #d8e8ff;
}

body.light-theme .history-row {
  border-bottom-color: #dce9fe;
}

body.light-theme .history-row:hover {
  background: #f0f6ff;
}

body.light-theme #watchalongWidget a {
  color: #1e62b8;
}

body.light-theme #watchalongWidget a:hover {
  color: #0f4f9f;
}

body.light-theme .brand-mark,
body.light-theme .btn-primary {
  color: #ffffff;
  background: var(--accent-2);
}

body.light-theme h1,
body.light-theme h2,
body.light-theme h3 {
  color: var(--text);
}

body.light-theme .flash-danger {
  color: #8f1f30;
}

body.light-theme .hit {
  color: #0f9d63;
}

body.light-theme .miss {
  color: #c9344c;
}

/* Missing Light Mode Fixes - Overhauled */
body.light-theme .history-link {
  color: var(--accent-2);
  font-weight: 600;
}

body.light-theme .history-link:hover {
  text-decoration: underline;
}

body.light-theme .table-wrap {
  background: var(--surface);
  border-color: var(--line);
}

body.light-theme .table-wrap th {
  background: var(--bg-2);
  color: var(--text);
  border-bottom-color: var(--line);
}

body.light-theme .table-wrap td {
  border-bottom-color: var(--line);
  color: var(--text);
}

body.light-theme .auth-form input,
body.light-theme .hero-actions input {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

body.light-theme .auth-form label {
  color: var(--text);
}

body.light-theme .fixture-row-time,
body.light-theme .fixture-row-pick,
body.light-theme .fixture-row-status {
  color: #5b7496;
}

body.light-theme .fixture-row-teams {
  color: #0c1930;
}

body.light-theme .competition-title {
  color: #1a3a69;
}

body.light-theme .competition-country {
  color: #4a678e;
}

/* Higher specificity for history table to override generic table-wrap */
body.light-theme .history-table td:nth-child(1) {
  color: #4b6282 !important;
}

body.light-theme .history-table .history-link {
  color: #1e62b8 !important;
}

body.light-theme .history-table .history-link:hover {
  color: #0c4284 !important;
}

body.light-theme .history-table td:nth-child(3) {
  color: #16355d !important;
}

body.light-theme .history-table td:nth-child(4),
body.light-theme .history-table td:nth-child(6) {
  color: #3a547e !important;
}

body.light-theme .history-inspect-btn {
  color: #1e62b8 !important;
  border-color: #bfd4f4 !important;
}

/* Consolidated Topbar handled at start of file */

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  transition: color .18s ease, background-color .18s ease;
}

.nav-links a:hover {
  background: rgba(70, 160, 255, 0.12);
}

.nav-ico {
  font-size: 0.85rem;
  opacity: 0.95;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.theme-ico {
  font-size: 0.88rem;
}

body.light-theme .theme-ico-moon {
  display: none;
}

body:not(.light-theme) .theme-ico-sun {
  display: none;
}

.hero,
.competition-section,
.fixture-card,
.widget-card,
.table-wrap,
.auth-panel,
.metric,
.leader-card,
.market-cell,
.scoreline-cell {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Removed hover transformations from static containers to improve usability */
.fixture-row {
  transition: background-color 0.2s ease;
}

.fixture-row:hover,
.history-table tr:hover td {
  background: rgba(49, 130, 206, 0.1) !important;
}

.btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.nav-links a {
  transition: all 0.2s ease;
}

.nav-links a:hover {
  color: var(--accent);
  transform: scale(1.05);
}

.tab-btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

main>* {
  animation: fadeSlide .28s ease-out;
}

/* Dropdown Styles */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  background: transparent;
  /* Changed from var(--surface) */
  color: var(--text);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.dropdown-trigger:hover,
.dropdown:hover .dropdown-trigger {
  background: var(--bg-2);
  border-color: var(--accent);
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  min-width: 220px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  border: 1px solid var(--line);
  z-index: 1000;
  overflow: hidden;
  animation: fadeSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown:not(.js-dropdown):hover .dropdown-menu {
  display: block;
}

.dropdown-menu-header {
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.dropdown-item {
  display: block;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s;
  font-size: 0.95rem;
  font-weight: 500;
}

.dropdown-item:hover {
  background: var(--bg);
  color: var(--accent);
}

.dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.btn-logout-dropdown {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 16px;
  color: #ff4757;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-logout-dropdown:hover {
  background: rgba(255, 71, 87, 0.1);
}

@keyframes fadeSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.light-theme .dropdown-menu {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body.light-theme .dropdown-menu-header {
  background: #f0f6ff;
  border-bottom-color: #dce9fe;
}

/* Footer Styles */
.site-footer {
  margin-top: auto;
  padding: 40px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-brand-block {
  max-width: 520px;
}

.footer-kicker {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-copyright {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 8px;
}

.footer-summary {
  margin: 0;
  line-height: 1.6;
}

.footer-link-groups {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 24px 36px;
  max-width: 460px;
}

.footer-link-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 140px;
}

.footer-link-heading {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-content a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.content-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.content-page-hero {
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--bg-2) 88%, transparent));
  margin-bottom: 24px;
}

.content-page-eyebrow {
  margin: 0 0 10px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.content-page h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.08;
}

.content-page-intro {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1rem;
}

.content-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.95fr);
  gap: 24px;
  align-items: start;
}

.content-page-main,
.content-side-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.content-page-main {
  padding: 28px 30px;
}

.content-side-card {
  padding: 24px;
}

.content-section + .content-section {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.content-section h2,
.content-side-card h2 {
  margin: 0 0 12px;
  font-size: 1.12rem;
  color: var(--text);
}

.content-section p,
.content-side-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.content-section p + p {
  margin-top: 14px;
}

.content-bullet-list,
.content-side-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.content-bullet-list li + li,
.content-side-list li + li {
  margin-top: 10px;
}

/* Logo Visibility Fix for Dark Mode */
/* Logo Visibility handled in main section */
.brand-text {
  font-family: inherit;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

@media (max-width: 768px) {

  /* Responsive Bottom-section tweaks */
  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    gap: 12px;
  }

  .hero-actions input,
  .hero-actions button {
    width: 100%;
  }

  .footer-content {
    flex-direction: column;
    gap: 18px;
    text-align: center;
    align-items: stretch;
  }

  .footer-brand-block {
    max-width: none;
  }

  .footer-link-groups {
    justify-content: center;
    max-width: none;
  }

  .footer-link-group {
    align-items: center;
    min-width: 120px;
  }

  .content-page {
    padding: 20px 12px 48px;
  }

  .content-page-hero,
  .content-page-main,
  .content-side-card {
    padding: 22px 18px;
    border-radius: 18px;
  }

  .content-page-grid {
    grid-template-columns: 1fr;
  }
}

/* Settings Page Styles */
.settings-group h3 {
  color: var(--text);
  margin-bottom: 12px;
  font-size: 1.1rem;
  font-weight: 600;
}

.settings-group p,
.settings-group li {
  color: var(--muted);
}

/* -------------------------------------------------------------------------- */
/*                          ULTIMATE MOBILE OVERRIDES                         */
/* -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .site-shell {
    padding: 8px 8px 40px !important;
  }

  .topbar {
    padding: 0 4px !important;
  }

  .topbar-container {
    padding: 0 8px !important;
  }

  .brand-text {
    display: none !important;
  }

  .logo-img {
    height: 32px !important;
    width: auto !important;
  }

  .nav-links {
    display: none !important;
  }

  .topbar-right {
    gap: 4px !important;
  }

  .auth-block {
    gap: 4px !important;
  }

  .lang-select {
    min-width: 44px !important;
    padding: 0 14px 0 4px !important;
    font-size: 0.68rem !important;
    height: 28px !important;
    border-radius: 6px !important;
  }

  .header-btn {
    padding: 5px 8px !important;
    font-size: 0.72rem !important;
    height: 32px !important;
    display: flex;
    align-items: center;
  }

  .status-bar-wrapper {
    flex-direction: column !important;
    gap: 12px !important;
    padding: 12px 0 8px !important;
    margin-bottom: 16px !important;
    background: transparent !important;
    border: none !important;
  }

  .status-bar {
    font-size: 0.82rem !important;
    padding: 0 10px !important;
    text-align: center !important;
    color: var(--muted) !important;
  }

  .status-bar-controls {
    width: 100% !important;
    overflow: hidden !important;
    display: block !important;
  }

  .date-strip {
    display: flex !important;
    overflow-x: auto !important;
    padding: 4px 10px 10px !important;
    gap: 10px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }

  .date-strip::-webkit-scrollbar {
    display: none;
  }

  .date-strip-item {
    flex: 0 0 52px !important;
    padding: 8px 0 !important;
    border-radius: 10px !important;
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    color: var(--muted) !important;
    font-family: inherit !important;
  }

  .date-strip-item span {
    font-size: 0.65rem !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
  }

  .date-strip-item strong {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
  }

  .date-strip-item.active {
    background: var(--accent-2) !important;
    border-color: var(--accent-2) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(49, 130, 206, 0.4) !important;
  }

  .widget-strip {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 0 !important;
    margin-bottom: 16px !important;
  }

  .widget-card {
    padding: 12px 10px !important;
  }

  .widget-card h3 {
    font-size: 0.65rem !important;
    margin-bottom: 4px !important;
    color: var(--muted) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
  }

  .widget-card p {
    font-size: 0.85rem !important;
    font-weight: 800 !important;
  }

  .widget-card:nth-child(3) {
    grid-column: span 2 !important;
  }

  .competition-section {
    padding: 0 !important;
    margin-bottom: 20px !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--line) !important;
    border-radius: 0 !important;
  }

  .competition-title {
    padding: 10px 8px 6px !important;
    font-size: 0.8rem !important;
    background: var(--bg) !important;
    border-bottom: 1px solid var(--line) !important;
  }

  .competition-list {
    background: var(--surface) !important;
  }

  .fixture-row {
    grid-template-columns: 48px minmax(0, 1fr) 80px 72px !important;
    gap: 8px !important;
    padding: 12px 8px !important;
    align-items: center !important;
    border-bottom: 1px solid var(--line) !important;
    display: grid !important;
  }

  .fixture-row:last-child {
    border-bottom: none !important;
  }

  .fixture-row-time {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: var(--muted) !important;
  }

  .fixture-row-teams {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    overflow: hidden !important;
    text-align: left !important;
  }

  .team-name {
    display: block !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: var(--text) !important;
    text-align: left !important;
  }

  .fixture-row-pick {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 2px !important;
    line-height: 1.1 !important;
  }

  .pick-label {
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    color: var(--accent-2) !important;
  }

  .pick-val {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    color: var(--text) !important;
  }

  .fixture-row-status {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    text-align: right !important;
    gap: 2px !important;
  }

  .fixture-score {
    font-weight: 800 !important;
    font-size: 0.9rem !important;
    color: var(--accent) !important;
    letter-spacing: 0.05em !important;
  }

  .fixture-status {
    font-size: 0.62rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: var(--muted) !important;
  }

  .hero.compact {
    padding: 20px 12px !important;
    margin-bottom: 12px !important;
  }

  .match-tabbar {
    margin-bottom: 16px !important;
  }

  .tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    padding-bottom: 8px !important;
    gap: 8px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 0 0 auto !important;
    padding: 8px 14px !important;
    font-size: 0.75rem !important;
    border-radius: 999px !important;
  }

  .market-grid,
  .leaders-grid,
  .player-actions-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* -------------------------------------------------------------------------- */
/*                          ULTRA-COMPACT MOBILE FIXES                        */
/* -------------------------------------------------------------------------- */

@media (max-width: 600px) {

  /* Reduce Font Sizes Globally on Mobile */
  html {
    font-size: 14px;
    /* Base font reduction */
  }

  /* Header Optimization - More space, less packing */
  .topbar-container {
    padding: 0 4px !important;
    gap: 2px !important;
  }

  .topbar-right {
    gap: 2px !important;
    flex: 1;
    justify-content: flex-end;
  }

  .auth-block {
    gap: 2px !important;
  }

  /* Even smaller language switcher */
  .lang-select {
    min-width: 38px !important;
    padding: 0 10px 0 2px !important;
    font-size: 0.65rem !important;
    background-position: calc(100% - 6px) 50% !important;
    background-size: 3px 3px !important;
  }

  .header-btn {
    padding: 4px 6px !important;
    font-size: 0.68rem !important;
    height: 28px !important;
  }

  /* Theme toggle smaller */
  .theme-toggle-btn {
    padding: 4px !important;
    min-width: 32px !important;
  }

  .theme-toggle-btn svg {
    width: 18px !important;
    height: 18px !important;
  }

  /* Reduce Wasted Space in Body */
  .site-shell {
    padding: 4px 4px 30px !important;
  }

  /* Compact Status Bar */
  .status-bar-wrapper {
    margin-bottom: 8px !important;
    padding-top: 4px !important;
  }

  .status-bar {
    font-size: 0.75rem !important;
    margin-bottom: 4px !important;
  }

  /* Smaller Date Strip */
  .date-strip {
    padding: 2px 4px 8px !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }

  .date-strip-item {
    flex: 0 0 48px !important;
    padding: 6px 0 !important;
    border-radius: 8px !important;
  }

  .date-strip-item span {
    font-size: 0.6rem !important;
  }

  .date-strip-item strong {
    font-size: 0.95rem !important;
  }

  /* Compact Widgets */
  .widget-strip {
    gap: 6px !important;
    margin-bottom: 12px !important;
  }

  .widget-card {
    padding: 10px 8px !important;
  }

  .widget-card h3 {
    font-size: 0.6rem !important;
  }

  .widget-card p {
    font-size: 0.8rem !important;
  }

  /* Ultra-Compact Fixture Rows */
  .competition-title {
    padding: 8px 6px 4px !important;
    font-size: 0.75rem !important;
  }

  .fixture-row {
    grid-template-columns: 42px minmax(0, 1fr) 75px 65px !important;
    padding: 8px 6px !important;
    gap: 4px !important;
  }

  .fixture-row-time {
    font-size: 0.7rem !important;
  }

  .team-name {
    font-size: 0.82rem !important;
    margin-bottom: 2px !important;
  }

  .pick-label {
    font-size: 0.62rem !important;
  }

  .pick-val {
    font-size: 0.68rem !important;
  }

  .fixture-score {
    font-size: 0.85rem !important;
  }

  .fixture-status {
    font-size: 0.58rem !important;
  }

  /* Match Page Tab bar spacing */
  .tabs {
    gap: 6px !important;
    padding: 0 4px 6px !important;
  }

  .tab-btn {
    padding: 6px 12px !important;
    font-size: 0.72rem !important;
  }
}

/* -------------------------------------------------------------------------- */
/*                          ULTRA-COMPACT MOBILE FIXES V2                     */
/* -------------------------------------------------------------------------- */

@media (max-width: 600px) {

  /* Smaller Logo */
  .logo-img {
    height: 24px !important;
  }

  /* Compact topbar wrapper */
  .topbar {
    height: 44px !important;
  }

  /* Extreme compactness for header elements */
  .lang-select {
    min-width: 32px !important;
    height: 24px !important;
    font-size: 0.6rem !important;
  }

  .header-btn {
    height: 24px !important;
    padding: 2px 6px !important;
    font-size: 0.65rem !important;
  }

  /* Reduce space between competition sections */
  .competition-section {
    margin-bottom: 8px !important;
  }

  /* Tighten fixture row height */
  .fixture-row {
    padding: 6px 8px !important;
  }

  /* Smaller text for prediction info */
  .pick-label {
    font-size: 0.6rem !important;
  }

  .pick-val {
    font-size: 0.65rem !important;
  }

  /* Force 2 columns for ALL widgets on mobile */
  .widget-strip {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* -------------------------------------------------------------------------- */
/*                          ULTRA-COMPACT WIDGETS & LIGHT MODE FIX            */
/* -------------------------------------------------------------------------- */

@media (max-width: 768px) {

  /* Reduce gap between widget cards */
  .widget-strip {
    gap: 6px !important;
    margin-bottom: 8px !important;
  }

  .widget-card {
    padding: 10px 8px !important;
  }

  /* Reduce space in match analysis panel */
  .match-layout {
    gap: 12px !important;
  }
}

/* Fix Player Names Visibility in Light Mode */
body.light-theme .pitch-name {
  color: var(--text) !important;
  font-weight: 600 !important;
}

body.light-theme .pitch-face-wrap {
  border-color: var(--line) !important;
}

body.light-theme .pitch {
  background: var(--surface) !important;
}

body.light-theme .streak-item {
  background: var(--surface) !important;
  border-color: var(--line) !important;
}

body.light-theme .streak-label {
  color: var(--text) !important;
}

/* -------------------------------------------------------------------------- */
/*                          ULTRA-COMPACT WIDGETS V2                          */
/* -------------------------------------------------------------------------- */

@media (max-width: 600px) {

  /* Smaller Gap between header and prediction widgets */
  .status-bar-wrapper {
    margin-bottom: 6px !important;
  }
}

/* --- Comprehensive Mobile UI Overhaul --- */

@media (max-width: 640px) {

  /* Global Font Reduction */
  html {
    font-size: 13px;
  }

  body {
    font-size: 0.85rem;
    line-height: 1.3;
  }

  h1 {
    font-size: 1.25rem;
  }

  h2 {
    font-size: 1.1rem;
  }

  h3 {
    font-size: 1rem;
  }

  /* Header optimization */
  .header-container {
    padding: 0.4rem 0.6rem !important;
    height: auto !important;
  }

  .logo-img {
    height: 22px !important;
  }

  .nav-actions {
    gap: 0.4rem !important;
  }

  .nav-btn {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.75rem !important;
  }

  /* Date Strip */
  .date-strip {
    padding: 0.3rem 0 !important;
    margin-bottom: 0.5rem !important;
  }

  .date-item {
    padding: 0.2rem 0.4rem !important;
    min-width: 40px !important;
  }

  .day-name {
    font-size: 0.6rem !important;
  }

  .day-number {
    font-size: 0.9rem !important;
  }

  /* Widgets Spacing */
  .widgets-container {
    gap: 0.5rem !important;
    margin-bottom: 0.8rem !important;
    padding: 0 0.5rem !important;
  }

  .widget-box {
    padding: 0.6rem !important;
  }

  .widget-title {
    font-size: 0.65rem !important;
    margin-bottom: 0.3rem !important;
  }

  .widget-content {
    font-size: 0.8rem !important;
  }

  /* Live Coverage Header */
  .section-header {
    padding: 0.4rem 0.6rem !important;
    margin-bottom: 0.4rem !important;
    font-size: 0.75rem !important;
  }

  /* Fixture Rows */
  .league-header {
    padding: 0.4rem 0.6rem !important;
    font-size: 0.7rem !important;
  }

  .fixture-row {
    padding: 0.5rem !important;
    margin-bottom: 0.25rem !important;
  }

  .time-col {
    width: 45px !important;
    font-size: 0.7rem !important;
  }

  .teams-col {
    padding: 0 0.5rem !important;
  }

  .team-name {
    font-size: 0.85rem !important;
  }

  .prediction-col {
    width: 60px !important;
    font-size: 0.7rem !important;
  }

  .score-col {
    width: 50px !important;
    font-size: 0.85rem !important;
  }

  /* Match Detail Page Header */
  .match-header-compact {
    padding: 1rem 0.5rem !important;
  }

  .match-teams-row {
    gap: 0.5rem !important;
  }

  .match-team-logo {
    width: 40px !important;
    height: 40px !important;
  }

  .match-score-big {
    font-size: 1.8rem !important;
  }

  /* Tabs & Subtabs */
  .tabs-container {
    gap: 0.3rem !important;
    padding: 0.3rem !important;
    margin-bottom: 1rem !important;
  }

  .tab-btn {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.75rem !important;
  }

  .sub-tabs {
    gap: 0.25rem !important;
    margin-bottom: 0.8rem !important;
  }

  .sub-tab-btn {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.7rem !important;
  }

  /* Prediction Cards */
  .prediction-card {
    padding: 0.8rem !important;
    margin-bottom: 0.8rem !important;
  }

  .card-header h4 {
    font-size: 0.9rem !important;
  }

  .confidence-badge {
    font-size: 0.7rem !important;
  }

  /* Settings & Billing */
  .settings-container,
  .billing-container {
    padding: 1rem 0.5rem !important;
  }

  .settings-card {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  .form-group {
    margin-bottom: 0.8rem !important;
  }

  .form-label {
    font-size: 0.8rem !important;
  }

  .form-input {
    padding: 0.5rem !important;
    font-size: 0.85rem !important;
  }
}

/* Light mode player name visibility fix */
body.light-theme .player-name,
body.light-theme .team-name {
  color: #1a1a1a !important;
}

body.light-theme .widget-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

/* --- Mobile UI Polishing Round 2 --- */

@media (max-width: 640px) {

  /* Header optimization - tighter fit */
  .topbar-container {
    padding: 0.25rem 0.4rem !important;
    gap: 0.2rem !important;
  }

  .topbar-right {
    gap: 0.3rem !important;
  }

  #themeToggleBtn {
    padding: 0.2rem !important;
    width: 32px !important;
    height: 32px !important;
  }

  .lang-label {
    display: none !important;
  }

  .lang-select {
    font-size: 0.7rem !important;
    padding: 0.1rem 0.2rem !important;
    width: 45px !important;
  }

  .dropdown-trigger {
    padding: 0.2rem 0.5rem !important;
    font-size: 0.75rem !important;
  }

  /* Match Detail Page - One Column for everything */
  .tab-panel.active {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.8rem !important;
  }

  .lineup-grid,
  .player-actions-grid,
  .market-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.8rem !important;
  }

  .widget-card.large {
    width: 100% !important;
    margin: 0 !important;
  }

  /* Billing Page - One Column plans */
  .billing-plans-container,
  .plans-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .plan-card {
    width: 100% !important;
  }

  /* Horizontal scroll for match tabs if too many */
  .tabs-container,
  .tabs {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
    padding-bottom: 5px !important;
    scrollbar-width: none;
    /* Hide scrollbar for clean look */
  }

  .tabs-container::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 0 0 auto !important;
  }

  /* Settings Page cleanup */
  .settings-container {
    padding: 0.5rem !important;
  }

  .settings-card h3 {
    margin-top: 1rem !important;
  }

  .btn-admin-dashboard {
    width: 100% !important;
    margin-top: 1rem !important;
  }

  /* Ensure text visibility in light mode */
  body.light-theme .text-muted,
  body.light-theme .muted {
    color: #64748b !important;
  }

  body.light-theme .player-name {
    font-weight: 600 !important;
    color: #0f172a !important;
  }
}

/* Fix for the overlapping Preferences & Billing links in settings */
.settings-card .btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* --- FINAL ULTRA-COMPACT MOBILE FIXES --- */

@media (max-width: 600px) {

  /* Layout: Force single column everywhere */
  .market-grid,
  .scoreline-grid,
  .leaders-grid,
  .lineup-grid,
  .player-actions-grid,
  .stats-grid,
  .form-grid,
  .billing-plans-container,
  .plans-grid,
  .overview-grid,
  .match-stats-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  /* Fix the "Probabilities" and "Markets" columns specifically */
  #overviewTab {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Header: Extreme compactness */
  .topbar {
    padding: 0 !important;
  }

  .topbar-container {
    padding: 0.15rem 0.3rem !important;
    height: 48px !important;
  }

  .logo-img {
    height: 18px !important;
    width: auto !important;
  }

  .topbar-right {
    gap: 4px !important;
  }

  #themeToggleBtn,
  .dropdown-trigger {
    transform: scale(0.9) !important;
  }

  .dropdown-trigger {
    max-width: 90px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .lang-select {
    width: 40px !important;
    background-position: right 4px center !important;
  }

  /* Tabs: Netflix-style horizontal scroll */
  .tabs-container,
  .player-subtabbar .tabs,
  .team-subtabbar .tabs {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    padding: 0.5rem 0.2rem !important;
    gap: 0.5rem !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs-container::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 0 0 auto !important;
    padding: 0.35rem 0.75rem !important;
    font-size: 0.7rem !important;
    border-radius: 20px !important;
  }

  /* Cards: Reduce padding */
  .widget-card {
    padding: 0.75rem !important;
    margin-bottom: 0.75rem !important;
    border-radius: 12px !important;
  }

  .widget-card h3 {
    font-size: 0.85rem !important;
    margin-bottom: 0.5rem !important;
  }

  /* Tables: Standardize */
  .comp-table th,
  .comp-table td {
    padding: 0.4rem 0.25rem !important;
    font-size: 0.75rem !important;
  }

  /* Match Detail Hero */
  .match-header-compact h2 {
    font-size: 1.3rem !important;
  }

  .match-meta-compact {
    font-size: 0.65rem !important;
  }
}

/* Fix for the overlapping Preferences & Billing links in settings */
.settings-card .btn-group,
.settings-card .actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
}

/* History page refinements */
#historyTableWrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

#historyTableWrap .history-table-scroll {
  border: 0;
  border-radius: 0;
}

#historyTableWrap .history-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
}

#historyTableWrap .history-table thead th {
  background: var(--surface-2);
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 800;
  padding: 12px 10px;
}

#historyTableWrap .history-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  font-size: 0.88rem;
  color: var(--text);
  vertical-align: middle;
}

#historyTableWrap .history-row-click {
  transition: background-color 0.18s ease;
}

#historyTableWrap .history-row-click:hover {
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
}

#historyTableWrap .history-row-click.is-expanded {
  background: color-mix(in srgb, var(--accent-2) 16%, transparent);
}

#historyTableWrap .history-link {
  color: var(--accent-2);
  font-weight: 700;
}

#historyTableWrap .history-link:hover {
  color: color-mix(in srgb, var(--accent-2) 75%, white);
}

#historyTableWrap .history-inspect-btn {
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent-2) 38%, var(--line));
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 10%, transparent);
  font-weight: 700;
  font-size: 0.76rem;
  padding: 5px 12px;
  line-height: 1.25;
}

#historyTableWrap .history-inspect-btn:hover {
  background: color-mix(in srgb, var(--accent-2) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent-2) 55%, var(--line));
}

#historyTableWrap .history-inspect-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

#historyTableWrap .history-eval-row td {
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
  padding: 0;
}

#historyTableWrap .history-eval-panel {
  padding: 14px;
  border-top: 1px solid var(--line);
}

#historyTableWrap .history-eval-head h3 {
  margin: 0 0 5px;
  font-size: 0.98rem;
}

#historyTableWrap .history-eval-head .muted {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

#historyTableWrap .history-eval-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

/* Keep market-evaluation rows static (no hover flash) */
#historyTableWrap .history-eval-panel .comp-table tbody tr:hover td {
  background: inherit !important;
}

#historyTableWrap .history-eval-panel .comp-table tbody tr:nth-child(odd) td {
  background: rgba(var(--surface-2-rgb), 0.3) !important;
}

#historyTableWrap .history-eval-panel .comp-table tbody tr:nth-child(even) td {
  background: transparent !important;
}

/* Ensure action button remains readable in both themes */
#historyTableWrap .history-eval-actions .btn-ghost {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent-2) 42%, var(--line));
  background: color-mix(in srgb, var(--accent-2) 10%, transparent);
}

#historyTableWrap .history-eval-actions .btn-ghost:hover {
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 18%, transparent);
}

@media (max-width: 900px) {
  #historyTableWrap .history-table {
    min-width: 680px;
  }

  #historyTableWrap .history-table thead th,
  #historyTableWrap .history-table td {
    padding: 10px 8px;
    font-size: 0.8rem;
  }

  #historyTableWrap .history-inspect-btn {
    padding: 4px 10px;
    font-size: 0.72rem;
  }

  #historyTableWrap .history-eval-panel {
    padding: 11px;
  }
}

body.light-theme #historyTableWrap {
  background: var(--surface);
  border-color: #d8e2ef;
}

body.light-theme #historyTableWrap .history-table thead th {
  background: #f2f6fc;
  color: #4f6584;
  border-bottom-color: #d9e3f2;
}

body.light-theme #historyTableWrap .history-table td {
  border-bottom-color: #e3ebf6;
  color: #27384f;
}

body.light-theme #historyTableWrap .history-row-click:hover {
  background: rgba(52, 120, 212, 0.08);
}

body.light-theme #historyTableWrap .history-row-click.is-expanded {
  background: rgba(52, 120, 212, 0.11);
}

body.light-theme #historyTableWrap .history-eval-row td {
  background: #f5f8fd;
}

body.light-theme #historyTableWrap .history-eval-actions .btn-ghost {
  color: #1e62b8;
  border-color: #bcd4f5;
  background: #eef5ff;
}

body.light-theme #historyTableWrap .history-eval-actions .btn-ghost:hover {
  color: #154d95;
  background: #e2efff;
}

/* History page: tighten hero-to-metrics spacing */
.history-hero.hero.compact {
  margin-bottom: 12px;
}

.history-hero,
.history-hero:hover {
  transform: none !important;
  box-shadow: none !important;
  border-color: var(--line) !important;
}

.history-metrics-grid.metrics-grid {
  margin-top: 0;
  margin-bottom: 12px;
}

/* History page: keep market evaluation section static (no hover effects) */
#historyTableWrap .history-eval-row:hover td,
#historyTableWrap .history-eval-panel .comp-table tbody tr:hover td,
body.light-theme #historyTableWrap .history-eval-row:hover td,
body.light-theme #historyTableWrap .history-eval-panel .comp-table tbody tr:hover td {
  background: inherit !important;
  filter: none !important;
  transform: none !important;
}

#historyTableWrap .history-eval-panel .comp-table tbody tr,
body.light-theme #historyTableWrap .history-eval-panel .comp-table tbody tr {
  transition: none !important;
}

.fixtures-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .status-bar-wrapper {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
  }

  .fixtures-toolbar {
    width: 100%;
    justify-content: center;
  }
}

.fixtures-control-search {
  height: 42px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  font-size: 0.9rem;
  width: 200px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.fixtures-control-search:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
  width: 260px;
  box-shadow: 0 0 0 3px rgba(42, 127, 255, 0.15);
}

@media (max-width: 900px) {
  .fixtures-control-search:focus {
    width: 200px;
  }
}

body.light-theme .fixtures-control-search,
body.light-theme .fixtures-toolbar .dropdown-trigger {
  background: #ffffff;
  border-color: #d4dfef;
}

/* Custom Dropdown Trigger */
.dropdown {
  position: relative;
}

.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 0 14px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dropdown-trigger:hover {
  border-color: var(--accent-2);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.dropdown.is-open .dropdown-trigger {
  border-color: var(--accent-2);
  background: var(--surface-2);
  box-shadow: 0 4px 12px rgba(49, 130, 206, 0.15);
}

.dropdown-arrow {
  opacity: 0.5;
  transition: transform 0.25s ease;
}

.dropdown.is-open .dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  z-index: 100;
  padding: 6px 0;
  overflow: hidden;
}

.dropdown-menu[hidden] {
  display: none;
}

.dropdown-menu-header {
  padding: 14px 16px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  opacity: 0.6;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
}

.dropdown-item:hover,
.dropdown-item.active {
  color: var(--text);
  background: rgba(49, 130, 206, 0.12);
}

.dropdown-item.active {
  font-weight: 800;
}

.dropdown-item svg {
  opacity: 0.7;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.dropdown-item:hover svg {
  opacity: 1;
  transform: scale(1.1);
}

.dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

body.light-theme .dropdown-menu {
  background: #ffffff;
  border-color: #d4dfef;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
}

body.light-theme .dropdown-trigger {
  background: #ffffff;
  border-color: #d4dfef;
  color: #243954;
}

body.light-theme .dropdown-item:hover,
body.light-theme .dropdown-item.active {
  background: rgba(49, 130, 206, 0.08);
  color: #1a365d;
}

@media (max-width: 980px) {
  .fixtures-toolbar {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
  }

  .fixtures-control {
    flex: 1 1 190px;
  }

  .fixtures-control-search {
    min-width: 180px;
  }
}

/* Match player detailed stat comparison */
.stat-compare-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
}

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

.stat-compare-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.stat-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.stat-select {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 8px;
}

.stat-compare-meta {
  margin: 0 0 7px;
  font-size: 0.78rem;
}

.leader-side {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.leader-side.home {
  background: rgba(0, 212, 167, 0.18);
  color: #7ef0d4;
  border: 1px solid rgba(0, 212, 167, 0.3);
}

.leader-side.away {
  background: rgba(49, 130, 206, 0.18);
  color: #9ecfff;
  border: 1px solid rgba(49, 130, 206, 0.35);
}

.underlying-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.underlying-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px;
  background: color-mix(in srgb, var(--surface-2) 75%, transparent);
}

.underlying-item span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}

.underlying-item strong {
  font-size: 0.92rem;
}

@media (max-width: 760px) {
  .stat-compare-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .underlying-grid {
    grid-template-columns: 1fr;
  }
}

body.light-theme .stat-compare-block,
body.light-theme .underlying-item {
  background: #f4f8ff;
  border-color: #d7e3f3;
}

body.light-theme .leader-side.home {
  background: #e7faf4;
  color: #0e7f67;
  border-color: #b8ebda;
}

body.light-theme .leader-side.away {
  background: #e8f1ff;
  color: #1e5fae;
  border-color: #bdd3f7;
}

/* Underlying tab chart + legend */
.underlying-chart-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
}

.underlying-chart {
  width: 100%;
  height: 120px;
  display: block;
}

.chart-axis {
  stroke: color-mix(in srgb, var(--muted) 45%, transparent);
  stroke-width: 1;
}

.chart-home,
.chart-away {
  fill: none;
  stroke-width: 2.6;
}

.chart-home {
  stroke: #00d4a7;
}

.chart-away {
  stroke: #4ea7ff;
}

.underlying-chart-legend {
  display: flex;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 8px;
}

.underlying-chart-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.underlying-chart-legend .dot.home {
  background: #00d4a7;
}

.underlying-chart-legend .dot.away {
  background: #4ea7ff;
}

body.light-theme .underlying-chart-wrap {
  background: #f4f8ff;
  border-color: #d7e3f3;
}

@media (max-width: 760px) {
  .underlying-chart-legend {
    flex-direction: column;
    gap: 6px;
  }
}

/* Unified dropdown/select styling (latest override) */
select.lang-select,
select.stat-select,
select.app-select,
select#currencySelect {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  min-height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background-color: var(--surface);
  color: var(--text);
  font-weight: 700;
  padding: 8px 34px 8px 12px;
  line-height: 1.2;
  transition: all 0.2s ease;
  background-image:
    linear-gradient(45deg, transparent 50%, color-mix(in srgb, var(--muted) 85%, var(--text)) 50%),
    linear-gradient(135deg, color-mix(in srgb, var(--muted) 85%, var(--text)) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

select.lang-select:focus,
select.stat-select:focus,
select.app-select:focus,
select#currencySelect:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-2) 72%, #fff);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-2) 24%, transparent);
}

select.lang-select option,
select.stat-select option,
select.app-select option,
select#currencySelect option {
  background: color-mix(in srgb, var(--surface) 96%, black 4%);
  color: var(--text);
}

.lang-form {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 2px 4px;
}

.lang-form:hover {
  border-color: color-mix(in srgb, var(--accent-2) 48%, var(--line));
}

.topbar .dropdown-trigger {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent-2) 24%, var(--line));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.topbar .dropdown-trigger:hover {
  border-color: color-mix(in srgb, var(--accent-2) 48%, var(--line));
}

.topbar .dropdown-menu {
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent-2) 30%, var(--line));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.topbar .dropdown-menu .dropdown-menu-header {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 85%, transparent);
}

.topbar .dropdown-menu .dropdown-item {
  font-weight: 650;
  color: var(--text);
}

.topbar .dropdown-menu .dropdown-item:hover {
  background: color-mix(in srgb, var(--accent-2) 14%, transparent);
}

body.light-theme .lang-form {
  background: #f8fbff;
  border-color: #c8d8ef;
  box-shadow: 0 10px 24px rgba(26, 47, 79, 0.08);
}

body.light-theme .topbar .dropdown-trigger {
  background: #f8fbff;
  border-color: #c8d8ef;
}

body.light-theme .topbar .dropdown-menu {
  background: #ffffff;
  border-color: #ceddf1;
  box-shadow: 0 18px 36px rgba(26, 47, 79, 0.14);
}

body.light-theme select.lang-select option,
body.light-theme select.stat-select option,
body.light-theme select.app-select option,
body.light-theme select#currencySelect option {
  background: #ffffff;
  color: #243850;
}

/* Base Light Theme overrides for Header Buttons */
body.light-theme .theme-toggle-btn,
body.light-theme .lang-btn,
body.light-theme .topbar .dropdown-trigger,
body.light-theme .btn-outline {
  background: #f1f7ff !important;
  border: 1.5px solid #c9d9ef !important;
  color: #2e4a70 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body.light-theme .theme-toggle-btn:hover,
body.light-theme .lang-btn:hover,
body.light-theme .lang-dropdown.is-open .lang-btn,
body.light-theme .topbar .dropdown-trigger:hover,
body.light-theme .dropdown.is-open .dropdown-trigger,
body.light-theme .btn-outline:hover {
  background: #ffffff !important;
  border-color: #2a7fff !important;
  color: #2a7fff !important;
  box-shadow: 0 4px 12px rgba(42, 127, 255, 0.12) !important;
}

body.light-theme .topbar .dropdown-menu {
  background: #ffffff !important;
  border: 1px solid #ceddf1 !important;
  box-shadow: 0 10px 30px rgba(26, 47, 79, 0.12) !important;
}

body.light-theme .dropdown-menu-header {
  background: #f4f9ff !important;
  color: #5a7ba9 !important;
  border-bottom: 1px solid #e2ecf9 !important;
  padding: 12px 16px !important;
}

body.light-theme .dropdown-item {
  color: #2e4a70 !important;
  padding: 10px 16px !important;
}

body.light-theme .dropdown-item:hover {
  background: #f0f7ff !important;
  color: #2a7fff !important;
}

body.light-theme .lang-current {
  color: #2e4a70 !important;
}

body.light-theme .lang-svg {
  color: #5a7ba9 !important;
}

/* Final dropdown behavior/style override (authoritative) */
.topbar .dropdown.js-dropdown {
  position: relative;
}

.topbar .dropdown.js-dropdown.is-open .dropdown-menu {
  display: block;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0);
  pointer-events: auto;
}

.topbar .dropdown.js-dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  z-index: 2400;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.topbar .dropdown.js-dropdown .dropdown-trigger {
  min-height: 44px;
  padding: 10px 14px;
  gap: 8px;
}

.topbar .dropdown.js-dropdown .dropdown-trigger::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid color-mix(in srgb, var(--muted) 70%, var(--text));
  margin-left: 4px;
}

.topbar .dropdown.js-dropdown .dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  min-height: 38px;
}

@media (max-width: 760px) {
  .topbar .dropdown.js-dropdown .dropdown-menu {
    right: 0;
    min-width: 180px;
  }

  .lang-form {
    min-height: 40px;
    padding: 2px 6px;
  }

  select.lang-select {
    min-height: 34px;
    padding: 7px 28px 7px 10px;
  }
}

.settings-pill-btn {
  width: 100% !important;
  text-align: center !important;
  display: block !important;
}

/* Ensure Player names are readable in light mode */
body.light-theme .player-name,
body.light-theme .team-name,
body.light-theme .leader-name {
  color: #0f172a !important;
}

/* Ensure lineup pitch labels are readable in light mode */
body.light-theme .pitch-name,
body.light-theme .pitch-player-link {
  color: #0f2748 !important;
  text-shadow: none !important;
}

/* --- FINAL POLISH --- */
@media (max-width: 600px) {
  .auth-panel {
    padding: 1rem !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  .settings-group h3 {
    font-size: 1rem !important;
  }

  .settings-group li {
    width: 100% !important;
  }

  .btn {
    padding: 0.6rem 1rem !important;
  }
}

/* --- Final Ultra-Compact Polish --- */

@media (max-width: 600px) {

  /* Header: Logo slightly bigger, tighter spacing */
  .topbar-container {
    padding: 0 0.5rem !important;
    height: 52px !important;
  }

  .logo-img {
    height: 22px !important;
  }

  .topbar-right {
    gap: 2px !important;
  }

  /* Tabs: Better pill style */
  .tab-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
  }

  .tab-btn.active {
    background: var(--accent-2) !important;
    color: white !important;
    border-color: transparent !important;
  }

  /* Force all panels but active to hide */
  .tab-panel {
    display: none !important;
  }

  .tab-panel.active {
    display: flex !important;
  }

  /* Homepage: Date strip item padding */
  .date-item {
    padding: 4px !important;
    min-width: 48px !important;
  }
}

/* Light mode overrides for the tab buttons */
body.light-theme .tab-btn {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

body.light-theme .tab-btn.active {
  background: var(--accent-2) !important;
  color: white !important;
}

/* Color Coding for Scores */
.score-win {
  color: #10b981;
  font-weight: bold;
}

.score-lose {
  color: #f43f5e;
  font-weight: bold;
}

.score-draw {
  color: #f59e0b;
  font-weight: bold;
}

/* --- Final Mobile Tab Bar Compatibility --- */
@media (max-width: 600px) {

  .match-tabbar .tabs,
  .player-subtabbar .tabs,
  .team-subtabbar .tabs {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    padding: 0.5rem 0.2rem !important;
    gap: 0.4rem !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .match-tabbar .tabs::-webkit-scrollbar {
    display: none;
  }
}

/* --- Desktop UI Polishing & Premium Refinements --- */

/* Premium Header with Glassmorphism */
.topbar {
  background: rgba(30, 36, 48, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.light-theme .topbar {
  background: rgba(255, 255, 255, 0.8) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* Language Dropdown Refinement */
.lang-form {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 2px 8px !important;
  border-radius: 12px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-form:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08) !important;
}

.lang-select {
  background-color: transparent !important;
  border: none !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: var(--text) !important;
  padding: 4px 20px 4px 4px !important;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E") !important;
  background-position: right 2px center !important;
  background-size: 10px !important;
}

body.light-theme .lang-form {
  background: rgba(0, 0, 0, 0.02) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* User Dropdown Item & Logout Button */
.dropdown-menu {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
  margin-top: 8px !important;
}

.dropdown-item {
  font-weight: 500 !important;
  padding: 12px 18px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px;
}

.dropdown-item:hover {
  background: rgba(42, 127, 255, 0.1) !important;
  color: var(--accent) !important;
}

/* Specific Style for Logout in Dropdown */
.logout-btn {
  width: 100%;
  background: transparent !important;
  border: none !important;
  border-top: 1px solid var(--line) !important;
  margin-top: 4px !important;
  padding: 12px 18px !important;
  color: #ff5252 !important;
  font-weight: 600 !important;
  text-align: left !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: rgba(255, 82, 82, 0.08) !important;
  color: #ff1744 !important;
}

body.light-theme .logout-btn:hover {
  background: rgba(255, 82, 82, 0.05) !important;
}

/* Desktop General Improvements */
@media (min-width: 1024px) {
  .widget-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  }

  .widget-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  }

  .topbar-container {
    padding: 0 40px !important;
  }
}

/* Auth Panel Glow Effect for Desktop */
@media (min-width: 768px) {
  .auth-panel {
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.02) !important;
  }
}

/* --- Language Select Sophistication --- */
.lang-form span.lang-label {
  font-size: 0.65rem !important;
  text-transform: uppercase !important;
  font-weight: 800 !important;
  color: var(--muted) !important;
  margin-right: 4px !important;
}

.lang-select {
  font-family: inherit !important;
  letter-spacing: 0.02em !important;
}

/* User Admin Chip Style */
.topbar .dropdown-trigger {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  font-weight: 600 !important;
  padding: 8px 16px !important;
  border-radius: 99px !important;
  transition: all 0.25s ease !important;
}

.topbar .dropdown-trigger:hover {
  background: rgba(49, 130, 206, 0.1) !important;
  border-color: var(--accent-2) !important;
}

/* Date Strip Premium Look on Desktop */
@media (min-width: 768px) {
  .date-strip-item {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  }

  .date-strip-item:hover {
    transform: translateY(-2px);
    background: rgba(49, 130, 206, 0.08) !important;
    border-color: rgba(49, 130, 206, 0.3) !important;
  }

  .date-strip-item.active {
    background: var(--accent-2) !important;
    box-shadow: 0 10px 20px rgba(49, 130, 206, 0.3) !important;
  }
}

/* --- Desktop Nav Hub Icons --- */
.nav-icon-link {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative;
  padding: 10px !important;
  border-radius: 12px !important;
  background: transparent !important;
}

.nav-icon-link:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--accent) !important;
  transform: translateY(-2px);
}

.nav-icon-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
  transition: transform 0.3s ease;
}

.nav-icon-link:hover::after {
  transform: translateX(-50%) scaleX(1);
}

body.light-theme .nav-icon-link:hover {
  background: rgba(0, 0, 0, 0.02) !important;
}

/* --- Fixtures Hero Box Desktop Glass --- */
@media (min-width: 768px) {
  .match-summary-stats {
    background: rgba(49, 130, 206, 0.08) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(49, 130, 206, 0.15) !important;
    border-radius: 12px !important;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  }

  .match-summary-stats:hover {
    background: rgba(49, 130, 206, 0.12) !important;
    transform: scale(1.005);
  }
}

/* User Account Group Styling in Dropdown Header */
.dropdown-menu-header {
  background: rgba(255, 255, 255, 0.02) !important;
  color: var(--muted) !important;
  font-size: 0.72rem !important;
  padding: 10px 18px !important;
  font-weight: 800 !important;
  letter-spacing: 0.1em !important;
}

body.light-theme .dropdown-menu-header {
  background: #f8fafc !important;
  color: #64748b !important;
}

/* Clean Up the Language Form */
.lang-form {
  gap: 8px !important;
}

.lang-select:focus {
  box-shadow: none !important;
  border-color: var(--accent) !important;
}

/* --- Desktop UI Polishing & Premium Refinements --- */

/* Premium Header with Glassmorphism */
.topbar {
  background: rgba(30, 36, 48, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.light-theme .topbar {
  background: rgba(255, 255, 255, 0.8) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* Language Dropdown Refinement */
.lang-form {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 2px 8px !important;
  border-radius: 12px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-form:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08) !important;
}

.lang-select {
  background-color: transparent !important;
  border: none !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: var(--text) !important;
  padding: 4px 20px 4px 4px !important;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E") !important;
  background-position: right 2px center !important;
  background-size: 10px !important;
  appearance: none !important;
}

body.light-theme .lang-form {
  background: rgba(0, 0, 0, 0.02) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* User Dropdown Item & Logout Button */
.dropdown-menu {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
  margin-top: 8px !important;
  background: var(--surface) !important;
}

.dropdown-item {
  font-weight: 500 !important;
  padding: 12px 18px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px;
}

.dropdown-item:hover {
  background: rgba(42, 127, 255, 0.1) !important;
  color: var(--accent) !important;
}

/* Specific Style for Logout in Dropdown */
.logout-btn {
  width: 100%;
  background: transparent !important;
  border: none !important;
  border-top: 1px solid var(--line) !important;
  margin-top: 4px !important;
  padding: 12px 18px !important;
  color: #ff5252 !important;
  font-weight: 600 !important;
  text-align: left !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: rgba(255, 82, 82, 0.08) !important;
  color: #ff1744 !important;
}

body.light-theme .logout-btn:hover {
  background: rgba(255, 82, 82, 0.05) !important;
}

/* Desktop General Improvements */
@media (min-width: 1024px) {
  .widget-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  }

  .widget-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  }

  .topbar-container {
    padding: 0 40px !important;
  }
}

/* --- Desktop UI Fixes & Refinements --- */

/* Fix Logout and Language Select in Topbar */
.topbar {
  z-index: 1001 !important;
}

.topbar .dropdown-menu {
  top: 100% !important;
  right: 0 !important;
  margin-top: 8px !important;
  display: none;
  background: var(--surface) !important;
}

.topbar .dropdown:hover .dropdown-menu {
  display: block !important;
}

/* Redesign Language Select for Premium Look */
.lang-form {
  display: flex !important;
  align-items: center !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 2px 10px !important;
  border-radius: 99px !important;
  margin-right: 12px !important;
}

body.light-theme .lang-form {
  background: rgba(0, 0, 0, 0.03) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.lang-select {
  background: transparent !important;
  border: none !important;
  color: var(--text) !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  padding: 4px 24px 4px 8px !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 4px center !important;
  background-size: 10px !important;
}

/* Hero Badge Polish on Desktop */
.hero-badge {
  background: rgba(49, 130, 206, 0.1) !important;
  color: var(--accent) !important;
  border: 1px solid rgba(49, 130, 206, 0.2) !important;
  padding: 6px 16px !important;
  border-radius: 99px !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
}

/* User Admin Trigger Polish */
.topbar .dropdown-trigger {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: var(--text) !important;
  padding: 6px 14px !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  gap: 8px !important;
}

.topbar .dropdown-trigger i {
  font-size: 1rem !important;
  color: var(--muted) !important;
}

/* Theme Toggle Button Fix */
#themeToggleBtn {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  width: 38px !important;
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  color: var(--text) !important;
  transition: all 0.2s ease !important;
}

#themeToggleBtn:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--accent) !important;
}

body.light-theme #themeToggleBtn {
  border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Logout Button Specific Red Styling */
.logout-btn {
  color: #ff5252 !important;
  border-top: 1px solid var(--line) !important;
  margin-top: 4px !important;
  font-weight: 600 !important;
}

.logout-btn:hover {
  background: rgba(255, 82, 82, 0.1) !important;
}

/* Main Container Padding on Desktop */
@media (min-width: 1024px) {
  .site-shell {
    max-width: 1280px !important;
    margin: 0 auto !important;
    padding: 0 40px 40px !important;
  }

  .topbar-container {
    max-width: 1280px !important;
    margin: 0 auto !important;
    padding: 0 40px !important;
  }
}

/* --- Desktop UI Fixes & Refinements (FORCE OVERRIDE) --- */

/* Fix Logout and Language Select in Topbar */
.topbar {
  z-index: 1001 !important;
}

/* Ensure the dropdown menu is hidden by default and shown on hover */
.topbar .dropdown-menu {
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  margin-top: 8px !important;
  display: none !important;
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  min-width: 200px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
  padding: 8px 0 !important;
  z-index: 1002 !important;
}

.topbar .dropdown:hover .dropdown-menu {
  display: block !important;
}

/* Redesign Language Select for Premium Look */
.lang-form {
  display: flex !important;
  align-items: center !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 0 10px !important;
  border-radius: 99px !important;
  margin-right: 12px !important;
  height: 38px !important;
}

body.light-theme .lang-form {
  background: rgba(0, 0, 0, 0.03) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.lang-label {
  font-size: 0.65rem !important;
  text-transform: uppercase !important;
  font-weight: 800 !important;
  color: var(--muted) !important;
  margin-right: 4px !important;
  letter-spacing: 0.05em !important;
}

.lang-select {
  background: transparent !important;
  border: none !important;
  color: var(--text) !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  padding: 0 24px 0 4px !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 4px center !important;
  background-size: 10px !important;
  height: 100% !important;
}

/* Redundant block removed */

/* Logout Item in User Dropdown */
.logout-btn {
  width: 100% !important;
  text-align: left !important;
  background: transparent !important;
  border: none !important;
  padding: 10px 16px !important;
  color: #ff5252 !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  border-top: 1px solid var(--line) !important;
  margin-top: 4px !important;
  display: block !important;
  cursor: pointer !important;
}

.logout-btn:hover {
  background: rgba(255, 82, 82, 0.1) !important;
}

/* --- Desktop Styling Refinements (Round 3) --- */

/* Premium Header Glossmorphism & Sizing */
.topbar {
  height: 72px !important;
  background: rgba(13, 17, 23, 0.7) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.light-theme .topbar {
  background: rgba(255, 255, 255, 0.8) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* Fix Icon visibility in Light Mode */
body.light-theme .topbar svg,
body.light-theme .topbar i {
  color: #4a5568 !important;
}

/* Polish the Language Select */
.lang-form {
  border-radius: 12px !important;
  transition: all 0.2s ease !important;
}

.lang-form:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--accent) !important;
}

body.light-theme .lang-form:hover {
  background: rgba(42, 127, 255, 0.05) !important;
}

/* User Profile Trigger Enhancement */
.topbar .dropdown-trigger {
  border-radius: 12px !important;
  transition: all 0.2s ease !important;
}

.topbar .dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--accent) !important;
}

body.light-theme .topbar .dropdown-trigger:hover {
  background: rgba(42, 127, 255, 0.03) !important;
}

/* Ensure Logo Size is consistent */
.logo img {
  height: 32px !important;
  width: auto !important;
}

/* Style the Dropdown Items for Premium feel */
.dropdown-menu .dropdown-item {
  padding: 10px 18px !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  color: var(--text) !important;
  transition: all 0.15s ease !important;
}

.dropdown-menu .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--accent) !important;
  padding-left: 22px !important;
}

body.light-theme .dropdown-menu .dropdown-item:hover {
  background: rgba(0, 0, 0, 0.02) !important;
}

/* Custom Logout Link in Dropdown */
.logout-btn {
  border-top: 1px solid var(--line) !important;
  margin-top: 6px !important;
  padding-top: 12px !important;
  color: #ff5252 !important;
  opacity: 0.9 !important;
}

.logout-btn:hover {
  background: rgba(255, 82, 82, 0.08) !important;
  color: #ff5252 !important;
  opacity: 1 !important;
}

/* --- Desktop Styling Refinements (Round 4) --- */

/* Fix specificity for logout button */
.dropdown-menu .dropdown-item.logout-btn {
  border-top: 1px solid var(--line) !important;
  margin-top: 6px !important;
  padding-top: 12px !important;
  color: #ff5252 !important;
  background-color: transparent !important;
  opacity: 0.9 !important;
  border: none;
  text-align: left;
  width: 100%;
  cursor: pointer;
}

.dropdown-menu .dropdown-item.logout-btn:hover {
  background: rgba(255, 82, 82, 0.08) !important;
  color: #ff5252 !important;
  opacity: 1 !important;
}

/* --- Date Selector Refinements Consistently for Desktop/Mobile --- */
@media (min-width: 768px) {
  .date-strip-item {
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    color: var(--muted) !important;
    transition: all 0.2s ease !important;
  }

  .date-strip-item:hover {
    transform: translateY(-2px) !important;
    border-color: var(--accent) !important;
    color: var(--text) !important;
  }

  .date-strip-item.active {
    background: var(--accent-2) !important;
    border-color: var(--accent-2) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(49, 130, 206, 0.4) !important;
    transform: translateY(-2px) !important;
  }
}

body.light-theme .date-strip-item {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  color: var(--muted) !important;
}

body.light-theme .date-strip-item:hover {
  background: rgba(0, 0, 0, 0.02) !important;
  border-color: var(--accent) !important;
  color: var(--text) !important;
}

body.light-theme .date-strip-item.active {
  background: var(--accent-2) !important;
  border-color: var(--accent-2) !important;
  color: #fff !important;
}

/* --- Fix Mobile Header Layout & Theme --- */
@media (max-width: 768px) {
  .topbar {
    padding: 8px 12px !important;
    height: auto !important;
    min-height: 60px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }

  .topbar-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .logo-link {
    flex: 1 !important;
  }

  .logo img {
    height: 28px !important;
    /* Proper size on mobile */
    max-width: 150px !important;
  }

  .topbar-right {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
  }

  #themeToggleBtn {
    width: 32px !important;
    height: 32px !important;
    margin-right: 4px !important;
  }

  .lang-form {
    margin-right: 4px !important;
    padding: 0 8px !important;
    height: 32px !important;
  }

  .lang-label {
    display: none !important;
    /* Hide Lang label on mobile */
  }

  .lang-select {
    font-size: 0.75rem !important;
    padding: 0 16px 0 0 !important;
    background-position: right center !important;
  }

  .auth-buttons {
    display: flex !important;
    gap: 6px !important;
  }

  .auth-buttons .btn {
    padding: 4px 10px !important;
    font-size: 0.75rem !important;
    white-space: nowrap !important;
  }

  .dropdown-trigger {
    padding: 4px 10px !important;
    height: 32px !important;
    font-size: 0.8rem !important;
  }
}

/* --- Final Fixes: Desktop Date Formatting & Mobile Header Un-packing --- */
.date-strip-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px 16px !important;
  min-width: 64px !important;
  border-radius: 12px !important;
}

.date-strip-item span {
  font-size: 0.65rem !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
  margin-bottom: 2px !important;
  line-height: 1 !important;
}

.date-strip-item strong {
  font-size: 1.1rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

/* Fix Mobile Header - Reduce Clutter */
@media (max-width: 768px) {
  .topbar {
    padding: 10px 16px !important;
    min-height: 60px !important;
  }

  .topbar-container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    gap: 12px !important;
  }

  .logo-link {
    flex: 1 1 auto !important;
    display: flex !important;
    align-items: center !important;
  }

  .logo img {
    height: 24px !important;
    /* Smaller logo for mobile */
    width: auto !important;
    max-width: 130px !important;
  }

  .topbar-right {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
  }

  /* Hide Language Dropdown entirely on mobile header to save space */
  .lang-form {
    display: none !important;
  }

  #themeToggleBtn {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  .auth-buttons {
    display: flex !important;
    gap: 6px !important;
  }

  .auth-buttons .btn {
    padding: 6px 12px !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.5px !important;
    height: auto !important;
    line-height: 1.2 !important;
  }

  .dropdown-trigger {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    height: auto !important;
    border-radius: 99px !important;
  }

  /* Dropdown alignment fix for mobile */
  .dropdown-menu {
    right: -10px !important;
    width: 220px !important;
  }
}

/* --- Clean up Status Bar Wrapper since Prediction Counter/Sync is gone --- */
.status-bar-wrapper {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin-top: 32px !important;
  margin-bottom: 24px !important;
  display: flex !important;
  justify-content: center !important;
}

@media (max-width: 768px) {
  .status-bar-wrapper {
    margin-top: 20px !important;
    margin-bottom: 16px !important;
  }
}

.status-bar-controls {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
}

.date-strip {
  justify-content: center !important;
  width: 100% !important;
}

@media (max-width: 768px) {
  .date-strip {
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 6px 8px !important;
    gap: 8px !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    /* Allow scroll on mobile */
  }

  .date-strip-item {
    flex: 0 0 56px !important;
    scroll-snap-align: center;
  }
}

.team-wrap {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  gap: 12px;
}

.team-name {
  flex: 0 1 auto;
  max-width: calc(100% - 30px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.fixture-row-teams {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fixture-score-inline {
  font-weight: 800;
  color: var(--text);
  flex-shrink: 0;
}

body.light-theme .fixture-score-inline {
  color: #0c1930;
}

.ai-powered-note {
  margin: 8px 2px 14px;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  color: var(--muted);
  opacity: 0.92;
}

/* --- Authoritative JS dropdown behavior/style override --- */
.topbar .dropdown.js-dropdown .dropdown-menu {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  transform: translateY(4px) !important;
  margin-top: 0 !important;
  pointer-events: none !important;
  border-radius: 14px !important;
}

.topbar .dropdown.js-dropdown.is-open .dropdown-menu {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

.topbar .dropdown.js-dropdown .dropdown-menu .dropdown-item.active {
  background: color-mix(in srgb, var(--accent-2) 18%, transparent) !important;
  color: var(--text) !important;
  font-weight: 700 !important;
}

body.light-theme .topbar .dropdown.js-dropdown .dropdown-menu .dropdown-item.active {
  background: #e7f0ff !important;
  color: #1f4f8f !important;
}

/* Premium Live Tracker Styles */
.live-tracker {
  background: linear-gradient(135deg, rgba(30, 36, 48, 0.8), rgba(22, 26, 35, 0.9));
  border: 1px solid rgba(0, 212, 167, 0.3);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.live-tracker h3 {
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-tracker h3::after {
  content: "LIVE";
  font-size: 0.65rem;
  background: var(--danger);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

.live-stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 600px) {
  .live-stats-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.2s ease;
}

.stat-item:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.05);
}

.stat-item span {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.stat-item strong {
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 800;
}


/* Live Clock Styling in Fixtures */
.live-clock {
  color: var(--accent);
  font-weight: 800;
  margin-left: 4px;
  background: rgba(0, 212, 167, 0.1);
  padding: 1px 4px;
  border-radius: 4px;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.live-clock-meta {
  color: var(--accent);
  font-weight: 700;
}

/* Favorite Leagues & Teams */
.favorite-toggle {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer;
  padding: 0;
  margin: 0;
  color: rgba(255, 255, 255, 0.25);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  vertical-align: middle;
}

.favorite-toggle:hover {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1) !important;
}

.favorite-toggle.is-active {
  color: #ffd700;
}

.favorite-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  pointer-events: none;
}

.competition-title .favorite-toggle {
  margin-right: 10px;
}

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

.competition-section.is-favorite {
  border-left: 3px solid #ffd700;
}

/* E2EE messaging */
.messages-shell {
  padding: 16px;
}

.messages-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.messages-head h2 {
  margin: 0 0 6px;
}

.pill-muted {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.messages-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.messages-action-block label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
}

.messages-inline {
  display: flex;
  gap: 8px;
}

.messages-inline input {
  flex: 1;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
}

.messages-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
}

.messages-sidebar,
.messages-main {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px;
}

.messages-sidebar h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
}

.conversation-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  padding: 10px;
  cursor: pointer;
}

.conversation-item.active {
  border-color: var(--accent-2);
  box-shadow: inset 0 0 0 1px var(--accent-2);
}

.conversation-item .title {
  font-weight: 700;
}

.conversation-item .meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 3px;
}

.messages-hints {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  max-height: 160px;
  overflow: auto;
}

.hint-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  padding: 8px;
  cursor: pointer;
}

.conversation-title {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 10px;
}

.message-feed {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  min-height: 360px;
  max-height: 460px;
  overflow: auto;
  padding: 10px;
}

.msg-row {
  margin-bottom: 10px;
  max-width: 88%;
}

.msg-row.mine {
  margin-left: auto;
}

.msg-bubble {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 8px 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-row.mine .msg-bubble {
  border-color: rgba(49, 130, 206, 0.6);
}

.msg-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.message-compose {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.message-compose textarea {
  flex: 1;
  min-height: 64px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  padding: 10px;
}

@media (max-width: 960px) {
  .messages-actions {
    grid-template-columns: 1fr;
  }
  .messages-grid {
    grid-template-columns: 1fr;
  }
}

.team-page-logo--placeholder {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(57, 154, 255, 0.22), rgba(10, 20, 34, 0.92));
  border: 1px solid rgba(87, 169, 255, 0.35);
  color: var(--text-strong);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.squad-player-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(17, 26, 40, 0.55);
}

.squad-player-card--compact {
  min-height: 84px;
}

.squad-player-main,
.squad-player-side {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.squad-player-name {
  font-weight: 700;
  color: var(--text-strong);
}

.squad-player-meta,
.squad-player-nation,
.squad-player-value {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.squad-player-side {
  align-items: flex-end;
  text-align: right;
}

.side-schedule-widget .schedule-card {
  padding: 2px 0;
}

@keyframes goal-flash {
  0% { background-color: transparent; }
  20% { background-color: rgba(229, 62, 62, 0.35); }
  100% { background-color: transparent; }
}

.fixture-row.goal-detected {
  animation: goal-flash 4s ease-out;
}
