:root {
  color-scheme: light;
  --ink: #111312;
  --muted: #637069;
  --line: #d9dfdc;
  --panel: #ffffff;
  --paper: #f2f5f3;
  --paper-strong: #e7ede9;
  --accent: #0f9f6e;
  --accent-dark: #096947;
  --accent-soft: #dff5ec;
  --warn: #b84b2f;
  --blue: #2468d8;
  --host-red: #d53b35;
  --host-blue: #315f9c;
  --radius: 8px;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(180deg, #fbfcfb 0, var(--paper) 560px);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 26px 0 46px;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 10px 0 27px;
}

.topbar::before {
  position: absolute;
  right: 0;
  bottom: 10px;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--accent-dark) 0 33.333%,
    var(--host-red) 33.333% 66.666%,
    var(--host-blue) 66.666% 100%
  );
  content: "";
  opacity: 0.72;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 56px;
  line-height: 0.95;
}

h2 {
  font-size: 22px;
  line-height: 1.15;
}

.title-line,
.detail-title-line {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.info-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.info-button {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(17, 19, 18, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.info-button:focus-visible,
.schedule-info-button:focus-visible,
.close-button:focus-visible,
.match-card:focus-visible,
.schedule-row:focus-visible,
.prob-row:focus-visible,
.team-chip:focus-visible,
.team-schedule-item:focus-visible {
  outline: 3px solid rgba(15, 159, 110, 0.3);
  outline-offset: 3px;
}

.schedule-info-button {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(9, 105, 71, 0.28);
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.schedule-info-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.info-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 20;
  width: min(330px, calc(100vw - 40px));
  max-width: 330px;
  transform: translateX(-50%) translateY(-4px);
  border: 1px solid rgba(17, 19, 18, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 45px rgba(39, 60, 51, 0.16);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  opacity: 0;
  padding: 12px 13px;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.info-wrap:hover .info-popover,
.info-wrap:focus-within .info-popover,
.info-wrap.open .info-popover {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.status-pill {
  min-width: 88px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 7px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.status-pill.ok {
  border-color: rgba(15, 159, 110, 0.35);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.status-pill.warn {
  border-color: rgba(184, 75, 47, 0.35);
  background: #fff0ea;
  color: var(--warn);
}

.timestamp {
  color: var(--muted);
  font-size: 13px;
}

.host-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

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

.host-ribbon img {
  width: 20px;
  height: 14px;
  border: 1px solid rgba(17, 19, 18, 0.12);
  border-radius: 2px;
  object-fit: cover;
}

.host-ribbon strong {
  color: var(--accent-dark);
  font-size: 12px;
}

.match-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: stretch;
}

.champion-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.42fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.pitch-panel,
.panel {
  border: 1px solid rgba(17, 19, 18, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 50px rgba(39, 60, 51, 0.08);
}

.pitch-panel {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(8, 52, 38, 0.96), rgba(12, 105, 76, 0.9)),
    #0b513b;
  color: #ffffff;
}

.pitch-lines {
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 24px;
}

.pitch-lines::before,
.pitch-lines::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.pitch-lines::before {
  inset: 18% 42%;
  border-radius: 999px;
}

.pitch-lines::after {
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 0;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 260px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 26px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.06));
}

.hero-copy .section-kicker {
  color: #b9f5d9;
}

.favorite-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.favorite-row .label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
}

.favorite-row strong {
  display: block;
  font-size: 50px;
  line-height: 0.92;
}

.favorite-score {
  font-size: 62px;
  font-weight: 850;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.hero-meter {
  height: 10px;
  margin: 22px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.hero-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #79f2bf;
  transition: width 360ms ease;
}

.source-note {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  line-height: 1.5;
}

.panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-header.compact {
  margin-bottom: 12px;
}

.schedule-panel {
  height: max(620px, calc(100dvh - 152px));
  min-width: 0;
  overflow: auto;
  padding-top: 0;
}

.schedule-header {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  padding: 20px 0 16px;
  backdrop-filter: blur(12px);
}

.schedule-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.match-count {
  border: 1px solid rgba(15, 159, 110, 0.22);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
  padding: 5px 8px;
  white-space: nowrap;
}

.next-panel {
  position: sticky;
  top: 16px;
  height: max(620px, calc(100dvh - 152px));
  overflow: auto;
}

.champion-summary {
  position: sticky;
  top: 16px;
}

.view-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.view-switch button {
  min-width: 70px;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.view-switch button.active {
  background: var(--ink);
  color: white;
}

.table-head,
.prob-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1fr);
  gap: 18px;
  align-items: center;
}

.table-head {
  padding: 0 0 9px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.probability-list {
  display: grid;
  gap: 0;
}

.prob-row {
  min-height: 64px;
  border-bottom: 1px solid rgba(17, 19, 18, 0.08);
  cursor: pointer;
  transition:
    background 160ms ease,
    padding 160ms ease;
}

.prob-row:hover {
  background: rgba(15, 159, 110, 0.05);
}

.team-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.rank {
  display: inline-flex;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.team-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.prob-cell {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 72px;
  gap: 14px;
  align-items: center;
}

.bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-strong);
}

.bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #6ac49f);
  transition: width 320ms ease;
}

.prob-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

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

.match-card {
  border: 1px solid rgba(17, 19, 18, 0.08);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--paper);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.match-card:hover {
  border-color: rgba(15, 159, 110, 0.28);
  background: #ffffff;
  transform: translateY(-1px);
}

.match-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.match-title {
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
}

.match-outcomes {
  display: grid;
  gap: 10px;
}

.match-outcome {
  display: grid;
  gap: 6px;
}

.match-outcome-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.match-outcome-top strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-outcome-top span {
  color: var(--accent-dark);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.match-outcome.draw .match-outcome-top span {
  color: var(--blue);
}

.match-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe8e4;
}

.match-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #6ac49f);
}

.match-outcome.draw .match-bar span {
  background: linear-gradient(90deg, var(--blue), #79a9ee);
}

.match-missing {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.filters {
  display: flex;
  gap: 10px;
}

.filters input,
.filters select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 0 12px;
  color: var(--ink);
}

.filters input {
  width: min(360px, 34vw);
}

.schedule-table {
  display: grid;
  gap: 0;
}

.schedule-row {
  display: grid;
  grid-template-columns: 92px minmax(190px, 0.95fr) minmax(260px, 1.1fr) minmax(140px, 0.65fr) minmax(110px, 0.4fr);
  gap: 16px;
  align-items: center;
  min-height: 58px;
  border-top: 1px solid rgba(17, 19, 18, 0.08);
  padding: 10px 0;
  cursor: pointer;
  transition: background 160ms ease;
}

.schedule-row:hover {
  background: rgba(15, 159, 110, 0.04);
}

.date-block {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.fixture-main {
  min-width: 0;
}

.fixture-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixture-main span,
.ground,
.round-tag {
  color: var(--muted);
  font-size: 12px;
}

.schedule-probability {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  font-size: 12px;
}

.schedule-probability span {
  min-width: 0;
  border: 1px solid rgba(17, 19, 18, 0.08);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 7px 8px;
  color: var(--muted);
  font-weight: 800;
}

.schedule-probability strong {
  display: block;
  margin-top: 2px;
  color: var(--accent-dark);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.schedule-probability.muted {
  display: block;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 10px 12px;
}

.round-tag {
  justify-self: start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--paper);
  font-weight: 800;
}

.empty {
  padding: 24px 0;
  color: var(--muted);
}

body.detail-open {
  overflow: hidden;
}

body.tournament-info-open {
  overflow: hidden;
}

.tournament-info-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.tournament-info-layer[hidden] {
  display: none;
}

.tournament-info-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(14, 22, 18, 0.48);
  cursor: pointer;
}

.tournament-info-panel {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  border: 1px solid rgba(17, 19, 18, 0.12);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(14, 22, 18, 0.28);
}

.tournament-info-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(17, 19, 18, 0.08);
  background: rgba(255, 255, 255, 0.96);
  padding: 18px 20px;
  backdrop-filter: blur(12px);
}

.tournament-info-header .section-kicker {
  margin-bottom: 5px;
}

.tournament-info-content {
  display: grid;
  gap: 22px;
  padding: 20px;
}

.tournament-current {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.8fr);
  gap: 20px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #0b5b42;
  color: #ffffff;
  padding: 20px;
}

.tournament-current::before,
.tournament-current::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.2);
  content: "";
  pointer-events: none;
}

