:root {
  color-scheme: dark;
  --bg: #06120d;
  --bg-2: #0b2117;
  --card: rgba(12, 35, 25, 0.78);
  --card-strong: rgba(16, 47, 32, 0.96);
  --text: #eef8f1;
  --muted: #a5b9ac;
  --line: rgba(255, 255, 255, 0.12);
  --primary: #21d07a;
  --primary-2: #f7c948;
  --danger: #ff6868;
  --success: #33e08c;
  --warning: #ffd166;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --header-h: 76px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef8f0;
  --bg-2: #dff2e7;
  --card: rgba(255, 255, 255, 0.88);
  --card-strong: rgba(255, 255, 255, 0.98);
  --text: #102217;
  --muted: #53665a;
  --line: rgba(14, 49, 28, 0.14);
  --primary: #0f9955;
  --primary-2: #c69212;
  --shadow: 0 20px 60px rgba(12, 70, 32, 0.18);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(33, 208, 122, 0.20), transparent 30rem),
    radial-gradient(circle at 80% 12%, rgba(247, 201, 72, 0.14), transparent 24rem),
    linear-gradient(140deg, var(--bg), var(--bg-2));
  color: var(--text);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

body::after {
  content: "";
  position: fixed;
  left: 50%;
  bottom: -330px;
  width: 920px;
  height: 520px;
  transform: translateX(-50%);
  pointer-events: none;
  border: 2px solid rgba(255,255,255,0.07);
  border-radius: 50% 50% 0 0;
  background: radial-gradient(ellipse at center, rgba(33, 208, 122, 0.08), transparent 62%);
}

button, input, select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  position: relative;
  width: min(1480px, calc(100% - 28px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 12px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--header-h);
  margin: 12px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--card-strong) 86%, transparent);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 24px rgba(33, 208, 122, 0.28);
  color: #06120d;
  font-size: 1.35rem;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
}

.site-nav a {
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  transition: 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-toggle,
.theme-toggle,
.chip-button,
.primary-btn,
.secondary-btn {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.chip-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  white-space: nowrap;
}

.chip-button:hover,
.theme-toggle:hover,
.nav-toggle:hover,
.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
}

.section-pad {
  padding: 72px 0 0;
}

.compact-pad {
  padding-top: 28px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 24px;
  align-items: stretch;
  padding-top: 72px;
}

.hero-content,
.next-card,
.control-card,
.feature-match,
.team-watch-card,
.day-block,
.standings-card,
.group-card,
.guide-grid article,
.score-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-content {
  padding: clamp(26px, 5vw, 58px);
  overflow: hidden;
  position: relative;
}

.hero-content::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -100px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  border: 18px solid rgba(255, 255, 255, 0.06);
  outline: 2px solid rgba(255, 255, 255, 0.08);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary-2);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  max-width: 850px;
  margin-bottom: 16px;
  font-size: clamp(2.5rem, 7vw, 6.1rem);
  line-height: 0.92;
  letter-spacing: -0.07em;
}

h2 {
  font-size: clamp(1.7rem, 3.8vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.045em;
  margin-bottom: 10px;
}

h3 {
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.hero-text {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 26px;
}

.hero-actions,
.result-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #07130d;
}

.secondary-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.08);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}

.status-strip span,
.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.07);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.next-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 430px;
}

.card-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 8px rgba(33, 208, 122, 0.12);
}

.next-card h2 {
  margin-top: 24px;
  font-size: clamp(2rem, 4vw, 3.8rem);
}

.next-card p {
  color: var(--muted);
  line-height: 1.55;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 24px 0;
}

.countdown-grid span,
.mini-countdown span {
  display: grid;
  place-items: center;
  min-height: 84px;
  padding: 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  border: 1px solid var(--line);
}

.countdown-grid strong,
.mini-countdown strong {
  font-size: clamp(1.3rem, 2.6vw, 2.2rem);
  line-height: 1;
}

.countdown-grid small,
.mini-countdown small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mini-note {
  font-size: 0.92rem;
}

.controls {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr 0.8fr;
  gap: 14px;
}

.control-card {
  border-radius: var(--radius-md);
  padding: 18px;
}

label {
  display: block;
  font-weight: 800;
  margin-bottom: 10px;
}

select,
input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

html[data-theme="light"] select,
html[data-theme="light"] input {
  background: #fff;
}

.control-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  max-width: 780px;
  line-height: 1.65;
}

.split-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.match-grid,
.team-watch-grid,
.standings-grid,
.groups-grid,
.guide-grid {
  display: grid;
  gap: 16px;
}

.match-grid {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.team-watch-grid,
.groups-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.standings-grid {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

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

.match-card,
.team-watch-card,
.score-card,
.timeline-item {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.035));
}

.match-card.favourite,
.feature-match {
  background:
    radial-gradient(circle at top right, rgba(247, 201, 72, 0.18), transparent 18rem),
    linear-gradient(180deg, rgba(33, 208, 122, 0.14), rgba(255,255,255,0.04));
  border-color: rgba(247, 201, 72, 0.32);
}


.team-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  vertical-align: middle;
  min-width: 0;
}

.team-label--right {
  justify-content: flex-end;
}

.team-name-text {
  min-width: 0;
}

.flag-icon {
  width: 1.35em;
  height: 0.95em;
  flex: 0 0 auto;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.22), 0 2px 8px rgba(0,0,0,0.18);
  background: rgba(255,255,255,0.15);
}

.match-title-horizontal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 1.12rem;
  font-weight: 900;
  margin-bottom: 12px;
}

.match-title-vertical {
  display: grid;
  gap: 8px;
  place-items: center;
  text-align: center;
}

.match-title-vertical strong {
  font-size: clamp(1.4rem, 4vw, 2.8rem);
}

.vs-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--line);
  color: var(--primary-2);
  font-weight: 950;
  letter-spacing: -0.06em;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.meta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 700;
}

.venue-line,
.time-line {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 10px;
}

.score-line {
  margin: 10px 0;
  font-size: 1.4rem;
  font-weight: 950;
  color: var(--primary-2);
}

