:root {
  --ink: #f7f7f4;
  --muted: #a9aaa6;
  --panel: #171816;
  --line: #090a09;
  --orange: #f36c0a;
  --qb: #f07d91;
  --rb: #8ddd78;
  --wr: #f6df65;
  --te: #55b8e8;
}

* { box-sizing: border-box; }

html { background: #0c0d0c; color-scheme: dark; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 88% -10%, rgba(243, 108, 10, .28), transparent 27rem),
    #0c0d0c;
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
}

.topbar {
  min-height: 106px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px 18px;
  border-bottom: 4px solid var(--orange);
  background: linear-gradient(90deg, rgba(15,16,15,.98) 30%, rgba(82,35,8,.82));
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(19px, 2.3vw, 32px); line-height: 1.1; }
.subtitle { margin: 6px 0 0; color: #d1d1cd; font-size: 13px; font-weight: 650; }

.brand-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--orange);
  color: white;
  font-size: 23px;
  font-weight: 950;
  letter-spacing: -.06em;
  box-shadow: 0 9px 26px rgba(0,0,0,.32);
}

main { padding: 12px; }

.controls {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1500px;
  margin: 0 auto 12px;
  padding: 12px;
  border: 1px solid #333530;
  border-radius: 10px;
  background: rgba(24,25,23,.96);
}

