/* The Board
   A sportsbook slate, not a dashboard. Dark by design: every book the
   readership uses is dark, and the numbers carry better on ink. */

:root {
  --ink:        #0e1420;
  --surface:    #151d2b;
  --raised:     #1c2636;
  --hairline:   #27344a;
  --hairline-2: #35465f;

  --text:       #e8edf5;
  --text-dim:   #8e9cb2;
  --text-faint: #5d6b80;

  --cheap:      #4ade80;
  --rich:       #fb7185;
  --warn:       #fbbf24;

  --fanduel:    #1493ff;
  --draftkings: #53d337;
  --crowd:      #a78bfa;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;

  --pad: clamp(16px, 4vw, 28px);
  --max: 900px;

  --fast: 140ms cubic-bezier(.2,.7,.4,1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: Archivo, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--crowd);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--pad);
}

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(12px);
}

.masthead-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
}

.wordmark {
  font-weight: 700;
  font-stretch: 85%;
  font-size: 1.0625rem;
  letter-spacing: .02em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark span { color: var(--text-faint); font-weight: 500; }

.masthead-spacer { flex: 1; }

.parent-link {
  font-size: .8125rem;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
}
.parent-link:hover { color: var(--text); }

/* ---------- state picker ---------- */

.state-select {
  appearance: none;
  background: var(--raised);
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-md);
  color: var(--text);
  padding: 7px 30px 7px 11px;
  font-size: .8125rem;
  font-weight: 500;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
                    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  max-width: 44vw;
  text-overflow: ellipsis;
}

/* ---------- board status strip ---------- */

.strip {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  padding: 26px 0 6px;
}

.strip h1 {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  font-stretch: 80%;
  letter-spacing: -.015em;
}

.strip-meta {
  font-size: .8125rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cheap);
  flex: none;
}
.pulse.stale { background: var(--warn); }
.pulse.down  { background: var(--rich); }

.standfirst {
  margin: 0 0 22px;
  max-width: 58ch;
  color: var(--text-dim);
  font-size: .9375rem;
}

/* ---------- market tabs ---------- */

.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 3px;
  margin-bottom: 18px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 7px 15px;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  transition: background var(--fast), color var(--fast);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  background: var(--raised);
  color: var(--text);
  font-weight: 600;
}

/* ---------- legend ---------- */

.legend {
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--surface);
  margin: 0 0 16px;
  font-size: .8125rem;
}

.legend summary {
  cursor: pointer;
  padding: 10px 14px;
  color: var(--text-dim);
  font-weight: 500;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend summary::-webkit-details-marker { display: none; }

.legend summary::before {
  content: "";
  width: 0; height: 0;
  border-left: 5px solid var(--text-faint);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform var(--fast);
  flex: none;
}
.legend[open] summary::before { transform: rotate(90deg); }
.legend summary:hover { color: var(--text); }

.legend-list {
  margin: 0;
  padding: 2px 14px 4px;
  border-top: 1px solid var(--hairline);
}

.legend-list dt {
  color: var(--text);
  font-weight: 600;
  margin-top: 11px;
}

.legend-list dd {
  margin: 2px 0 0;
  color: var(--text-dim);
  max-width: 64ch;
  line-height: 1.55;
}

.legend-foot {
  margin: 12px 14px 12px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--hairline) 60%, transparent);
  color: var(--text-faint);
  font-size: .75rem;
}

/* ---------- the board ---------- */

.board { display: flex; flex-direction: column; gap: 10px; }

.day-heading {
  margin: 18px 0 2px;
  font-size: .8125rem;
  font-weight: 700;
  font-stretch: 88%;
  color: var(--text-dim);
  letter-spacing: .03em;
}
.day-heading:first-child { margin-top: 0; }

.game {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.game-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--hairline);
  font-size: .8125rem;
}

.tip-time { font-weight: 600; letter-spacing: .01em; }

.tip-rel { color: var(--text-faint); }

.game-head-spacer { flex: 1; }

.line-tag {
  color: var(--text-dim);
  font-size: .75rem;
  font-weight: 500;
}

/* column headers */

.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(var(--book-count, 2), minmax(74px, 90px)) 1px minmax(74px, 90px);
  gap: 7px;
  align-items: center;
  padding: 8px 16px 4px;
  font-size: .6875rem;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: .04em;
}