.tournament-current::before {
  top: -76px;
  right: 40px;
  width: 210px;
  height: 210px;
  border-radius: 999px;
}

.tournament-current::after {
  top: 0;
  right: 144px;
  bottom: 0;
}

.tournament-current > * {
  position: relative;
  z-index: 1;
}

.tournament-current span,
.tournament-section-heading span {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tournament-current h3,
.tournament-section-heading h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
}

.tournament-current p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.tournament-next {
  align-self: center;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  padding-left: 20px;
}

.tournament-next strong {
  display: block;
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.5;
}

.tournament-format,
.tournament-timetable {
  display: grid;
  gap: 14px;
}

.tournament-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.tournament-section-heading span {
  color: var(--accent-dark);
}

.tournament-section-heading p {
  max-width: 390px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.tournament-roadmap {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.tournament-stage {
  position: relative;
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 154px;
  border: 1px solid rgba(17, 19, 18, 0.09);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 13px 12px;
}

.tournament-stage:not(:last-child)::after {
  position: absolute;
  top: 32px;
  right: -11px;
  z-index: 2;
  width: 11px;
  border-top: 2px solid var(--line);
  content: "";
}

.tournament-stage.active {
  border-color: rgba(15, 159, 110, 0.5);
  background: var(--accent-soft);
  box-shadow: inset 0 3px 0 var(--accent);
}

.tournament-stage.complete {
  background: #ffffff;
}

.tournament-stage.complete .stage-team-count {
  background: var(--accent-dark);
}

.stage-team-count {
  display: inline-flex;
  width: fit-content;
  min-width: 46px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font-size: 11px;
  font-weight: 850;
  padding: 4px 8px;
}

.tournament-stage strong {
  margin-top: 13px;
  font-size: 15px;
}

.tournament-stage small {
  margin-top: 5px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.tournament-stage p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.third-place-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-left: 3px solid var(--host-red);
  background: #fff5f3;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
}

.third-place-note strong {
  color: var(--ink);
}

.tournament-search {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  padding: 0 13px;
}

.tournament-search:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 159, 110, 0.13);
}