.mini-countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.mini-countdown span {
  min-height: 56px;
  border-radius: 14px;
}

.mini-countdown strong {
  font-size: 1.02rem;
}

.mini-countdown small {
  font-size: 0.62rem;
}

.notify-btn {
  width: 100%;
  margin-top: 14px;
}

.favourite-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(330px, 1.04fr);
  gap: 16px;
}

.feature-match {
  min-height: 460px;
  padding: clamp(22px, 4vw, 34px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.feature-match .match-title-vertical strong {
  font-size: clamp(2.2rem, 5vw, 4.1rem);
}

.timeline {
  display: grid;
  gap: 12px;
  align-content: start;
}

.timeline-item {
  display: grid;
  gap: 8px;
}

.scoreboard-list,
.schedule-list {
  display: grid;
  gap: 14px;
}

.day-block {
  border-radius: var(--radius-md);
  overflow: clip;
}

.day-summary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 0;
  color: var(--text);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  text-align: left;
}

.day-summary strong {
  font-size: 1.08rem;
}

.day-summary span {
  color: var(--muted);
  font-size: 0.9rem;
}

.day-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  padding: 14px;
}

.day-block.is-collapsed .day-content {
  display: none;
}

.standings-card,
.group-card,
.guide-grid article,
.empty-state {
  padding: 18px;
}

.standings-card h3,
.group-card h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
  font-size: 0.88rem;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tr:last-child td {
  border-bottom: 0;
}

.team-name-cell {
  font-weight: 850;
}

.team-name-cell .team-label {
  justify-content: flex-start;
}

.group-card strong .team-label,
.team-watch-card h3 .team-label,
.badge .team-label {
  font-weight: 900;
}

.qualified-row .team-name-cell::after {
  content: "  • Q zone";
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 900;
}

.group-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.group-card li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
}

.status-live {
  color: #06120d;
  background: var(--danger);
}

.status-finished {
  color: #06120d;
  background: var(--warning);
}

.status-upcoming {
  color: #06120d;
  background: var(--primary);
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 36px;
}

code {
  padding: 0.1rem 0.34rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--line);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 52px 0 34px;
  color: var(--muted);
}

.site-footer a {
  color: var(--primary-2);
  font-weight: 800;
}

@media (max-width: 1080px) {
  .hero,
  .favourite-layout,
  .controls {
    grid-template-columns: 1fr;
  }

  .site-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .site-nav {
    order: 4;
    width: 100%;
    display: none;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-top: 10px;
  }

  .site-nav.is-open {
    display: flex;
  }

  .header-actions {
    margin-left: auto;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 18px, 1480px);
  }

  .site-header {
    top: 8px;
    padding: 10px;
    border-radius: 20px;
  }

  .brand small,
  .header-actions .chip-button {
    display: none;
  }

  .section-pad {
    padding-top: 48px;
  }

  .hero {
    padding-top: 34px;
  }

  .hero-content,
  .next-card,
  .feature-match {
    border-radius: 22px;
  }

  .countdown-grid,
  .mini-countdown {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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

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

/* Batch 1 refinements: navbar, status bar, icon system, controls relocation, dropdown polish */
:root {
  --bg: #04130e;
  --bg-2: #092218;
  --bg-3: #103622;
  --glass: rgba(11, 34, 25, 0.68);
  --glass-soft: rgba(255, 255, 255, 0.07);
  --header-h: 72px;
}

html[data-theme="light"] {
  --bg: #edf8f1;
  --bg-2: #dff1e7;
  --bg-3: #f8fbf4;
  --card: rgba(255, 255, 255, 0.74);
  --card-strong: rgba(255, 255, 255, 0.88);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-soft: rgba(16, 102, 60, 0.06);
}

body {
  font-family: "Mulish", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 5%, rgba(33, 208, 122, 0.24), transparent 24rem),
    radial-gradient(circle at 78% 8%, rgba(247, 201, 72, 0.16), transparent 23rem),
    radial-gradient(circle at 50% 100%, rgba(30, 120, 70, 0.18), transparent 34rem),
    linear-gradient(145deg, var(--bg) 0%, var(--bg-2) 54%, var(--bg-3) 100%);
  background-attachment: fixed;
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 14% 6%, rgba(15, 153, 85, 0.20), transparent 24rem),
    radial-gradient(circle at 85% 10%, rgba(198, 146, 18, 0.16), transparent 24rem),
    radial-gradient(circle at 55% 105%, rgba(15, 153, 85, 0.12), transparent 30rem),
    linear-gradient(145deg, var(--bg) 0%, var(--bg-2) 50%, var(--bg-3) 100%);
}

body::before {
  opacity: 0.72;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 14%, rgba(255, 255, 255, 0.06), transparent 34rem);
  background-size: 92px 92px, 92px 92px, auto;
}

html[data-theme="light"] body::before {
  background:
    linear-gradient(90deg, rgba(7, 70, 40, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(7, 70, 40, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 14%, rgba(7, 70, 40, 0.05), transparent 34rem);
  background-size: 92px 92px, 92px 92px, auto;
}

.icon {
  width: 1.08em;
  height: 1.08em;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: -0.18em;
}

.chip-button,
.theme-toggle,
.nav-toggle,
.footer-top-link,
.time-line,
.venue-line,
.mini-note,
.top-status-bar span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.site-header {
  top: 10px;
  min-height: var(--header-h);
  padding: 10px 14px;
  background: color-mix(in srgb, var(--card-strong) 76%, transparent);
  transition: min-height 180ms ease, padding 180ms ease, border-radius 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

html.is-scrolled .site-header {
  min-height: 62px;
  padding: 8px 12px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--card-strong) 88%, transparent);
  box-shadow: 0 20px 62px rgba(0, 0, 0, 0.34);
}

.brand-mark {
  color: #06120d;
  font-size: 1.1rem;
}

.brand-mark .icon-brand {
  width: 26px;
  height: 26px;
}

.brand strong {
  letter-spacing: -0.035em;
}

.site-nav {
  gap: 6px;
}

.site-nav a {
  padding: 10px 13px;
  font-weight: 850;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: linear-gradient(135deg, rgba(33, 208, 122, 0.14), rgba(247, 201, 72, 0.08));
  color: var(--text);
}

.theme-toggle,
.nav-toggle {
  display: inline-grid;
  place-items: center;
}

.theme-toggle .icon,
.nav-toggle .icon,
.chip-button .icon {
  width: 18px;
  height: 18px;
}

.top-status-bar {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  z-index: 45;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card-strong) 66%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.20);
}

