:root {
  color-scheme: light;
  --ink: #101820;
  --muted: #5e6a72;
  --line: #d8dee2;
  --surface: #ffffff;
  --band: #f2f6f4;
  --green: #006b54;
  --green-soft: #e7f1ec;
  --red: #9e1b32;
  --gold: #c89b3c;
  --blue: #144c7c;
  --live: #d72638;
  --shadow: 0 18px 45px rgba(16, 24, 32, 0.08);
  --shadow-soft: 0 8px 24px rgba(16, 24, 32, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #fbfcfb;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.site-header {
  padding: 36px 0 24px;
  color: var(--ink);
  background: #fbfcfb;
  border-bottom: 1px solid var(--line);
}

.header-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}

.header-main {
  align-self: center;
  padding-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: var(--green);
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4.6vw, 44px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.subtitle {
  max-width: 560px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-side {
  display: grid;
  gap: 12px;
  justify-items: end;
  min-width: min(360px, 38vw);
}

.hero-next {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.hero-next-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.hero-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-status.live {
  background: rgba(215, 38, 56, 0.1);
  color: var(--live);
  animation: pulse 1.6s ease-in-out infinite;
}

.hero-status.soon {
  background: var(--band);
  color: var(--muted);
}

.hero-match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.hero-team {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
}

.hero-team strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.hero-team small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.hero-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 26px;
  line-height: 1;
}

.hero-vs-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.hero-countdown {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(36, 126, 81, 0.1);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.hero-countdown::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.6s ease-in-out infinite;
}

.hero-vs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 26px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.hero-vs.live {
  color: var(--live);
  font-size: 17px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.hero-meta {
  display: grid;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.hero-time {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.hero-venue {
  color: var(--muted);
  font-size: 11px;
}

.hero-empty {
  display: block;
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 4px;
}

.button,
.icon-button,
.segment {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.button svg {
  flex-shrink: 0;
  opacity: 0.9;
}

.button:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.button.primary:hover {
  background: #1e7a48;
  border-color: #1e7a48;
  color: #fff;
}

.button.primary svg {
  opacity: 1;
}

main {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.summary-band > div {
  min-height: 92px;
  padding: 18px;
  background: var(--surface);
}

.metric {
  display: block;
  font-size: 28px;
  font-weight: 850;
  white-space: nowrap;
}

.metric-label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(150px, 0.7fr)) auto;
  gap: 12px;
  align-items: end;
  margin: 22px 0 12px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(4, 1fr);
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.segment {
  min-width: 66px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.segment:last-child {
  border-right: 0;
}

.segment.active {
  background: var(--green);
  color: #fff;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 12px 0 20px;
  padding: 12px 14px;
  border: 1px solid #d7e4dd;
  border-radius: 8px;
  background: var(--band);
  color: #21342d;
}

code {
  overflow-wrap: anywhere;
  color: var(--green);
}

.icon-button {
  min-height: 34px;
  padding: 0 12px;
  font-weight: 700;
}

.match-list {
  display: grid;
  gap: 12px;
  padding-bottom: 42px;
}

.team-detail {
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.team-hero {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 20px;
  background: linear-gradient(90deg, #f4f8f5, #ffffff);
}

.team-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 38px;
}

.team-hero h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.team-hero h2 span {
  color: var(--muted);
  font-size: 18px;
  font-weight: 650;
}

.team-hero p {
  max-width: 760px;
  margin: 0;
  color: #38444c;
  line-height: 1.65;
}

.team-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.team-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #d7e4dd;
  border-radius: 999px;
  background: #ffffff;
  color: #21342d;
  font-size: 12px;
  font-weight: 800;
}

.team-tags span:first-child {
  border-color: rgba(158, 27, 50, 0.22);
  background: #fff5f6;
  color: var(--red);
}

.close-detail {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.team-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.7fr) minmax(280px, 1fr);
  gap: 1px;
  background: var(--line);
}

.team-info-grid > div {
  padding: 18px;
  background: var(--surface);
}

.team-info-grid h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.story-list,
.team-schedule {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.story-list li {
  padding-left: 12px;
  border-left: 3px solid var(--gold);
  color: #344047;
  line-height: 1.55;
}

.fact-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.fact-list div {
  display: grid;
  gap: 3px;
}

.fact-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.fact-list dd {
  margin: 0;
  line-height: 1.5;
}

.team-schedule li {
  display: grid;
  gap: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf0f1;
}

.team-schedule li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.team-schedule span,
.team-schedule small {
  color: var(--muted);
  font-size: 12px;
}

.team-schedule strong {
  font-size: 14px;
}

.date-group {
  margin-top: 10px;
}

.date-title {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 2px;
  background: rgba(251, 252, 251, 0.94);
  backdrop-filter: blur(8px);
}

.date-title h2 {
  margin: 0;
  font-size: 22px;
}

.date-title span {
  color: var(--muted);
  font-size: 13px;
}

.match-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 64px 220px;
  gap: 18px;
  align-items: center;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.match-card:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 107, 84, 0.32);
  box-shadow: 0 16px 36px rgba(16, 24, 32, 0.1);
}

.match-card.is-live {
  border-color: rgba(215, 38, 56, 0.5);
  box-shadow: 0 14px 36px rgba(215, 38, 56, 0.14);
}

.match-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.match-status.live {
  background: rgba(215, 38, 56, 0.12);
  color: var(--live);
  animation: pulse 1.6s ease-in-out infinite;
}

.match-status.done {
  background: var(--green-soft);
  color: var(--green);
}

.match-status.pending {
  background: #eef2f4;
  color: var(--muted);
}

.score-stack.live {
  color: var(--live);
}

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

.time-block {
  color: var(--muted);
}

.time-block strong {
  display: block;
  color: var(--ink);
  font-size: 26px;
}

.teams {
  display: grid;
  gap: 10px;
}

.team-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.team-link {
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}

.team-link:hover,
.team-link:focus-visible {
  outline: 2px solid rgba(0, 107, 84, 0.18);
  background: #f3f8f5;
}

.team-link.disabled {
  pointer-events: none;
}

.flag {
  width: 44px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #f7f9f8;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 26px;
  line-height: 1;
}

.team-name {
  min-width: 0;
  font-size: 18px;
  font-weight: 800;
}

.team-name small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.score-stack,
.score-button {
  display: grid;
  align-self: stretch;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  min-width: 54px;
  justify-items: center;
  align-items: center;
  color: var(--ink);
  font-size: 24px;
  font-weight: 850;
}

.score-button {
  width: 54px;
  min-height: 68px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.score-button:hover,
.score-button:focus-visible {
  border-color: rgba(0, 107, 84, 0.28);
  background: #f3f8f5;
  outline: 0;
}

.goal-details {
  margin: -4px 0 8px 130px;
  padding: 14px 16px;
  border: 1px solid #d7e4dd;
  border-radius: 8px;
  background: #f8fbf9;
}

.goal-details h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.goal-details ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.goal-details li {
  display: grid;
  grid-template-columns: 58px 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.goal-details time {
  color: var(--green);
  font-weight: 850;
}

.goal-details small {
  grid-column: 3;
  color: var(--muted);
}

.goal-empty {
  margin: 0;
  color: var(--muted);
}

.meta {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.pill {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f0f4f6;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.calendar-link {
  width: fit-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid #d7e4dd;
  border-radius: 8px;
  background: #f3f8f5;
  color: var(--green);
  text-decoration: none;
  font-size: 13px;
  font-weight: 850;
}

.calendar-link:hover,
.calendar-link:focus-visible {
  border-color: rgba(0, 107, 84, 0.32);
  background: #e8f2ed;
  outline: 0;
}

.empty {
  padding: 40px 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .header-shell,
  .toolbar,
  .team-info-grid {
    grid-template-columns: 1fr;
  }

  .match-card {
    grid-template-columns: 88px minmax(0, 1fr) 54px;
  }

  .match-card .meta {
    grid-column: 2 / 4;
  }

  .header-shell {
    align-items: start;
    min-height: 0;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .header-side {
    justify-items: start;
    min-width: 0;
  }

  .hero-next {
    max-width: none;
  }

  .goal-details {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding-top: 28px;
    padding-bottom: 20px;
  }

  .summary-band > div {
    min-height: 72px;
    padding: 12px 10px;
  }

  .metric {
    font-size: 18px;
  }

  .metric-label {
    margin-top: 4px;
    font-size: 11px;
  }

  .segmented {
    width: 100%;
  }

  .notice,
  .team-hero,
  footer {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .match-card {
    gap: 12px;
  }
}

/* ---------- View tabs ---------- */
.view-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 22px 0 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.view-tab {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  text-align: center;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.view-tab:hover {
  color: var(--ink);
  background: var(--band);
}

.view-tab.active {
  background: linear-gradient(135deg, var(--green), #014c3c);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 107, 84, 0.28);
}

.view-tab.active .view-tab-sub {
  color: rgba(255, 255, 255, 0.78);
}

.view-tab-title {
  display: block;
  font-size: 16px;
  font-weight: 850;
}

.view-tab-sub {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.view-panel {
  margin-top: 4px;
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 8px 0 18px;
}

.view-head h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.view-head p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.view-head-meta {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--band);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

/* ---------- Standings ---------- */
.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
  padding-bottom: 42px;
}

.standings-card {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.standings-card.third-card {
  grid-column: 1 / -1;
}

.standings-card > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--green-soft), #f7faf8);
}

.standings-card > header h3 {
  margin: 0;
  font-size: 17px;
  color: var(--green);
}

.standings-card > header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.standings-table {
  display: grid;
}

.standings-head,
.standings-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1.5fr) repeat(7, 30px) 36px;
  gap: 6px;
  align-items: center;
  padding: 9px 14px;
  font-size: 13px;
}

.standings-table.thirds .standings-head,
.standings-table.thirds .standings-row {
  grid-template-columns: 28px minmax(0, 1.5fr) 36px repeat(5, 30px) 36px;
}

.standings-head {
  border-bottom: 1px solid var(--line);
  background: #fafbfa;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.standings-row {
  border-top: 1px solid #eef0ef;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.18s ease;
}

.standings-row:first-of-type {
  border-top: 0;
}

.standings-row:hover {
  background: var(--band);
}

.standings-row.qualified {
  background: rgba(0, 107, 84, 0.05);
}

.standings-row.qualified.third {
  background: rgba(200, 155, 60, 0.1);
}

.standings-row.border-third {
  border-bottom: 1px dashed rgba(94, 106, 114, 0.35);
}

.standings-row .rank {
  font-weight: 850;
  color: var(--muted);
}

.standings-row.qualified .rank {
  color: var(--green);
}

.standings-row.qualified.third .rank {
  color: var(--gold);
}

.standings-row .team {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.standings-row .team .flag {
  width: 28px;
  height: 22px;
  font-size: 18px;
  border-radius: 2px;
}

.team-name-cell {
  display: grid;
  min-width: 0;
}

.team-name-cell strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
}

.team-name-cell small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.standings-row .num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.standings-row .num.pts {
  font-weight: 850;
  color: var(--green);
}

/* ---------- Knockout ---------- */
.knockout-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 14px;
  padding-bottom: 42px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.ko-column {
  display: grid;
  align-content: start;
  gap: 12px;
  scroll-snap-align: start;
}

.ko-column-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green-soft), #fff);
}

.ko-column-head h3 {
  margin: 0;
  color: var(--green);
  font-size: 16px;
}

.ko-column-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.ko-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ko-card:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 107, 84, 0.3);
  box-shadow: 0 14px 30px rgba(16, 24, 32, 0.1);
}

.ko-card.is-live {
  border-color: rgba(215, 38, 56, 0.45);
}

.ko-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
  font-size: 11px;
  color: var(--muted);
}

.ko-id {
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ko-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.ko-tag.live {
  background: rgba(215, 38, 56, 0.12);
  color: var(--live);
  animation: pulse 1.6s ease-in-out infinite;
}

.ko-tag.done {
  background: var(--green-soft);
  color: var(--green);
}

.ko-tag.pending {
  background: #eef2f4;
  color: var(--muted);
}

.ko-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-radius: 6px;
}

.ko-row .flag {
  width: 28px;
  height: 22px;
  font-size: 18px;
  border-radius: 2px;
}

.ko-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
}

.ko-code {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ko-row.win {
  color: var(--green);
}

.ko-row.win .ko-name::after {
  content: " \2713";
  color: var(--green);
}

.ko-row.lose {
  color: var(--muted);
}

.ko-row.lose .ko-name {
  text-decoration: line-through;
  text-decoration-color: rgba(94, 106, 114, 0.45);
}

.ko-mid {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2px 0;
}

.ko-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #f3f5f6;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.ko-score.live {
  background: rgba(215, 38, 56, 0.1);
  color: var(--live);
}

.ko-score.pending {
  background: var(--green-soft);
  color: var(--green);
}

.ko-card > footer {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

/* ---------- Teams grid ---------- */
.teams-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.teams-toolbar .search-box {
  flex: 1 1 280px;
  min-width: 220px;
}

.segmented.confed {
  display: inline-flex;
  flex-wrap: wrap;
  width: auto;
  height: auto;
  grid-template-columns: none;
}

.segmented.confed .segment {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 14px;
  border-right: 1px solid var(--line);
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding-bottom: 42px;
}

.team-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.team-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 107, 84, 0.3);
  box-shadow: 0 16px 36px rgba(16, 24, 32, 0.1);
}

.team-card-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.team-card-head .flag {
  width: 44px;
  height: 32px;
  font-size: 26px;
}

.team-card-head strong {
  display: block;
  font-size: 17px;
  font-weight: 850;
}

.team-card-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.team-card-head em {
  align-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.team-card-confed {
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.team-card-intro {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: #38444c;
  font-size: 13px;
  line-height: 1.55;
}

.team-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 0;
  border-top: 1px dashed #e3e8ea;
  border-bottom: 1px dashed #e3e8ea;
}

.team-card-stats div {
  text-align: center;
}

.team-card-stats span {
  display: block;
  font-size: 18px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.team-card-stats small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.team-card-next {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .view-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .view-tab {
    padding: 10px 6px;
  }

  .view-tab-title {
    font-size: 14px;
  }

  .view-tab-sub {
    display: none;
  }

  .standings-head,
  .standings-row {
    grid-template-columns: 24px minmax(0, 1.4fr) repeat(7, 24px) 32px;
    padding: 9px 10px;
    font-size: 12px;
  }

  .standings-table.thirds .standings-head,
  .standings-table.thirds .standings-row {
    grid-template-columns: 24px minmax(0, 1.4fr) 28px repeat(5, 24px) 32px;
  }

  .knockout-board {
    grid-auto-columns: 80%;
  }
}

@media (max-width: 640px) {
  .view-head h2 {
    font-size: 20px;
  }

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

  .standings-head,
  .standings-row {
    grid-template-columns: 22px minmax(0, 1.2fr) repeat(7, 22px) 30px;
    gap: 4px;
    padding: 8px 8px;
  }

  .standings-table.thirds .standings-head,
  .standings-table.thirds .standings-row {
    grid-template-columns: 22px minmax(0, 1.2fr) 26px repeat(5, 22px) 30px;
  }

  .knockout-board {
    grid-auto-columns: 86%;
  }

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