:root {
  color-scheme: light;
  --ink: #191c1a;
  --muted: #68716a;
  --line: #d9dfd8;
  --paper: #f7f8f3;
  --surface: #ffffff;
  --turf: #24533f;
  --turf-2: #386c4d;
  --accent: #d36b2c;
  --accent-dark: #9d3f16;
  --cool: #315b82;
  --shadow: 0 18px 60px rgba(31, 45, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(36, 83, 63, 0.12), transparent 38%),
    linear-gradient(250deg, rgba(211, 107, 44, 0.12), transparent 42%),
    var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button {
  font: inherit;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.workspace {
  min-height: calc(100svh - 48px);
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 18px;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.status {
  color: var(--muted);
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  white-space: nowrap;
}

.match-switch,
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.match-tab,
.primary-action,
.secondary-action,
.ghost-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.match-tab:hover,
.primary-action:hover,
.secondary-action:hover,
.ghost-action:hover {
  transform: translateY(-1px);
  border-color: rgba(25, 28, 26, 0.28);
}

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

.primary-action {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 800;
}

.secondary-action {
  color: #fff;
  background: var(--cool);
  border-color: var(--cool);
  font-weight: 750;
}

.ghost-action {
  background: transparent;
}

.scoreboard {
  min-height: 108px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.team-block.right {
  text-align: right;
}

.team-label {
  font-size: clamp(1.5rem, 3vw, 3.2rem);
  font-weight: 900;
  line-height: 1;
}

.shape {
  color: var(--muted);
  font-weight: 800;
}

.score-core {
  min-width: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  line-height: 0.9;
}

.divider {
  color: var(--muted);
  font-weight: 500;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.7fr);
  gap: 18px;
  align-items: stretch;
}

.pitch-panel,
.context-panel,
.timeline-section,
.distribution-section {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(217, 223, 216, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.pitch-panel {
  min-height: 560px;
  padding: 14px;
}

.pitch {
  position: relative;
  min-height: 532px;
  height: 100%;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0 8.33%, transparent 8.33% 16.66%, rgba(255, 255, 255, 0.08) 16.66% 25%, transparent 25% 33.33%, rgba(255, 255, 255, 0.08) 33.33% 41.66%, transparent 41.66% 50%, rgba(255, 255, 255, 0.08) 50% 58.33%, transparent 58.33% 66.66%, rgba(255, 255, 255, 0.08) 66.66% 75%, transparent 75% 83.33%, rgba(255, 255, 255, 0.08) 83.33% 91.66%, transparent 91.66%),
    linear-gradient(135deg, var(--turf), var(--turf-2));
}

.pitch::before,
.pitch::after {
  content: "";
  position: absolute;
  inset: 26px;
  border: 2px solid rgba(255, 255, 255, 0.62);
  border-radius: 4px;
  pointer-events: none;
}

.pitch::after {
  inset: 50%;
  width: 128px;
  height: 128px;
  margin: -64px 0 0 -64px;
  border-radius: 50%;
  border-color: rgba(255, 255, 255, 0.46);
}

.half-line {
  position: absolute;
  left: 26px;
  right: 26px;
  top: 50%;
  height: 2px;
  background: rgba(255, 255, 255, 0.56);
}

.player {
  position: absolute;
  width: clamp(72px, 7.2vw, 108px);
  min-height: 42px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  color: #fff;
  background: rgba(25, 28, 26, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  font-size: clamp(0.68rem, 1vw, 0.82rem);
  font-weight: 850;
  line-height: 1.1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.player.away {
  background: rgba(238, 239, 235, 0.94);
  color: var(--ink);
}

.context-panel {
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 20px;
}

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

.meta-row span,
.section-heading span {
  color: var(--muted);
}

.meta-row strong {
  text-align: right;
}

.context-panel p {
  margin: 8px 0 0;
  color: #3e4640;
  line-height: 1.7;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.timeline-section,
.distribution-section {
  padding: 20px;
}

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

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

.timeline li {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid rgba(217, 223, 216, 0.9);
  line-height: 1.55;
}

.timeline li.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: timeline-in 460ms ease forwards;
  animation-delay: var(--delay, 0ms);
}

@keyframes timeline-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline .minute {
  color: var(--accent-dark);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.timeline .goal {
  color: var(--accent-dark);
  font-weight: 850;
}

.timeline .empty {
  display: block;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .timeline li.reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

.dist-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.dist-summary span {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 248, 243, 0.72);
  font-weight: 850;
}

.dist-summary small {
  color: var(--muted);
  font-weight: 700;
}

.score-table {
  display: grid;
  gap: 8px;
}

.score-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 54px;
  gap: 10px;
  align-items: center;
  font-variant-numeric: tabular-nums;
}

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

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

@media (max-width: 920px) {
  .shell {
    padding: 16px;
  }

  .workspace {
    min-height: calc(100svh - 32px);
  }

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

  .status {
    white-space: normal;
  }

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

  .scoreboard {
    gap: 10px;
    text-align: center;
  }

  .team-block.right {
    text-align: center;
  }

  .team-block.left {
    text-align: center;
  }

  .score-core {
    order: -1;
    min-width: 0;
  }

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

  .pitch {
    min-height: 592px;
  }

  .player {
    width: 82px;
    font-size: 0.66rem;
  }
}

@media (max-width: 560px) {
  .match-tab,
  .primary-action,
  .secondary-action,
  .ghost-action {
    width: 100%;
  }

  .scoreboard {
    padding: 16px 8px;
  }

  .dist-summary {
    grid-template-columns: 1fr;
  }

  .timeline li {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .score-row {
    grid-template-columns: 78px minmax(0, 1fr) 48px;
  }
}
