*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #1a7a3c;
  --green-dark: #145e2e;
  --green-light: #e8f5ee;
  --gold: #e8a020;
  --gold-light: #fff8ec;
  --bg: #f0f2f5;
  --card-bg: #fff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e8eaed;
  --border-strong: #d1d5db;
  --sidebar-w: 220px;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.09), 0 2px 4px rgba(0,0,0,0.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Header ---- */
header {
  background: linear-gradient(135deg, #0d4220 0%, var(--green) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.22);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.header-title h1 {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.logo-mark {
  width: 1.5em;
  height: 1.5em;
  flex-shrink: 0;
}

.header-title .subtitle {
  font-size: 0.68rem;
  opacity: 0.7;
  letter-spacing: 0.03em;
}

.sidebar-toggle {
  display: none;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 0.28rem 0.85rem;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}

/* Compact by design: the header is a single non-wrapping row and this is the
   fourth control in it, so a "?" costs the least width of anything legible. */
.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1;
  transition: background 0.15s;
}
.help-btn:hover { background: rgba(255,255,255,0.22); }

/* The sidebar copy of Get Odds — shown only on phones, where it lives in the
   ☰ drawer instead of competing for space in the header. Styled for the light
   sidebar rather than the dark header, matching .all-favs-btn above it. */
.sidebar-odds { display: none; margin-bottom: 0.6rem; }

.sidebar-odds .get-odds-btn {
  width: 100%;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
}
.sidebar-odds .get-odds-btn:hover { border-color: var(--green); color: var(--green); }
.sidebar-odds .get-odds-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #4a2c00;
}

.get-odds-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 0.28rem 0.85rem;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.get-odds-btn:hover { background: rgba(255,255,255,0.22); }
.get-odds-btn.active {
  background: #c8f04a;
  border-color: #c8f04a;
  color: #0f0f0f;
  font-weight: 600;
}

/* ---- Odds row ---- */
.odds-row {
  display: none;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  padding: 0.35rem 0 0.1rem;
  border-top: 1px solid var(--border);
  margin-top: 0.3rem;
}
.odds-mode .odds-row { display: flex; }

.odds-label {
  font-size: 0.68rem;
  color: var(--muted);
  margin-right: 0.1rem;
}

