:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #667085;
  --line: #d9e0e8;
  --paper: #f6f8fb;
  --surface: #ffffff;
  --green: #0f7b5f;
  --red: #b42335;
  --gold: #b7791f;
  --blue: #235b9f;
  --shadow: 0 18px 50px rgba(24, 33, 47, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1420px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 22px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
}

h2 {
  font-size: 18px;
}

.source-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 10px 14px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(24, 33, 47, 0.07);
}

.overview {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: stretch;
}

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

.scoreboard > div {
  min-height: 124px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow);
}

.scoreboard span {
  display: block;
  color: var(--blue);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 850;
}

.scoreboard small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.pitch-visual {
  position: relative;
  min-height: 124px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(15, 123, 95, 0.85), rgba(20, 92, 120, 0.72)),
    repeating-linear-gradient(90deg, #0f7b5f 0 64px, #148266 64px 128px);
  box-shadow: var(--shadow);
}

.pitch-visual::before,
.pitch-visual::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 6px;
}

.pitch-visual::after {
  left: 50%;
  width: 0;
  border-left-width: 2px;
  border-right: 0;
}

.pitch-line {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.center-circle {
  width: 82px;
  height: 82px;
  top: calc(50% - 41px);
  left: calc(50% - 41px);
  border-radius: 50%;
}

.box {
  width: 86px;
  height: 78px;
  top: calc(50% - 39px);
}

.left-box {
  left: 12px;
}

.right-box {
  right: 12px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 22px 0 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab,
.swap {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
}

.tab {
  flex: 0 0 auto;
  padding: 0 18px;
}

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

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

label {
  display: grid;
  gap: 6px;
  min-width: 190px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

label.wide {
  flex: 1 1 320px;
}

select,
input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

select:focus,
input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35, 91, 159, 0.15);
}

.swap {
  width: 48px;
  padding: 0;
  font-size: 22px;
}

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

.summary-card,
.table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-card {
  align-self: start;
  padding: 20px;
}

.summary-title {
  margin-bottom: 14px;
  font-size: 24px;
  line-height: 1.18;
}

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

.metric {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.metric:last-child {
  border-bottom: 0;
}

.metric b {
  text-align: right;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

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

.table-wrap {
  overflow: auto;
  max-height: 640px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf2f7;
  color: #3b4758;
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

.match-title {
  font-weight: 800;
}

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

.score {
  display: inline-flex;
  min-width: 76px;
  justify-content: center;
  border-radius: 8px;
  background: #edf2f7;
  padding: 5px 8px;
  font-weight: 850;
}

.result-win {
  color: var(--green);
  font-weight: 850;
}

.result-loss {
  color: var(--red);
  font-weight: 850;
}

.result-draw {
  color: var(--gold);
  font-weight: 850;
}

.result-pending {
  color: var(--muted);
  font-weight: 850;
}

.full {
  width: 100%;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.5fr) minmax(120px, 2fr) 90px;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.bar-label {
  font-weight: 800;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef4;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.bar-value {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

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

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

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

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

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1420px);
    padding-top: 12px;
  }

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

  .toolbar {
    padding: 12px;
  }

  label {
    min-width: 100%;
  }

  .swap {
    width: 100%;
  }

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

  .bar-value {
    text-align: left;
  }
}
