/* ── reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0d1b2a;
  --bg2:         #142336;
  --bg3:         #1a2d44;
  --border:      #2a3f58;
  --gold:        #f0b429;
  --gold-dim:    #8a6810;
  --red:         #e63946;
  --green:       #2ec4b6;
  --text:        #e8edf2;
  --text-muted:  #6b8299;
  --live:        #e63946;
  --qualify:     #2ec4b670;
  --possible:    #f0b42940;
  --radius:      10px;
  --card-shadow: 0 2px 12px rgba(0,0,0,.35);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── header ──────────────────────────────────────────────────────────────── */
header {
  background: linear-gradient(135deg, #0a1628 0%, #1a2d44 100%);
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px 10px;
  max-width: 900px;
  margin: 0 auto;
}

.trophy { font-size: 2.2rem; line-height: 1; }

.header-text h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--gold);
}

.header-text p {
  font-size: .75rem;
  color: var(--text-muted);
  letter-spacing: .3px;
}

.date-display {
  margin-left: auto;
  font-size: .8rem;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}

/* ── tab nav ─────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  padding: 0 20px;
  max-width: 900px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .4px;
  padding: 10px 18px 8px;
  text-transform: uppercase;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
}
.tab:hover  { color: var(--text); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── main layout ─────────────────────────────────────────────────────────── */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  min-height: calc(100vh - 140px);
}

.tab-content         { display: none; }
.tab-content.active  { display: block; }

/* ── section labels ──────────────────────────────────────────────────────── */
.section-label {
  color: var(--gold);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 28px 0 12px;
  padding-left: 2px;
  border-left: 3px solid var(--gold);
  padding-left: 10px;
}
.section-label:first-child { margin-top: 0; }

/* ── match card ──────────────────────────────────────────────────────────── */
.match-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: border-color .2s;
}
.match-card:hover { border-color: var(--gold-dim); }

.match-card.live  { border-color: var(--live); animation: pulse-border 2s infinite; }

@keyframes pulse-border {
  0%, 100% { border-color: var(--live); }
  50%       { border-color: #ff7b84; }
}

.match-meta {
  background: var(--bg3);
  color: var(--text-muted);
  font-size: .7rem;
  letter-spacing: .4px;
  padding: 5px 14px;
  border-bottom: 1px solid var(--border);
}

.match-body {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
}

.team {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.team.away { justify-content: flex-end; }
.team .flag { font-size: 1.5rem; flex-shrink: 0; }
.team .name {
  font-weight: 600;
  font-size: .9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team.away .name { text-align: right; }
.team.winner .name { color: var(--gold); }

/* score area */
.score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 90px;
  text-align: center;
  flex-shrink: 0;
}

.score.finished {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2px;
}
.score.finished .vs { color: var(--text-muted); font-weight: 400; font-size: 1rem; }
.score.finished .goals { min-width: 24px; }

.score.live {
  color: var(--live);
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--live);
  animation: blink 1s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.2} }

.score.scheduled {
  flex-direction: column;
  gap: 2px;
}
.kick-time {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .8rem;
  font-weight: 600;
  padding: 5px 12px;
  letter-spacing: .5px;
}

/* ── empty day ───────────────────────────────────────────────────────────── */
.empty-day {
  background: var(--bg2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: 32px;
  text-align: center;
  font-size: .9rem;
}

/* ── standings table ─────────────────────────────────────────────────────── */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
}

.group-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.group-title {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  color: var(--gold);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 8px 14px;
  text-transform: uppercase;
}

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

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

table.standings th {
  background: var(--bg3);
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: .5px;
  padding: 6px 8px;
  text-align: center;
}
table.standings th:nth-child(2) { text-align: left; }

table.standings td {
  padding: 8px 8px;
  text-align: center;
  border-top: 1px solid var(--border);
}
table.standings td:nth-child(2) { text-align: left; }

table.standings tr.qualify  td:first-child { border-left: 3px solid var(--green); }
table.standings tr.possible td:first-child { border-left: 3px solid var(--gold); }

