/* Box Office Fantasy: one stylesheet, no build step.
   Colours are tokens on :root; dark mode follows the system setting. */

:root {
  color-scheme: light;
  --bg: #f4f5f9;
  --bg-tint: #eceef6;
  --panel: #ffffff;
  --panel-2: #f8f9fc;
  --ink: #12141c;
  --muted: #646b7d;
  --line: #e3e6ee;
  --line-strong: #cfd3df;
  --accent: #d6264f;          /* marquee crimson */
  --accent-hover: #b81e43;
  --accent-soft: #fde8ed;
  --accent-ink: #ffffff;
  --gold: #b7791f;
  --gold-soft: #fdf3dc;
  --good: #11825a;
  --good-soft: #e3f5ec;
  --bad: #d12c3a;
  --bad-soft: #fde9eb;
  --me: #fff6dc;
  --header: #10121b;
  --header-ink: #f3f4f8;
  --header-muted: #9aa0b4;
  --focus: #6d5efc;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 18, 27, .04), 0 2px 8px rgba(16, 18, 27, .04);
  --shadow-lift: 0 2px 4px rgba(16, 18, 27, .05), 0 12px 28px rgba(16, 18, 27, .10);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", var(--font);
  font-family: var(--font);
  font-feature-settings: "cv11", "ss01";
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b0d14;
    --bg-tint: #10131d;
    --panel: #141824;
    --panel-2: #191e2c;
    --ink: #eceef5;
    --muted: #979eb2;
    --line: #252a3a;
    --line-strong: #343a4e;
    --accent: #ff5277;
    --accent-hover: #ff7090;
    --accent-soft: #3a1522;
    --accent-ink: #1a0710;
    --gold: #f2bd57;
    --gold-soft: #33260e;
    --good: #4cd397;
    --good-soft: #0f2c22;
    --bad: #ff6b76;
    --bad-soft: #36141a;
    --me: #2c2614;
    --header: #080a10;
    --header-ink: #eceef5;
    --header-muted: #8b92a7;
    --focus: #9d93ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 30px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink); line-height: 1.5; font-size: 15px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; text-underline-offset: .18em; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }

/* Header */
header.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--header) 92%, transparent);
  backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  color: var(--header-ink);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