html.is-scrolled .top-status-bar {
  top: 78px;
}

.top-status-bar > span {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--glass-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.top-status-bar .icon {
  color: var(--primary-2);
}

.hero {
  padding-top: 44px;
}

.status-strip {
  display: none;
}

.section-toolbar,
.schedule-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.favourite-toolbar {
  justify-content: flex-end;
}

.schedule-toolbar {
  margin: -4px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  box-shadow: 0 14px 46px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

.field-wrap {
  min-width: min(100%, 240px);
  flex: 1;
  position: relative;
}

.field-wrap.search-field {
  flex: 1.4;
  min-width: min(100%, 320px);
}

.field-wrap.compact-select {
  flex: 0 1 250px;
  min-width: min(100%, 220px);
}

.field-wrap label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 7px;
}

select,
input {
  min-height: 48px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--card-strong) 72%, transparent);
  border-color: color-mix(in srgb, var(--line) 72%, var(--primary) 12%);
  color: var(--text);
  padding: 0 44px 0 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

input[type="search"] {
  padding-right: 14px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

select option {
  background: #0b2117;
  color: #eef8f1;
}

html[data-theme="light"] select option {
  background: #ffffff;
  color: #102217;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 18px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--primary-2);
  border-bottom: 2px solid var(--primary-2);
  transform: rotate(45deg);
  pointer-events: none;
}

select:focus,
input:focus {
  border-color: rgba(33, 208, 122, 0.62);
  box-shadow: 0 0 0 4px rgba(33, 208, 122, 0.12), inset 0 1px 0 rgba(255,255,255,0.07);
}

.control-card,
.controls {
  display: none;
}

.card-icon-text,
.time-line,
.venue-line,
.mini-note {
  gap: 7px;
}

.time-line .icon,
.venue-line .icon,
.mini-note .icon {
  color: var(--primary-2);
  opacity: 0.95;
}

.notify-btn {
  justify-content: center;
}

.footer-top-link {
  color: var(--primary-2);
  font-weight: 850;
}

.footer-top-link .icon {
  width: 17px;
  height: 17px;
}

@media (max-width: 1180px) {
  .site-header {
    align-items: center;
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-grid;
  }

  .site-nav {
    order: 4;
    width: 100%;
    display: none;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-top: 10px;
  }

  .site-nav.is-open {
    display: flex;
  }

  .header-actions {
    margin-left: auto;
  }

  .top-status-bar {
    top: 82px;
  }
}

@media (min-width: 1181px) {
  .nav-toggle {
    display: none;
  }
}

@media (max-width: 760px) {
  .brand strong {
    font-size: 0.96rem;
  }

  .brand small {
    display: none;
  }

  .top-status-bar {
    position: relative;
    top: auto;
  }

  html.is-scrolled .top-status-bar {
    top: auto;
  }

  .top-status-bar > span {
    width: 100%;
    justify-content: flex-start;
  }

  .section-toolbar,
  .schedule-toolbar,
  .favourite-toolbar {
    width: 100%;
    align-items: stretch;
    justify-content: flex-start;
  }

  .field-wrap,
  .field-wrap.search-field,
  .field-wrap.compact-select {
    flex-basis: 100%;
  }

  .header-actions .chip-button {
    display: none;
  }
}

.nav-anchor { display: block; position: relative; top: -118px; height: 0; overflow: hidden; }

/* Batch 2 refinements: match-focused hero, unified cards, favourite/results/followed teams */
.hero-dashboard {
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  align-items: stretch;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 16% 10%, rgba(33, 208, 122, 0.18), transparent 20rem),
    radial-gradient(circle at 84% 0%, rgba(247, 201, 72, 0.12), transparent 22rem),
    color-mix(in srgb, var(--card) 92%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  border: 16px solid rgba(255, 255, 255, 0.055);
  pointer-events: none;
}

html[data-theme="light"] .hero-panel::after {
  border-color: rgba(13, 100, 54, 0.08);
}

.hero-panel-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(22px, 4vw, 42px);
}

.hero-panel-primary .hero-match-title {
  font-size: clamp(1.25rem, 2.6vw, 2.9rem);
}

.hero-panel-secondary .hero-match-title {
  font-size: clamp(1rem, 1.8vw, 1.6rem);
}

