:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-soft: #eef3f8;
  --ink: #152033;
  --muted: #667085;
  --line: #d8e0ea;
  --accent: #0d6b7c;
  --accent-strong: #093b49;
  --gold: #c79235;
  --green: #16845a;
  --red: #b74242;
  --shadow: 0 18px 50px rgba(37, 49, 76, 0.11);
  --landing-width: min(1180px, calc(100% - 40px));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(9, 59, 73, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(9, 59, 73, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #ffffff 0%, #f3f6fa 54%, #f7f9fc 100%);
  background-size: 56px 56px, 56px 56px, auto;
}

button,
input,
select {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 20;
  transform: translateY(-140%);
  border-radius: 8px;
  background: var(--accent-strong);
  color: #fff;
  padding: 10px 14px;
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.landing-page {
  width: var(--landing-width);
  margin: 0 auto;
  padding: 18px 0 34px;
}

.landing-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  min-height: 62px;
}

.brand-link,
.nav-links,
.hero-actions,
.venue-marquee {
  display: flex;
  align-items: center;
}

.brand-link,
.nav-links a,
.nav-cta,
.landing-button,
.landing-link {
  color: inherit;
  text-decoration: none;
}

.brand-link {
  gap: 10px;
  color: var(--accent-strong);
  font-weight: 900;
}

.mark-small {
  width: 34px;
  height: 34px;
}

.nav-links {
  justify-content: center;
  gap: 24px;
  min-width: 0;
}

.nav-links a {
  color: #516070;
  font-size: 14px;
  font-weight: 800;
}

.nav-links a:hover,
.landing-link:hover {
  color: var(--accent-strong);
}

.nav-cta,
.landing-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  background: var(--accent-strong);
  color: #fff;
  padding: 0 18px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(9, 59, 73, 0.18);
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(430px, 1fr) minmax(500px, 1.1fr);
  gap: clamp(32px, 4.4vw, 58px);
  align-items: center;
  min-height: clamp(560px, calc(100vh - 160px), 760px);
  padding: 28px 0 42px;
}

.hero-copy h1 {
  max-width: 640px;
  margin-bottom: 24px;
  font-size: clamp(46px, 7.3vw, 92px);
  line-height: 0.94;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 580px;
  margin-bottom: 28px;
  color: #4f5f70;
  font-size: clamp(18px, 2.1vw, 22px);
  line-height: 1.45;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 18px;
}

.landing-link {
  color: #4f5f70;
  font-size: 14px;
  font-weight: 900;
}

.hero-preview {
  position: relative;
  margin: 0;
  border: 1px solid rgba(216, 224, 234, 0.9);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 30px 70px rgba(37, 49, 76, 0.16);
  overflow: hidden;
}

.hero-preview::before {
  content: "";
  display: block;
  height: 26px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 16px 50%, #e95858 0 4px, transparent 5px),
    radial-gradient(circle at 32px 50%, #e7b74f 0 4px, transparent 5px),
    radial-gradient(circle at 48px 50%, #2ba772 0 4px, transparent 5px),
    #f8fafc;
}

.hero-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  object-position: left top;
}

.landing-section {
  display: grid;
  gap: 30px;
  padding: 74px 0;
  border-top: 1px solid rgba(216, 224, 234, 0.72);
}

.section-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.58fr);
  gap: 30px;
  align-items: end;
}

.landing-section h2,
.landing-close h2 {
  margin-bottom: 0;
  font-size: clamp(32px, 4.7vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.landing-section p {
  margin-bottom: 0;
  color: #566575;
  font-size: 17px;
  line-height: 1.55;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.workflow-item {
  min-height: 236px;
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 252, 0.94)),
    var(--panel);
  padding: 22px;
  box-shadow: 0 16px 38px rgba(37, 49, 76, 0.08);
}

.workflow-number {
  display: block;
  margin-bottom: 46px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.workflow-item h3 {
  margin-bottom: 12px;
  font-size: 24px;
  line-height: 1.08;
}

.data-section {
  grid-template-columns: minmax(0, 0.62fr) minmax(320px, 0.88fr);
  align-items: center;
}

.data-flow {
  display: grid;
  gap: 12px;
}

.data-step {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 16px;
}

.data-step strong {
  color: var(--accent-strong);
  font-size: 17px;
}

.data-step span {
  color: #596879;
  line-height: 1.45;
}

.venues-section {
  grid-template-columns: minmax(0, 0.78fr) minmax(320px, 0.72fr);
  align-items: center;
}

.venue-copy {
  max-width: 650px;
}

.venue-marquee {
  flex-wrap: wrap;
  gap: 10px;
}

.venue-marquee span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-strong);
  padding: 12px 14px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(37, 49, 76, 0.07);
}