header.top .wrap { display: flex; gap: .4rem 1.2rem; align-items: center; flex-wrap: wrap; padding-top: .6rem; padding-bottom: .6rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--font-display); font-weight: 800; font-size: 1.08rem; color: var(--header-ink); letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { color: var(--header-ink); text-decoration: none; }
.brand .logo { width: 30px; height: 30px; flex: none; display: block; }
.brand .name span { background: linear-gradient(90deg, #ff5277, #ffb347); -webkit-background-clip: text; background-clip: text; color: transparent; }
nav { display: flex; gap: .15rem; flex-wrap: wrap; align-items: center; font-size: .92rem; }
header.top nav a { color: var(--header-muted); padding: .38rem .7rem; border-radius: 99px; font-weight: 500; }
header.top nav a:hover { color: var(--header-ink); background: rgba(255, 255, 255, .07); text-decoration: none; }
header.top nav a[aria-current="page"] { color: var(--header-ink); background: rgba(255, 255, 255, .11); }
header.top .user { color: var(--header-muted); font-size: .88rem; margin-right: .4rem; }
header.top .btn.ghost { color: var(--header-ink); border-color: rgba(255, 255, 255, .22); background: transparent; }
header.top .btn.ghost:hover { background: rgba(255, 255, 255, .08); }
header.top nav a.btn { color: var(--accent-ink); background: var(--accent); padding: .3rem .8rem; margin-left: .3rem; }
header.top nav a.btn:hover { background: var(--accent-hover); color: var(--accent-ink); }
.spacer { flex: 1; }
@media (max-width: 640px) {
  header.top .wrap { gap: .3rem .6rem; }
  header.top nav.main { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -6px; scrollbar-width: none; }
  header.top nav.main::-webkit-scrollbar { display: none; }
  header.top .user { display: none; }
}

/* Layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { width: 100%; flex: 1; padding-top: 1.8rem; padding-bottom: 3.5rem; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.1rem); font-weight: 800; margin: .1rem 0 .35rem; }
h2 { font-size: 1.2rem; font-weight: 700; margin: 2.2rem 0 .7rem; }
h3 { font-weight: 700; }
.sub { color: var(--muted); margin: 0 0 1.2rem; }
.muted { color: var(--muted); }
.hidden { display: none; }
.row { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }

/* Surfaces */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.35rem; box-shadow: var(--shadow); }
.grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card {
  position: relative; display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.1rem 1rem 1.25rem; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; overflow: hidden;
}
a.card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, var(--accent), #ffb347); opacity: .85; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); text-decoration: none; color: var(--ink); }
.card strong { display: block; overflow-wrap: anywhere; font-family: var(--font-display); font-size: 1.02rem; letter-spacing: -.01em; }
.card .meta { color: var(--muted); font-size: .84rem; margin-top: .15rem; }
div.card .meta { margin: 0 0 .2rem; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; font-weight: 600; }
div.card strong { font-size: 1.45rem; font-variant-numeric: tabular-nums; }

/* Tables */
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: .62rem .8rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
thead th { background: var(--panel-2); font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; padding-top: .7rem; padding-bottom: .7rem; }
tbody tr { transition: background-color .1s ease; }
.tablewrap tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.total { font-weight: 800; font-size: 1.05rem; font-family: var(--font-display); }
tr.me td, .tablewrap tbody tr.me:hover td { background: var(--me); }
tr.me td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.panel table { border: 1px solid var(--line); border-radius: var(--radius-sm); border-collapse: separate; border-spacing: 0; overflow: hidden; margin: .6rem 0 1rem; }
.panel table th { background: var(--panel-2); }
.panel table td { white-space: normal; }

/* Standings */
.place {
  display: inline-grid; place-items: center; width: 1.65rem; height: 1.65rem; margin-right: .6rem;
  border-radius: 99px; font-size: .78rem; font-weight: 700; color: var(--muted); background: var(--bg-tint);
  font-variant-numeric: tabular-nums;
}
.place[data-place="1"] { color: #5a3d00; background: linear-gradient(135deg, #ffe08a, #f3b73b); }
.place[data-place="2"] { color: #2f3542; background: linear-gradient(135deg, #eef0f4, #c3c8d2); }
.place[data-place="3"] { color: #4a2510; background: linear-gradient(135deg, #f6c79d, #cf8a52); }
#standings td:first-child a { font-weight: 600; }
#standings td.total { color: var(--ink); }
@media (max-width: 640px) {
  #standings th:first-child, #standings td:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); box-shadow: 1px 0 0 var(--line); }
  #standings thead th:first-child { background: var(--panel-2); }
  #standings tr.me td:first-child { background: var(--me); box-shadow: inset 3px 0 0 var(--gold), 1px 0 0 var(--line); }
}

.neg { color: var(--bad); }
.pos { color: var(--good); }

.tag { display: inline-block; vertical-align: .08em; font-size: .68rem; font-weight: 600; letter-spacing: .02em; padding: .1rem .5rem; border-radius: 99px; color: var(--muted); background: var(--bg-tint); margin-left: .3rem; }
.tag.out { color: var(--bad); background: var(--bad-soft); }
.tag.open { color: var(--good); background: var(--good-soft); }

/* Segmented toggle */
.toggle { display: inline-flex; padding: 3px; background: var(--bg-tint); border: 1px solid var(--line); border-radius: 99px; }
.toggle button { border: 0; background: transparent; padding: .3rem .9rem; color: var(--muted); cursor: pointer; font: inherit; font-size: .84rem; font-weight: 600; border-radius: 99px; transition: background-color .15s, color .15s; }
.toggle button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--accent); color: var(--accent-ink); border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: .55rem 1rem; font: inherit; font-weight: 600; font-size: .92rem; line-height: 1.2; cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 18, 27, .12), inset 0 1px 0 rgba(255, 255, 255, .15);
  transition: background-color .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--accent-hover); color: var(--accent-ink); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow); }
.btn.ghost:hover { background: var(--panel-2); border-color: var(--muted); color: var(--ink); }
.btn.small { padding: .25rem .65rem; font-size: .8rem; border-radius: 8px; }