.cols span { text-align: center; }
.cols span:first-child { text-align: left; }

.col-rule { background: var(--hairline); height: 100%; min-height: 14px; }

/* a team row */

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(var(--book-count, 2), minmax(74px, 90px)) 1px minmax(74px, 90px);
  gap: 7px;
  align-items: stretch;
  padding: 4px 16px;
}
.row:last-of-type { padding-bottom: 14px; }

.team {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-weight: 600;
  font-stretch: 88%;
  font-size: .9375rem;
  letter-spacing: -.005em;
}

.team-city {
  color: var(--text-dim);
  font-weight: 500;
  white-space: nowrap;
}

.team-nick {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-home {
  font-size: .625rem;
  font-weight: 700;
  color: var(--text-faint);
  border: 1px solid var(--hairline-2);
  border-radius: 3px;
  padding: 0 4px;
  flex: none;
}

/* price cells */

.price {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 46px;
  border-radius: var(--r-md);
  background: var(--raised);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: .9375rem;
  text-decoration: none;
  transition: border-color var(--fast), transform var(--fast);
}

a.price:hover { border-color: var(--hairline-2); }
a.price:active { transform: scale(.97); }

.price.best {
  border-color: color-mix(in srgb, var(--op) 55%, transparent);
  background: color-mix(in srgb, var(--op) 13%, var(--raised));
  color: color-mix(in srgb, var(--op) 70%, var(--text));
}

.price.empty { color: var(--text-faint); font-weight: 500; }

.price-line {
  font-size: .6875rem;
  font-weight: 600;
  color: var(--text-dim);
  line-height: 1;
}
.price.best .price-line { color: inherit; opacity: .8; }
.price-odds { font-size: .9375rem; font-weight: 600; line-height: 1.1; }

.price.flash { animation: flash .9s ease-out; }

@keyframes flash {
  0%   { background: color-mix(in srgb, var(--crowd) 38%, var(--raised)); }
  100% { background: var(--raised); }
}

.price.best.flash { animation: flash-best .9s ease-out; }
@keyframes flash-best {
  0%   { background: color-mix(in srgb, var(--crowd) 38%, var(--raised)); }
  100% { background: color-mix(in srgb, var(--op) 13%, var(--raised)); }
}

/* crowd cell: a reading, not a destination */

.crowd {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: var(--r-md);
  border: 1px dashed var(--hairline-2);
  line-height: 1.15;
}

.crowd-val { font-weight: 600; font-size: .9375rem; color: var(--crowd); }

.crowd-gap { font-size: .6875rem; font-weight: 600; margin-top: 1px; }
.crowd-gap.cheap { color: var(--cheap); }
.crowd-gap.rich  { color: var(--rich); }
.crowd-gap.flat  { color: var(--text-faint); }

.crowd.thin .crowd-val { color: var(--text-faint); }

/* footer of a game card */

.game-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-top: 1px solid var(--hairline);
  font-size: .75rem;
  color: var(--text-faint);
}

.detail-link {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--hairline-2);
  padding-bottom: 1px;
}
.detail-link:hover { color: var(--text); border-color: var(--text-dim); }

/* ---------- notices ---------- */

.notice {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--warn);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 13px 16px;
  margin-bottom: 16px;
  font-size: .875rem;
  color: var(--text-dim);
}
.notice strong { color: var(--text); font-weight: 600; }

/* Sample data is a hazard on a page about money, so it gets the loudest
   treatment on the site rather than a quiet footnote. */
.notice.sample {
  border-left-color: var(--rich);
  background: color-mix(in srgb, var(--rich) 9%, var(--surface));
  color: var(--text);
}

.empty-state {
  border: 1px dashed var(--hairline-2);
  border-radius: var(--r-lg);
  padding: 44px 24px;
  text-align: center;
  color: var(--text-dim);
}
.empty-state h2 {
  margin: 0 0 6px;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
}
.empty-state p { margin: 0; font-size: .9375rem; }

.skeleton {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  height: 168px;
  margin-bottom: 10px;
  opacity: .5;
}

/* ---------- detail page ---------- */