.hero-panel-topline,
.hero-panel-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-kicker,
.panel-stage,
.hero-panel-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.panel-kicker {
  color: var(--primary-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel-kicker--live {
  color: #fff;
  background: rgba(255, 60, 60, 0.18);
  border-color: rgba(255, 104, 104, 0.42);
  box-shadow: 0 0 0 8px rgba(255, 104, 104, 0.08);
}

.is-live-panel .match-center .score-stack strong {
  color: #fff;
  text-shadow: 0 0 26px rgba(255, 104, 104, 0.45);
}

.hero-countdown span {
  min-height: 92px;
}

.hero-mini-countdown span {
  min-height: 58px;
}

.match-grid,
.team-watch-grid,
.scoreboard-list,
.day-content,
.timeline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.match-card,
.team-watch-card,
.score-card,
.timeline-item {
  min-height: 292px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(circle at 8% 5%, rgba(33, 208, 122, 0.13), transparent 12rem),
    linear-gradient(180deg, rgba(255,255,255,0.095), rgba(255,255,255,0.035));
}

html[data-theme="light"] .match-card,
html[data-theme="light"] .team-watch-card,
html[data-theme="light"] .score-card,
html[data-theme="light"] .timeline-item,
html[data-theme="light"] .day-block,
html[data-theme="light"] .feature-match,
html[data-theme="light"] .standings-card {
  background:
    radial-gradient(circle at 10% 0%, rgba(15, 153, 85, 0.11), transparent 12rem),
    linear-gradient(180deg, rgba(255,255,255,0.82), rgba(239, 250, 244, 0.66));
  border-color: rgba(12, 88, 48, 0.16);
}

.match-card--live {
  border-color: rgba(255, 104, 104, 0.48);
  box-shadow: 0 22px 70px rgba(255, 50, 50, 0.13);
}

.match-card--finished {
  border-color: rgba(247, 201, 72, 0.34);
}

.match-title-horizontal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 4px;
  font-size: 1rem;
}

.match-title-horizontal > span {
  min-width: 0;
}

.team-side--home,
.team-label--left {
  justify-content: flex-start;
  text-align: left;
}

.team-side--away,
.team-label--right {
  justify-content: flex-end;
  text-align: right;
}

.match-center {
  display: grid;
  place-items: center;
  min-width: 64px;
}

.team-label {
  width: 100%;
  gap: 9px;
  font-weight: 950;
}

.team-name-text {
  overflow-wrap: anywhere;
  line-height: 1.18;
}

.flag-icon {
  width: 1.7em;
  height: 1.16em;
  border-radius: 4px;
}

.hero-match-title .flag-icon,
.match-title-feature .flag-icon {
  width: 2.2em;
  height: 1.45em;
}

.vs-badge {
  width: 52px;
  height: 52px;
  letter-spacing: 0;
}

.score-stack {
  display: grid;
  place-items: center;
  min-width: 86px;
  padding: 8px 10px;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
}

.score-stack strong {
  color: var(--primary-2);
  font-size: clamp(1.18rem, 2.2vw, 2.1rem);
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
}

.score-stack small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.score-stack--live {
  background: rgba(255, 104, 104, 0.14);
  border-color: rgba(255, 104, 104, 0.36);
}

.penalty-line {
  color: var(--primary-2) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.meta-row {
  margin: 6px 0 2px;
}

.meta-row span {
  min-height: 28px;
  padding: 5px 9px;
}

.status-pill.status-live {
  color: #fff;
  background: linear-gradient(135deg, #ff4f5f, #d31f2f);
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 0 0 6px rgba(255, 79, 95, 0.10);
}

.status-pill.status-finished {
  color: #08120d;
  background: linear-gradient(135deg, #ffd166, #f7a928);
}

.status-pill.status-upcoming {
  color: #06120d;
  background: linear-gradient(135deg, var(--primary), #83f5b4);
}

.time-line,
.venue-line,
.state-line {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.state-line--live {
  color: var(--danger);
  font-weight: 850;
}

.mini-countdown {
  grid-template-columns: repeat(4, minmax(54px, 1fr));
  margin-top: auto;
}

.mini-countdown span {
  min-height: 64px;
  min-width: 0;
  padding: 8px 6px;
}

.mini-countdown strong {
  font-size: 1.03rem;
  font-variant-numeric: tabular-nums;
}

.countdown-grid strong,
.mini-countdown strong {
  font-variant-numeric: tabular-nums;
}

.notify-btn {
  margin-top: auto;
  width: max-content;
  max-width: 100%;
}

.favourite-layout {
  display: block;
}

.feature-match {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr);
  gap: 22px;
  align-items: center;
  min-height: 260px;
  padding: clamp(20px, 3vw, 32px);
  margin-bottom: 16px;
}

.feature-main-copy h3 {
  margin: 8px 0 8px;
  font-size: clamp(1.55rem, 3vw, 2.65rem);
  letter-spacing: -0.05em;
}

.feature-main-copy p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.feature-match-body {
  display: grid;
  gap: 12px;
}

.match-title-feature {
  font-size: clamp(1.1rem, 2vw, 2rem);
}

.selected-team-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: -8px 0 16px;
}

.selected-team-chip,
.empty-chip-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  color: var(--text);
  font: inherit;
  font-weight: 900;
}

.selected-team-chip {
  cursor: pointer;
}

.selected-team-chip .icon {
  width: 15px;
  height: 15px;
  color: var(--danger);
}

.empty-chip-note {
  color: var(--muted);
}

.team-watch-grid .match-card h3,
.team-watch-card h3 {
  display: none;
}

.scoreboard-list {
  display: grid;
  gap: 16px;
}

.day-content {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.day-content .match-card {
  min-height: 286px;
}

/* stronger light mode so the site does not look washed out */
html[data-theme="light"] body {
  background:
    radial-gradient(circle at 8% 4%, rgba(6, 125, 70, 0.22), transparent 24rem),
    radial-gradient(circle at 82% 7%, rgba(224, 156, 20, 0.19), transparent 23rem),
    radial-gradient(circle at 40% 92%, rgba(28, 139, 91, 0.18), transparent 32rem),
    linear-gradient(135deg, #e3f3e8 0%, #f6f4e7 45%, #dceee4 100%);
}

html[data-theme="light"] body::before {
  opacity: 0.95;
  background:
    linear-gradient(90deg, rgba(8, 77, 42, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(8, 77, 42, 0.052) 1px, transparent 1px),
    radial-gradient(circle at 52% 10%, rgba(8, 97, 55, 0.075), transparent 32rem);
  background-size: 74px 74px, 74px 74px, auto;
}

html[data-theme="light"] body::after {
  border-color: rgba(7, 88, 47, 0.12);
  background: radial-gradient(ellipse at center, rgba(12, 132, 73, 0.12), transparent 62%);
}

html[data-theme="light"] .top-status-bar,
html[data-theme="light"] .site-header,
html[data-theme="light"] .schedule-toolbar {
  background: rgba(255,255,255,0.68);
  box-shadow: 0 16px 50px rgba(32, 104, 62, 0.14);
}

html[data-theme="light"] .score-stack,
html[data-theme="light"] .vs-badge,
html[data-theme="light"] .meta-row span,
html[data-theme="light"] .selected-team-chip,
html[data-theme="light"] .empty-chip-note {
  background: rgba(6, 95, 55, 0.06);
}

@media (max-width: 1120px) {
  .hero-dashboard,
  .feature-match {
    grid-template-columns: 1fr;
  }

  .match-grid,
  .team-watch-grid,
  .scoreboard-list,
  .day-content,
  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .match-grid,
  .team-watch-grid,
  .scoreboard-list,
  .day-content,
  .timeline {
    grid-template-columns: 1fr;
  }

  .match-title-horizontal {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    font-size: 0.92rem;
  }

  .flag-icon {
    width: 1.45em;
    height: 1em;
  }

  .hero-match-title .flag-icon,
  .match-title-feature .flag-icon {
    width: 1.7em;
    height: 1.12em;
  }

  .score-stack {
    min-width: 72px;
    padding: 7px 8px;
  }

  .score-stack strong {
    font-size: 1.14rem;
  }

  .vs-badge {
    width: 42px;
    height: 42px;
  }

  .mini-countdown {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mini-countdown span {
    min-height: 58px;
  }

  .hero-panel {
    min-height: 360px;
  }
}

/* Mobile readability patch: hero scoreboard + favourite team cards */
.team-name-text {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

@media (max-width: 720px) {
  html,
  body {
    overflow-x: hidden;
  }

  .page-shell {
    overflow-x: clip;
  }

  .hero-dashboard {
    gap: 16px;
  }

  .hero-panel {
    min-height: auto;
    border-radius: 24px;
  }

  .hero-panel-inner {
    padding: 18px;
    gap: 18px;
  }

  .hero-panel-topline {
    align-items: flex-start;
    gap: 8px;
  }

  .panel-kicker,
  .panel-stage {
    min-height: 30px;
    padding: 6px 9px;
    font-size: 0.68rem;
  }

  .hero-panel .hero-match-title {
    grid-template-columns: minmax(0, 1fr) minmax(54px, auto) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    font-size: clamp(1rem, 4.9vw, 1.32rem);
  }

  .hero-panel .team-side--home,
  .hero-panel .team-side--away {
    justify-content: center;
    min-width: 0;
    text-align: center;
  }

  .hero-panel .team-label {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 100%;
    text-align: center;
  }

  .hero-panel .team-name-text {
    max-width: 9.5ch;
    font-size: clamp(1.02rem, 5vw, 1.35rem);
    line-height: 1.08;
    overflow-wrap: break-word;
    word-break: normal;
    text-wrap: balance;
  }

  .hero-panel .flag-icon {
    width: 2.05em;
    height: 1.34em;
    flex: 0 0 auto;
  }

  .hero-panel .match-center {
    min-width: 54px;
  }

  .hero-panel .vs-badge {
    width: 48px;
    height: 48px;
    font-size: 0.9rem;
  }

  .hero-panel .score-stack {
    min-width: 58px;
    max-width: 68px;
    padding: 7px 6px;
    border-radius: 14px;
  }

  .hero-panel .score-stack strong {
    font-size: clamp(0.9rem, 4.2vw, 1.08rem);
  }

  .hero-panel .score-stack small {
    max-width: 56px;
    margin-top: 4px;
    font-size: 0.52rem;
    line-height: 1.05;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .hero-panel-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero-panel-meta span {
    width: 100%;
    justify-content: flex-start;
    white-space: normal;
    overflow-wrap: break-word;
    font-size: 0.72rem;
  }

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

  .hero-countdown span {
    min-height: 72px;
    padding: 10px 8px;
  }

  .hero-countdown strong {
    font-size: 1.45rem;
  }

  .feature-match {
    gap: 16px;
    padding: 18px;
  }

  .feature-main-copy h3 {
    font-size: clamp(1.35rem, 6vw, 1.75rem);
  }

  .feature-main-copy p:not(.eyebrow) {
    font-size: 0.92rem;
  }

  .feature-match .match-title-feature {
    gap: 10px;
    font-size: clamp(1.08rem, 4.7vw, 1.32rem);
  }

  .feature-match .team-label {
    font-size: 1.08rem;
    font-weight: 1000;
  }

  .feature-match .team-name-text {
    line-height: 1.14;
    overflow-wrap: break-word;
    word-break: normal;
    text-wrap: balance;
  }

  .feature-match .flag-icon {
    width: 1.85em;
    height: 1.2em;
  }

  .feature-match .vs-badge {
    width: 46px;
    height: 46px;
    font-size: 0.92rem;
  }
}

@media (max-width: 420px) {
  .hero-panel-inner {
    padding: 16px;
  }

  .hero-panel .hero-match-title {
    gap: 6px;
  }

  .hero-panel .team-name-text {
    max-width: 8.5ch;
    font-size: clamp(0.98rem, 5vw, 1.18rem);
  }

  .hero-panel .score-stack {
    min-width: 54px;
    max-width: 62px;
    padding-inline: 5px;
  }

  .hero-panel .score-stack small {
    font-size: 0.48rem;
  }

  .feature-match .team-label {
    font-size: 1.02rem;
  }
}

/* Mobile-only hero scoreboard layout patch
   Keeps desktop/tablet unchanged. Fixes stacked/misaligned flags and broken hero names. */
@media (max-width: 720px) {
  .hero-panel .hero-match-title {
    grid-template-columns: minmax(94px, 1fr) minmax(54px, auto) minmax(106px, 1fr);
    grid-template-areas: "home center away";
    align-items: center;
    column-gap: 8px;
    width: 100%;
  }

  .hero-panel .team-side--home { grid-area: home; }
  .hero-panel .match-center { grid-area: center; }
  .hero-panel .team-side--away { grid-area: away; }

  .hero-panel .team-side--home,
  .hero-panel .team-side--away {
    min-width: 0;
    display: flex;
    align-items: center;
  }

  .hero-panel .team-side--home {
    justify-content: flex-start;
    text-align: left;
  }

  .hero-panel .team-side--away {
    justify-content: flex-end;
    text-align: right;
  }

  .hero-panel .team-label {
    flex-direction: row !important;
    align-items: center;
    width: auto;
    min-width: 0;
    gap: 6px;
    font-weight: 1000;
  }

  .hero-panel .team-label--left {
    justify-content: flex-start;
    text-align: left;
  }

  .hero-panel .team-label--right {
    justify-content: flex-end;
    text-align: right;
  }

  .hero-panel .team-name-text {
    max-width: 10.2ch;
    font-size: clamp(0.96rem, 4.35vw, 1.16rem);
    line-height: 1.08;
    overflow-wrap: normal;
    word-break: keep-all;
    text-wrap: balance;
  }

  .hero-panel .flag-icon {
    width: 2em;
    height: 1.34em;
    flex: 0 0 auto;
  }

  .hero-panel .match-center {
    min-width: 54px;
    display: grid;
    place-items: center;
  }

  .hero-panel .vs-badge {
    width: 44px;
    height: 44px;
    font-size: 0.86rem;
  }

  .hero-panel .score-stack {
    min-width: 60px;
    max-width: 72px;
    padding: 7px 6px;
    border-radius: 14px;
    text-align: center;
  }

  .hero-panel .score-stack strong {
    font-size: clamp(0.86rem, 4vw, 1.05rem);
    line-height: 0.96;
  }

  .hero-panel .score-stack small {
    max-width: 60px;
    margin-top: 4px;
    font-size: 0.46rem;
    line-height: 1.06;
    text-align: center;
    overflow-wrap: normal;
    word-break: normal;
  }
}

@media (max-width: 390px) {
  .hero-panel .hero-match-title {
    grid-template-columns: minmax(88px, 1fr) minmax(50px, auto) minmax(98px, 1fr);
    column-gap: 6px;
  }

  .hero-panel .team-name-text {
    max-width: 9.2ch;
    font-size: clamp(0.9rem, 4.15vw, 1.08rem);
  }

  .hero-panel .flag-icon {
    width: 1.82em;
    height: 1.22em;
  }

  .hero-panel .score-stack {
    min-width: 56px;
    max-width: 66px;
    padding: 6px 5px;
  }

  .hero-panel .score-stack small {
    max-width: 54px;
    font-size: 0.43rem;
  }
}

/* Mobile-only hero reference scoreboard layout patch
   API untouched. Desktop/tablet layout remains unchanged. */
@media (max-width: 720px) {
  .hero-panel .hero-match-title {
    display: grid;
    grid-template-columns: minmax(74px, 1fr) minmax(74px, auto) minmax(74px, 1fr);
    grid-template-areas: "home center away";
    align-items: center;
    justify-items: center;
    column-gap: 10px;
    width: 100%;
    min-width: 0;
  }

  .hero-panel .team-side--home,
  .hero-panel .team-side--away {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .hero-panel .team-label,
  .hero-panel .team-label--left,
  .hero-panel .team-label--right {
    width: 100%;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px;
    text-align: center !important;
  }

  .hero-panel .team-label--right .flag-icon {
    order: -1;
  }

  .hero-panel .team-label--right .team-name-text {
    order: 1;
  }

  .hero-panel .flag-icon {
    width: 2.28rem;
    height: 1.52rem;
    border-radius: 4px;
    flex: 0 0 auto;
  }

  .hero-panel .team-name-text {
    display: block;
    max-width: 9.5ch;
    font-size: clamp(0.78rem, 3.65vw, 1rem);
    line-height: 1.08;
    font-weight: 900;
    overflow-wrap: normal;
    word-break: normal;
    text-wrap: balance;
  }

  .hero-panel .match-center {
    grid-area: center;
    min-width: 68px;
    display: grid;
    place-items: center;
    text-align: center;
  }

  .hero-panel .score-stack {
    min-width: 68px;
    max-width: 86px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: center;
  }

  .hero-panel .score-stack strong {
    display: block;
    font-size: clamp(1.25rem, 8vw, 2rem);
    line-height: 1;
    color: var(--text);
    letter-spacing: 0.02em;
    text-shadow: none;
    white-space: nowrap;
  }

  .hero-panel .score-stack small,
  .hero-panel .score-stack .penalty-line {
    display: block;
    max-width: 86px;
    margin-top: 5px;
    font-size: clamp(0.48rem, 2.35vw, 0.62rem);
    line-height: 1.05;
    color: var(--muted);
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    overflow-wrap: normal;
    word-break: normal;
  }

  .hero-panel .vs-badge {
    width: 48px;
    height: 48px;
    font-size: 0.9rem;
  }
}

@media (max-width: 390px) {
  .hero-panel .hero-match-title {
    grid-template-columns: minmax(68px, 1fr) minmax(62px, auto) minmax(68px, 1fr);
    column-gap: 8px;
  }

  .hero-panel .flag-icon {
    width: 2.08rem;
    height: 1.38rem;
  }

  .hero-panel .team-name-text {
    max-width: 8.7ch;
    font-size: clamp(0.72rem, 3.55vw, 0.92rem);
  }

  .hero-panel .score-stack {
    min-width: 62px;
    max-width: 76px;
  }
}

/* =============================
   Batch 3 UI/layout refinement
   API-safe: CSS-only layout rules
   ============================= */

body {
  font-family: "Mulish", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Universal match-card grid: 1 = full, 2 = 50/50, 3 = thirds, max 3 per row, final row fills. */
.match-card-grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 16px !important;
  align-items: stretch;
}

.match-card-grid > .match-card {
  grid-column: span 2;
  width: 100%;
}

.match-card-grid[data-tail="1"] > .match-card:last-child {
  grid-column: span 6;
}

.match-card-grid[data-tail="2"] > .match-card:nth-last-child(-n + 2) {
  grid-column: span 3;
}

.match-card-grid[data-card-count="1"] > .match-card:only-child {
  grid-column: span 6;
}

.match-card-grid[data-card-count="2"] > .match-card {
  grid-column: span 3;
}

.match-grid,
.team-watch-grid,
.scoreboard-list,
.timeline,
.day-content {
  align-items: stretch;
}

.scoreboard-list.match-card-grid,
.timeline.match-card-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
}

/* Full schedule toolbar: search + date/team/stage filters */
.schedule-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) minmax(170px, 0.8fr) minmax(190px, 0.9fr) minmax(170px, 0.8fr) auto;
  align-items: end;
  gap: 12px;
}

.schedule-toolbar .chip-button {
  min-height: 46px;
  justify-content: center;
}

.result-filter-toolbar {
  flex-wrap: wrap;
}

/* Standings: max two group cards per row on desktop for better table readability. */
.standings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 18px !important;
}

.standings-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at top left, rgba(33, 208, 122, 0.08), transparent 14rem),
    linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.028));
  overflow: hidden;
}

.standings-card .table-wrap {
  overflow-x: auto;
  scrollbar-width: thin;
}

.standings-card table {
  min-width: 560px;
}

.standings-card th,
.standings-card td {
  padding: 10px 7px;
}

.standings-card .team-label {
  max-width: 230px;
}

/* Bracket section */
.bracket-scroll {
  overflow-x: auto;
  padding: 6px 0 16px;
  scrollbar-width: thin;
}

.bracket-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 16px;
  min-width: 1380px;
  align-items: start;
}

.bracket-round {
  display: grid;
  gap: 12px;
}

.bracket-round h3 {
  position: sticky;
  left: 0;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.075);
  color: var(--primary-2);
  text-align: center;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bracket-round-list {
  display: grid;
  gap: 10px;
}

.bracket-match {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(247, 201, 72, 0.10), transparent 10rem),
    linear-gradient(180deg, rgba(255,255,255,0.085), rgba(255,255,255,0.032));
  overflow: hidden;
}