.tournament-time-list {
  display: grid;
  max-height: 350px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  scrollbar-color: rgba(9, 105, 71, 0.32) transparent;
  scrollbar-width: thin;
}

.tournament-time-row {
  display: grid;
  grid-template-columns: 128px 110px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 52px;
  border-bottom: 1px solid rgba(17, 19, 18, 0.08);
  padding: 8px 4px;
}

.tournament-time-row time {
  font-size: 13px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.tournament-time-row time small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.tournament-time-row > span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.tournament-time-row strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  justify-items: end;
}

.detail-layer[hidden] {
  display: none;
}

.detail-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(14, 22, 18, 0.42);
  cursor: pointer;
}

.detail-panel {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 32px));
  height: calc(100dvh - 32px);
  margin: 16px;
  overflow: auto;
  border: 1px solid rgba(17, 19, 18, 0.12);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(14, 22, 18, 0.24);
}

.detail-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(17, 19, 18, 0.08);
  background: rgba(255, 255, 255, 0.96);
  padding: 20px;
}

.detail-header h2 {
  max-width: 560px;
  font-size: 26px;
}

.detail-kicker {
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
}

.close-button {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.detail-body {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.match-detail-top,
.team-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.match-detail-meta,
.team-summary-item {
  border: 1px solid rgba(17, 19, 18, 0.08);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 13px;
}

.match-detail-meta span,
.team-summary-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.match-detail-meta strong,
.team-summary-item strong {
  overflow-wrap: anywhere;
}

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

.match-teams > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.team-chip {
  display: grid;
  min-width: 0;
  border: 1px solid rgba(15, 159, 110, 0.24);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-dark);
  cursor: pointer;
  padding: 12px;
  text-align: left;
}

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

.team-chip span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.detail-section {
  display: grid;
  gap: 12px;
}

.detail-section h3 {
  margin: 0;
  font-size: 17px;
}

.detail-probability-grid {
  display: grid;
  gap: 12px;
}

.detail-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 850;
  padding: 18px;
  text-align: center;
}

.key-player-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.key-player-card {
  border: 1px solid rgba(17, 19, 18, 0.08);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 12px;
}

.key-player-card strong,
.key-player-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-player-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.team-schedule-list {
  display: grid;
  gap: 8px;
}

.team-schedule-item {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1fr) minmax(160px, 0.8fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(17, 19, 18, 0.08);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
  padding: 11px 12px;
  text-align: left;
}

.team-schedule-item span,
.team-schedule-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.team-schedule-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-table {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(17, 19, 18, 0.08);
  border-radius: var(--radius);
}

.player-head,
.player-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.2fr) 72px minmax(120px, 0.95fr) 105px minmax(130px, 0.85fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
}