.back {
  display: inline-block;
  margin: 22px 0 6px;
  font-size: .8125rem;
  color: var(--text-dim);
  text-decoration: none;
}
.back:hover { color: var(--text); }

.detail-title {
  margin: 4px 0 2px;
  font-size: clamp(1.375rem, 5vw, 1.875rem);
  font-weight: 700;
  font-stretch: 80%;
  letter-spacing: -.015em;
}

.detail-sub { color: var(--text-dim); font-size: .875rem; margin: 0 0 24px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 30px 0 4px;
}
.section-head h2 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  font-stretch: 88%;
}
.section-note {
  margin: 0 0 14px;
  font-size: .8125rem;
  color: var(--text-faint);
  max-width: 62ch;
}

.nov-title {
  margin: 24px 0 8px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: .01em;
}

.nov-basis {
  margin: -2px 0 10px;
  font-size: .75rem;
  color: var(--text-faint);
  max-width: 68ch;
  line-height: 1.5;
}

/* novelty table */

.nov {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.nov-head,
.nov-row {
  display: grid;
  grid-template-columns: 1fr 72px 72px 62px;
  gap: 8px;
  align-items: center;
  padding: 9px 16px;
}

.nov-head {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--hairline);
}
.nov-head span:not(:first-child),
.nov-row > span:not(:first-child),
.nov-row > .nov-gap { text-align: right; }

.nov-row { border-bottom: 1px solid color-mix(in srgb, var(--hairline) 55%, transparent); }
.nov-row:last-child { border-bottom: none; }

.nov-label { font-size: .875rem; font-weight: 500; }
.nov-market { font-weight: 600; color: var(--crowd); font-size: .9375rem; }
.nov-model { font-weight: 600; color: var(--text-dim); font-size: .9375rem; }
.nov-gap { font-size: .8125rem; font-weight: 600; }
.nov-gap.cheap { color: var(--cheap); }
.nov-gap.rich  { color: var(--rich); }
.nov-gap.flat  { color: var(--text-faint); }
.nov-row.thin .nov-market { color: var(--text-faint); }

.basis {
  grid-column: 1 / -1;
  font-size: .75rem;
  color: var(--text-faint);
  padding-top: 2px;
  max-width: 68ch;
}

/* ---------- footer ---------- */

.site-foot {
  margin-top: 54px;
  border-top: 1px solid var(--hairline);
  padding: 26px 0 44px;
  font-size: .8125rem;
  color: var(--text-faint);
}

.site-foot p { margin: 0 0 11px; max-width: 70ch; line-height: 1.6; }
.site-foot a { color: var(--text-dim); }

.foot-rg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-md);
  padding: 7px 12px;
  margin-bottom: 14px;
  color: var(--text-dim);
  font-weight: 500;
}

.age-mark {
  font-weight: 700;
  color: var(--text);
  border: 1.5px solid var(--text-dim);
  border-radius: 50%;
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  font-size: .6875rem;
  flex: none;
}

/* ---------- responsive ---------- */

@media (max-width: 620px) {
  .parent-link { display: none; }
  .state-select { max-width: 52vw; }
}

@media (max-width: 560px) {
  .cols, .row {
    grid-template-columns: minmax(0, 1fr) repeat(var(--book-count, 2), minmax(60px, 1fr)) 1px minmax(62px, 1fr);
    padding-inline: 12px;
    gap: 5px;
  }
  .game-head, .game-foot { padding-inline: 12px; }
  .team {
    font-size: .9375rem;
    font-stretch: 76%;
    gap: 6px;
    /* Long nicknames wrap rather than truncate. "Trail Bla..." and
       "Timberwolv..." are worse than two tidy lines, and a hard list of
       short names would need maintaining for every league added. */
    align-items: center;
  }
  .team-nick {
    white-space: normal;
    line-height: 1.12;
    overflow: visible;
  }
  .team-city { display: none; }
  /* Home is always the lower row on a board, so the badge is redundant
     here and the space goes to the team name instead. */
  .badge-home { display: none; }
  .price, .crowd { min-height: 48px; }
  .price-odds { font-size: .875rem; }
  .nov-head, .nov-row { grid-template-columns: 1fr 58px 58px 50px; padding-inline: 12px; }
  .strip { padding-top: 20px; }
}

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