:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #69746d;
  --line: #dfe5e1;
  --surface: #ffffff;
  --surface-soft: #f5f7f5;
  --accent: #087f5b;
  --accent-dark: #056344;
  --accent-soft: #e6f4ee;
  --orange: #c96a16;
  --red: #bb3e3e;
  --shadow: 0 14px 40px rgba(20, 42, 30, 0.08);
  font-family: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% -10%, rgba(8, 127, 91, 0.12), transparent 34rem),
    #f2f5f3;
}

button, input, select { font: inherit; }
button, select, input[type="checkbox"] { cursor: pointer; }
a { color: inherit; }

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 44px;
}

.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(23, 33, 27, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--accent);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: -0.02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 12px; }

.live-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #13a36f;
  box-shadow: 0 0 0 5px rgba(19, 163, 111, 0.12);
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding: 54px 0 30px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 { margin: 0; font-size: clamp(34px, 5vw, 54px); letter-spacing: -0.055em; line-height: 1.05; }
.hero-copy { max-width: 700px; margin: 15px 0 0; color: var(--muted); font-size: 16px; line-height: 1.8; }

.refresh-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: var(--accent);
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease;
}

.refresh-button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.refresh-button:disabled { cursor: wait; opacity: 0.65; }
.refresh-button.loading span { display: inline-block; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.compliance-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  margin: 0 0 18px;
  padding: 17px 19px;
  border: 1px solid #ecd7a8;
  border-radius: 16px;
  color: #654814;
  background: #fff9e9;
}

.compliance-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #b7791f;
  font-size: 14px;
  font-weight: 900;
}

.compliance-notice h2 { margin: 2px 0 7px; font-size: 15px; }
.compliance-notice p { margin: 0; font-size: 13px; line-height: 1.8; }

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

.summary-card {
  min-height: 104px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 18px rgba(26, 44, 34, 0.035);
}

.summary-card span { display: block; color: var(--muted); font-size: 13px; }
.summary-card strong { display: block; margin-top: 10px; font-size: 28px; letter-spacing: -0.04em; }
.summary-card-wide strong { font-size: 18px; letter-spacing: -0.02em; }

.filter-bar {
  position: sticky;
  top: 10px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid rgba(215, 223, 218, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.search-field { flex: 1 1 340px; }
.search-field input, .filter-bar select {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: var(--surface-soft);
}

.search-field input:focus, .filter-bar select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(8, 127, 91, 0.1); }
.filter-bar > label:not(.search-field):not(.toggle-field) { min-width: 170px; }

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 14px;
}

.toggle-field input { width: 17px; height: 17px; accent-color: var(--accent); }
.result-count { margin-left: auto; padding: 0 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }

.status-panel { margin-bottom: 16px; padding: 13px 16px; border-radius: 12px; font-size: 14px; }
.status-panel.error { color: #852c2c; background: #fdecec; }
.status-panel.warning { color: #7b4b11; background: #fff3dd; }
.status-panel.info { color: #155c48; background: var(--accent-soft); }

.match-list { display: grid; gap: 14px; }
.match-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 8px 30px rgba(24, 42, 32, 0.045); }

.match-meta {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid #edf0ee;
  background: #fafbfa;
}

.match-meta > div:first-child { display: flex; align-items: center; gap: 9px; }
.match-meta-actions { display: flex; align-items: center; gap: 8px; }
.match-number { font-weight: 800; font-size: 13px; }
.league-name { color: var(--muted); font-size: 12px; }
.match-state { padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.match-state.selling { color: #08704f; background: var(--accent-soft); }
.match-state.closed { color: #777; background: #ecefed; }
.model-entry {
  padding: 6px 10px;
  border: 1px solid #b8d8cb;
  border-radius: 8px;
  color: var(--accent);
  background: white;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.model-entry:hover { color: white; border-color: var(--accent); background: var(--accent); }

.match-main {
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) minmax(420px, 1.8fr) auto;
  gap: 22px;
  align-items: center;
  padding: 20px;
}

.teams { min-width: 0; }
.team-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 9px; margin-bottom: 10px; }
.team-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.team-row small { color: var(--muted); font-size: 11px; }
.team-role { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: white; background: var(--accent); font-size: 11px; font-weight: 800; }
.team-role.away { background: #47554d; }
.teams time { display: block; margin-top: 13px; color: var(--muted); font-size: 12px; }

.main-pools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pool-block { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.pool-title { min-height: 22px; display: flex; align-items: center; gap: 7px; margin-bottom: 10px; font-size: 12px; font-weight: 700; }
.pool-title small { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 500; }
.handicap { padding: 2px 6px; border-radius: 5px; font-size: 10px; }
.handicap.positive { color: #a64f09; background: #fff0df; }
.handicap.negative { color: #2262a1; background: #eaf3ff; }
.outcome-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.outcome { padding: 8px 4px; text-align: center; border-radius: 8px; background: white; }
.outcome span, .outcome small { display: block; color: var(--muted); font-size: 10px; }
.outcome strong { display: block; margin: 3px 0 2px; font-size: 16px; }
.pool-empty { color: var(--muted); text-align: center; font-size: 13px; }

.prediction-panel { min-width: 110px; padding: 13px; border-radius: 12px; color: #07543e; background: var(--accent-soft); }
.prediction-panel span, .prediction-panel small { display: block; font-size: 10px; }
.prediction-panel strong { display: block; margin: 5px 0; font-size: 15px; }

.more-markets { border-top: 1px solid #edf0ee; }
.more-markets summary { padding: 13px 20px; color: var(--accent); font-size: 13px; font-weight: 700; cursor: pointer; user-select: none; }
.more-markets[open] summary { border-bottom: 1px solid #edf0ee; }
.detail-content { display: grid; gap: 18px; padding: 20px; background: #fafbfa; }
.detail-pool h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; }
.detail-pool h4 small { color: var(--muted); font-size: 10px; font-weight: 500; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.odds-chip { display: inline-flex; gap: 7px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 12px; }
.odds-chip span { color: var(--muted); }

.empty-state { min-height: 230px; display: grid; place-content: center; gap: 8px; text-align: center; border: 1px dashed #cbd5ce; border-radius: 18px; color: var(--muted); }
.empty-state strong { color: var(--ink); }

.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 26px; padding: 22px 2px; color: var(--muted); font-size: 12px; }
.site-footer strong { display: block; margin-bottom: 6px; color: #7a3b2b; font-size: 13px; }
.site-footer p { margin: 0; line-height: 1.7; }
.site-footer a { color: var(--accent); text-decoration: none; font-weight: 700; }
.footer-links { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .match-main { grid-template-columns: 1fr; }
  .prediction-panel { width: 100%; }
}

@media (max-width: 680px) {
  .page-shell { width: min(100% - 20px, 1240px); }
  .site-header { min-height: 68px; }
  .live-state span:last-child { display: none; }
  .hero { align-items: start; padding: 38px 2px 24px; }
  .hero-copy { font-size: 14px; }
  .refresh-button { width: 44px; padding: 0; justify-content: center; font-size: 0; }
  .refresh-button span { font-size: 20px; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .summary-card { min-height: 86px; padding: 14px; }
  .summary-card strong { font-size: 24px; }
  .summary-card-wide { grid-column: 1 / -1; }
  .summary-card-wide strong { font-size: 15px; }
  .filter-bar { top: 6px; flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .filter-bar > label:not(.search-field):not(.toggle-field) { flex: 1; min-width: 130px; }
  .result-count { display: none; }
  .match-meta, .match-main { padding-left: 14px; padding-right: 14px; }
  .main-pools { grid-template-columns: 1fr; }
  .site-footer { display: grid; text-align: center; }
  .footer-links { justify-content: center; flex-wrap: wrap; }
}
