:root {
  --ink: #13201d;
  --ink-soft: #5f6b67;
  --paper: #f3f0e8;
  --panel: #fffdf8;
  --line: #d9d7cf;
  --forest: #0d1e1a;
  --forest-2: #173a31;
  --lime: #d6f36a;
  --lime-deep: #9ec323;
  --orange: #ff7a45;
  --blue: #5bb6d6;
  --rose: #e7778f;
  --violet: #8c7bd1;
  --shadow: 0 16px 48px rgba(13, 30, 26, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 9% 10%, rgba(214, 243, 106, .15), transparent 24rem),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, select, input { font: inherit; }
button, label[for] { -webkit-tap-highlight-color: transparent; }

.site-header {
  position: relative;
  overflow: hidden;
  color: #f8f8f2;
  background:
    linear-gradient(125deg, rgba(13, 30, 26, .98), rgba(23, 58, 49, .96)),
    var(--forest);
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.site-header::after {
  content: "";
  position: absolute;
  inset: auto -10% -110px 20%;
  height: 160px;
  border: 1px solid rgba(214, 243, 106, .16);
  border-radius: 50%;
  transform: rotate(-4deg);
}

.stadium-lights {
  position: absolute;
  inset: 0;
  opacity: .6;
  background:
    radial-gradient(ellipse at 82% 0%, rgba(214, 243, 106, .23), transparent 26%),
    repeating-linear-gradient(105deg, transparent 0 90px, rgba(255,255,255,.018) 91px 92px);
}

.header-inner {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  min-height: 250px;
  margin: 0 auto;
  padding: 54px 0 46px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
}

.eyebrow, .section-kicker {
  display: block;
  color: var(--lime-deep);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.site-header .eyebrow { color: var(--lime); }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.05; letter-spacing: -.035em; }

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  font-weight: 850;
}

h1 em { color: var(--lime); font-style: normal; }

.brand-block p { margin: 0; color: rgba(255,255,255,.68); }

.header-actions {
  max-width: 280px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  text-align: right;
}

.header-actions small { width: 100%; color: rgba(255,255,255,.52); font-size: .72rem; }

.upload-button, .ghost-button {
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: 10px 15px;
  color: var(--forest);
  background: var(--lime);
  font-weight: 750;
  transition: transform .18s ease, background .18s ease;
}

.upload-button:hover, .ghost-button:hover { transform: translateY(-1px); }
.ghost-button { color: #fff; background: transparent; }

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

.forecast-hero {
  position: relative;
  z-index: 2;
  margin-top: -22px;
  min-height: 136px;
  padding: 25px 28px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 30px;
  align-items: center;
  border-radius: var(--radius);
  background: var(--lime);
  box-shadow: var(--shadow);
}

.forecast-hero h2 { margin: 2px 0 5px; font-size: clamp(1.65rem, 3vw, 2.5rem); }
.forecast-hero p { margin: 0; color: rgba(19,32,29,.68); }
.forecast-label { color: rgba(19,32,29,.62); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.forecast-bars { display: grid; gap: 7px; }
.forecast-row { display: grid; grid-template-columns: 82px 1fr 48px; gap: 10px; align-items: center; font-size: .86rem; font-weight: 700; }
.forecast-track { overflow: hidden; height: 8px; border-radius: 99px; background: rgba(13,30,26,.13); }
.forecast-fill { height: 100%; border-radius: inherit; background: var(--forest); }

.tabs {
  margin: 42px 0 34px;
  display: flex;
  gap: 9px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  cursor: pointer;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255,255,255,.38);
  font-weight: 720;
}

.tab.active { color: #fff; border-color: var(--forest); background: var(--forest); }
.tab-panel { display: none; animation: reveal .25s ease; }
.tab-panel.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }

.section-heading { margin: 0 0 20px; }
.section-heading h2 { margin: 4px 0 0; font-size: clamp(1.75rem, 3vw, 2.6rem); }
.section-heading .lede { max-width: 720px; margin: 12px 0 0; color: var(--ink-soft); }
.split-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }

.select-wrap { display: grid; gap: 5px; color: var(--ink-soft); font-size: .72rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
select {
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 34px 9px 11px;
  color: var(--ink);
  background: var(--panel);
}

.metric-grid {
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.metric-card {
  min-height: 130px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,253,248,.76);
}

.metric-card.highlight { color: #fff; border-color: var(--forest); background: var(--forest); }
.metric-label { color: var(--ink-soft); font-size: .76rem; font-weight: 720; }
.highlight .metric-label, .highlight .metric-note { color: rgba(255,255,255,.62); }
.metric-value { display: block; margin: 7px 0 2px; font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 850; letter-spacing: -.05em; line-height: 1; }
.metric-note { color: var(--ink-soft); font-size: .76rem; }

.two-column { display: grid; grid-template-columns: 1.55fr .9fr; gap: 18px; }
.panel {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 30px rgba(13,30,26,.035);
}

.panel-title { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-title h3 { margin: 3px 0 0; font-size: 1.25rem; }
.info-chip { padding: 5px 9px; border-radius: 999px; color: var(--ink-soft); background: #efede6; font-size: .68rem; white-space: nowrap; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { color: var(--ink-soft); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
th, td { padding: 10px 9px; text-align: left; border-bottom: 1px solid #e9e7e0; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank { color: var(--ink-soft); font-weight: 800; }
.player-cell { display: flex; align-items: center; gap: 9px; font-weight: 750; }
.avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--forest-2);
  font-size: .68rem;
  font-weight: 800;
}
.leader-row .avatar { color: var(--forest); background: var(--lime); }
.leader-row { background: rgba(214,243,106,.10); }

.bar-list { display: grid; gap: 14px; }
.bar-list.large { gap: 16px; }
.bar-head { margin-bottom: 5px; display: flex; justify-content: space-between; gap: 16px; font-size: .82rem; }
.bar-name { font-weight: 720; }
.bar-value { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.bar-track { overflow: hidden; height: 8px; border-radius: 99px; background: #e8e6df; }
.large .bar-track { height: 12px; }
.bar-fill { height: 100%; min-width: 2px; border-radius: inherit; background: var(--forest-2); transition: width .35s ease; }
.bar-row:nth-child(1) .bar-fill { background: var(--lime-deep); }
.bar-sub { margin-top: 4px; color: var(--ink-soft); font-size: .7rem; }

.chart-panel { margin-top: 0; }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-soft); font-size: .7rem; }
.legend-swatch { width: 16px; height: 3px; border-radius: 9px; }
.progress-chart { min-height: 330px; }
.progress-chart svg { width: 100%; height: 330px; display: block; overflow: visible; }
.chart-grid { stroke: #dfddd5; stroke-width: 1; }
.chart-axis-text { fill: var(--ink-soft); font-size: 10px; }
.chart-line { fill: none; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; opacity: .82; }
.chart-line.top { stroke-width: 3.2; opacity: 1; }
.chart-end-label { font-size: 10px; font-weight: 750; }

.insight-grid { margin-bottom: 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.insight-card { min-height: 185px; padding: 20px; border-top: 4px solid var(--orange); border-radius: 0 0 var(--radius) var(--radius); background: var(--panel); }
.insight-card:nth-child(2) { border-color: var(--blue); }
.insight-card:nth-child(3) { border-color: var(--lime-deep); }
.insight-card:nth-child(4) { border-color: var(--rose); }
.insight-card:nth-child(5) { border-color: var(--violet); }
.insight-card:nth-child(6) { border-color: var(--forest-2); }
.insight-icon { display: inline-grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #efede6; }
.insight-card h3 { margin: 18px 0 7px; font-size: 1.1rem; }
.insight-card p { margin: 0; color: var(--ink-soft); font-size: .84rem; }
.insight-card strong { color: var(--ink); }

.team-summary { margin-bottom: 18px; display: grid; grid-template-columns: 1.2fr repeat(3, .65fr); gap: 13px; }
.team-hero { padding: 22px; border-radius: var(--radius); color: #fff; background: var(--forest); }
.team-hero h3 { margin: 3px 0 6px; font-size: 1.7rem; }
.team-hero p { margin: 0; color: rgba(255,255,255,.62); font-size: .82rem; }

.heatmap-wrap { overflow-x: auto; }
.heatmap { min-width: 880px; display: grid; gap: 4px; align-items: stretch; }
.heat-cell { min-height: 34px; padding: 5px; display: grid; place-items: center; border-radius: 7px; font-size: .68rem; font-variant-numeric: tabular-nums; }
.heat-header { color: var(--ink-soft); font-weight: 720; writing-mode: vertical-rl; transform: rotate(180deg); justify-self: center; max-height: 100px; }
.heat-row-label { justify-content: start; font-weight: 750; white-space: nowrap; }
.heat-none { color: #9a9f9c; background: #efede7; }
.heat-low { color: #4c1c13; background: #f4b7a5; }
.heat-mid { color: #4d4415; background: #efe19c; }
.heat-good { color: #23420c; background: #cce886; }
.heat-great { color: #fff; background: var(--forest-2); }

.player-profile { margin-bottom: 48px; }
.profile-top { display: grid; grid-template-columns: 1.1fr 2fr; gap: 18px; }
.profile-identity { min-height: 260px; padding: 26px; border-radius: var(--radius); color: #fff; background: var(--forest); }
.profile-avatar { width: 64px; height: 64px; margin-bottom: 24px; font-size: 1.2rem; background: var(--lime); color: var(--forest); }
.profile-identity h3 { margin: 0 0 7px; font-size: 2rem; }
.profile-rank { color: var(--lime); font-weight: 750; }
.profile-big { margin-top: 30px; font-size: 2.6rem; font-weight: 850; line-height: 1; }
.profile-big small { display: block; margin-top: 5px; color: rgba(255,255,255,.55); font-size: .72rem; font-weight: 500; }
.profile-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.profile-lists { margin-top: 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.mini-list { display: grid; gap: 10px; }
.mini-row { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 9px; border-bottom: 1px solid #e8e6df; font-size: .86rem; }

.model-podium { margin-bottom: 18px; display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 13px; }
.podium-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.podium-card.first { color: #fff; border-color: var(--forest); background: var(--forest); }
.podium-rank { color: var(--ink-soft); font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.first .podium-rank { color: var(--lime); }
.podium-card h3 { margin: 22px 0 6px; font-size: 1.6rem; }
.podium-odds { font-size: 2.5rem; font-weight: 850; letter-spacing: -.06em; }
.podium-card p { margin: 4px 0 0; color: var(--ink-soft); font-size: .78rem; }
.first p { color: rgba(255,255,255,.58); }
.model-notes { margin: 18px 0 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.note { padding: 16px 18px; border-left: 3px solid var(--lime-deep); background: rgba(255,255,255,.4); font-size: .8rem; color: var(--ink-soft); }

.toast {
  position: fixed;
  z-index: 20;
  right: 20px;
  bottom: 20px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  background: var(--forest);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #8a2f22; }

footer {
  padding: 28px max(20px, calc((100% - 1180px) / 2));
  color: rgba(255,255,255,.58);
  background: var(--forest);
  font-size: .75rem;
}
footer p { margin: 4px 0; }
footer strong { color: rgba(255,255,255,.88); }

@media (max-width: 900px) {
  .header-inner { align-items: flex-start; flex-direction: column; }
  .header-actions { max-width: 100%; justify-content: flex-start; text-align: left; }
  .forecast-hero { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .two-column, .profile-top { grid-template-columns: 1fr; }
  .insight-grid { grid-template-columns: repeat(2, 1fr); }
  .team-summary { grid-template-columns: repeat(3, 1fr); }
  .team-hero { grid-column: 1 / -1; }
  .model-podium { grid-template-columns: repeat(2, 1fr); }
  .podium-card.first { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  main, .header-inner { width: min(100% - 24px, 1180px); }
  .header-inner { min-height: 270px; padding: 38px 0 42px; }
  h1 { font-size: 2.8rem; }
  .forecast-hero { margin-top: -16px; padding: 21px 18px; }
  .forecast-row { grid-template-columns: 70px 1fr 42px; }
  .tabs { margin: 30px 0 26px; }
  .split-heading { align-items: stretch; flex-direction: column; }
  select { width: 100%; }
  .metric-grid, .insight-grid, .model-podium, .model-notes, .profile-stats, .profile-lists { grid-template-columns: 1fr; }
  .metric-card { min-height: 112px; }
  .panel { padding: 17px 14px; }
  .panel-title { align-items: flex-start; flex-direction: column; }
  .legend { justify-content: flex-start; }
  .progress-chart { overflow-x: auto; }
  .progress-chart svg { min-width: 620px; }
  .team-summary { grid-template-columns: 1fr; }
  .team-hero { grid-column: auto; }
  .info-chip { white-space: normal; }
  .toast { right: 12px; bottom: 12px; left: 12px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