.bracket-match-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bracket-team {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.055);
}

.bracket-team .team-label {
  font-size: 0.78rem;
}

.bracket-team strong,
.bracket-team em {
  font-style: normal;
  font-weight: 1000;
  color: var(--primary-2);
}

.bracket-team.is-winner .team-name-text {
  font-weight: 1000;
  color: var(--text);
}

.bracket-team.is-loser {
  opacity: 0.58;
}

.bracket-team.is-loser .team-name-text {
  text-decoration: line-through;
}

.bracket-match .penalty-line {
  justify-self: center;
  font-size: 0.72rem;
}

.bracket-match p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.bracket-empty {
  min-height: 92px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
}

/* Results and score labels should have enough room for full readable state names. */
.score-stack {
  min-width: 104px;
}

.score-stack small {
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0.02em;
}

.status-pill.status-finished,
.status-pill.status-live {
  white-space: nowrap;
}

/* Footer and translucent back-to-top button */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 54px;
  padding: 28px 0 38px;
}

.site-footer strong {
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 16px;
}

.footer-links a {
  color: var(--primary-2);
  font-weight: 900;
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(20, 56, 38, 0.32);
  color: var(--primary-2);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0,0,0,0.18);
  transition: opacity 160ms ease, background 160ms ease, transform 160ms ease;
}

