:root {
  color-scheme: light dark;
  --bg: #0f1115;
  --card: #1a1d24;
  --border: #2a2e37;
  --text: #e8e9ec;
  --muted: #9aa0ab;
  --accent: #1d9bf0;
  --live: #3ecf6e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.topbar-title h1 {
  font-size: 1.1rem;
  margin: 0;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(62, 207, 110, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(62, 207, 110, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(62, 207, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 207, 110, 0); }
}

.notify-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.notify-btn:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: default;
}

.mode-banner {
  background: #3a2f10;
  color: #f0c766;
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.page-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.feed {
  flex: 1 1 640px;
  min-width: 0;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar {
  flex: 1 1 320px;
  min-width: 0;
  max-width: 380px;
  position: sticky;
  top: 5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
}

.mobile-view-switcher {
  display: none;
}

@media (max-width: 880px) {
  .page-layout {
    flex-direction: column;
  }
  .feed,
  .sidebar {
    max-width: 100%;
    width: 100%;
  }
  .sidebar {
    position: static;
    max-height: none;
  }

  .mobile-view-switcher {
    display: flex;
    gap: 0.5rem;
    margin: 0 auto 1rem;
    max-width: 640px;
    padding: 0 1rem;
  }
  .mobile-view-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
  }
  .mobile-view-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }
  .page-layout[data-mobile-view="feed"] .sidebar {
    display: none;
  }
  .page-layout[data-mobile-view="sidebar"] .feed {
    display: none;
  }

  /* Full-screen feel for the sidebar on mobile: drop the boxed card look and let it
     use the whole viewport width instead of looking like a widget squeezed into a panel. */
  .page-layout[data-mobile-view="sidebar"] .sidebar {
    border: none;
    border-radius: 0;
    padding: 0.75rem 0.5rem;
    background: transparent;
  }

  /* Collapse the multi-column tables into stacked cards — a 5-6 column table forced into
     a narrow phone screen otherwise requires horizontal scrolling to read every field. */
  .transfers-table thead {
    display: none;
  }
  .transfers-table,
  .transfers-table tbody,
  .transfers-table tr,
  .transfers-table td {
    display: block;
    width: 100%;
  }
  .transfers-table tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    margin-bottom: 0.6rem;
    background: var(--card);
  }
  .transfers-table td {
    border-bottom: none;
    padding: 0.3rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
  }
  .transfers-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
  }
  .transfers-table td[data-label="Player"] {
    font-weight: 700;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.3rem;
  }
}

.empty-state {
  color: var(--muted);
  text-align: center;
  margin-top: 3rem;
}

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  animation: fade-in 0.4s ease;
}

.post-card-summary {
  border-left: 3px solid var(--accent);
  background: linear-gradient(180deg, rgba(29, 155, 240, 0.07), transparent 40%), var(--card);
}

/* Confirmed/"here we go" deals: a one-time light sweep on arrival plus a lasting gold
   glow, so completed transfers read as bigger news than rumors without animating forever. */
.post-card-confirmed {
  border: 1px solid #f0c766;
  background: linear-gradient(180deg, rgba(240, 199, 102, 0.12), transparent 45%), var(--card);
  box-shadow: 0 0 24px rgba(240, 199, 102, 0.22);
  position: relative;
  overflow: hidden;
}

.post-card-confirmed::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: shine-sweep 1.6s ease-in-out 1;
  pointer-events: none;
}

@keyframes shine-sweep {
  0% { left: -150%; }
  100% { left: 150%; }
}

.confirmed-tag {
  display: inline-block;
  background: linear-gradient(90deg, #f0c766, #ffe27a);
  color: #1a1508;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-right: 0.4rem;
  box-shadow: 0 0 10px rgba(240, 199, 102, 0.5);
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
}

.mock-tag {
  background: #4a3b12;
  color: #f0c766;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  margin-right: 0.4rem;
}

.romano-tag {
  background: #1d3a2f;
  color: #3ecf6e;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  margin-right: 0.4rem;
}

.romano-tag-exclusive {
  background: #3a2f10;
  color: #f0c766;
}

.romano-tag-newsletter {
  background: #1d2f3a;
  color: #66b8f0;
}

.source-tag {
  color: var(--text);
  font-weight: 600;
}

.post-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  line-height: 1.35;
}

.post-text {
  margin: 0;
  line-height: 1.4;
  color: var(--muted);
}

.summary-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.post-summary {
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text);
}

.player-name {
  color: var(--live);
  font-weight: 700;
}

.team-name {
  font-weight: 600;
}

.team-name-a {
  color: #f0a15c;
}

.team-name-b {
  color: #b98cf0;
}

.amount {
  color: #5ce1e6;
  font-weight: 600;
}

.enrichment-line {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.post-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
}

/* --- Sports sidebar --------------------------------------------------------------- */

.sidebar-notice {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}

.sidebar-notice strong {
  color: var(--text);
}

.sidebar-notice code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
  font-size: 0.82em;
}

.sidebar-loading,
.sidebar-empty {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem 0;
}

.sidebar-muted {
  color: var(--muted);
  font-size: 0.85em;
}

