/* ===========================================================
   GoBuckYourself — Fantasy Football Rankings & Trade Calculator
   Design tokens, layout, components
   =========================================================== */

:root {
  --bg: #0c0c0e;
  --bg-2: #131316;
  --surface: #1a1a1e;
  --surface-2: #232328;
  --border: #2c2c33;
  --border-strong: #3d3d46;
  --text: #f2f2f2;
  --text-2: #b3b3b8;
  --text-3: #7c7c85;
  --accent: #e0242f;   /* Buckeye scarlet, brightened for dark backgrounds */
  --accent-2: #bb0000; /* official OSU scarlet */
  --accent-ink: #ffffff;
  --blue: #a7a9ac;     /* OSU gray, used as the secondary/Team B color */
  --red: #ff6b6b;
  --amber: #f5b942;
  --qb: #ff6b6b;
  --rb: #4fd1c5;
  --wr: #63a4ff;
  --te: #ffa94d;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(187, 0, 0, .22), transparent 60%),
              radial-gradient(900px 500px at -10% 20%, rgba(167, 169, 172, .08), transparent 60%),
              var(--bg);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(224, 36, 47, .45); }

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

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(12, 12, 14, .82);
  border-bottom: 1px solid var(--border);
}
.nav__inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; font-size: 18px; }
.brand__mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #e0242f, #8a0000);
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 14px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 6px 18px rgba(187,0,0,.45);
}
.nav__links { display: flex; gap: 4px; margin-left: 8px; }
.nav__links a {
  padding: 8px 14px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav__links a:hover { color: var(--text); background: var(--surface); }
.nav__links a.active { color: var(--text); background: var(--surface-2); }
.nav__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav__toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 10px; width: 40px; height: 40px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px;
  transition: transform .1s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent-2); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(187,0,0,.35); }
.btn--primary:hover { background: var(--accent); border-color: transparent; }
.btn--ghost { background: transparent; }
.btn--sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn--lg { padding: 14px 24px; font-size: 16px; border-radius: 13px; }

/* ---------- Segmented control ---------- */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 4px; gap: 2px; }
.seg button {
  background: transparent; border: 0; padding: 7px 14px; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: 13px;
  transition: background .15s, color .15s;
}
.seg button.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.seg button:hover:not(.active) { color: var(--text); }

/* ---------- Hero ---------- */
.hero { padding: 88px 0 56px; position: relative; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: rgba(224,36,47,.14); color: var(--accent); font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid rgba(224,36,47,.35);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
h1.display { font-size: clamp(38px, 5.4vw, 62px); line-height: 1.04; letter-spacing: -.035em; margin: 18px 0 16px; font-weight: 800; }
h1.display .grad { background: linear-gradient(90deg, #ff3b47, #ff8a90); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--text-2); font-size: 18px; max-width: 540px; margin: 0 0 28px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__stats { display: flex; gap: 32px; margin-top: 36px; }
.stat b { display: block; font-size: 26px; letter-spacing: -.02em; }
.stat span { color: var(--text-3); font-size: 13px; }

/* Hero mock card */
.mock {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border); border-radius: 20px; padding: 20px; box-shadow: var(--shadow);
  transform: rotate(-1.5deg);
}
.mock__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; color: var(--text-2); font-size: 13px; }
.mock__row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; }
.mock__row + .mock__row { border-top: 1px solid var(--border); }
.mock__row .val { margin-left: auto; font-family: var(--mono); font-weight: 600; }
.mock__row:first-of-type { background: rgba(224,36,47,.10); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.03em; margin: 0 0 6px; }
.sub { color: var(--text-2); margin: 0; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
  transition: transform .15s, border-color .15s;
}
.feature:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.feature__icon {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 14px;
  background: rgba(167,169,172,.14); color: #d0d2d5;
}
.feature h3 { margin: 0 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--text-2); font-size: 14px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card__head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card__head h3 { margin: 0; font-size: 15px; }
.card__body { padding: 16px 18px; }

/* ---------- Position badges ---------- */
.pos {
  display: inline-grid; place-items: center; min-width: 34px; height: 22px; padding: 0 7px; border-radius: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
}
.pos--QB { background: rgba(255,107,107,.16); color: var(--qb); }
.pos--RB { background: rgba(79,209,197,.16); color: var(--rb); }
.pos--WR { background: rgba(99,164,255,.16); color: var(--wr); }
.pos--TE { background: rgba(255,169,77,.16); color: var(--te); }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); flex: none;
}
.avatar--QB { color: var(--qb); } .avatar--RB { color: var(--rb); } .avatar--WR { color: var(--wr); } .avatar--TE { color: var(--te); }