html.is-scrolled .back-to-top {
  opacity: 0.48;
  pointer-events: auto;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  opacity: 1 !important;
  background: rgba(20, 56, 38, 0.82);
  transform: translateY(-2px);
}

html[data-theme="light"] .back-to-top {
  background: rgba(255, 255, 255, 0.48);
  color: #0f6b3e;
}

/* Richer light mode contrast */
html[data-theme="light"] .match-card,
html[data-theme="light"] .bracket-match,
html[data-theme="light"] .standings-card,
html[data-theme="light"] .feature-match {
  box-shadow: 0 18px 58px rgba(15, 77, 43, 0.11);
}

@media (max-width: 1180px) {
  .schedule-toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .schedule-toolbar .search-field,
  .schedule-toolbar .chip-button {
    grid-column: 1 / -1;
  }
  .standings-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 780px) {
  .match-card-grid,
  .scoreboard-list.match-card-grid,
  .timeline.match-card-grid {
    grid-template-columns: 1fr !important;
  }
  .match-card-grid > .match-card,
  .match-card-grid[data-tail="1"] > .match-card:last-child,
  .match-card-grid[data-tail="2"] > .match-card:nth-last-child(-n + 2),
  .match-card-grid[data-card-count="1"] > .match-card:only-child,
  .match-card-grid[data-card-count="2"] > .match-card {
    grid-column: 1 / -1;
  }
  .schedule-toolbar {
    grid-template-columns: 1fr;
  }
  .bracket-board {
    grid-template-columns: repeat(6, minmax(205px, 1fr));
    min-width: 1280px;
  }
  .score-stack {
    min-width: 76px;
  }
  .score-stack small {
    font-size: 0.62rem;
  }
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .footer-links {
    justify-content: flex-start;
  }
  .back-to-top {
    right: 12px;
    bottom: 12px;
    width: 44px;
    height: 44px;
  }
}

