/* Site shell and shared components on top of base.css and look-b.css (B Arena). */
:root { --pop-bg: rgba(16,17,23,.97); --muted2: #b9bbc4; }
body { padding-bottom: env(safe-area-inset-bottom); }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 300; padding: 8px 12px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 800; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid #ffb347; outline-offset: 2px; }
.noscript { padding: 40px; text-align: center; }
#loader:focus { outline: none; }

/* top bar on computers (AB437, AB467): Home, Rankings, Report, My team, More, then the search icon; they scroll sideways if the window is narrow */
#topbar { gap: 14px; }
#topbar .tabs { overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 0 1 auto; }
#topbar .tabs::-webkit-scrollbar { display: none; }
#topbar .tabs a, #topbar .tabs button { flex: none; padding: 8px 11px; }
#topbar .tabs button { display: flex; align-items: center; gap: 8px; border: 0; background: none; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; }
#topbar .tabs button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
#topbar .tabs button:hover { color: var(--text); }
#topbar .tabs button.on { color: var(--on-text); background: var(--on-bg); }
#search-top { flex: none; margin-right: auto; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); }
#search-top:hover, #search-top[aria-expanded="true"] { color: var(--text); }
.search-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 759px) { #search-top { display: none; } }
/* the tour replay icon (AB618, AB804): very small, in the top bar just before search, as drawn (mock-up 60928e71).
   Below 820 px it stays in the bar too (AB821) */
.ab-replay { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: -2px -6px; padding: 0; border: 0; border-radius: 50%; background: none; color: #9a9ca6; cursor: pointer; }
.ab-replay svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ab-replay:hover, .ab-replay:focus-visible { color: #ffb347; background: rgba(255,255,255,.06); }
.ab-replay:focus-visible { outline: 2px solid #ffb347; outline-offset: -2px; }
/* below 820 (AB821, TOUR-ICON A): the icon stays in the top bar beside Week and Motion; on phones the 'Active Ballerz' words give way, the logo stays */
@media (max-width: 759.98px) { #topbar .brand span { display: none; } }
@media (max-width: 1320px) and (min-width: 760px) { #topbar .tabs a svg { display: none; } .brand span { display: none; } }
.week-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--muted2); white-space: nowrap; cursor: pointer; }
.week-pill b { color: var(--accent); font-weight: 800; }
.week-pill i { font-style: normal; font-size: 12px; opacity: .7; }
@media (max-width: 440px) { .week-pill { display: inline-flex; } .week-pill .wp-s, .week-pill .wp-dot { display: none; } }
/* 760 to 899 px (AB496): the pill drops the season so the five tabs and More fit on one row; the aria-label keeps it */
@media (min-width: 760px) and (max-width: 899.98px) { .week-pill .wp-s, .week-pill .wp-dot { display: none; } }
@media (min-width: 760px) and (max-width: 799.98px) { #topbar { gap: 10px; } #topbar .tabs a, #topbar .tabs button { padding: 8px 8px; } }
/* 760 to 819 px (AB821): the replay icon joins the bar, so the gaps, the icon's edges and Motion tighten to keep More inside the tab row; the icon's tap area stays 44 px */
@media (min-width: 760px) and (max-width: 819.98px) { #topbar { gap: 10px; } .ab-replay { margin: -2px -10px; } #motion { padding: 6px 10px; } }
#motion[aria-pressed="false"] { color: var(--muted); }

/* phone bar (AB467): Home, Rankings, Report, My team, More, then the search icon, labels 12 px (AB105, AB313) */
@media (max-width: 759px) {
  #topbar .brand { margin-right: auto; }
  #tabbar a, #tabbar button { min-width: 0; white-space: nowrap; }
  #tabbar button { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 12px; font-weight: 600; color: var(--muted); border: 0; background: none; border-radius: 12px; }
  #tabbar .search-btn svg { width: 22px; height: 22px; stroke-width: 1.8; }
  #tabbar .search-btn[aria-expanded="true"] { color: var(--text); }
  html.searching #tabbar { visibility: hidden; }
  #tabbar button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
  #tabbar button.on { color: var(--accent); }
  #motion { padding: 6px 10px; }
}
/* AB303: on a 360 phone the logo, the week pill and the Motion button fit inside the screen (week 0's old "Preseason" label was 10 px too wide; it reads "Week 0" since AB539) */
@media (max-width: 380px) { #topbar { gap: 8px; } #topbar .brand img { width: 42px; height: 42px; } .week-pill { padding: 6px 9px; gap: 4px; } #motion { padding: 6px 8px; } }
.more-menu { display: grid; gap: 6px; }
.more-menu a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--row-bg); border: var(--row-border); font-weight: 700; }
.more-menu a.on { color: var(--accent); border-color: var(--won-border); }
.more-menu svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }

/* page search (AB437, AB467, AB468): a full width field over the bar it was opened from; the pages found sit under it
   on computers and above it on phones (the field rides on the bottom bar, above the keyboard) */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* A W-L or W-L-T record never breaks across lines (AB519); the line may break before it. util.js recSpan.
   It stays inline text: a wider rule such as ".tn span { display: grid }" must not turn it into a block. */
.wl-rec { white-space: nowrap; display: inline !important; }
#search { position: fixed; z-index: 45; left: 0; right: 0; top: 0; display: flex; flex-direction: column; }
#search[hidden] { display: none; }
.sr-form { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 var(--gut); background: #101117; border-bottom: 1px solid var(--line); }
.sr-form > svg { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
#search-q { flex: 1; min-width: 0; height: 44px; padding: 0 16px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.06); color: var(--text); font: 600 16px/1 var(--f-body); -webkit-appearance: none; appearance: none; }
#search-q::placeholder { color: var(--muted); opacity: 1; }
#search-q::-webkit-search-cancel-button, #search-q::-webkit-search-decoration { -webkit-appearance: none; display: none; }
#search-x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--text); }
#search-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sr-res { overflow-y: auto; overscroll-behavior: contain; padding: 8px var(--gut) 12px; background: #101117; border-bottom: 1px solid var(--line); box-shadow: 0 18px 60px -10px #000; }
.sr-res[hidden] { display: none; }
#search-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
#search-list a { display: flex; align-items: baseline; gap: 10px; min-height: 44px; padding: 11px 14px; border-radius: 12px; border: 1px solid transparent; }
#search-list li.on a, #search-list a:hover { background: var(--row-bg); border-color: var(--won-border); }
.sr-t { font-weight: 700; font-size: 15px; color: var(--text); }
.sr-p { font-size: 12px; color: var(--muted2); }
.sr-empty { margin: 6px 0; padding: 8px 14px; font-size: 14px; color: var(--muted2); }
@media (max-width: 759px) {
  #search { top: auto; bottom: 0; flex-direction: column-reverse; }
  .sr-form { height: auto; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-bottom: 0; border-top: 1px solid var(--line); }
  .sr-res { padding: 10px 10px 8px; border-bottom: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; }
}

/* pop-overs (info, picker, More) */
.pop { position: fixed; z-index: 400; max-width: calc(100vw - 24px); background: var(--pop-bg); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; box-shadow: 0 18px 60px -10px #000; padding: 14px; font-size: 14px; animation: popIn .16s ease both; }
.pop:focus { outline: none; }
.pop p { margin: 6px 0 0; color: var(--muted2); line-height: 1.45; }
.pop-title { font-weight: 800; display: block; }
.pop-list { margin: 8px 0 0; padding-left: 18px; color: var(--muted2); max-height: 220px; overflow: auto; }
.pop.as-sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto !important; max-width: none; border-radius: 18px 18px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); animation: sheetIn .22s cubic-bezier(.2,.8,.2,1) both; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } }
@keyframes sheetIn { from { transform: translateY(100%); } }
html.still .pop, html.still .pop.as-sheet { animation: none; }
.picker { display: grid; gap: 8px; min-width: 260px; }
.pk-h { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pk-seasons, .pk-weeks { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-weeks { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
.sz, .wk { border: 1px solid var(--line); background: var(--card2); border-radius: 10px; padding: 8px 10px; font-weight: 800; font-size: 13px; display: grid; justify-items: center; line-height: 1.1; }
.wk small { font-size: 9px; font-weight: 600; color: var(--muted); } .wk small.stale { color: var(--down); }
.sz.on, .wk.on { background: var(--accent); color: var(--on-accent); border-color: transparent; } .wk.on small { color: inherit; }
.wk-wide { grid-column: 1 / -1; }
.pk-note { margin: 2px 0 0 !important; font-size: 12px; }
.week-select { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.week-select select { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font: inherit; font-weight: 700; }

/* info icon and legends */
/* The tap area is 25 x 25 px (target size, AB114); the circle people see is still 17 px, drawn by ::before, and the
   negative margins keep the old 17 px footprint so nothing around it moves. */
button.info { position: relative; isolation: isolate; display: inline-grid; place-items: center; width: 25px; height: 25px; margin: -4px -4px -4px -1px; padding: 0; border-radius: 50%; border: 0; background: none; color: var(--muted2); font: italic 700 10.5px/1 Georgia, serif; vertical-align: middle; text-transform: none; letter-spacing: 0; }
button.info::before { content: ""; position: absolute; left: 4px; top: 4px; width: 17px; height: 17px; border-radius: 50%; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.06); z-index: -1; pointer-events: none; }
button.info:hover, button.info[aria-expanded="true"] { color: var(--accent); }
button.info:hover::before, button.info[aria-expanded="true"]::before { border-color: var(--accent); }
.legend-dl { display: grid; gap: 8px; margin: 0; } .legend-dl dt { font-weight: 800; } .legend-dl dd { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.legend-title { font-weight: 800; color: var(--text); }
.lg-dot { width: 9px !important; height: 9px !important; border-radius: 50% !important; background: #fff; }
.lg-avg { height: 0 !important; border-top: 2px dashed rgba(255,255,255,.55); background: none; }
.grade-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.grade-legend span { display: grid; justify-items: center; padding: 4px 7px; border-radius: 8px; background: var(--card2); font-size: 11px; color: var(--muted); }
.grade-legend b { color: var(--text); font-size: 13px; }

/* sortable table */
.stable-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stable { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-variant-numeric: tabular-nums; font-size: 14px; }
.stable caption { text-align: left; color: var(--muted); font-size: 12px; padding-bottom: 4px; }
.stable th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 2px 8px 4px; white-space: nowrap; }
.stable th.on { color: var(--on-text); }
.th-btn { border: 0; background: none; padding: 4px 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; gap: 4px; align-items: center; }
.th-ar { font-style: normal; font-size: 12px; min-width: 8px; }
.stable td { padding: 8px; background: var(--row-bg); border-top: var(--row-border); border-bottom: var(--row-border); }
.stable td:first-child { border-left: var(--row-border); border-radius: var(--r-row) 0 0 var(--r-row); }
.stable td:last-child { border-right: var(--row-border); border-radius: 0 var(--r-row) var(--r-row) 0; }
.stable tr[data-card] { cursor: pointer; } .stable tr[data-card]:hover td { background: var(--row-hover); }
.stable tr.row-on td { background: var(--on-bg); }
.stable .tl { text-align: left; } .stable .tr { text-align: right; }
@media (max-width: 759px) { .stable { font-size: 13px; } .stable td { padding: 7px 6px; } }

/* Phone tables (AB354, AB358, AB385, AB389; js/ui/phone-tables.js). Every column stays on a phone and the table
   scrolls sideways inside its box with the name pinned. Look A: a shadow on the pinned edge once scrolled, a fade
   on the right edge while there is more, a one-time "Swipe for more columns" hint, and a sticky header row. */
:root { --pin-base: #0a0b0f; }
.ph-tbl { position: relative; min-width: 0; display: flex; flex-direction: column; }
.ph-tbl > .ph-box { min-width: 0; }
.ph-tbl > .ph-hintrow { order: -2; } .ph-tbl > .ph-stick { order: -1; }
.ph-box { position: relative; }
.ph-fade, .ph-stick, .ph-hintrow { display: none; }
@media (max-width: 759px) {
  .ph-tbl .stable th.pin, .ph-tbl .stable td.pin { position: sticky; left: 0; z-index: 2; white-space: nowrap; }
  .ph-tbl .stable tr th.pin { background-color: var(--pin-base); }
  .ph-tbl .stable tr td.pin { background-color: var(--pin-base); background-image: linear-gradient(var(--row-bg), var(--row-bg)); }
  .ph-tbl .stable tr.rk-one td.pin { background-image: linear-gradient(90deg, rgba(255,122,26,.16), rgba(255,255,255,.03) 60%); }
  .ph-tbl .stable tr.row-on td.pin { background-image: linear-gradient(var(--on-bg), var(--on-bg)); }
  .ph-tbl .stable tr[data-card]:hover td.pin { background-image: linear-gradient(var(--row-hover), var(--row-hover)); }
  .ph-tbl .stable td.pin:first-child:not(.pin-end), .ph-tbl .stable th.pin:first-child:not(.pin-end) { padding-right: 4px; }
  .ph-tbl .pin-end::after { content: ''; position: absolute; top: 0; bottom: 0; right: -10px; width: 10px; pointer-events: none; opacity: 0; border-left: 1px solid rgba(255,255,255,.10); background: linear-gradient(90deg, rgba(0,0,0,.6), rgba(0,0,0,0)); transition: opacity .2s ease; }
  .ph-tbl.scrolled .pin-end::after { opacity: 1; }
  .ph-fade { position: absolute; top: 0; right: 0; bottom: 0; width: 28px; pointer-events: none; z-index: 3; background: linear-gradient(90deg, rgba(10,11,15,0), var(--pin-base)); }
  .ph-tbl.over:not(.at-end) .ph-fade { display: block; }
  .ph-hintrow { display: flex; justify-content: flex-end; margin: 0 0 6px; }
  .ph-hint { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #ffd27a; background: rgba(255,179,71,.12); border: 1px solid rgba(255,179,71,.35); animation: phHintIn .3s ease both; }
  /* the sticky header: a copy that shows only while the real header row is under the top bar */
  .ph-tbl.sticky .ph-stick { display: block; position: sticky; z-index: 6; height: 0; overflow: visible; visibility: hidden; pointer-events: none; }
  .ph-tbl.sticky.stuck .ph-stick { visibility: visible; pointer-events: auto; }
  .ph-hscroll { overflow: hidden; background: var(--pin-base); }
  .ph-hscroll .stable { table-layout: fixed; width: auto; }
  /* AB385: no avatar or face in the pinned block on phones; computers keep them */
  .ph-tbl .stable .pin .av, .ph-tbl .stable .pin .face { display: none; }
  /* the pinned name: capped at 130 px, an ellipsis first, and only a line that still cannot fit wraps */
  .ph-tbl .rk-nm b, .ph-tbl .pin .who-t b, .ph-tbl .pin .pl-name b { max-width: 130px; }
  .ph-tbl .pin .rk-nm, .ph-tbl .pin .who-t { width: max-content; max-width: 130px; }
  .ph-tbl .pin .rk-nm b, .ph-tbl .pin .who-t b { max-width: 100%; }
  .ph-tbl .rk-nm .handle { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ph-tbl .pin .who-t small { display: flex; flex-wrap: wrap; column-gap: 4px; max-width: 130px; }
  .ph-tbl .pin .who-t small .hw-t { flex: 1 1 0; min-width: 3.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ph-tbl .pin .who-t small .rec-sc, .ph-tbl .pin .who-t small .tag { flex: none; }
  /* AB313: nothing in a table under 12 px on a phone */
  .stable :is(th, .th-btn, small, .tag, .ftag, .tt-chip, .tag-plus3, .vs-s, .mv, .handle, .hw-t, .av b, .pp, .pos-chip, button.info), .heatmap.stable td { font-size: 12px !important; }
}
@keyframes phHintIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
html.still .ph-hint { animation: none; } html.still .ph-tbl .pin-end::after { transition: none; }
@media (prefers-reduced-motion: reduce) { .ph-hint { animation: none; } .ph-tbl .pin-end::after { transition: none; } }

/* stale note */
.stale-note { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(255,77,106,.45); background: rgba(255,77,106,.08); }
.stale-note p { margin: 4px 0 0; color: var(--muted2); font-size: 13px; } .stale-note small { color: var(--muted); }

/* chips (team and player buttons) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 700; text-align: left; }
.chip:hover { border-color: var(--won-border); }
.handle { color: var(--muted); font-weight: 600; font-size: max(12px, .86em); }
.av.img-failed, .face.img-failed { background: color-mix(in srgb, var(--pc, #ff7a1a) 30%, var(--card)); }
.av b, .face b { position: relative; }
.av { background: linear-gradient(160deg, rgba(255,122,26,.28), rgba(255,255,255,.04)); }
.av b { color: #ffd9b8; }
.stub .lede { font-size: 17px; }
.linkish { border: 0; background: none; padding: 0; color: var(--on-text); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.btn { cursor: pointer; }
/* initials on position colors when a headshot is missing (AB34) */
.face { background: color-mix(in srgb, var(--pc, #8a96a8) 38%, #11131a); }
.face b { color: #fff; }

/* Footer line on every page (AB245 item 2): 12 px or more, never under the phone tab bar. */
#site-foot { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut) 24px; text-align: center; }
#site-foot small { font-size: 12px; color: var(--muted); }
@media (max-width: 759px) {
  main#app { padding-bottom: 24px !important; }
  #site-foot { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}
/* AB598: in a table, the team name under a manager's handle (the head-to-head tables on Teams and the team page) keeps
   one line and ends in "..." when it does not fit, like the phone tables' pinned names; never cut, never smaller */
.stable .who-t > small.hw-t, .ph-tbl .pin .who-t > small.hw-t { display: block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