.team-cell { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.team-cell .flag { font-size: 1.1rem; }

td.pts   { font-weight: 700; color: var(--text); }
td.pos-gd { color: var(--green); }
td.neg-gd { color: var(--red); }

/* qualify legend */
.qualify-legend {
  color: var(--text-muted);
  font-size: .75rem;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.qualify-legend .dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
  margin-right: 4px;
}
.qualify-legend .dot.qualify  { background: var(--green); }
.qualify-legend .dot.possible { background: var(--gold); }

/* ── schedule tab ────────────────────────────────────────────────────────── */
.schedule-day { margin-bottom: 32px; }

.day-header {
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.schedule-day.today-day .day-header {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ── footer ──────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .75rem;
  margin-top: 40px;
  padding: 24px 20px;
  text-align: center;
  line-height: 2.2;
}

.footer-disclaimer {
  color: #7a6230;
  font-size: .7rem;
  line-height: 1.6;
  margin: 8px auto;
  max-width: 600px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

.footer-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
  font-size: .72rem;
}
.footer-legal a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .2s;
}
.footer-legal a:hover { color: var(--gold); }
.footer-legal span    { color: var(--border); }

.footer-copy {
  color: #3a5070;
  font-size: .65rem;
}

/* ── local time in match card ────────────────────────────────────────────── */
.kick-time { /* primary — user's local time */
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .8rem;
  font-weight: 600;
  padding: 5px 12px;
  letter-spacing: .3px;
  text-align: center;
  white-space: nowrap;
}
.kick-et { /* secondary — ET reference */
  color: var(--text-muted);
  font-size: .65rem;
  text-align: center;
  display: block;
  margin-top: 3px;
  letter-spacing: .3px;
}

/* ── unofficial badge ────────────────────────────────────────────────────── */
.header-sub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.header-sub-row p { margin: 0; }

.unofficial-badge {
  background: #2a1a00;
  border: 1px solid #8a5a00;
  border-radius: 4px;
  color: #f0b429;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .8px;
  padding: 2px 6px;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: .85;
}

/* ── header right cluster ─────────────────────────────────────────────────── */
.header-right {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  position: relative;
}

.date-display {
  font-size: .75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* watch pill button */
.watch-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 600;
  padding: 4px 10px 4px 8px;
  transition: border-color .2s, background .2s;
  white-space: nowrap;
}
.watch-pill:hover { border-color: var(--gold); background: var(--bg2); }
.pill-caret { color: var(--text-muted); font-size: .65rem; }

/* header dropdown */
.country-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  padding: 12px;
  z-index: 200;
  min-width: 220px;
}
.dropdown-label {
  display: block;
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .5px;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.country-dropdown select,
#watch-select-inline {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .82rem;
  padding: 7px 10px;
  width: 100%;
  cursor: pointer;
  appearance: auto;
}
.country-dropdown select:focus,
#watch-select-inline:focus { outline: 2px solid var(--gold); }

/* ── where to watch card ─────────────────────────────────────────────────── */
.watch-card {
  background: linear-gradient(135deg, #1a2d44 0%, #0f2235 100%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.watch-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.watch-flag { font-size: 2rem; flex-shrink: 0; }
.watch-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--gold);
}
.watch-subtitle {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.watch-change {
  margin-left: auto;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .7rem;
  font-weight: 600;
  padding: 4px 10px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color .2s, color .2s;
}
.watch-change:hover { border-color: var(--gold); color: var(--gold); }

.watch-body { padding: 12px 16px 4px; }

.watch-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.watch-type-label {
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  min-width: 120px;
  padding-top: 3px;
  flex-shrink: 0;
}
.watch-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* badge types */
.badge {
  border-radius: 5px;
  font-size: .73rem;
  font-weight: 600;
  padding: 3px 9px;
  white-space: nowrap;
}
.badge-free      { background: #0d3d22; border: 1px solid #1a6640; color: #4ade80; }
.badge-cable     { background: #1a2d5a; border: 1px solid #2a4a9a; color: #93c5fd; }
.badge-streaming { background: #3d1a4d; border: 1px solid #6a2a8a; color: #d8b4fe; }

.watch-note {
  color: var(--text-muted);
  font-size: .65rem;
  padding: 0 16px 10px;
  font-style: italic;
}

/* inline country picker (inside watch card) */
.watch-picker-inline {
  border-top: 1px solid var(--border);
  padding: 10px 16px;
}

/* ── responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .header-content { padding: 10px 12px 8px; gap: 10px; }
  .trophy  { font-size: 1.6rem; }
  .header-text h1  { font-size: .88rem; }
  .tab     { padding: 8px 11px 7px; font-size: .73rem; }
  main     { padding: 12px; }

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

  .match-body  { padding: 10px 10px; gap: 6px; }
  .team .name  { font-size: .78rem; }
  .team .flag  { font-size: 1.2rem; }
  .score.finished { font-size: 1.15rem; }
  .score { min-width: 68px; }

  .watch-pill      { font-size: .65rem; padding: 3px 8px 3px 6px; }
  .watch-type-label { min-width: 100px; font-size: .65rem; }
  .watch-row       { gap: 6px; }
  .watch-header    { padding: 10px 12px 8px; gap: 10px; }
  .watch-flag      { font-size: 1.6rem; }
  .watch-title     { font-size: .82rem; }
  .country-dropdown { min-width: 180px; }
}
