:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #e6eaf0;
  --green: #12b76a;
  --blue: #2563eb;
  --yellow: #f79009;
  --red: #ef4444;
  --shadow: 0 18px 60px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 38px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand > div { display: flex; flex-direction: column; gap: 2px; }
.brand-sub { font-size: 11px; color: #94a3b8; }
.mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, #0f172a, #2563eb);
}
.brand strong { display: block; font-size: 18px; }
.brand span, .header-status, .sub, .league, .human-note, footer, .panel-card p, .panel-card li { color: var(--muted); }

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.status-divider {
  width: 1px;
  height: 14px;
  background: var(--line);
}
.live-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--green); box-shadow: 0 0 0 6px rgba(18, 183, 106, 0.12); }
button {
  border: 0;
  border-radius: 999px;
  padding: 10px 15px;
  background: #0f172a;
  color: white;
  font-weight: 800;
  cursor: pointer;
}

main { max-width: 1400px; margin: 0 auto; padding: 34px 22px 54px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr); gap: 22px; align-items: stretch; margin-bottom: 22px; }
.hero.hero-simple { grid-template-columns: 1fr; }
.hero-copy {
  padding: 36px;
  border-radius: 30px;
  background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 28rem), #fff;
  box-shadow: var(--shadow);
}
.eyebrow { margin: 0 0 12px; color: var(--blue); font-weight: 800; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 58px); line-height: 1.02; letter-spacing: -0.05em; }
.sub { max-width: 760px; margin-top: 18px; font-size: 18px; line-height: 1.65; }