.player-head {
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.player-row {
  border-top: 1px solid rgba(17, 19, 18, 0.08);
  font-size: 13px;
}

.player-row > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.player-row strong {
  margin-right: 6px;
}

.player-row a {
  color: var(--accent-dark);
  font-weight: 850;
  text-decoration: none;
}

.player-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.key-badge {
  display: inline-flex;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 850;
  padding: 3px 7px;
}

@media (max-width: 1120px) {
  .match-workspace,
  .champion-layout {
    grid-template-columns: 1fr;
  }

  .next-panel,
  .champion-summary {
    position: static;
    max-height: none;
  }

  .schedule-panel,
  .next-panel {
    height: auto;
    overflow: visible;
  }

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

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 20px, 1440px);
    padding-top: 14px;
  }

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

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 20px;
  }

  .status-stack {
    align-items: flex-start;
  }

  .hero-copy {
    min-height: 250px;
    padding: 22px;
  }

  .favorite-row {
    display: grid;
  }

  .favorite-score {
    font-size: 54px;
  }

  .favorite-row strong {
    font-size: 44px;
  }

  .panel {
    padding: 16px;
  }

  .panel-header {
    display: grid;
  }

  .schedule-header {
    top: 0;
    gap: 14px;
    align-items: stretch;
    justify-content: stretch;
    padding: 16px 0 14px;
  }

  .schedule-header > *,
  .filters {
    display: grid;
    width: 100%;
  }

  .filters input,
  .filters select {
    width: 100%;
  }

  .table-head {
    display: none;
  }

  .prob-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px 0;
  }

  .prob-cell {
    grid-template-columns: minmax(120px, 1fr) 70px;
  }

  .schedule-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 0;
  }

  .match-list {
    grid-template-columns: 1fr;
  }

  .schedule-probability {
    grid-template-columns: 1fr;
  }

  .info-popover {
    left: auto;
    right: 0;
    transform: translateY(-4px);
  }

  .info-wrap:hover .info-popover,
  .info-wrap:focus-within .info-popover,
  .info-wrap.open .info-popover {
    transform: translateY(0);
  }

  .detail-panel {
    width: calc(100vw - 18px);
    height: calc(100dvh - 18px);
    margin: 9px;
  }

  .detail-header {
    padding: 16px;
  }

  .detail-header h2 {
    font-size: 22px;
  }

  .detail-body {
    padding: 16px;
  }

  .match-detail-top,
  .team-summary-grid,
  .key-player-grid,
  .match-teams {
    grid-template-columns: 1fr;
  }

  .match-teams > span {
    text-align: center;
  }

  .team-schedule-item {
    grid-template-columns: 1fr;
  }

  .player-head {
    display: none;
  }

  .player-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

/* Overview and full-page collection views */
[hidden] {
  display: none !important;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) 440px;
  gap: 16px;
  height: max(650px, calc(100dvh - 152px));
  min-height: 0;
}

.overview-schedule,
.overview-recent,
.overview-champions {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.overview-side {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}

.overview-header {
  margin-bottom: 12px;
}

.overview-search {
  width: 100%;
  height: 42px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 0 13px;
  color: var(--ink);
}

.overview-search:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 159, 110, 0.13);
}

.back-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  padding: 0 12px;
  white-space: nowrap;
}

.back-button:hover {
  border-color: rgba(15, 159, 110, 0.35);
  background: var(--accent-soft);
}

.preview-schedule,
.preview-match-list,
.compact-probability-list {
  flex: 1 1 0;
  align-content: start;
  grid-auto-rows: max-content;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 5px;
  scrollbar-color: rgba(9, 105, 71, 0.32) transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.preview-schedule::-webkit-scrollbar,
.preview-match-list::-webkit-scrollbar,
.compact-probability-list::-webkit-scrollbar {
  width: 7px;
}

.preview-schedule::-webkit-scrollbar-thumb,
.preview-match-list::-webkit-scrollbar-thumb,
.compact-probability-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(9, 105, 71, 0.28);
}

.preview-schedule::-webkit-scrollbar-track,
.preview-match-list::-webkit-scrollbar-track,
.compact-probability-list::-webkit-scrollbar-track {
  background: transparent;
}

.preview-schedule .schedule-row.compact {
  grid-template-columns: 82px minmax(180px, 0.9fr) minmax(225px, 1.1fr) 86px;
  gap: 12px;
  min-height: 64px;
  padding: 8px 0;
}

.preview-schedule .schedule-row.compact .ground {
  display: none;
}

.preview-match-list {
  gap: 8px;
}

.match-card.compact {
  padding: 11px 12px;
}

.match-card.compact .match-meta {
  margin-bottom: 7px;
}

.match-card.compact .match-title {
  margin-bottom: 9px;
}

