:root {
  --ink: #14213d;
  --muted: #667085;
  --line: #d8dee9;
  --paper: #f7f9fc;
  --surface: #ffffff;
  --green: #0f7b55;
  --blue: #2557a7;
  --amber: #b26b00;
  --red: #b42318;
  --shadow: 0 18px 40px rgba(20, 33, 61, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 42px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand,
.topnav a {
  color: var(--ink);
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 6px;
}

.topnav {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 36px;
}

.hero {
  position: relative;
  min-height: 520px;
  margin: 18px 0;
  overflow: hidden;
  color: #fff;
  border-radius: 8px;
  background: #10212b;
}

.hero-media {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(8, 22, 31, 0.92), rgba(8, 22, 31, 0.58) 48%, rgba(8, 22, 31, 0.16)), url("./assets/cover-home.jpg");
  background-position: 58% 18%;
  background-size: 106% auto;
  background-repeat: no-repeat;
}

.hero-content {
  position: relative;
  width: min(690px, 100%);
  padding: clamp(30px, 7vw, 78px);
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 6px 10px;
  color: #c6f6df;
  background: rgba(15, 123, 85, 0.35);
  border: 1px solid rgba(198, 246, 223, 0.32);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

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

h1 {
  max-width: 640px;
  margin-bottom: 16px;
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
  letter-spacing: 0;
}

.hero p {
  max-width: 590px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 17px;
}

.quick-search {
  width: min(560px, 100%);
  margin-top: 28px;
}

.quick-search label,
.control-block span,
.control-block label {
  display: block;
  margin-bottom: 8px;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 50px 44px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
}

.search-row input {
  min-width: 0;
  border: 0;
  padding: 14px 16px;
  color: var(--ink);
  outline: 0;
}

.search-row button,
.close-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 24px;
}

.icon-button {
  display: grid;
  place-items: center;
  border-left: 1px solid #edf1f7;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.icon-button:hover,
.search-row button:hover {
  color: var(--blue);
  background: #f4f7fb;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(640px, 100%);
  margin: 28px 0 0;
}

.metrics div {
  padding: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.metrics dt {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.metrics dd {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 800;
}

.notice,
.controls,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.notice p {
  margin: 4px 0 0;
  color: var(--muted);
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  background: var(--green);
  border-radius: 50%;
}

.ghost-button,
.segmented button,
.match-card,
.team-card {
  border: 1px solid var(--line);
  background: #fff;
}

.ghost-button {
  flex: 0 0 auto;
  padding: 10px 14px;
  color: var(--green);
  border-color: #b7dbc9;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px;
}

.control-block {
  min-width: 0;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented button {
  min-width: 44px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.segmented button[aria-selected="true"] {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

select {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

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

.team-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.flag-img {
  width: 28px;
  height: 20px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  color: var(--blue);
  background: #eaf1ff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.tag-green {
  color: var(--green);
  background: #eaf8f1;
}

.tag-amber {
  color: var(--amber);
  background: #fff4df;
}

.tag-red {
  color: var(--red);
  background: #fff0ee;
}

.insight-list,
.match-list,
.team-grid {
  display: grid;
  gap: 12px;
}

.insight-item {
  padding: 13px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.insight-item strong {
  display: block;
  margin-bottom: 5px;
}

.insight-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

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

.match-card {
  display: grid;
  gap: 13px;
  padding: 14px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.match-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(20, 33, 61, 0.11);
}

.match-meta,
.prob-row,
.score-row,
.team-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.side {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 800;
}

.side.away {
  justify-content: flex-end;
  text-align: right;
}

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

.score {
  min-width: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 900;
}

.prob-bars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.prob {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.bar {
  height: 7px;
  overflow: hidden;
  background: #edf1f7;
  border-radius: 999px;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--green);
}

.prob:nth-child(2) .bar span {
  background: var(--amber);
}

.prob:nth-child(3) .bar span {
  background: var(--blue);
}

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

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

.team-tabs {
  margin-bottom: 14px;
}

.team-card {
  padding: 14px;
  border-radius: 8px;
}

.team-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-weight: 900;
}

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

.team-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.mini-button {
  margin-top: 14px;
  padding: 8px 10px;
  color: var(--blue);
  background: #eaf1ff;
  border: 1px solid #cddcff;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
}

dialog {
  width: min(720px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

dialog::backdrop {
  background: rgba(20, 33, 61, 0.52);
}

.dialog-card {
  position: relative;
  padding: 22px;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 12px;
}

.analysis-title {
  padding-right: 36px;
  margin-bottom: 18px;
}

.analysis-title h2 {
  margin-bottom: 8px;
}

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

.analysis-item {
  padding: 13px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.analysis-item span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.analysis-item strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.analysis-note {
  margin: 14px 0 0;
  color: var(--muted);
}

.player-list {
  display: grid;
  gap: 12px;
}

.player-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.player-avatar {
  width: 58px;
  height: 58px;
  object-fit: cover;
  background: #eaf1ff;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.player-row strong,
.player-row span {
  display: block;
}

.player-row span {
  margin-top: 2px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.player-row p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 22px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 860px) {
  .topbar,
  .notice,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    min-height: auto;
  }

  .metrics,
  .controls,
  .section-grid,
  .match-list,
  .team-grid,
  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .topnav {
    width: 100%;
    justify-content: space-between;
  }

  .hero-media {
    background-size: auto 100%;
    background-position: 56% 12%;
  }
}

@media (max-width: 520px) {
  main,
  .footer {
    width: min(100% - 20px, 1180px);
  }

  .hero-content {
    padding: 26px 18px;
  }

  h1 {
    font-size: 34px;
  }

  .notice,
  .controls,
  .panel {
    padding: 14px;
  }

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

  .side.away {
    justify-content: flex-start;
    text-align: left;
  }

  .score {
    text-align: left;
  }
}