.featured-card, .match-card, .panel-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.featured-card { padding: 26px; display: flex; flex-direction: column; justify-content: space-between; }
.match-status { color: var(--green); font-weight: 800; font-size: 14px; }
h2 { font-size: 30px; margin: 18px 0; }
.teams-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.teams-row div {
  padding: 15px;
  border-radius: 18px;
  background: #f4f6fa;
  border: 1px solid var(--line);
}
.teams-row .hot { background: rgba(18, 183, 106, 0.1); border-color: rgba(18, 183, 106, 0.28); }
.teams-row span { display: block; color: var(--muted); font-size: 13px; }
.teams-row b { display: block; margin-top: 6px; font-size: 24px; }
.pick-box { margin-top: 18px; padding: 16px; border-radius: 20px; background: #101828; color: #fff; }
.pick-box span { display: block; color: #98a2b3; font-size: 13px; margin-bottom: 6px; }

.quick-tabs { display: flex; gap: 10px; overflow-x: auto; margin: 24px 0; padding-bottom: 2px; }
.quick-tabs button { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.quick-tabs .active { background: var(--blue); color: #fff; border-color: var(--blue); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.section-title { display: flex; justify-content: space-between; align-items: end; margin: 8px 0 14px; }
.section-title h3, .panel-card h3 { margin: 0; font-size: 22px; }
.section-title span { color: var(--muted); font-size: 14px; }
.main-feed { display: grid; gap: 16px; }
.main-feed.today-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rough-note { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; color: #667085; font-size: 13px; line-height: 1.5; grid-column: 1 / -1; }
.match-card { padding: 18px; position: relative; border-left: 4px solid transparent; }
.match-card.strong { border-color: rgba(18, 183, 106, 0.28); box-shadow: 0 0 0 1px rgba(18, 183, 106, 0.08), 0 18px 60px rgba(16, 24, 40, 0.08); border-left-color: #12b76a; }
.match-card.caution { border-color: rgba(247, 144, 9, 0.24); box-shadow: 0 8px 30px rgba(16, 24, 40, 0.06); border-left-color: #f79009; }
.match-card.rough { opacity: 0.72; filter: saturate(0.72); background: #f8fafc; box-shadow: 0 4px 16px rgba(16, 24, 40, 0.04); border-left-color: #9ca3af; }
.match-card.rough:hover { opacity: 0.9; }
.match-card:hover { transform: translateY(-2px); box-shadow: 0 20px 70px rgba(16, 24, 40, 0.14) !important; }
.match-top { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.match-top h4 { margin: 6px 0 0; font-size: 20px; }
.live-line { display: block; margin-top: 6px; color: #667085; font-size: 12px; font-weight: 700; }
.lineup-line { display: block; margin-top: 2px; color: #94a3b8; font-size: 11px; font-weight: 800; }
.badge { padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 900; white-space: nowrap; }
.badge.green { color: #fff; background: #059669; }
.badge.yellow { color: #1c1917; background: #fde68a; }
.badge.gray { color: #1c1917; background: #d4d4d8; }

/* tabular numbers for better alignment */
.league, .live-line, .lineup-line, .prob-bars b, .prediction-grid strong, .prediction-grid span, .signal-row b, .hit-row > span, .accuracy-panel b, .history-result { font-variant-numeric: tabular-nums; }

.prob-bars { display: grid; gap: 6px; margin: 12px 0 8px; }
.prob-bars div { display: grid; grid-template-columns: 56px 1fr 34px; gap: 8px; align-items: center; }
.prob-bars span { color: var(--muted); font-size: 12px; }
.prob-bars b { text-align: right; font-size: 13px; }
.bar { height: 8px; background: #edf1f6; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; }
.bar.strong i, .strong .bar i, .strong i { background: linear-gradient(90deg, #3b82f6, #10b981); }
.bar.weak i, .weak .bar i, .weak i { background: linear-gradient(90deg, #cbd5e1, #94a3b8); }
.bar.draw i, .draw .bar i, .draw i { background: #9ca3af; }

.prediction-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.prediction-grid div { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--line); }
.prediction-grid span { color: var(--muted); font-size: 12px; }
.prediction-grid strong { font-size: 12px; text-align: right; }
.prediction-grid div[style*="span 2"] strong { font-size: 12px; text-align: right; max-width: none; }
.human-note { margin: 8px 0 0; font-size: 13px; line-height: 1.45; }

.side-panel { display: grid; gap: 16px; }
.panel-card { padding: 20px; }
.group-row { display: grid; grid-template-columns: 70px 1fr 42px; gap: 10px; align-items: center; margin-top: 14px; }
.signal-row { grid-template-columns: 32px 70px 1fr 48px; gap: 8px; }
.signal-row span { font-size: 13px; }
.rank-num { color: #94a3b8; font-weight: 900; font-size: 12px; }
.signal-side { color: #059669; font-weight: 900; }
.signal-row .mini-bar { height: 6px; border-radius: 999px; background: #edf1f6; overflow: hidden; }
.signal-row .mini-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #059669); }
.signal-row b { text-align: right; font-variant-numeric: tabular-nums; }
.panel-note { margin: 14px 0 0; font-size: 11px; color: #94a3b8; }
.panel-card p { line-height: 1.55; }
.panel-card ul { padding-left: 20px; margin-bottom: 0; }
.panel-card li { margin: 9px 0; line-height: 1.5; }
.panel-card.alert { border-color: rgba(247, 144, 9, 0.24); }
.panel-card.warn { border-color: rgba(251, 146, 60, 0.3); background: rgba(255, 247, 237, 0.5); }
.panel-card.warn h3 { color: #ea580c; }
.panel-card.schedule { background: #0f172a; color: #fff; }
.panel-card.schedule p { color: #cbd5e1; }

.history-section { margin-top: 28px; }
#historyList { display: grid; gap: 14px; }
.accuracy-panel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.accuracy-panel div { padding: 16px; border-radius: 18px; background: #101828; color: #fff; }
.accuracy-panel span { display: block; color: #98a2b3; font-size: 12px; margin-bottom: 6px; }
.accuracy-panel b { font-size: 22px; }
.history-card { padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.history-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.history-head h4 { margin: 5px 0 0; font-size: 21px; }
.history-result { margin-top: 10px; color: #667085; font-size: 13px; font-weight: 800; }
.hit-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hit-row > span { padding: 7px 9px; border-radius: 999px; background: #f8fafc; color: #475569; font-size: 12px; font-weight: 900; }
.hit { margin-left: 4px; }
.hit.yes { color: #027a48; }
.hit.no { color: #b42318; }
.hit.wait { color: #667085; }
.history-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 12px; }
.history-grid div { padding: 12px; border-radius: 14px; background: #f8fafc; border: 1px solid var(--line); }
.history-grid span { display: block; color: #667085; font-size: 12px; margin-bottom: 5px; }
.history-grid b { font-size: 15px; }

footer { max-width: 1400px; margin: 0 auto; padding: 22px; display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); font-size: 14px; }
.footer-risk { color: #475569; font-weight: 800; }

.modal { display: none; position: fixed; z-index: 100; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); overflow-y: auto; }
.modal-content { position: relative; background: var(--card); margin: 5% auto; padding: 32px; max-width: 700px; width: calc(100% - 32px); border-radius: 24px; box-shadow: 0 20px 80px rgba(0,0,0,0.3); animation: modalFadeIn 0.2s ease; }
@keyframes modalFadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.modal-close { position: absolute; top: 16px; right: 16px; font-size: 32px; font-weight: 300; color: var(--muted); background: none; padding: 0; width: 36px; height: 36px; line-height: 32px; border-radius: 50%; }
.modal-close:hover { background: #f1f5f9; color: var(--ink); }
.match-card { padding: 22px; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.match-card:hover { transform: translateY(-2px); box-shadow: 0 20px 70px rgba(16, 24, 40, 0.12); }

.detail-probs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.lineup-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 20px; }
.lineup-detail div { padding: 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; }
.lineup-detail span { display: block; color: #475569; font-size: 13px; font-weight: 900; margin-bottom: 6px; }
.lineup-detail p { margin: 0; color: #667085; font-size: 12px; line-height: 1.55; }
.detail-prob-card { padding: 16px; background: #f8fafc; border-radius: 12px; text-align: center; }
.detail-prob-card.hot { background: rgba(18, 183, 106, 0.1); border: 1px solid rgba(18, 183, 106, 0.28); }
.detail-prob-card div { color: #667085; font-size: 13px; margin-bottom: 6px; }
.detail-prob-card strong { font-size: 28px; font-weight: 700; }

@media (max-width: 900px) {
  .site-header { padding: 14px 16px; align-items: flex-start; gap: 12px; }
  .brand span { display: none; }
  #headerUpdatedAt { display: none; }
  .hero, .layout, .prediction-grid, .prediction-grid.wide, .history-grid, .accuracy-panel { grid-template-columns: 1fr; }
  .main-feed.today-grid { grid-template-columns: 1fr; }
  .hero-copy { padding: 26px; }
  .side-panel { position: static; }
  .teams-row { grid-template-columns: 1fr; }
  .detail-probs { grid-template-columns: 1fr; }
  .lineup-detail { grid-template-columns: 1fr; }
  .detail-prob-card strong { font-size: 24px; }
  .match-top { display: block; }
  .badge { display: inline-block; margin-top: 12px; }
  .prob-bars div { grid-template-columns: 64px minmax(0, 1fr) 38px; }
  h1 { font-size: 34px; letter-spacing: -0.04em; }
  footer { flex-direction: column; }
}

@media (max-width: 520px) {
  main { padding: 18px 12px 36px; }
  .site-header { flex-direction: column; }
  .header-status { width: 100%; justify-content: center; }
  .hero-copy, .featured-card, .match-card, .panel-card { border-radius: 20px; }
  .hero-copy { padding: 22px; }
  h1 { font-size: 29px; line-height: 1.08; }
  h2 { font-size: 24px; }
  .match-top h4 { font-size: 22px; }
  .sub { font-size: 16px; }
  .section-title { display: block; }
  .section-title span { display: block; margin-top: 6px; }
  .quick-tabs { margin: 18px -12px; padding: 0 12px 4px; }
  .prob-bars div { grid-template-columns: 58px minmax(0, 1fr) 34px; gap: 8px; }
  .prediction-grid div { padding: 12px; }
  footer { padding: 18px 12px; }
}