.trend { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.trend--up { color: var(--accent); } .trend--down { color: var(--red); } .trend--flat { color: var(--text-3); }

/* ---------- Toolbar & inputs ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search input {
  width: 100%; padding: 11px 14px 11px 40px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(224,36,47,.22); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600;
}
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
select.select {
  padding: 10px 36px 10px 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a4afc2' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none; outline: none;
}

/* ---------- Rankings table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.rank { width: 100%; border-collapse: collapse; min-width: 720px; }
table.rank th, table.rank td { padding: 12px 14px; text-align: left; white-space: nowrap; }
table.rank thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700;
  border-bottom: 1px solid var(--border); background: var(--bg-2);
}
table.rank tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
table.rank tbody tr:hover { background: var(--surface-2); }
table.rank tbody tr:last-child { border-bottom: 0; }
td.rank-no { color: var(--text-3); font-family: var(--mono); font-weight: 600; width: 56px; }
td.player { display: flex; align-items: center; gap: 12px; }
td.player .name { font-weight: 600; }
td.player .meta { color: var(--text-3); font-size: 12px; }
td.value { font-family: var(--mono); font-weight: 700; }
.bar { height: 6px; border-radius: 4px; background: var(--surface-2); width: 120px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #bb0000, #ff3b47); }
.num { text-align: right !important; }
.tier { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 700; }

/* ---------- Trade calculator ---------- */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.side { position: relative; }
.side__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.side__head h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.side__head .dot { width: 10px; height: 10px; border-radius: 50%; }
.side--a .dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.side--b .dot { background: var(--blue); box-shadow: 0 0 10px var(--blue); }
.side__total { font-family: var(--mono); font-weight: 800; font-size: 18px; }
.side__list { padding: 8px; min-height: 120px; }
.asset {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px;
  animation: pop .18s ease-out;
}
.asset:hover { background: var(--surface-2); }
.asset .name { font-weight: 600; }
.asset .meta { color: var(--text-3); font-size: 12px; }
.asset .val { margin-left: auto; font-family: var(--mono); font-weight: 700; }
.asset .rm { background: none; border: 0; color: var(--text-3); padding: 4px; border-radius: 6px; line-height: 0; }
.asset .rm:hover { color: var(--red); background: rgba(255,95,109,.12); }
.empty { color: var(--text-3); text-align: center; padding: 28px 12px; font-size: 14px; }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.side__search { padding: 10px 12px 12px; border-top: 1px solid var(--border); position: relative; }
.dropdown {
  position: absolute; left: 12px; right: 12px; top: calc(100% - 4px); z-index: 20;
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow);
  max-height: 300px; overflow-y: auto; display: none;
}
.dropdown.open { display: block; }
.dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px;
}
.dropdown button:hover, .dropdown button.hl { background: var(--surface-2); }
.dropdown .val { margin-left: auto; font-family: var(--mono); color: var(--text-2); font-size: 13px; }