.landing-close {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  border-top: 1px solid rgba(216, 224, 234, 0.72);
  padding: 58px 0 30px;
}

.tracker-shell {
  scroll-margin-top: 18px;
}

.tracker-anchor {
  position: relative;
  top: -18px;
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 28px;
}

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

.title-block {
  display: flex;
  gap: 16px;
  align-items: center;
}

.mark {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--accent-strong), var(--accent)),
    #0d6b7c;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.13), var(--shadow);
}

.overline {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  gap: 12px;
  align-items: end;
}

.search-box,
.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.search-box input,
.field input,
.field select,
.filters select {
  height: 42px;
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.search-box input:focus,
.field input:focus,
.field select:focus,
.filters select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 107, 124, 0.14);
}

.primary-button,
.secondary-button {
  height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  background: var(--accent-strong);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.layout {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr) 306px;
  gap: 16px;
  align-items: start;
}

.phase-nav,
.workspace,
.summary-rail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.phase-nav {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.phase-button {
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
  padding: 0 12px;
}

.phase-button.active,
.phase-button:hover {
  background: var(--accent-strong);
  color: #fff;
}

.workspace {
  min-height: 72vh;
  overflow: hidden;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #f9fbfd;
}

#content {
  padding: 16px;
}

.summary-rail {
  position: sticky;
  top: 20px;
  padding: 16px;
}

.source-card,
.metric-card,
.match-card,
.group-card,
.venue-card,
.settings-card,
.bracket-match {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.source-card,
.metric-card,
.settings-card {
  padding: 14px;
}

.source-card {
  margin-bottom: 12px;
  background: var(--panel-soft);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.metric-card strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.metric-card span,
.meta,
.muted {
  color: var(--muted);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 4px 0 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 22px;
}

.date-group {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.date-title {
  margin: 0;
  color: var(--accent-strong);
  font-size: 15px;
}

.match-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 86px minmax(0, 1fr) 180px;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.match-number {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.team {
  min-width: 0;
  font-weight: 800;
}

.score {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
}

.venue-line {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 8px;
  padding: 0 8px;
  background: #e8eef5;
  color: #42526a;
  font-size: 12px;
  font-weight: 800;
}

.tag.live {
  background: rgba(22, 132, 90, 0.12);
  color: var(--green);
}

.tag.final {
  background: rgba(199, 146, 53, 0.16);
  color: #85601f;
}

.grid-2,
.grid-3,
.bracket-grid {
  display: grid;
  gap: 12px;
}

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

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

.group-card,
.venue-card {
  padding: 14px;
}

.standings {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}

.standings th,
.standings td {
  border-bottom: 1px solid var(--line);
  padding: 8px 4px;
  text-align: right;
}

.standings th:first-child,
.standings td:first-child {
  text-align: left;
}

.fixture-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.bracket-grid {
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  overflow-x: auto;
  padding-bottom: 8px;
}

.bracket-round {
  display: grid;
  align-content: start;
  gap: 10px;
}

.bracket-match {
  padding: 10px;
}

.bracket-team {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  font-weight: 800;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.settings-card form {
  display: grid;
  gap: 12px;
}

.rail-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.rail-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

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

@media (max-width: 1160px) {
  .landing-hero,
  .section-intro,
  .data-section,
  .venues-section {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    min-height: auto;
  }

  .hero-copy h1 {
    max-width: 760px;
  }

  .hero-preview {
    max-width: 860px;
  }

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

  .summary-rail {
    position: static;
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  :root {
    --landing-width: min(100% - 24px, 1180px);
  }

  body {
    background-size: 38px 38px, 38px 38px, auto;
  }

  .landing-page {
    padding-top: 10px;
  }

  .landing-nav {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .nav-links {
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .nav-cta {
    min-height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }

  .landing-hero {
    padding: 28px 0 46px;
  }

  .hero-copy h1 {
    font-size: clamp(40px, 13vw, 58px);
  }

  .hero-copy p {
    font-size: 17px;
  }

  .hero-preview img {
    aspect-ratio: 4 / 3;
  }

  .landing-section {
    padding: 52px 0;
  }

  .workflow-grid,
  .data-step,
  .landing-close {
    grid-template-columns: 1fr;
  }

  .workflow-grid {
    display: grid;
  }

  .workflow-item {
    min-height: 0;
  }

  .workflow-number {
    margin-bottom: 24px;
  }

  .landing-close {
    display: grid;
    justify-items: start;
  }

  .app-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 16px;
  }

  .topbar,
  .topbar-actions {
    display: grid;
    align-items: stretch;
  }

  .layout,
  .filters,
  .grid-2,
  .grid-3,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .phase-nav {
    position: static;
    grid-template-columns: repeat(2, 1fr);
  }

  .match-card {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .score {
    text-align: left;
  }
}