/* Patch: schedule toggle + resilient bracket/standings placeholders */
.flag-placeholder {
  display: inline-block;
  width: 22px;
  height: 15px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.26), rgba(255,255,255,0.04)),
    rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  flex: 0 0 auto;
}

.bracket-match--placeholder {
  border-style: dashed;
  opacity: 0.86;
}

.bracket-match--placeholder .team-name-text,
.bracket-match--placeholder em,
.standings-placeholder .empty-state {
  color: var(--muted);
}

#scheduleToggleBtn[aria-pressed="true"] {
  border-color: rgba(247, 201, 72, 0.44);
  color: var(--primary-2);
}


/* Final UI text/interaction patch: schedule toggle, back-to-top, and standings alignment */
.qualified-row .team-name-cell::after {
  content: none !important;
}

.standings-card table {
  table-layout: fixed;
}

.standings-card th,
.standings-card td {
  text-align: center !important;
  vertical-align: middle;
}

.standings-card th:nth-child(2),
.standings-card td.team-name-cell {
  text-align: left !important;
}

.standings-card th:first-child,
.standings-card td:first-child {
  width: 44px;
}

.standings-card th:nth-child(2),
.standings-card td:nth-child(2) {
  width: 210px;
}

.standings-team-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.standings-team-wrap .team-label {
  min-width: 0;
}

