:root {
  --bg: #07100c;
  --panel: #0d1812;
  --panel-2: #111f17;
  --panel-3: #16271d;
  --line: #26382d;
  --text: #f4f7f5;
  --muted: #93a69a;
  --accent: #38e078;
  --accent-2: #b9ffcf;
  --gold: #f4c95d;
  --danger: #ff7474;
  --warning: #ffd166;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(56, 224, 120, .12), transparent 34rem),
    radial-gradient(circle at 90% 10%, rgba(244, 201, 93, .08), transparent 32rem),
    var(--bg);
}
button { font: inherit; }
button:focus-visible { outline: 3px solid rgba(56, 224, 120, .35); outline-offset: 2px; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1rem clamp(1rem, 4vw, 3.75rem);
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(7, 16, 12, .88);
  backdrop-filter: blur(18px);
}
.brand-wrap { display: flex; align-items: center; gap: .9rem; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-weight: 900;
  letter-spacing: -.04em;
  color: #041108;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 8px 30px rgba(56,224,120,.2);
}
.eyebrow, .section-label {
  color: var(--accent);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.topbar h1 { margin: .1rem 0 0; font-size: clamp(1rem, 2vw, 1.35rem); letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
.status-pill, .count-badge, .stake-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d9e2dc;
  background: #0b1510;
  font-size: .75rem;
  font-weight: 700;
}
.status-pill.demo { color: var(--warning); }
.dot { width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(255,209,102,.08); }
.ghost-button, .tab {
  color: #dfe8e2;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 10px;
  padding: .55rem .78rem;
  cursor: pointer;
}
.ghost-button:hover, .tab:hover, .tab.active { border-color: rgba(56,224,120,.6); color: var(--accent-2); background: rgba(56,224,120,.08); }

main { width: min(1500px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 5rem; }
.hero-grid { display: grid; grid-template-columns: 1.35fr .9fr; gap: 1.1rem; }
.hero-card, .panel, .metric {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17,31,23,.96), rgba(10,20,14,.96));
  box-shadow: var(--shadow);
}
.hero-card { min-height: 340px; padding: clamp(1.25rem, 3vw, 2rem); border-radius: 22px; position: relative; overflow: hidden; }
.hero-card::after { content: ""; position: absolute; width: 240px; height: 240px; right: -110px; top: -110px; border-radius: 50%; background: rgba(56,224,120,.08); pointer-events: none; }
.winner-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.4rem; }
.winner-row h2 { margin: .15rem 0 .2rem; font-size: clamp(1.65rem, 4vw, 3rem); letter-spacing: -.045em; }
.muted { color: var(--muted); margin: 0; }
.score { margin: 0; color: #d7e4dc; font-weight: 700; }
.award-badge { display: grid; place-items: center; width: clamp(85px, 12vw, 125px); aspect-ratio: 1; border-radius: 50%; color: #051109; background: linear-gradient(145deg, #f7ffd9, var(--gold)); font-size: clamp(1.4rem, 3vw, 2.25rem); font-weight: 950; box-shadow: 0 16px 50px rgba(244,201,93,.18); }
.deadline-row { display: flex; gap: .65rem 1.3rem; flex-wrap: wrap; margin: 1.25rem 0; color: var(--muted); font-size: .8rem; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem; }
.choice-button { text-align: left; padding: 1rem; min-height: 82px; border-radius: 14px; cursor: pointer; color: var(--text); border: 1px solid var(--line); background: var(--panel-2); }
.choice-button strong, .choice-button small { display: block; }
.choice-button small { margin-top: .35rem; color: var(--muted); }
.choice-button:hover, .choice-button.selected { border-color: rgba(56,224,120,.75); background: rgba(56,224,120,.09); box-shadow: inset 0 0 0 1px rgba(56,224,120,.15); }
.choice-button.featured strong { color: var(--accent-2); }
.tiny-note { color: #74877b; font-size: .73rem; line-height: 1.5; margin: .9rem 0 0; }
.bank-total { display: flex; justify-content: space-between; align-items: flex-end; margin: 1.4rem 0 1.5rem; }
.bank-total span { color: var(--muted); }
.bank-total strong { font-size: clamp(2rem, 5vw, 3.3rem); letter-spacing: -.05em; }
.allocation-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .82rem; color: #dce6df; }
.bar { height: 7px; border-radius: 99px; overflow: hidden; background: #07110b; margin: .4rem 0 .75rem; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bonus-bank { margin-top: 1.1rem; padding: 1rem; border-radius: 14px; border: 1px solid rgba(244,201,93,.28); background: rgba(244,201,93,.06); display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.bonus-bank span, .bonus-bank small { display: block; }
.bonus-bank span { font-weight: 800; }
.bonus-bank small { color: var(--muted); margin-top: .25rem; }
.bonus-bank strong { color: var(--gold); font-size: 1.35rem; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .8rem; margin: 1rem 0; }
.metric { padding: 1rem 1.1rem; border-radius: 16px; }
.metric span, .metric strong, .metric small { display: block; }
.metric span { color: var(--muted); font-size: .78rem; }
.metric strong { font-size: 1.45rem; margin-top: .18rem; }
.metric small { color: #718378; margin-top: .25rem; }

.content-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(330px,.7fr); gap: 1rem; margin-top: 1rem; align-items: start; }
.builder-layout { grid-template-columns: minmax(0,1.55fr) minmax(340px,.65fr); }
.panel { padding: clamp(1rem, 2.4vw, 1.5rem); border-radius: 20px; margin-top: 1rem; }
.content-grid > .panel { margin-top: 0; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-heading h2, .slip-heading h2 { margin: .2rem 0 0; font-size: clamp(1.15rem, 2.4vw, 1.55rem); letter-spacing: -.025em; }
.tabs { display: flex; gap: .4rem; }
.tab { font-size: .75rem; padding: .45rem .65rem; }
.book-note { display: flex; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; padding: .8rem .9rem; border-radius: 12px; border: 1px solid rgba(56,224,120,.2); background: rgba(56,224,120,.055); font-size: .78rem; margin-bottom: 1rem; }
.book-note span { color: var(--muted); }
.market-list { display: grid; gap: .8rem; }
.event-card { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: rgba(6,14,9,.45); }
.event-head { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.event-head strong { display: block; }
.event-meta { color: var(--muted); font-size: .72rem; margin-top: .22rem; }
.sport-chip { align-self: flex-start; padding: .3rem .5rem; border-radius: 8px; color: var(--accent-2); background: rgba(56,224,120,.08); font-size: .7rem; font-weight: 800; }
.market-options { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .55rem; padding: .8rem; }
.market-option { padding: .75rem; min-height: 70px; border-radius: 11px; border: 1px solid #2a3e31; background: #0e1a13; color: var(--text); cursor: pointer; text-align: left; }
.market-option:hover, .market-option.selected { border-color: var(--accent); background: rgba(56,224,120,.08); }
.market-option span, .market-option strong { display: block; }
.market-option span { font-size: .75rem; color: #c9d5cd; }
.market-option strong { color: var(--accent-2); margin-top: .25rem; }
.market-option small { color: #708379; font-size: .67rem; }

.bet-slip { position: sticky; top: 86px; }
.slip-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.stake-badge.ready { color: var(--accent-2); border-color: rgba(56,224,120,.4); }
.empty-state { min-height: 220px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); padding: 1.5rem; }
.empty-state p { max-width: 280px; line-height: 1.55; }
.empty-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; border: 1px dashed #43604d; color: var(--accent); font-size: 1.8rem; }
.slip-legs { display: grid; gap: .55rem; margin-top: 1rem; }
.slip-leg { display: grid; grid-template-columns: 1fr auto; gap: .8rem; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(5,12,8,.5); }
.slip-leg strong, .slip-leg span, .slip-leg small { display: block; }
.slip-leg span { color: var(--accent-2); font-weight: 800; margin-top: .15rem; }
.slip-leg small { color: var(--muted); margin-top: .18rem; }
.remove-leg { align-self: start; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; color: #cfddd4; border: 1px solid var(--line); background: transparent; }
.remove-leg:hover { color: var(--danger); border-color: rgba(255,116,116,.45); }
.slip-totals { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.slip-totals > div { display: flex; justify-content: space-between; margin: .5rem 0; color: var(--muted); }
.slip-totals > div strong { color: var(--text); }
.return-row { padding-top: .55rem; border-top: 1px dashed #314538; }
.return-row strong { color: var(--gold) !important; font-size: 1.15rem; }
.warning { padding: .7rem; border-radius: 10px; color: #f7dea0; background: rgba(255,209,102,.07); border: 1px solid rgba(255,209,102,.18); font-size: .75rem; line-height: 1.45; }
.primary-button, .secondary-button { width: 100%; border-radius: 11px; padding: .8rem 1rem; cursor: pointer; font-weight: 850; margin-top: .6rem; }
.primary-button { color: #041108; background: linear-gradient(135deg, var(--accent-2), var(--accent)); border: none; }
.secondary-button { color: var(--text); background: #14231a; border: 1px solid #34503c; }
.primary-button:hover, .secondary-button:hover { filter: brightness(1.07); }

.analysis-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .7rem; margin-bottom: 1rem; }
.analysis-metric { padding: .9rem; border-radius: 12px; background: #09130d; border: 1px solid var(--line); }
.analysis-metric span, .analysis-metric strong { display: block; }
.analysis-metric span { color: var(--muted); font-size: .72rem; }
.analysis-metric strong { margin-top: .25rem; font-size: 1.1rem; }
.analysis-legs { display: grid; gap: .7rem; }
.analysis-leg { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 1rem; padding: .9rem; border: 1px solid var(--line); border-radius: 12px; }
.analysis-leg p { margin: .35rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.rating { align-self: start; border-radius: 999px; padding: .35rem .55rem; font-size: .7rem; font-weight: 850; }
.rating.strong { color: var(--accent-2); background: rgba(56,224,120,.1); }
.rating.neutral { color: var(--warning); background: rgba(255,209,102,.08); }
.rating.weak { color: #ffaaaa; background: rgba(255,116,116,.09); }
.analysis-disclaimer { margin-top: 1rem; padding: .8rem; border-radius: 10px; color: #7f9386; background: #08110c; font-size: .72rem; line-height: 1.5; }

.future-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .75rem; }
.future-card { padding: 1rem; border-radius: 14px; background: #09130d; border: 1px solid var(--line); }
.future-card h3 { margin: .35rem 0 .2rem; font-size: 1rem; }
.future-card .future-market { color: var(--muted); font-size: .72rem; min-height: 34px; }
.future-values { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .8rem; }
.future-values div { padding: .55rem; border-radius: 9px; background: #0f1c14; }
.future-values span, .future-values strong { display: block; }
.future-values span { font-size: .65rem; color: var(--muted); }
.future-values strong { margin-top: .14rem; font-size: .85rem; }
.sparkline { width: 100%; height: 54px; margin-top: .65rem; overflow: visible; }
.sparkline polyline { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.line-move { color: var(--accent-2); font-size: .7rem; font-weight: 800; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
.standings-table { min-width: 900px; font-variant-numeric: tabular-nums; }
.standings-table caption { text-align: left; padding-bottom: .7rem; }
.standings-table tbody th { color: var(--text); text-transform: none; letter-spacing: normal; font-size: .8rem; min-width: 160px; }
.standings-table td:not(:nth-child(2)) { white-space: nowrap; }
.standings-details { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .8rem; }
.standings-details summary { color: var(--muted); font-size: .8rem; cursor: pointer; }
th, td { padding: .72rem .45rem; text-align: left; border-bottom: 1px solid var(--line); font-size: .78rem; }
th { color: #789083; font-size: .67rem; text-transform: uppercase; letter-spacing: .08em; }
td { color: #d7e2db; }
.amount-credit { color: var(--accent-2); }
.amount-debit { color: #ffb3b3; }
.queue-list { display: grid; gap: .7rem; }
.queue-item { padding: .9rem; border-radius: 12px; border: 1px solid var(--line); background: #09130d; }
.queue-item strong, .queue-item span { display: block; }
.queue-item span { color: var(--muted); font-size: .75rem; margin-top: .25rem; }
.queue-status { color: var(--warning) !important; font-weight: 800; }
.count-badge { min-width: 30px; justify-content: center; color: var(--gold); }

footer { width: min(1500px, calc(100% - 2rem)); margin: 0 auto; padding: 1.5rem 0 3rem; display: flex; justify-content: space-between; gap: 1rem; color: #62766a; border-top: 1px solid rgba(255,255,255,.05); font-size: .75rem; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 1.5rem; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: .8rem 1rem; border-radius: 11px; color: #06100a; background: var(--accent-2); font-weight: 850; box-shadow: 0 18px 50px rgba(0,0,0,.4); transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.hidden { display: none !important; }

@media (max-width: 1050px) {
  .hero-grid, .builder-layout, .content-grid { grid-template-columns: 1fr; }
  .bet-slip { position: static; }
  .future-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .topbar { align-items: flex-start; }
  .topbar-actions .status-pill:not(.demo) { display: none; }
  main { width: min(100% - 1rem, 1500px); padding-top: .75rem; }
  .hero-grid { gap: .6rem; }
  .hero-card { min-height: auto; border-radius: 16px; }
  .winner-row { align-items: flex-start; }
  .choice-grid, .stats-grid, .future-grid, .analysis-summary { grid-template-columns: 1fr 1fr; }
  .stats-grid { gap: .5rem; }
  .market-options { grid-template-columns: 1fr; }
  .panel { border-radius: 15px; }
  .panel-heading { flex-direction: column; }
  footer { flex-direction: column; }
}
@media (max-width: 480px) {
  .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .eyebrow { display: none; }
  .topbar h1 { font-size: .95rem; }
  .choice-grid, .future-grid, .analysis-summary { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .award-badge { width: 76px; }
  .tabs { width: 100%; }
  .tab { flex: 1; }
}
.edition-panel { margin: 1.5rem 0; padding: 1.5rem; }
.edition-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 1rem; margin-top: 1rem; }
.edition-team { padding: 1rem; border: 1px solid var(--border); border-radius: 12px; }
.edition-team h4 { margin: 0 0 .5rem; }
.edition-team p { line-height: 1.65; white-space: pre-wrap; }
.edition-facts { color: var(--accent-2); font-size: .85rem; }
.edition-panel summary, .edition-draft summary { cursor: pointer; padding: .8rem 0; }
.edition-correction { color: #ffd18a; }
.edition-edit-label { display: block; margin: 1rem 0; }
.edition-edit-label textarea { display: block; width: 100%; box-sizing: border-box; margin-top: .5rem; resize: vertical; }