.verdict { margin-top: 18px; text-align: center; padding: 26px 20px; }
.verdict__title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.verdict__sub { color: var(--text-2); margin: 0 0 18px; }
.meter { position: relative; height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.meter__a, .meter__b { position: absolute; top: 0; bottom: 0; transition: width .35s cubic-bezier(.2,.8,.2,1); }
.meter__a { left: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.meter__b { right: 0; background: linear-gradient(270deg, #8e9094, #c5c7ca); }
.meter__mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .6; }
.meter__labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--text-2); font-family: var(--mono); }
.suggest { margin-top: 18px; text-align: left; }
.suggest h4 { margin: 0 0 8px; font-size: 13px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.suggest__list { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest__list button {
  border: 1px dashed var(--border-strong); background: transparent; border-radius: 10px; padding: 7px 12px; font-size: 13px; color: var(--text-2);
  display: flex; align-items: center; gap: 8px;
}
.suggest__list button:hover { border-color: var(--accent); color: var(--text); }
.suggest__list .val { font-family: var(--mono); color: var(--text-3); }

.settings { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.settings label { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }

/* ---------- Home mini rankings ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mini-list { padding: 6px 8px; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 9px; }
.mini-row:hover { background: var(--surface-2); }
.mini-row .no { width: 20px; color: var(--text-3); font-family: var(--mono); font-size: 12px; }
.mini-row .name { font-weight: 600; font-size: 14px; }
.mini-row .meta { color: var(--text-3); font-size: 12px; }
.mini-row .val { margin-left: auto; font-family: var(--mono); font-weight: 700; font-size: 13px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 32px 0; margin-top: 40px; color: var(--text-3); font-size: 13px; }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px;
  transition: .2s; pointer-events: none; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- Page header ---------- */
.page-head { padding: 44px 0 20px; }
.page-head h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.03em; margin: 0 0 6px; }
.page-head p { color: var(--text-2); margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .mock { transform: none; }
  .features, .grid-3 { grid-template-columns: 1fr; }
  .calc { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav__links { display: none; position: absolute; left: 0; right: 0; top: 64px; flex-direction: column; padding: 10px; background: var(--bg-2); border-bottom: 1px solid var(--border); }
  .nav__links.open { display: flex; }
  .nav__toggle { display: inline-grid; place-items: center; }
  .hero { padding: 48px 0 32px; }
  .hero__stats { gap: 20px; }
  table.rank thead th { top: 0; }
}

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Data provenance ---------- */
.inj { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px; font-size: 10px; font-weight: 800; background: rgba(255,95,109,.16); color: var(--red); vertical-align: middle; }
.src { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; cursor: help; }
.src--agree { background: rgba(224,36,47,.16); color: var(--accent); }
.src--mixed { background: rgba(255,182,72,.14); color: var(--amber); }
.src--split { background: rgba(255,95,109,.14); color: var(--red); }

/* ---------- Balance panel ---------- */
.balance { margin-top: 22px; text-align: left; border-top: 1px solid var(--border); padding-top: 18px; }
.balance__head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 14px; }
.balance h4 { margin: 0 0 2px; font-size: 15px; }
.balance h5 { margin: 0 0 8px; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.balance__controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search--sm input { padding: 8px 12px 8px 32px; font-size: 13px; border-radius: 9px; }
.search--sm svg { left: 11px; }
.search--sm { min-width: 200px; flex: 0 1 220px; }
.chips--sm .chip { padding: 5px 10px; font-size: 12px; }
.balance__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.balance__list { display: flex; flex-direction: column; gap: 6px; }
.brow {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; transition: border-color .15s, background .15s;
}
.brow:hover { border-color: var(--accent); background: var(--surface-2); }
.brow__players { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.brow__p { display: flex; align-items: center; gap: 8px; }
.brow__p .avatar { width: 30px; height: 30px; font-size: 11px; }
.brow__p b { display: block; font-size: 13px; line-height: 1.2; }
.brow__p small { color: var(--text-3); font-size: 11px; }
.brow__plus { color: var(--text-3); font-weight: 700; }
.brow__after { font-family: var(--mono); font-size: 12px; font-weight: 700; white-space: nowrap; padding: 3px 8px; border-radius: 6px; }
.brow__after--ok { background: rgba(224,36,47,.16); color: var(--accent); }
.brow__after--over { background: rgba(167,169,172,.16); color: #d0d2d5; }
.brow__after--under { background: rgba(255,182,72,.14); color: var(--amber); }
@media (max-width: 720px) { .balance__grid { grid-template-columns: 1fr; } }

/* ---------- Comparables ---------- */
.finder { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.finder .card__head h3 { display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot--a { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.dot--b { background: var(--blue); box-shadow: 0 0 10px var(--blue); }
.fh { margin: 0 0 8px; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
a.feature { display: block; }
@media (max-width: 960px) { .finder { grid-template-columns: 1fr; } }

/* ---------- Player photos & team logos ---------- */
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; background: var(--surface-2); opacity: 0; transition: opacity .2s; }
.avatar img.ok { opacity: 1; }
.avatar__init { position: relative; z-index: 0; }
.team { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.team .logo { width: 16px; height: 16px; object-fit: contain; opacity: 0; transition: opacity .2s; }
.team .logo.ok { opacity: 1; }
.team .logo[style*="none"] + * { margin-left: 0; }
td.player .avatar, .asset .avatar { width: 40px; height: 40px; }
.mock__row .avatar { width: 40px; height: 40px; }