.qualification-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(33, 208, 122, 0.28);
  background: rgba(33, 208, 122, 0.10);
  color: var(--primary);
  font-size: 0.62rem;
  font-weight: 1000;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.day-summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--primary-2);
  font-weight: 1000;
}

.day-block:not(.is-collapsed) .day-summary::after {
  content: "−";
}

.back-to-top {
  cursor: pointer;
}

@media (max-width: 780px) {
  .standings-card table {
    min-width: 600px;
  }

  .standings-card th:nth-child(2),
  .standings-card td:nth-child(2) {
    width: 190px;
  }
}

/* Schedule collapse visibility fix
   Keep this after the universal match-card grid rules because .match-card-grid uses display:grid !important. */
.day-block.is-collapsed .day-content,
.day-block.is-collapsed .day-content.match-card-grid {
  display: none !important;
}


/* Bosnia and Herzegovina readability fix
   Targeted only to long-name rendering in hero panels and standings tables. */
.team-name-text--bosnia {
  overflow-wrap: normal !important;
  word-break: keep-all !important;
  hyphens: none !important;
}

.team-name-text--bosnia > span {
  white-space: nowrap;
}

.hero-panel .team-name-text--bosnia {
  display: inline-flex !important;
  flex-direction: column;
  align-items: inherit;
  max-width: 13ch !important;
  font-size: clamp(1.35rem, 2.45vw, 2.25rem) !important;
  line-height: 1.06 !important;
  letter-spacing: -0.02em;
}

.hero-panel .team-label--right .team-name-text--bosnia {
  align-items: flex-end;
}

.hero-panel .team-label--left .team-name-text--bosnia {
  align-items: flex-start;
}

.standings-card .team-name-text--bosnia {
  display: inline-flex !important;
  flex-direction: column;
  align-items: flex-start;
  max-width: 12ch !important;
  line-height: 1.08 !important;
  font-size: 0.92em;
}

.standings-card .team-name-cell,
.standings-card td.team-name-cell {
  overflow: visible;
}

.standings-team-wrap {
  flex-wrap: wrap;
  row-gap: 4px;
}

.standings-team-wrap .team-label {
  flex: 1 1 auto;
  min-width: 0;
}

.standings-card .qualification-badge {
  position: static !important;
  flex: 0 0 auto;
  white-space: nowrap;
  margin-left: 2px;
}

@media (max-width: 720px) {
  .hero-panel .team-name-text--bosnia {
    max-width: 12ch !important;
    font-size: clamp(0.74rem, 3.15vw, 0.9rem) !important;
    line-height: 1.02 !important;
    align-items: center !important;
    text-align: center !important;
  }

  .standings-card .team-name-text--bosnia {
    max-width: 12ch !important;
    font-size: 0.86em;
  }

  .standings-card .qualification-badge {
    font-size: 0.58rem;
    padding-inline: 6px;
  }
}

/* Targeted final fix: Bosnia and Herzegovina readability in hero + standings.
   API/JS untouched. Keeps the name as two clean lines and prevents Q Zone from wrapping below. */
.hero-panel .team-name-text--bosnia {
  max-width: 10.4ch !important;
  font-size: clamp(1rem, 1.65vw, 1.58rem) !important;
  line-height: 1.02 !important;
  letter-spacing: -0.035em;
}

.hero-panel-primary .team-name-text--bosnia {
  font-size: clamp(1.05rem, 1.7vw, 1.65rem) !important;
}

.hero-panel-secondary .team-name-text--bosnia {
  font-size: clamp(0.9rem, 1.35vw, 1.2rem) !important;
}

.hero-panel .team-label:has(.team-name-text--bosnia) {
  gap: 7px;
}

.hero-panel .team-label--right .team-name-text--bosnia {
  align-items: flex-end !important;
  text-align: right !important;
}

.hero-panel .team-label--left .team-name-text--bosnia {
  align-items: flex-start !important;
  text-align: left !important;
}

.standings-team-wrap {
  flex-wrap: nowrap !important;
  align-items: center !important;
  column-gap: 8px !important;
}

.standings-team-wrap .team-label {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
}

.standings-card .team-name-text--bosnia {
  max-width: 10.5ch !important;
  font-size: 0.84em !important;
  line-height: 1.02 !important;
  letter-spacing: -0.02em;
}

.standings-card .qualification-badge {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  min-width: max-content !important;
  margin-left: 0 !important;
  font-size: 0.58rem !important;
  padding: 3px 7px !important;
}

@media (max-width: 720px) {
  .hero-panel .team-name-text--bosnia,
  .hero-panel-primary .team-name-text--bosnia,
  .hero-panel-secondary .team-name-text--bosnia {
    max-width: 10ch !important;
    font-size: clamp(0.66rem, 2.9vw, 0.82rem) !important;
    line-height: 1.02 !important;
    letter-spacing: -0.025em;
  }

  .standings-card .team-name-text--bosnia {
    max-width: 10.5ch !important;
    font-size: 0.78em !important;
  }

  .standings-card .qualification-badge {
    font-size: 0.54rem !important;
    padding: 2px 6px !important;
  }
}


/* Live-score batch: safer hero team-name sizing so names like Canada do not break awkwardly. */
.hero-panel .hero-match-title {
  font-size: clamp(0.95rem, 1.95vw, 2.05rem) !important;
}

.hero-panel-primary .hero-match-title {
  font-size: clamp(1rem, 2.15vw, 2.35rem) !important;
}

.hero-panel .hero-match-title .team-name-text:not(.team-name-text--bosnia) {
  max-width: 12ch;
  line-height: 1.08;
  overflow-wrap: normal;
  word-break: keep-all;
  text-wrap: balance;
}

@media (max-width: 720px) {
  .hero-panel .hero-match-title,
  .hero-panel-primary .hero-match-title {
    font-size: clamp(0.72rem, 3.25vw, 0.95rem) !important;
  }

  .hero-panel .hero-match-title .team-name-text:not(.team-name-text--bosnia) {
    max-width: 8.5ch;
  }
}
