:root {
  --bg: #0b1220;
  --panel: #111a2e;
  --panel-2: #0d1526;
  --line: #1f2b47;
  --text: #e9effc;
  --muted: #93a1bd;
  --accent: #4ade80;
  --accent-dim: #14532d;
  --blue: #60a5fa;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.hidden { display: none !important; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 800; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: #052e16; font-size: 0.85rem; font-weight: 900;
}
.header-nav a { color: var(--muted); text-decoration: none; margin-left: 22px; font-size: 0.95rem; }
.header-nav a:hover { color: var(--text); }

/* ---------- hero ---------- */
.hero { padding: 72px 0 56px; background: radial-gradient(800px 400px at 50% -80px, #16294d 0%, var(--bg) 70%); }
.pill {
  display: inline-block; font-size: 0.8rem; color: var(--accent);
  border: 1px solid var(--accent-dim); border-radius: 999px; padding: 4px 14px; margin: 0 0 18px;
}
.hero h1 { font-size: 2.6rem; line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.02em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 640px; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; margin-bottom: 48px; flex-wrap: wrap; }

.btn {
  display: inline-block; border-radius: 9px; padding: 10px 20px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer; text-decoration: none; border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #052e16; border: none; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); }

.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature h3 { margin: 0 0 8px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* ---------- app ---------- */
.app { padding: 8px 20px 40px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; margin-bottom: 24px;
}
.card h2 { margin: 0 0 6px; font-size: 1.35rem; }

.league-bar { display: flex; flex-direction: column; gap: 14px; }
.league-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.league-controls input {
  flex: 1; min-width: 220px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 9px; color: var(--text); padding: 10px 14px; font-size: 0.95rem;
  font-family: ui-monospace, monospace;
}
.status { margin: 0; font-size: 0.9rem; color: var(--muted); }
.status.error { color: var(--bad); }

.tabs { display: flex; gap: 8px; margin: 4px 0 20px; flex-wrap: wrap; }
.tab {
  background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 22px; font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
.tab.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-dim); }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 12px; font-size: 0.9rem; max-width: 100%;
}

.table-wrap { overflow-x: auto; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.trend-up { color: var(--accent); } .trend-down { color: var(--bad); } .trend-flat { color: var(--muted); }
.val-high { color: var(--accent); font-weight: 700; }

/* ---------- trade ---------- */
.trade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.trade-side { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.trade-side h3 { margin: 0 0 10px; }
.trade-add { display: flex; gap: 8px; margin-bottom: 10px; }
.trade-add select { flex: 1; min-width: 0; }
.trade-list { list-style: none; margin: 0 0 10px; padding: 0; }
.trade-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px;
  font-size: 0.88rem;
}
.trade-list .pv { color: var(--accent); font-weight: 700; margin: 0 10px; }
.trade-list button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
.trade-list button:hover { color: var(--bad); }
.trade-total { margin: 0; font-size: 1.05rem; }
.verdict {
  margin-top: 18px; padding: 14px 18px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line); font-size: 1rem;
}

/* ---------- digest ---------- */
.digest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 18px; }
.digest-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.digest-card h3 { margin: 0 0 2px; font-size: 1rem; }
.digest-card .matchup-line { color: var(--muted); font-size: 0.85rem; margin: 0 0 10px; }
.lean { font-size: 0.88rem; padding: 8px 0; border-top: 1px solid var(--line); }
.lean:first-of-type { border-top: none; }
.lean .swap { font-weight: 700; }
.lean .why { color: var(--muted); display: block; margin-top: 2px; }
.lean .proj { color: var(--blue); font-variant-numeric: tabular-nums; }
.no-leans { color: var(--muted); font-size: 0.88rem; }

/* ---------- how / roadmap / footer ---------- */
.recipe { padding-left: 22px; }
.recipe li { margin-bottom: 10px; color: var(--muted); }
.recipe li strong, .recipe code { color: var(--text); }
.recipe code { background: var(--panel-2); padding: 1px 6px; border-radius: 5px; font-size: 0.85em; }
.stub-list { list-style: none; padding: 0; margin: 14px 0 0; }
.stub-list li {
  padding: 10px 14px; border: 1px dashed var(--line); border-radius: 9px;
  margin-bottom: 8px; color: var(--muted); font-size: 0.92rem;
}
.stub-list li strong { color: var(--text); }
.footer { padding: 8px 20px 48px; }

@media (max-width: 720px) {
  .hero h1 { font-size: 1.9rem; }
  .feature-row { grid-template-columns: 1fr; }
  .trade-grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
}

/* ---------- my team ---------- */
.myteam-row { margin-top: 0.6rem; align-items: center; }
.myteam-row label { margin-right: 0.35rem; }
#myTeam { max-width: 18rem; }
.digest-card.my-team-card { border: 2px solid var(--accent, #f5a623); }
.myteam-badge { color: #b97c0a; font-weight: 700; font-size: 0.85em; white-space: nowrap; }
.myteam-btn { margin: 0.15rem 0 0.6rem; }
.btn-small { font-size: 0.8rem; padding: 0.28rem 0.65rem; border-radius: 999px;
  border: 1px solid var(--line, #d8d8d8); background: transparent; color: inherit; cursor: pointer; }
.btn-small:hover { background: rgba(127,127,127,0.12); }