.odds-link {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: opacity 0.15s;
}
.odds-link:hover { opacity: 0.8; }
.odds-link.oc { background: #1a1a2e; color: #fff; }
.odds-link.pp { background: #007a3d; color: #fff; }
.odds-link.lb { background: #e4002b; color: #fff; }
.odds-link.boyle { background: #003222; color: #fff; }

.odds-bookie {
  font-size: 0.78rem;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-strong, #d1d5db);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.bk-name {
  font-weight: 700;
  color: var(--gold, #e8a020);
  margin-right: 0.15rem;
}

.bk-team {
  color: var(--muted, #6b7280);
}

.bk-price {
  color: var(--text, #111827);
  font-weight: 600;
}

.bk-sep {
  color: var(--border-strong, #d1d5db);
}

.odds-more {
  font-size: 0.68rem;
  color: var(--muted, #8890a8);
  text-decoration: underline;
  margin-left: 0.3rem;
}

.odds-more:hover { color: var(--text, #e8eaf0); }

/* ---- Body layout ---- */
.body-layout {
  display: flex;
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  align-items: flex-start;
  padding: 1rem 1rem 1rem 0;
  gap: 1rem;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 57px;
  max-height: calc(100vh - 57px);
  overflow-y: auto;
}

.sidebar-inner {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  padding: 0.75rem 0;
  overflow: hidden;
}

.sidebar-all-favs {
  padding: 0.5rem 0.75rem 0.4rem;
  border-bottom: 1px solid var(--border);
}

.all-favs-btn {
  width: 100%;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
}

.all-favs-btn:hover { border-color: var(--green); color: var(--green); }

.all-favs-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #7a4400;
}

.watchlist-section {
  padding: 0 0.75rem 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.watchlist-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.watchlist-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  padding-top: 0.25rem;
}

.watchlist-heading {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.watchlist-heading-row .my-teams-btn {
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 0.15rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
}

.watchlist-heading-row .my-teams-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

.watchlist-heading-row .my-teams-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #7a4400;
}

.watchlist-list {
  list-style: none;
}

.watchlist-list li {
  margin-bottom: 1px;
}

/* Meta tournament item */
.meta-tourn-item {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
  padding-bottom: 0.1rem;
}

.meta-tourn-btn {
  font-weight: 600;
  font-style: italic;
}

/* Sport group header */
.sport-group { list-style: none; }

.sport-group-btn {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.12s;
}

.sport-group-btn:hover { background: var(--bg); }
.sport-group-btn.has-active { color: var(--green); }
.sport-group-btn.has-partial { color: var(--green); }

.sport-group-arrow {
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 0.15s;
  color: var(--muted);
}

.sport-group-arrow.open { transform: rotate(90deg); }

/* Collapsible competition list */
.sport-group-list {
  list-style: none;
  display: none;
  padding-left: 0.7rem;
}

.sport-group-list.open { display: block; }

/* Nested group/subgroup levels (e.g. DDSL: Soccer > DDSL > 13 Boys > divisions)
   reuse the same collapsible markup one level deeper each time — dial the
   font down a touch per level so the hierarchy still reads at a glance. */
.sport-group-list .sport-group-btn { font-size: 0.76rem; font-weight: 500; }
.sport-group-list .sport-group-list .sport-group-btn { font-size: 0.73rem; }

/* Competition and team buttons */
.watchlist-btn {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 0.25rem 0.45rem;
  font-size: 0.78rem;
  border-radius: 5px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.12s, color 0.12s;
  line-height: 1.3;
}

.watchlist-btn:hover { background: var(--bg); }

.watchlist-btn.active {
  background: var(--green-light);
  color: var(--green-dark);
  font-weight: 600;
}

.watchlist-empty {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.2rem 0.45rem;
  font-style: italic;
}

.team-add-form {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}

.tz-select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 0.27rem 0.45rem;
  font-size: 0.78rem;
  background: var(--bg);
  color: inherit;
  outline: none;
  cursor: pointer;
}
.tz-select:focus { border-color: var(--green); }

.team-input {
  flex: 1;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 0.27rem 0.45rem;
  font-size: 0.78rem;
  outline: none;
  min-width: 0;
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s;
}

.team-input:focus { border-color: var(--green); background: #fff; }

.team-add-btn {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 5px;
  width: 26px;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s;
}

.team-add-btn:hover { background: var(--green-dark); }

.team-fav-item {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.team-fav-item .watchlist-btn {
  flex: 1;
  padding: 0.25rem 0.45rem;
}

.team-remove-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
  border-radius: 3px;
  transition: color 0.12s, background 0.12s;
}

.team-remove-btn:hover { color: #dc2626; background: #fee2e2; }

.tourn-browse-item {
  display: flex;
  align-items: center;
}

.tourn-browse-item .watchlist-btn { flex: 1; }

.comp-star-btn {
  background: none;
  border: none;
  color: var(--border-strong);
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  padding: 0 0.2rem;
  border-radius: 3px;
  transition: color 0.12s;
  flex-shrink: 0;
}

.comp-star-btn:hover { color: var(--gold); }
.comp-star-btn.starred { color: var(--gold); }

.clear-watchlist {
  display: block;
  width: calc(100% - 1.5rem);
  margin: 0.5rem 0.75rem 0.25rem;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 0.3rem;
  font-size: 0.73rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.clear-watchlist:hover { border-color: #dc2626; color: #dc2626; background: #fee2e2; }

/* ---- Main content ---- */
main {
  flex: 1;
  min-width: 0;
}

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

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  padding: 0 0.1rem;
}

.section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-count {
  background: var(--bg);
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  letter-spacing: 0;
}

.toggle-btn {
  background: none;
  border: none;
  font-size: 0.72rem;
  color: var(--green);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.older-results-bar,
.show-more-bar {
  margin: 0.4rem 0 0.9rem;
}

.show-results-btn {
  background: none;
  border: 1px solid var(--green);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}

.show-results-btn:hover { background: var(--green); color: #fff; }

/* ---- Date groups ---- */
.date-group {
  margin-bottom: 1rem;
}

.date-group-header {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0 0.1rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  white-space: nowrap;
}

.date-group-header::before,
.date-group-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

/* ---- Match rows ---- */
.match-list {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
}

/* [badge comp date] | [home score away] | [venue] */
.match-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  transition: background 0.12s;
}

.match-card:hover { background: #f4f6f9; }

.match-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

/* Inner grid — score is the exact midpoint */
.match-teams {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
  gap: 0.5rem;
  min-width: 280px;
}

/* Tennis: two stacked rows, each "player ... sets" */
.match-teams.tennis {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
}
.tennis-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.tennis-line .team {
  text-align: left;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tennis-sets {
  display: inline-flex;
  gap: 0.45rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.tennis-sets .set {
  min-width: 0.9em;
  text-align: center;
  color: var(--muted, #6b7280);
}
.tennis-sets .set.set-won {
  color: var(--text, #111827);
}

.match-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.18rem;
  min-width: 0;
}

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

.match-card.status-live {
  border-left: 3px solid var(--gold);
  background: var(--gold-light);
}

.match-card.status-live:hover { background: #fff3dc; }

.match-card.status-postponed { opacity: 0.68; }
.match-card.status-postponed .team { text-decoration: line-through; text-decoration-color: var(--border-strong); }

.match-card.watchlist-match { background: var(--green-light); }
.match-card.watchlist-match:hover { background: #ddf0e6; }

.match-card.status-live.watchlist-match {
  background: #fef6e4;
  border-left-color: var(--gold);
}

.sport-icon {
  display: none;
}

.sport-badge {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-size: 0.56rem;
  font-weight: 700;
  padding: 0.14rem 0.42rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  flex-shrink: 0;
}

/* Sport-specific badge colours */
.sport-football  .sport-badge { background: #1d4ed8; }
.sport-hurling   .sport-badge { background: #b45309; }
.sport-rugby     .sport-badge { background: #dc2626; }
.sport-soccer    .sport-badge { background: #059669; }
.sport-basketball .sport-badge { background: #d97706; }
.sport-icehockey .sport-badge { background: #0284c7; }
.sport-golf      .sport-badge { background: #16a34a; }
.sport-tennis    .sport-badge { background: #65a30d; }

/* Knockout-round badge: a small pill sitting next to the sport-badge */
.round-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.14rem 0.4rem;
  border-radius: 3px;
  background: var(--gold-light, #fff8ec);
  color: #9c6f10;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.round-badge.round-r32  { background: #eef2ff; color: #3730a3; }
.round-badge.round-r16  { background: #e0e7ff; color: #312e81; }
.round-badge.round-qf   { background: #e8f5ee; color: var(--green-dark, #145e2e); }
.round-badge.round-sf   { background: #fff8ec; color: #9c6f10; }
.round-badge.round-3rd  { background: #f5f5f5; color: #525252; }
.round-badge.round-stage { background: #eef2f5; color: #475569; } /* group/qualifier rounds */
.round-badge.round-final {
  background: var(--gold, #e8a020);
  color: #fff;
}

.comp {
  font-size: 0.73rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team.home { text-align: right; }
.team.away { text-align: left; }
.team.fav  { color: var(--green); }

/* Team names are click-to-filter */
.team[data-team] { cursor: pointer; }
.team[data-team]:hover { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }

/* Active-filter bar — sticky so "Clear" is always one click away */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0 0 0.6rem;
  padding: 0.4rem 0.7rem;
  background: var(--green);
  color: #fff;
  border-radius: 6px;
  font-size: 0.82rem;
}
.filter-bar-label strong { font-weight: 700; }
.filter-clear-btn {
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.6);
  background: transparent;
  color: #fff;
  border-radius: 5px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.filter-clear-btn:hover { background: rgba(255,255,255,0.18); }

.score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
}

.score {
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  text-align: center;
  width: 96px;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.match-time {
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  text-align: center;
  width: 44px;
  font-size: 0.87rem;
}

.match-venue {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-link {
  font-size: 0.64rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--border-strong);
  white-space: nowrap;
  line-height: 1.3;
}

.source-link:hover { color: var(--green); border-bottom-color: var(--green); }

.tv-badge {
  font-size: 0.62rem;
  font-weight: 600;
  background: #e8f0fe;
  color: #1a56db;
  padding: 0.07rem 0.35rem;
  border-radius: 4px;
  white-space: nowrap;
}

.match-card { cursor: pointer; }

/* Detail row — hidden on desktop, always visible on mobile */
.match-detail {
  display: none;
}

/* News inline panel — mobile only, hidden by default */
.news-panel {
  display: none;
}

/* ---- News popup (desktop) ---- */
#news-popup {
  display: none;
  position: absolute;
  z-index: 120;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0;
  width: 320px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.13);
  max-height: 360px;
  overflow-y: auto;
}
#news-popup.open { display: block; }

.news-item {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.news-item:last-child { border-bottom: none; }
.news-item:hover { background: #f5f8ff; color: var(--green); }

.news-source-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.1rem;
  margin-right: 0.3rem;
}

/* YouTube highlights link — pinned above regular news items */
.news-item.news-highlight { background: rgba(204, 0, 0, 0.04); }
.news-item.news-highlight:hover { background: rgba(204, 0, 0, 0.09); color: var(--text); }
.news-highlight-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  color: #c00;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.1rem;
  margin-right: 0.3rem;
  white-space: nowrap;
}

/* ---- Expanded-card detail bar (form dots + source link) ---- */
.detail-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.9rem;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  background: var(--gold-light, #fff8ec);
}
.team-form {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
}
.form-team {
  font-weight: 600;
  white-space: nowrap;
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.form-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted, #6b7280);
  flex-shrink: 0;
}
.form-dot.form-W { background: var(--green, #1a7a3c); }
.form-dot.form-D { background: var(--gold, #e8a020); }
.form-dot.form-L { background: #d9272e; }
.form-empty {
  color: var(--muted);
  font-size: 0.7rem;
}
.detail-source {
  margin-left: auto;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.7rem;
}
.detail-source:hover { color: var(--green); text-decoration: underline; }

.news-match-link {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

.news-loading, .news-empty {
  display: block;
  padding: 0.6rem 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.live-badge {
  display: inline-block;
  background: var(--gold);
  color: #7a4400;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  animation: livepulse 1.8s ease-in-out infinite;
}

@keyframes livepulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.postponed-badge {
  display: inline-block;
  background: var(--muted);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  white-space: nowrap;
  justify-self: center;
}

/* ---- Footer ---- */
footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 1rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1rem;
}

.footer-links a {
  color: var(--green-dark);
  text-decoration: none;
}

.footer-links a:hover { text-decoration: underline; }

/* ---- Static content pages (help.html, privacy.html) ----
   Plain documents that reuse this stylesheet and the site header; no JS. */
.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.doc h1 { font-size: 1.5rem; margin-bottom: 0.35rem; }

.doc .doc-intro {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

.doc h2 {
  font-size: 1.02rem;
  margin: 1.75rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

.doc h3 { font-size: 0.9rem; margin: 1.1rem 0 0.3rem; }

.doc p, .doc li {
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 0.6rem;
}

.doc ul { padding-left: 1.2rem; margin-bottom: 0.8rem; }
.doc li { margin-bottom: 0.35rem; }
.doc a { color: var(--green-dark); }

.doc .doc-note {
  background: var(--bg);
  border-left: 3px solid var(--green);
  padding: 0.6rem 0.85rem;
  border-radius: 0 5px 5px 0;
  margin: 0.9rem 0;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 0.6rem 0 1rem;
}

.doc th, .doc td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.doc th { color: var(--muted); font-weight: 600; }

.doc-table-wrap { overflow-x: auto; }

/* Sidebar "new here?" pointer — the footer sits below a long feed, so a
   first-time user needs an entry point where they're already looking. */
.sidebar-help {
  font-size: 0.75rem;
  margin-bottom: 0.6rem;
  text-align: center;
}

.sidebar-help a { color: var(--green-dark); }

/* Account panel — the email in the header is a button that opens it */
button.auth-email {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.35);
}

.danger-zone summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: #b91c1c;
  padding: 0.3rem 0;
}

.danger-zone summary:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.modal-submit.danger { background: #b91c1c; }
.modal-submit.danger:hover { background: #991b1b; }

/* ---- Responsive ---- */
@media (max-width: 700px) {
  .sidebar-toggle { display: block; }

  /* The header is one non-wrapping row carrying help, odds, the account area
     and the sidebar toggle. On a narrow phone that overflows — worst for a
     signed-in user, whose email takes up to 160px — so drop the strapline and
     the toggle's label, keeping the ☰ glyph and its aria-label. */
  .header-inner { gap: 0.5rem; }
  .header-title .subtitle { display: none; }
  .sidebar-toggle-label { display: none; }
  .auth-email { max-width: 110px; }

  /* Get Odds moves into the ☰ drawer on phones. */
  .header-actions .get-odds-btn { display: none; }
  .sidebar-odds { display: block; }

  .body-layout { padding: 0.5rem; gap: 0; }

  .sidebar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    max-height: 100%;
    z-index: 200;
    background: rgba(0,0,0,0.45);
    padding: 3.5rem 0.65rem 1rem;
  }

  .sidebar.open { display: block; }

  .sidebar-inner {
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  /* iOS Safari zooms in when a focused input's font is under 16px, which shifts
     the layout sideways and pushes the "+" add button off-screen. A 16px font
     stops the zoom without disabling pinch-zoom in the viewport meta. */
  .team-input, .tz-select { font-size: 16px; }

  .match-card {
    grid-template-columns: auto 1fr;
    gap: 0 0.4rem;
    padding: 0.42rem 0.55rem;
  }

  .match-left {
    display: flex;
    align-items: center;
    grid-row: 1;
  }

  .match-left .sport-badge,
  .match-left .comp { display: none; }

  .match-left .sport-icon {
    display: flex;
    align-items: center;
  }

  .match-right { display: none; }
  .match-teams { min-width: 0; grid-column: 2; }
  .score { width: 80px; }
  .match-time { width: 36px; }

  .match-detail {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.1rem 0.35rem;
    padding: 0.12rem 0 0;
    font-size: 0.71rem;
    color: var(--muted);
    grid-column: 1 / -1;
  }

  .news-panel {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border);
    margin-top: 0.3rem;
    padding-top: 0.15rem;
  }
  .news-panel.open { display: block; }
  .news-panel .news-item { padding: 0.4rem 0.25rem; }
}

/* ---- Accounts ---- */

.auth-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 0.28rem 0.85rem;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.auth-btn:hover { background: rgba(255,255,255,0.22); }

.auth-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.auth-email {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.85);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,20,0.45);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 320px;
  max-width: calc(100vw - 2rem);
  padding: 1.25rem;
}

.modal-box h2 {
  font-size: 1.05rem;
  margin-bottom: 0.9rem;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.modal-field label {
  font-size: 0.75rem;
  color: var(--muted);
}

.modal-field input {
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 0.45rem 0.55rem;
  font-size: 0.85rem;
  outline: none;
}
.modal-field input:focus { border-color: var(--green); }

.modal-error {
  color: #dc2626;
  font-size: 0.78rem;
  margin-bottom: 0.6rem;
  min-height: 1em;
}

.modal-submit {
  width: 100%;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.modal-submit:hover { background: var(--green-dark); }

.modal-links {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.78rem;
}

.modal-resend {
  display: block;
  background: none;
  border: none;
  color: var(--green-dark);
  cursor: pointer;
  padding: 0;
  font-size: 0.78rem;
  text-decoration: underline;
  margin: -0.4rem 0 0.6rem;
}

.modal-links a, .modal-links button {
  background: none;
  border: none;
  color: var(--green-dark);
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  text-decoration: underline;
}

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

.modal-box { position: relative; }

.verify-banner {
  background: var(--gold-light);
  border-bottom: 1px solid var(--gold);
  color: var(--text);
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.verify-banner button {
  background: none;
  border: none;
  color: var(--green-dark);
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
}

.auth-toast {
  position: fixed;
  top: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green-dark);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.82rem;
  box-shadow: var(--shadow-md);
  z-index: 400;
}

/* ---- Server-rendered competition links (see server/seo.js) ----
   Crawl-discovery links on the SSR homepage. app.js replaces #content on
   hydration, so this is only ever seen by crawlers and no-JS visitors. */
.seo-comp-nav {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.seo-comp-group { margin-bottom: 1rem; }

.seo-comp-group h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.seo-comp-group ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
}

.seo-comp-group a {
  font-size: 0.8rem;
  color: var(--green-dark);
  text-decoration: none;
}

.seo-comp-group a:hover { text-decoration: underline; }
