:root {
  --bg: #eef3ef;
  --paper: #fffdf8;
  --paper-2: #f6f8f4;
  --ink: #17201d;
  --muted: #6a746f;
  --line: #d9dfd8;
  --line-strong: #bdc8c0;
  --green: #137d55;
  --green-deep: #0d4f3b;
  --gold: #c4a04b;
  --red: #c83f38;
  --blue: #2f6fa3;
  --shadow: 0 16px 42px rgba(23, 32, 29, 0.08);
  --refresh-progress: 0%;
  --bracket-card-h: 120px;
  --bracket-gap: 10px;
  --bracket-stack-h: 1030px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(19, 125, 85, 0.1), rgba(238, 243, 239, 0) 360px),
    radial-gradient(circle at 18% 0%, rgba(196, 160, 75, 0.14), transparent 30%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1920px, 100%);
  margin: 0 auto;
  padding: 14px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(420px, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 32, 29, 0.1);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fffdf8;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-kicker,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.brand strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-switcher {
  display: inline-grid;
  grid-template-columns: repeat(4, 1fr);
  min-width: 360px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf2ed;
}

.view-switcher button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.view-switcher button.is-active {
  background: var(--ink);
  color: #fffdf8;
  box-shadow: 0 6px 16px rgba(23, 32, 29, 0.16);
}

.top-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.search-shell,
.select-shell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.search-shell {
  flex: 1;
  max-width: 320px;
  padding: 0 12px;
}

.search-shell span {
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.search-shell input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.select-shell {
  padding-left: 10px;
}

.select-shell span {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.select-shell select {
  height: 42px;
  max-width: 142px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 7px 7px 0;
  background: #fff;
  color: var(--ink);
  font-weight: 750;
  outline: 0;
  padding: 0 24px 0 8px;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.icon-button:hover,
.view-switcher button:hover {
  border-color: rgba(23, 32, 29, 0.24);
}

.refresh-button.is-spinning {
  animation: spin 0.6s ease-in-out;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.pulse-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(430px, auto) minmax(190px, auto);
  gap: 18px;
  align-items: center;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 29, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(19, 125, 85, 0.12), rgba(196, 160, 75, 0.15)),
    var(--paper);
  padding: 18px;
  box-shadow: var(--shadow);
}

.pulse-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 32, 29, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 29, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(90deg, black, transparent 82%);
}

.hero-title,
.metrics,
.sync-chip {
  position: relative;
  z-index: 1;
}

.hero-title p {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-title h1 {
  width: min(760px, 100%);
  margin: 0;
  font-size: clamp(30px, 4vw, 60px);
  line-height: 1;
  letter-spacing: 0;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(200, 63, 56, 0.16);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(76px, 1fr));
  gap: 8px;
}

.metrics div {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(23, 32, 29, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.metrics strong {
  display: block;
  font-size: clamp(24px, 2vw, 32px);
  line-height: 1;
}

.metrics span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.sync-chip {
  display: grid;
  gap: 6px;
  justify-items: end;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.sync-chip small {
  display: block;
  max-width: 260px;
  overflow: hidden;
  color: var(--green-deep);
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-chip b {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 2px solid var(--green);
  border-radius: 50%;
  background: #fff;
  color: var(--green-deep);
}

.refresh-meter {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green) var(--refresh-progress), transparent 0);
}

.today-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 14px;
  align-items: stretch;
  margin-top: 14px;
}

.today-panel,
.confidence-card {
  min-width: 0;
}

.today-card,
.confidence-shell {
  height: 100%;
  border: 1px solid rgba(23, 32, 29, 0.1);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.today-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.today-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--blue));
}

.today-card.is-live::before {
  background: linear-gradient(90deg, var(--red), var(--gold));
}

.today-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
  gap: 18px;
  align-items: start;
}

.today-copy h2 {
  margin: 6px 0 6px;
  font-size: clamp(28px, 3vw, 50px);
  line-height: 0.98;
  letter-spacing: 0;
}

.today-copy h2 .versus-word {
  color: var(--gold);
  font-size: 0.72em;
}

.today-copy p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.45;
}

.countdown-tile {
  display: grid;
  gap: 6px;
  justify-items: end;
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: 18px;
  text-align: right;
}

