:root {
  --bg: #f4f6f1;
  --ink: #162019;
  --muted: #627166;
  --line: #d8ded4;
  --surface: #ffffff;
  --field: #2f7f54;
  --field-dark: #236a45;
  --a: #1267d6;
  --b: #d34436;
  --draw: #768252;
  --warn: #b36b00;
  --good: #267653;
  --shadow: 0 18px 42px rgba(29, 44, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(244, 246, 241, 0.98), rgba(232, 238, 226, 0.95)),
    radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.9), transparent 26%),
    radial-gradient(circle at 82% 12%, rgba(57, 123, 84, 0.14), transparent 30%);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  max-width: 100%;
  margin: 0 auto;
  padding: 28px 0 40px;
}

.control-band,
.panel,
.empty-state {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.control-band {
  padding: 24px;
}

.brand-block {
  display: grid;
  gap: 6px;
}

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

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

h1 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.04;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.subtitle {
  color: var(--muted);
  max-width: 760px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.status-pill,
.mini-tag,
.confidence {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e8f3ec;
  color: #246244;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.muted,
.mini-tag {
  background: #eef0ea;
  color: #566157;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input {
  width: 100%;
  height: 48px;
  border: 1px solid #cbd3c6;
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fbfcfa;
  outline: none;
}

input:focus {
  border-color: #357657;
  box-shadow: 0 0 0 4px rgba(53, 118, 87, 0.14);
}

.icon-button,
.primary-button {
  height: 48px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.icon-button {
  width: 44px;
  background: #e7ede2;
  color: #24362a;
  font-size: 22px;
}

.primary-button {
  padding: 0 24px;
  background: #173f2a;
  color: #fff;
}

.dashboard {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

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

.team-card,
.score-lens {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(29, 44, 31, 0.08);
}

.team-card h2 {
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.08;
}

.team-meta,
.record-line {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

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

.score-lens {
  min-width: 190px;
  display: grid;
  place-items: center;
  align-content: center;
  grid-template-columns: auto auto auto;
  column-gap: 8px;
}

.score-lens small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 800;
  margin-top: 3px;
}

.lambda {
  font-size: 42px;
  font-weight: 950;
  line-height: 1;
}

.dash {
  color: var(--muted);
  font-size: 28px;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.match-form > *,
.scoreboard > *,
.main-grid > *,
.metric-strip > *,
.compact-metrics > *,
.risk-list > *,
.notes-grid > * {
  min-width: 0;
}

.panel {
  padding: 18px;
}

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

.panel-heading h3 {
  font-size: 18px;
  line-height: 1.2;
}

.bars {
  display: grid;
  gap: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: 86px minmax(90px, 1fr) 56px;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}

.bar-track {
  position: relative;
  height: 14px;
  background: #ecf0e9;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  transition: width 380ms ease;
}

.win-a {
  background: var(--a);
}

.draw {
  background: var(--draw);
}

.win-b {
  background: var(--b);
}

.pitch-visual {
  position: relative;
  height: 176px;
  overflow: hidden;
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 36px, transparent 36px 72px),
    linear-gradient(135deg, var(--field), var(--field-dark));
}

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

.pitch-line.center {
  inset: 0 auto 0 50%;
  width: 0;
  border-width: 0 0 0 2px;
}

.pitch-line.box-left {
  top: 44px;
  left: 0;
  width: 74px;
  height: 88px;
  border-left: 0;
}

.pitch-line.box-right {
  top: 44px;
  right: 0;
  width: 74px;
  height: 88px;
  border-right: 0;
}

.tilt-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  border: 6px solid rgba(22, 32, 25, 0.18);
  transform: translate(-50%, -50%);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.2);
}

.metric-strip,
.compact-metrics {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

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

.metric-strip span,
.compact-metrics div,
.score-item,
.risk-chip,
.note {
  border: 1px solid var(--line);
  background: #fbfcfa;
  border-radius: 8px;
}

.metric-strip span {
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

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

.score-item {
  display: grid;
  grid-template-columns: 76px minmax(80px, 1fr) 58px;
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.score-item strong {
  font-size: 21px;
}

.mini-bar {
  height: 8px;
  border-radius: 999px;
  background: #e9eee6;
  overflow: hidden;
}

.mini-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #173f2a, #58a36f);
  border-radius: inherit;
}

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

.compact-metrics div {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.compact-metrics span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.compact-metrics strong {
  font-size: 24px;
}

.detail-panel {
  box-shadow: 0 10px 24px rgba(29, 44, 31, 0.08);
}

.risk-list,
.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.risk-chip,
.note {
  padding: 12px;
  line-height: 1.45;
  color: #3f4b42;
  font-size: 14px;
}

.risk-chip.warn {
  border-color: rgba(179, 107, 0, 0.32);
  color: #6d4200;
  background: #fff7e9;
}

.risk-chip.good {
  border-color: rgba(38, 118, 83, 0.22);
  color: #1e6042;
  background: #edf7f1;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 38px 22px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}

.empty-state p {
  max-width: 580px;
}

.ball-orbit {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 47%, #1a241d 47% 53%, transparent 53%),
    linear-gradient(0deg, transparent 47%, #1a241d 47% 53%, transparent 53%),
    radial-gradient(circle at 50% 50%, #fff 0 24%, #1a241d 25% 32%, #fff 33% 100%);
  border: 3px solid #1a241d;
  box-shadow: 0 12px 24px rgba(29, 44, 31, 0.18);
}

@media (max-width: 860px) {
  .match-form,
  .scoreboard,
  .main-grid,
  .risk-list,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .icon-button {
    width: 100%;
  }

  .align-right {
    text-align: left;
  }

  .score-lens {
    min-width: 0;
    overflow: hidden;
  }

  .metric-strip,
  .compact-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100vw - 48px, 1180px);
    padding-top: 10px;
  }

  .control-band,
  .panel {
    padding: 14px;
  }

  h1 {
    font-size: 28px;
    line-height: 1.12;
  }

  .subtitle {
    max-width: 300px;
  }

  .status-pill,
  .mini-tag,
  .confidence {
    white-space: normal;
  }

  .panel-heading {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .lambda {
    font-size: 30px;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 8px;
    font-size: 13px;
  }

  .bar-row > span:first-child {
    grid-column: 1;
    grid-row: 1;
  }

  .bar-row > strong {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }

  .bar-track {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .compact-metrics strong {
    font-size: 20px;
  }
}