/* Forms */
form p { margin: 0 0 1rem; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
input, select, textarea {
  font: inherit; font-size: .95rem; padding: .55rem .7rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink); width: 100%; max-width: 480px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
.helptext { display: block; color: var(--muted); font-size: .8rem; margin-top: .3rem; }
.errorlist { color: var(--bad); margin: .2rem 0; padding-left: 1rem; font-size: .88rem; }
form.panel { max-width: 560px; }

/* Messages and notes */
.messages { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.messages li { padding: .7rem .95rem; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--line); border-left-width: 4px; margin-bottom: .5rem; overflow-wrap: anywhere; box-shadow: var(--shadow); }
.messages .success { border-left-color: var(--good); }
.messages .error { border-left-color: var(--bad); }
.messages .warning { border-left-color: var(--gold); }
.warn { border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; padding: .45rem .8rem; background: var(--gold-soft); margin: .35rem 0; font-size: .88rem; }

/* Lists */
.log { list-style: none; padding: 0; margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.log li { padding: .6rem 1rem; border-bottom: 1px solid var(--line); display: flex; gap: .3rem .9rem; flex-wrap: wrap; align-items: baseline; }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--muted); font-size: .8rem; min-width: 9.5rem; font-variant-numeric: tabular-nums; }
main ol, main ul:not(.log):not(.messages):not(.errorlist) { padding-left: 1.3rem; }
main li::marker { color: var(--accent); }

/* Roster */
.roster h3 { display: flex; align-items: center; gap: .6rem; margin: 2rem 0 .6rem; font-size: 1.05rem; }
.rostertable tfoot th { background: var(--panel-2); color: var(--ink); font-size: .88rem; font-weight: 700; text-transform: none; letter-spacing: 0; border-top: 1px solid var(--line-strong); border-bottom: 0; }
.rostertable tfoot th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rostertable td:first-child { white-space: normal; min-width: 12rem; }
.rostertable td:first-child a { font-weight: 500; }
.pager { display: flex; gap: .4rem .9rem; align-items: center; margin: 1.2rem 0; flex-wrap: wrap; }
.pager a { padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); }
.pager a:hover { text-decoration: none; border-color: var(--line-strong); }

/* Footer */
footer { color: var(--muted); font-size: .8rem; text-align: center; padding: 1.6rem 16px 2.2rem; border-top: 1px solid var(--line); }

/* Page hero for the logged-out home page */
.hero { position: relative; overflow: hidden; border-radius: calc(var(--radius) + 6px); padding: clamp(1.6rem, 4vw, 3rem); margin-bottom: 1.6rem;
  background: radial-gradient(120% 140% at 100% 0%, rgba(255, 82, 119, .35), transparent 55%),
              radial-gradient(90% 120% at 0% 100%, rgba(255, 179, 71, .25), transparent 60%), var(--header);
  color: var(--header-ink); }