.countdown-tile span,
.countdown-tile small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.countdown-tile strong {
  color: var(--green-deep);
  font-size: clamp(23px, 2vw, 34px);
  line-height: 1;
}

.today-scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  border-block: 1px solid var(--line);
  padding: 16px 0;
}

.today-team {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.today-team.is-away {
  justify-items: end;
  text-align: right;
}

.today-team span {
  font-size: 28px;
  line-height: 1;
}

.today-team strong {
  overflow: hidden;
  font-size: clamp(18px, 2vw, 30px);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-team small,
.today-score span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.today-score {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.today-score strong {
  display: grid;
  min-width: 72px;
  min-height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fffdf8;
  font-size: 24px;
  line-height: 1;
}

.today-card.is-live .today-score strong {
  background: var(--red);
}

.today-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 0;
}

.today-details div {
  min-width: 0;
  border-left: 2px solid var(--line-strong);
  padding-left: 10px;
}

.today-details dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.today-details dd {
  overflow: hidden;
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.today-rail-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  padding: 9px;
}

.today-rail-item span,
.today-rail-item small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.today-rail-item strong {
  display: block;
  overflow: hidden;
  margin: 4px 0;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confidence-shell {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  align-content: start;
  padding: 16px;
}

.confidence-shell h2 {
  margin: 3px 0 6px;
  font-size: 22px;
  line-height: 1.05;
}

.confidence-shell p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.confidence-shell ul {
  grid-column: 2;
  display: grid;
  gap: 7px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.confidence-shell li {
  border-top: 1px solid var(--line);
  padding-top: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.confidence-dot {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(19, 125, 85, 0.12);
}

.confidence-shell.is-live .confidence-dot {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(200, 63, 56, 0.14);
}

.confidence-shell.is-warning .confidence-dot {
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(196, 160, 75, 0.16);
}

.confidence-shell.is-error .confidence-dot {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(200, 63, 56, 0.14);
}

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

.status-card {
  display: grid;
  align-content: space-between;
  min-height: 118px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(23, 32, 29, 0.06);
}

.status-card.is-live {
  border-color: rgba(200, 63, 56, 0.38);
  background: linear-gradient(180deg, #fff, #fff7f5);
}

.status-top,
.status-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-top,
.status-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.status-top span,
.status-top b,
.status-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-top b {
  color: var(--green-deep);
}

.status-card.is-live .status-top b {
  color: var(--red);
}

.status-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 10px 0;
  font-size: 14px;
  font-weight: 900;
}

.status-match span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-match span:last-child {
  text-align: right;
}

.status-match strong {
  min-width: 0;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  text-align: center;
}

.chart-layout {
  display: grid;
  grid-template-columns: minmax(260px, 310px) minmax(0, 1fr) minmax(260px, 310px);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.groups-rail {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.group-card,
.center-stage,
.fixtures-panel,
.groups-panel,
.third-place-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.group-card {
  min-width: 0;
  overflow: hidden;
  border-top: 5px solid var(--accent);
}

.group-card.is-hidden {
  display: none;
}

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 62px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(19, 125, 85, 0.08), #fff 78%);
}

.group-head h2,
.chart-header h2,
.section-head h2,
.third-place-card h2 {
  overflow: hidden;
  margin: 2px 0 0;
  font-size: 19px;
  line-height: 1.1;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-badge {
  flex: 0 0 auto;
  max-width: 92px;
  overflow: hidden;
  border: 1px solid rgba(19, 125, 85, 0.22);
  border-radius: 999px;
  padding: 5px 8px;
  background: #fff;
  color: var(--green-deep);
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standings,
.third-place-card table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.standings th,
.standings td,
.third-place-card th,
.third-place-card td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(217, 223, 216, 0.82);
  text-align: right;
  font-size: 12px;
}

.standings th {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.standings th:nth-child(1),
.standings td:nth-child(1) {
  width: 26px;
}

.standings th:nth-child(2),
.standings td:nth-child(2),
.third-place-card th:nth-child(3),
.third-place-card td:nth-child(3) {
  text-align: left;
}

.standings tr.qualifies td:first-child {
  color: var(--green-deep);
}

.standings tr.watch td:first-child {
  color: var(--gold);
}

.pos {
  color: var(--muted);
  font-weight: 900;
}

.team-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-weight: 850;
}

.team-cell span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flag {
  display: inline-block;
  margin-right: 5px;
  font-size: 15px;
  line-height: 1;
  vertical-align: -2px;
}

.flag-right {
  margin-right: 0;
  margin-left: 5px;
}

.points {
  color: var(--green-deep);
  font-weight: 900;
}

.group-foot {
  min-height: 58px;
  padding: 10px 12px 12px;
}

.mini-fixture {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  border-left: 3px solid var(--accent);
  padding-left: 8px;
  font-size: 12px;
}

.mini-fixture strong,
.mini-fixture span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-fixture span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.center-stage {
  min-width: 0;
  overflow: hidden;
  padding: 12px;
}

.chart-header,
.section-head,
.third-place-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px 14px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-live {
  background: var(--red);
}

.legend-next {
  background: var(--green);
}

.legend-lock {
  background: var(--gold);
}

.bracket-board {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid rgba(217, 223, 216, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(23, 32, 29, 0.035) 1px, transparent 1px),
    #fffdf8;
  background-size: 196px 100%;
  padding: 12px;
}

.bracket-grid {
  display: grid;
  grid-template-columns: 188px 188px 188px 224px 188px 188px 188px;
  gap: 14px;
  min-width: 1378px;
}

.round,
.round-column {
  min-width: 0;
}

.round-center {
  display: grid;
  gap: 14px;
  align-content: center;
}

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

.round-title {
  display: grid;
  gap: 3px;
  min-height: 46px;
  align-content: center;
  border: 1px solid rgba(23, 32, 29, 0.16);
  border-radius: 8px;
  background: var(--ink);
  padding: 7px 9px;
  color: #fffdf8;
}

.round-title h3 {
  margin: 0;
  overflow: hidden;
  font-size: 12px;
  letter-spacing: 0;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.round-title span {
  overflow: hidden;
  color: rgba(255, 253, 248, 0.72);
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.round-stack {
  display: grid;
  gap: var(--bracket-gap);
  position: relative;
}

.round-r32 .round-stack {
  grid-template-rows: repeat(8, minmax(var(--bracket-card-h), auto));
}

.round-r16 .round-stack {
  grid-template-rows: repeat(4, minmax(var(--bracket-card-h), auto));
  align-content: space-around;
  min-height: var(--bracket-stack-h);
}

.round-qf .round-stack {
  grid-template-rows: repeat(2, minmax(var(--bracket-card-h), auto));
  align-content: space-around;
  min-height: var(--bracket-stack-h);
}

.round-center .round-stack {
  grid-template-rows: none;
}

.round-center .round-column {
  align-content: start;
}

.knockout-card {
  position: relative;
  display: grid;
  grid-template-rows: 29px 28px 20px 28px 1fr;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(23, 32, 29, 0.05);
}

.knockout-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--gold);
}

.knockout-card.is-final::before {
  background: var(--green);
}

.knockout-card.is-live {
  border-color: rgba(200, 63, 56, 0.45);
}

.match-meta,
.venue-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 9px 9px 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.match-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 850;
}

.slot-row span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-box {
  display: grid;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-2);
  font-weight: 900;
}

.score-box.is-empty {
  background:
    linear-gradient(135deg, transparent 46%, rgba(23, 32, 29, 0.18) 47%, rgba(23, 32, 29, 0.18) 53%, transparent 54%),
    var(--paper-2);
}

.slot-row.is-pending span:first-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.versus {
  height: 20px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 20px;
  text-align: center;
}

.venue-line {
  display: block;
  overflow: hidden;
  padding-top: 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.third-place-card {
  margin-top: 12px;
  padding: 12px;
  box-shadow: none;
}

.third-place-card header {
  padding: 0 0 10px;
}

.third-place-card th,
.third-place-card td {
  font-size: 12px;
}

.third-place-card tr.is-qualifying td:first-child {
  color: var(--green-deep);
  font-weight: 900;
}

.fixtures-panel,
.groups-panel {
  margin-top: 14px;
  padding: 14px;
}

.section-head {
  padding: 0 0 14px;
}

.section-head strong {
  color: var(--green-deep);
  font-size: 13px;
}

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

.fixture-day {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.fixture-day h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.fixture-day-list {
  display: grid;
  gap: 6px;
}

.fixture-row {
  display: grid;
  grid-template-columns: 88px minmax(280px, 1.5fr) minmax(210px, 0.82fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 78px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.fixture-row.is-live {
  border-color: rgba(200, 63, 56, 0.42);
  background: #fff8f6;
}

.fixture-time {
  display: grid;
  gap: 3px;
}

.fixture-time strong {
  font-size: 16px;
  line-height: 1;
}

.fixture-time span,
.fixture-stage span,
.fixture-stage b,
.fixture-venue span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.fixture-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  font-size: 14px;
  font-weight: 900;
}

.fixture-teams span,
.fixture-stage span,
.fixture-stage b,
.fixture-venue {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixture-teams span:last-child {
  text-align: right;
}

.fixture-teams b {
  min-width: 0;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  line-height: 28px;
  text-align: center;
}

.fixture-venue {
  font-weight: 850;
}

.fixture-stage {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.fixture-status-pill {
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(19, 125, 85, 0.22);
  border-radius: 999px;
  background: #f2f7f3;
  padding: 3px 7px;
  color: var(--green-deep);
}

.fixture-meta-line {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  align-items: baseline;
}

.fixture-meta-line b {
  color: var(--muted);
  font-weight: 900;
}

.fixture-meta-line span {
  color: var(--ink);
}

.fixture-row.is-live .fixture-status-pill {
  border-color: rgba(200, 63, 56, 0.26);
  background: #fff0ed;
  color: var(--red);
}

.fixture-venue {
  display: grid;
  gap: 2px;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 10px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-weight: 800;
}

/* ---- Following (My teams) ---- */
.my-teams {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.my-teams-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 12px;
}

.my-teams.is-empty .my-teams-head {
  padding-bottom: 10px;
}

.link-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.link-button:hover {
  border-color: rgba(23, 32, 29, 0.24);
  color: var(--ink);
}

.my-teams.is-empty .link-button {
  display: none;
}

.my-teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.my-team-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.my-team-card.q-through {
  border-left-color: var(--green);
}

.my-team-card.q-out {
  border-left-color: var(--red);
}

.my-team-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.my-team-flag {
  flex: 0 0 auto;
  font-size: 26px;
  line-height: 1;
}

.my-team-name {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
}

.my-team-name strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-team-name span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.my-team-fixtures {
  display: grid;
  gap: 6px;
}

.my-team-line {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 4px 8px;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

.my-team-line b {
  grid-row: span 2;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.my-team-opp {
  overflow: hidden;
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-team-when {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-team-line.is-empty .my-team-when,
.my-team-line.is-empty span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.my-team-line.is-live .my-team-opp {
  color: var(--red);
}

/* ---- Follow stars ---- */
.fav-star {
  flex: 0 0 auto;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--line-strong);
  font-size: 15px;
  line-height: 1;
}

.fav-star:hover {
  color: var(--gold);
}

.fav-star.is-on {
  color: var(--gold);
}

.my-team-head .fav-star {
  font-size: 18px;
}

/* ---- Qualification badges ---- */
.q-badge {
  flex: 0 0 auto;
  display: inline-grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.q-badge.q-through {
  background: rgba(19, 125, 85, 0.16);
  color: var(--green-deep);
}

.q-badge.q-watch {
  background: rgba(196, 160, 75, 0.22);
  color: #7a5d12;
}

.q-badge.q-out {
  background: rgba(200, 63, 56, 0.16);
  color: var(--red);
}

/* ---- Richer standings ---- */
.team-cell .team-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standings th,
.standings td {
  padding: 6px 4px;
  font-size: 11.5px;
}

.standings th {
  font-size: 9.5px;
}

.standings th:nth-child(1),
.standings td:nth-child(1) {
  width: 22px;
}

.standings th:nth-child(3),
.standings td:nth-child(3),
.standings th:nth-child(4),
.standings td:nth-child(4),
.standings th:nth-child(5),
.standings td:nth-child(5),
.standings th:nth-child(6),
.standings td:nth-child(6) {
  width: 20px;
}

.standings th:nth-child(7),
.standings td:nth-child(7) {
  width: 30px;
}

.standings th:nth-child(8),
.standings td:nth-child(8) {
  width: 28px;
}

.standings tr.q-through td:first-child {
  color: var(--green-deep);
}

.standings tr.q-watch td:first-child {
  color: var(--gold);
}

.standings tr.q-out {
  opacity: 0.62;
}

.standings tr.is-fav,
.slot-row.is-fav,
.standings tr.is-fav .points {
  color: var(--green-deep);
}

.standings tr.is-fav td.team-cell .team-name {
  font-weight: 900;
}

/* ---- Projected bracket slots ---- */
.slot-row.is-projected span:first-child {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.proj-tag {
  margin-left: 5px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(196, 160, 75, 0.2);
  color: #7a5d12;
  font-size: 8.5px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.slot-row.is-fav span:first-child {
  font-weight: 900;
}

/* ---- Favourite highlight on cards ---- */
.status-card.has-fav,
.fixture-row.has-fav,
.knockout-card.has-fav,
.today-card.has-fav {
  box-shadow: 0 0 0 2px rgba(196, 160, 75, 0.55), 0 12px 28px rgba(23, 32, 29, 0.06);
}

.knockout-card.has-fav {
  box-shadow: 0 0 0 2px rgba(196, 160, 75, 0.55);
}

@media (max-width: 1680px) {
  .topbar {
    grid-template-columns: minmax(230px, 1fr) auto minmax(380px, 1fr);
  }

  .chart-layout {
    grid-template-columns: minmax(250px, 292px) minmax(0, 1fr) minmax(250px, 292px);
  }

  .bracket-grid {
    grid-template-columns: 176px 176px 176px 208px 176px 176px 176px;
    min-width: 1312px;
  }

  .groups-grid {
    grid-template-columns: repeat(3, minmax(240px, 1fr));
  }
}

@media (max-width: 1180px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr;
  }

  .view-switcher {
    width: 100%;
  }

  .top-controls {
    justify-content: stretch;
  }

  .pulse-panel {
    grid-template-columns: 1fr;
  }

  .today-command {
    grid-template-columns: 1fr;
  }

  .sync-chip {
    justify-items: start;
    text-align: left;
  }

  .chart-layout {
    grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  }

  #rightGroups {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
  }

  .live-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1060px) {
  .app-shell {
    padding: 10px;
  }

  .top-controls {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
  }

  .search-shell {
    grid-column: 1 / -1;
    max-width: none;
  }

  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .today-main {
    grid-template-columns: 1fr;
  }

  .countdown-tile {
    justify-items: start;
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 12px;
    padding-left: 0;
    text-align: left;
  }

  .today-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-strip,
  #rightGroups {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .status-card,
  #rightGroups .group-card {
    min-width: 252px;
  }

  .chart-layout {
    display: block;
  }

  .center-stage {
    margin-top: 10px;
  }

  .groups-rail {
    grid-template-columns: repeat(2, minmax(230px, 1fr));
  }

  .fixture-row {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .fixture-stage,
  .fixture-venue {
    grid-column: 2;
  }

  .groups-grid {
    grid-template-columns: repeat(2, minmax(230px, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar {
    position: static;
    gap: 9px;
    min-height: 0;
    padding: 9px;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    font-size: 19px;
  }

  .view-switcher {
    min-width: 0;
  }

  .view-switcher button {
    min-height: 36px;
    font-size: 12px;
  }

  .top-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
  }

  .search-shell,
  .select-shell {
    min-height: 40px;
  }

  .select-shell {
    min-width: 0;
  }

  .select-shell select {
    height: 38px;
    width: 100%;
    max-width: none;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .hero-title h1 {
    font-size: 32px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-card {
    padding: 14px;
  }

  .today-copy h2 {
    font-size: 30px;
  }

  .today-scoreboard {
    grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr);
    gap: 8px;
    padding: 13px 0;
  }

  .today-team span {
    font-size: 22px;
  }

  .today-team strong {
    font-size: 16px;
  }

  .today-score strong {
    min-width: 58px;
    min-height: 42px;
    font-size: 20px;
  }

  .today-details {
    grid-template-columns: 1fr;
  }

  .confidence-shell {
    padding: 14px;
  }

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

  .chart-header,
  .section-head,
  .third-place-card header {
    align-items: flex-start;
    flex-direction: column;
  }

  .fixture-row {
    grid-template-columns: 1fr;
  }

  .fixture-stage,
  .fixture-venue {
    grid-column: auto;
  }

  .fixture-teams {
    grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  }
}