.match-card.compact .match-outcomes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.match-card.compact .match-outcome-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 12px;
}

.match-card.compact .match-bar {
  display: none;
}

.match-card.compact .match-missing {
  grid-column: 1 / -1;
  padding: 8px;
}

.compact-probability-list .prob-row.compact {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 42px;
}

.compact-probability-list .prob-row.compact .rank {
  width: 24px;
  height: 24px;
}

.compact-probability-list .prob-row.compact .team-sub,
.compact-probability-list .prob-row.compact .bar {
  display: none;
}

.compact-probability-list .prob-row.compact .prob-cell {
  display: block;
}

.compact-probability-list .prob-row.compact .team-name {
  font-size: 14px;
}

.collection-view {
  display: grid;
  gap: 16px;
}

.collection-topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 4px 0;
}

.collection-panel {
  min-height: 620px;
}

.collection-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.collection-controls .filters {
  width: 100%;
  align-items: center;
}

.collection-controls .filters input {
  width: min(520px, 48vw);
}

.collection-controls .match-count {
  margin-left: auto;
}

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

.collection-probability-list {
  max-width: 940px;
}

.team-flag,
.fixture-flag,
.detail-team-flag,
.team-chip-flag {
  display: block;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid rgba(17, 19, 18, 0.12);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(17, 19, 18, 0.08);
}

.team-flag {
  width: 30px;
  height: 21px;
  border-radius: 3px;
}

.fixture-flag {
  width: 24px;
  height: 17px;
  border-radius: 2px;
}

.fixture-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.fixture-team {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.fixture-team strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixture-vs {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.detail-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.detail-team-flag {
  width: 64px;
  height: 44px;
  border-radius: 5px;
}

.team-chip {
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.team-chip-flag {
  width: 48px;
  height: 33px;
  border-radius: 4px;
}

.team-chip-copy {
  display: grid;
  min-width: 0;
}

.team-chip-copy > span {
  margin-top: 3px;
}

@media (max-width: 1120px) {
  .overview-grid {
    grid-template-columns: minmax(0, 1.35fr) 360px;
  }

  .preview-schedule .schedule-row.compact {
    grid-template-columns: 80px minmax(165px, 1fr) minmax(210px, 1fr);
  }

  .preview-schedule .schedule-row.compact .round-tag {
    display: none;
  }
}

@media (max-width: 920px) {
  .overview-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .overview-side {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
  }

  .overview-schedule,
  .overview-recent,
  .overview-champions {
    height: min(680px, 72dvh);
    min-height: 420px;
  }

  .collection-match-list {
    grid-template-columns: 1fr;
  }

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

  .tournament-stage:nth-child(3)::after {
    display: none;
  }
}

@media (max-width: 760px) {
  .overview-side {
    grid-template-columns: 1fr;
  }

  .overview-schedule,
  .overview-recent,
  .overview-champions {
    height: min(620px, 72dvh);
    min-height: 390px;
  }

  .preview-schedule .schedule-row.compact {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 12px 0;
  }

  .preview-schedule .schedule-row.compact .round-tag {
    display: inline-flex;
  }

  .preview-schedule .schedule-row.compact .schedule-probability {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .collection-topbar {
    align-items: flex-start;
  }

  .collection-controls .filters {
    display: grid;
  }

  .collection-controls .filters input,
  .collection-controls .filters select {
    width: 100%;
  }

  .collection-controls .match-count {
    margin-left: 0;
    justify-self: start;
  }

  .detail-team-flag {
    width: 48px;
    height: 33px;
  }

  .host-ribbon {
    margin-top: 12px;
  }

  .tournament-info-layer {
    padding: 9px;
  }

  .tournament-info-panel {
    width: calc(100vw - 18px);
    max-height: calc(100dvh - 18px);
  }

  .tournament-info-header,
  .tournament-info-content {
    padding: 16px;
  }

  .tournament-current {
    grid-template-columns: 1fr;
  }

  .tournament-current::after {
    display: none;
  }

  .tournament-next {
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    border-left: 0;
    padding-top: 14px;
    padding-left: 0;
  }

  .tournament-section-heading {
    display: grid;
  }

  .tournament-section-heading p {
    text-align: left;
  }

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

  .tournament-stage:nth-child(3)::after {
    display: block;
  }

  .tournament-stage:nth-child(2n)::after {
    display: none;
  }

  .tournament-time-row {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .tournament-time-row strong {
    grid-column: 1 / -1;
    padding-bottom: 4px;
    white-space: normal;
  }
}