label, fieldset { display: flex; gap: 6px; }
label { flex-direction: column; }
label > span, legend {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.search { flex: 1 1 260px; }

input, select, button {
  min-height: 36px;
  border: 1px solid #41433e;
  border-radius: 6px;
  background: #0f100f;
  color: var(--ink);
  font: inherit;
}

input { width: 100%; padding: 0 11px; }
select { padding: 0 28px 0 10px; }

fieldset { margin: 0; padding: 0; border: 0; align-items: end; }
legend { margin-bottom: 6px; }

button {
  min-width: 41px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

button.is-active { outline: 2px solid white; outline-offset: 1px; }
button.qb { background: var(--qb); color: #201114; }
button.rb { background: var(--rb); color: #10200d; }
button.wr { background: var(--wr); color: #201d08; }
button.te { background: var(--te); color: #081b24; }

.status { margin: 0 0 9px auto; color: var(--muted); font-size: 12px; }

.board-shell {
  max-width: 1800px;
  margin: 0 auto;
  overflow: auto;
  border: 3px solid var(--line);
  border-radius: 5px;
  background: var(--line);
  box-shadow: 0 18px 60px rgba(0,0,0,.34);
}

.board {
  min-width: 1210px;
  display: grid;
  grid-template-columns: repeat(12, minmax(98px, 1fr));
  gap: 3px;
}

.team-header {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 72px;
  display: grid;
  place-content: center;
  text-align: center;
  background: #30312f;
  border-bottom: 2px solid #4b4d49;
}

.team-header strong { font-size: 13px; }
.team-header span { margin-top: 4px; color: #bcbdb8; font-size: 10px; }

.player-card {
  min-height: 100px;
  padding: 7px 7px 6px;
  display: flex;
  flex-direction: column;
  color: #11130f;
  overflow: hidden;
  transition: opacity .15s, filter .15s, transform .15s;
}

.player-card.qb { background: var(--qb); }
.player-card.rb { background: var(--rb); }
.player-card.wr { background: var(--wr); }
.player-card.te { background: var(--te); }

.pick-line, .adp-line { display: flex; justify-content: space-between; align-items: baseline; }
.round-pick { font-size: 12px; }
.overall-pick { color: rgba(0,0,0,.55); font-size: 10px; font-weight: 800; }

.player-line { min-width: 0; display: flex; gap: 7px; align-items: center; flex: 1; }
.avatar {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid rgba(255,255,255,.48);
  border-radius: 50%;
  background: rgba(0,0,0,.18);
  font-size: 10px;
  font-weight: 950;
}

.player-copy { min-width: 0; display: flex; flex-direction: column; }
.player-name {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-meta { margin-top: 3px; font-size: 9px; font-weight: 900; }
.adp-line { padding-top: 5px; border-top: 1px solid rgba(0,0,0,.16); font-size: 9px; font-weight: 800; }
.adp-line strong { font-size: 11px; }

.player-card.is-dimmed { opacity: .16; filter: grayscale(.55); }
.player-card.is-match { z-index: 2; outline: 4px solid white; outline-offset: -4px; transform: scale(.98); }
.player-card { cursor: pointer; }
.player-card:hover { filter: brightness(1.08); }
.player-card.is-drafted { outline: 4px solid var(--orange); outline-offset: -4px; }
.player-card.is-drafted .player-name::after { content: " ✓"; }

.capital-chip { margin-left: auto; color: rgba(0,0,0,.62); font-size: 9px; font-weight: 900; }
.capital-chip strong { font-size: 11px; }
.pick-line { gap: 6px; }
.pick-line .overall-pick { margin-left: 0; }

.board-with-panel {
  display: flex;
  gap: 12px;
  max-width: 1800px;
  margin: 0 auto;
  align-items: flex-start;
}
.board-column { flex: 1 1 auto; min-width: 0; }
.board-column .board-shell, .board-column .legend { max-width: none; }

.draft-panel {
  flex: 0 0 268px;
  position: sticky;
  top: 76px;
  padding: 14px;
  border: 1px solid #333530;
  border-radius: 10px;
  background: rgba(24,25,23,.96);
}
.draft-panel h2 { margin: 0 0 4px; font-size: 15px; }
.panel-hint { margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.45; }

.panel-row { margin-bottom: 10px; }
.panel-row-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; margin-bottom: 3px; }
.panel-row-head i, .panel-player i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.panel-row-head strong { color: var(--orange); font-size: 13px; }
.panel-row-head em { color: var(--muted); font-style: normal; font-size: 10.5px; }
i.qb { background: var(--qb); } i.rb { background: var(--rb); } i.wr { background: var(--wr); } i.te { background: var(--te); }

.panel-bar { position: relative; height: 7px; border-radius: 4px; background: #0f100f; overflow: hidden; }
.panel-bar-fill { height: 100%; border-radius: 4px; transition: width .18s; }
.panel-bar-fill.qb { background: var(--qb); }
.panel-bar-fill.rb { background: var(--rb); }
.panel-bar-fill.wr { background: var(--wr); }
.panel-bar-fill.te { background: var(--te); }
.panel-bar-fill.over { background: #ff5c5c; }
.panel-bar-target { position: absolute; top: -1px; bottom: -1px; width: 2px; background: rgba(255,255,255,.55); }

.panel-total { display: flex; justify-content: space-between; padding-top: 10px; margin-top: 12px; border-top: 1px solid #333530; font-size: 13px; font-weight: 800; }
.panel-total strong { color: var(--orange); }
.panel-roster-title { margin: 12px 0 6px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.panel-player { display: flex; align-items: baseline; gap: 5px; padding: 2.5px 0; font-size: 12px; }
.panel-player-pick { color: var(--muted); font-size: 10.5px; min-width: 33px; }
.panel-player-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-player-capital { margin-left: auto; color: var(--orange); font-size: 11px; font-weight: 800; }
.panel-empty { margin: 0; color: var(--muted); font-size: 12px; }

.panel-clear {
  width: 100%;
  margin-top: 12px;
  background: #0f100f;
  font-size: 12px;
}
.panel-clear:hover { background: #1c1d1b; }

@media (max-width: 1100px) {
  .board-with-panel { flex-direction: column-reverse; }
  .draft-panel { position: static; flex: none; width: 100%; }
}

.legend {
  max-width: 1500px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 11px auto 26px;
  color: #bfc0bb;
  font-size: 11px;
}
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; }
.legend i.qb { background: var(--qb); }
.legend i.rb { background: var(--rb); }
.legend i.wr { background: var(--wr); }
.legend i.te { background: var(--te); }

@media (max-width: 700px) {
  .topbar { min-height: 90px; padding: 16px; }
  .brand-mark { width: 49px; height: 49px; font-size: 18px; }
  main { padding: 7px; }
  .controls { align-items: stretch; gap: 10px; padding: 10px; }
  .status { width: 100%; margin: 0; }
}

@media print {
  @page { size: landscape; margin: .2in; }
  body { background: white; }
  .topbar { min-height: 60px; padding: 8px 12px; background: #171816; }
  .controls, .legend, .draft-panel { display: none; }
  main { padding: 0; }
  .board-shell { overflow: visible; border: 1px solid black; box-shadow: none; }
  .board { min-width: 0; gap: 1px; }
  .team-header { min-height: 36px; }
  .player-card { min-height: 48px; padding: 3px; }
  .avatar, .adp-line span { display: none; }
  .player-name { font-size: 7px; }
  .player-meta, .overall-pick { font-size: 6px; }
  .round-pick, .adp-line strong { font-size: 7px; }
}

/* Stack planner */
.stack-panel {
  max-width: 1800px;
  margin: 0 auto 10px;
  padding: 10px 12px;
  border: 1px solid #333530;
  border-radius: 9px;
  background: rgba(24,25,23,.96);
}
.stack-panel-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.stack-panel-head strong { font-size: 13px; }
.stack-panel-hint { color: var(--muted); font-size: 11px; }
.stack-teams { display: flex; flex-wrap: wrap; gap: 6px; }
.stack-team {
  min-height: 34px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 4px 11px;
  border: 1px solid #41433e;
  border-radius: 7px;
  background: #0f100f;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.stack-team strong { font-size: 12px; font-weight: 900; letter-spacing: .03em; }
.stack-team span { color: var(--muted); font-size: 9.5px; font-weight: 800; }
.stack-team.has-qb { border-color: rgba(243,108,10,.6); }
.stack-team:hover { background: #1a1b19; }
.stack-team.is-active { border-color: var(--orange); background: rgba(243,108,10,.16); }
.stack-team.is-active span { color: #f7b27a; }

/* Board highlighting driven by the stack planner.
   The four position colours are pink, green, yellow and blue, so a coloured
   outline disappears on at least one of them. The target treatment is instead
   a dark inner edge with a white halo, which reads on all four. */
.board.has-stack-slot .player-card:not(.is-slot-reachable) { opacity: .26; filter: grayscale(.4); }
.player-card.is-slot-reachable { outline: 2px solid rgba(255,255,255,.45); outline-offset: -2px; }

.board.has-stack-team .player-card:not(.is-stack-target) { opacity: .14; filter: grayscale(.75); }

.player-card.is-stack-target {
  position: relative;
  outline: 3px solid #0b0c0b;
  outline-offset: -3px;
  box-shadow:
    0 0 0 3px #ffffff,
    0 0 22px 6px rgba(255, 255, 255, .5),
    0 10px 26px rgba(0, 0, 0, .5);
  transform: scale(1.045);
  opacity: 1 !important;
  filter: none !important;
  z-index: 6;
}

.player-card.is-stack-target .player-name { font-weight: 950; }

/* A solid marker so the pick is findable even while scrolling a dimmed board. */
.player-card.is-stack-target::after {
  content: "";
  position: absolute;
  inset: auto 5px 5px auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0b0c0b;
  box-shadow: 0 0 0 2px #ffffff;
}