.league-chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.6rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.league-chip {
  flex: 0 0 auto;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}

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

.sidebar-tabs,
.fixture-range-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.sidebar-tab,
.range-tab {
  flex: 1;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.3rem;
  font-size: 0.76rem;
  cursor: pointer;
}

.sidebar-tab.active,
.range-tab.active {
  background: var(--card);
  color: var(--text);
  border-color: var(--accent);
}

.standings-table,
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.standings-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: 0.3rem 0.25rem;
  border-bottom: 1px solid var(--border);
}

.standings-table td {
  padding: 0.35rem 0.25rem;
  border-bottom: 1px solid var(--border);
}

.standings-team {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scorers-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: scorer;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.scorers-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  counter-increment: scorer;
}

.scorers-list li::before {
  content: counter(scorer);
  color: var(--muted);
  width: 1.2rem;
  flex: 0 0 auto;
}

.scorer-name {
  flex: 1;
  font-weight: 600;
}

.scorer-team {
  color: var(--muted);
  font-size: 0.85em;
}

.scorer-goals {
  font-weight: 700;
  color: var(--live);
}

.fixtures-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fixture-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
}

.fixture-live {
  border-color: #e05555;
}

.fixture-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.live-dot-small {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e05555;
  animation: pulse 1.5s infinite;
}

.fixture-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  gap: 0.4rem;
}

.fixture-teams span:first-child,
.fixture-teams span:last-child {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixture-score {
  font-weight: 700;
  flex: 0 0 auto;
}

.fixture-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fixture-modal.hidden {
  display: none;
}

.fixture-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.fixture-modal-panel {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 560px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.25rem;
}

.fixture-modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.fixture-modal-body h3 {
  margin: 0 0 0.75rem;
}

.fixture-modal-body h4 {
  font-size: 0.85rem;
  color: var(--accent);
  margin: 1.1rem 0 0.5rem;
}

.highlight-embed iframe {
  border-radius: 8px;
  display: block;
}

.events-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.event-minute {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-right: 0.3rem;
}

.lineups-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.lineup-team h4 {
  margin: 0 0 0.4rem;
}

.lineup-players {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  line-height: 1.6;
}

.stats-table td {
  padding: 0.3rem 0.4rem;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.stat-type {
  color: var(--muted);
  text-align: center;
}

/* --- Sidebar mode switcher (Live Scores / Here We Go) ------------------------------ */

.mode-switcher {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.mode-btn {
  flex: 1;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.mode-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* --- Here We Go transfers table ----------------------------------------------------- */

.transfer-filters {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.transfer-filters select,
.transfer-filters input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  font-family: inherit;
}

#transfers-summary {
  font-size: 0.78rem;
  margin-bottom: 0.6rem;
}

.transfers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.transfers-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: 0.3rem 0.3rem;
  border-bottom: 1px solid var(--border);
}

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

.transfers-table a {
  color: var(--accent);
  text-decoration: none;
}

.uncertain-flag {
  cursor: help;
  color: #f0c766;
}

.deal-type-tag {
  display: inline-block;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
}

.deal-type-permanent {
  background: #1d3a2f;
  color: #3ecf6e;
}

.deal-type-loan {
  background: #1d2f3a;
  color: #66b8f0;
}

.deal-type-contract {
  background: #3a2f10;
  color: #f0c766;
}

/* --- Highlights discoverability hint on finished fixture cards ---------------------- */

.highlights-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
}

.friendly-tag {
  display: inline-block;
  margin-top: 0.25rem;
  background: var(--border);
  color: var(--muted);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-size: 0.68rem;
}

/* --- Clubs mode ---------------------------------------------------------------------- */

.club-search-input {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  font-family: inherit;
  margin: 0.6rem 0;
}

#club-search-results {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.club-search-result {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.club-detail-title {
  margin: 0.8rem 0 0.6rem;
  font-size: 1rem;
}

/* --- Logos / photos (licensed API-Football media, not scraped) ---------------------- */

.team-logo-sm {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: -3px;
  margin-right: 0.35rem;
}

.player-photo-sm {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 0.4rem;
  vertical-align: -6px;
  background: var(--border);
}

.post-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  margin-top: 0.1rem;
  background: var(--border);
  border: 1px solid var(--border);
}

/* --- Featured highlights strip (main page) ------------------------------------------ */

.featured-highlights {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1rem 0;
}

.featured-highlights-title {
  font-size: 0.95rem;
  margin: 0 0 0.6rem;
  color: var(--text);
}

.featured-highlights-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.highlight-card {
  position: relative;
  flex: 0 0 auto;
  width: 220px;
  height: 124px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  padding: 0;
}

.highlight-card-playing {
  cursor: default;
}

.highlight-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.highlight-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.highlight-teams {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), transparent);
  color: white;
  font-size: 0.72rem;
  padding: 0.3rem 0.4rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.live-now-league {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0.6rem 0 0.2rem;
}

.live-now-league:first-child {
  margin-top: 0;
}

.nationality-text {
  color: #66d9c9;
  font-weight: 600;
}