.hero h1 { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 3rem); max-width: 18ch; margin-bottom: .6rem; }
.hero .sub { color: var(--header-muted); font-size: 1.05rem; max-width: 52ch; }
.hero .btn.ghost { background: transparent; color: var(--header-ink); border-color: rgba(255, 255, 255, .3); }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, .08); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* Draft room */
.draft-room .hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.small { font-size: .84rem; }
.pill { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .3rem .8rem; border-radius: 99px; background: var(--bg-tint); color: var(--muted); border: 1px solid var(--line); }
.pill[data-status="live"] { background: var(--good-soft); color: var(--good); border-color: transparent; }
.pill[data-status="live"]::before { content: ""; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; margin-right: .4rem; vertical-align: .05em; animation: pulse 1.4s ease-in-out infinite; }
.pill[data-status="paused"] { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
@keyframes pulse { 50% { opacity: .35; } }
.draft-setup { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; margin-bottom: 1.4rem; }
.draft-setup form.panel { max-width: none; }
.error-banner { padding: .7rem .95rem; border-radius: var(--radius-sm); background: var(--bad-soft); color: var(--bad); border-left: 4px solid var(--bad); margin: 0 0 1rem; font-weight: 500; }
.block { padding: 1.3rem 1.4rem; }
.block-head { display: flex; gap: 1.1rem; align-items: center; }
.block-main { flex: 1; min-width: 0; }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.block-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.3rem, 1rem + 1.4vw, 1.9rem); letter-spacing: -.02em; line-height: 1.15; margin: .15rem 0; overflow-wrap: anywhere; }
.block-meta { color: var(--muted); font-size: .9rem; }
.clock { position: relative; width: 76px; height: 76px; flex: none; display: grid; place-items: center; }
.clock svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.clock circle { fill: none; stroke-width: 4; }
.clock .track { stroke: var(--line); }
.clock .arc { stroke: var(--good); stroke-linecap: round; stroke-dasharray: 120; transition: stroke-dashoffset .2s linear, stroke .2s; }
.clock[data-level="warm"] .arc { stroke: var(--gold); }
.clock[data-level="hot"] .arc { stroke: var(--bad); }
.clock[data-level="paused"] .arc { stroke: var(--muted); }
.clock span { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.clock[data-level="hot"] span { color: var(--bad); }
.high { text-align: right; flex: none; }
.high .amt { font-family: var(--font-display); font-weight: 800; font-size: 2.1rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.high .who { color: var(--muted); font-weight: 600; }
.high.mine .amt, .high.mine .who { color: var(--good); }
.controls { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .7rem 1rem; align-items: center; }
.controls .btn.big { font-size: 1.1rem; padding: .75rem 1.5rem; min-width: 9rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.custom, .nom-go { display: flex; align-items: center; gap: .4rem; }
.custom input, .nom-go input { width: 6.5rem; }
.dollar { color: var(--muted); font-weight: 700; }
.controls .muted.small { flex-basis: 100%; }
.controls.nominate { display: block; }
.nom-search label { margin-bottom: .45rem; }
.nom-list { list-style: none; padding: 0 !important; margin: .6rem 0; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.nom-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .8rem; border-bottom: 1px solid var(--line); cursor: pointer; font-size: .92rem; }
.nom-list li:last-child { border-bottom: 0; }
.nom-list li:hover { background: var(--panel-2); }
.nom-list li[aria-selected="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.nom-list li .t { font-weight: 500; overflow-wrap: anywhere; }
.nom-list li .muted { white-space: nowrap; font-size: .84rem; }
.waiting { margin-top: 1rem; }
.comm { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin-top: 1rem; padding: .8rem 1.1rem; border-style: dashed; }
.comm label.inline { display: flex; align-items: center; gap: .5rem; margin: 0; font-weight: 500; }
.comm select { width: auto; padding: .3rem .5rem; font-size: .88rem; }
.draft-cols { display: grid; gap: 0 1.4rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
#owners tr.turn td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
#owners .who { font-weight: 600; }
#owners td.strong { font-weight: 700; }
.tag.hi { color: var(--accent); background: var(--accent-soft); }
.feed li { font-size: .88rem; }
.feed time { min-width: 6rem; }
.board { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.board .col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.board .col.me { border-color: var(--gold); }
.board .col-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding: .6rem .8rem; background: var(--panel-2); border-bottom: 1px solid var(--line); font-size: .9rem; }
.board ol { list-style: none; margin: 0; padding: 0 !important; counter-reset: slot; }
.board li { display: flex; gap: .5rem; padding: .4rem .8rem; border-bottom: 1px solid var(--line); font-size: .84rem; counter-increment: slot; }
.board li:last-child { border-bottom: 0; }
.board li::before { content: counter(slot); color: var(--muted); width: 1.1rem; flex: none; font-variant-numeric: tabular-nums; }
.board li .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li .b { font-weight: 700; font-variant-numeric: tabular-nums; }
.board li.empty .t { border-bottom: 1px dashed var(--line-strong); }
.done { margin-top: 1.4rem; border-left: 4px solid var(--good); }
@media (max-width: 560px) {
  .block-head { flex-wrap: wrap; }
  .high { text-align: left; flex-basis: 100%; display: flex; align-items: baseline; gap: .6rem; }
  .high .amt { font-size: 1.7rem; }
  .clock { width: 64px; height: 64px; }
  #owners th:first-child, #owners td:first-child { display: none; }
  #owners th, #owners td { padding-left: .55rem; padding-right: .55rem; }
  #owners tr.turn td:nth-child(2) { box-shadow: inset 3px 0 0 var(--accent); }
  .feed li { flex-wrap: nowrap; gap: .6rem; }
  .feed time { min-width: 0; white-space: nowrap; }
}
