/* Grid floors are wrapped in min(…, 100%): a bare minmax(392px, 1fr) cannot
   fit a 402px viewport and forces the whole page to scroll sideways. */
/* ── NFL Summary ─────────────────────────────────────────────────────
   Lives inside the .nap shell and inherits its dark palette. The slate
   is read top-down: what the games look like, where the points are, then
   who to play. */
.nxs {
  /* Same aliasing as the shell — follows the site's light / dim / dark toggle. */
  --x-panel:  var(--bg-card);
  --x-panel2: var(--bg-card-h);
  --x-line:   var(--border-card);
  --x-line2:  var(--border);
  --x-text:   var(--text-1);
  --x-text2:  var(--text-2);
  --x-text3:  var(--text-3);
  --x-accent: var(--brand);
  --x-good:   #16a34a;
  --x-warn:   #b45309;
  --x-cash:   var(--brand);
  --x-gpp:    #b45309;
  /* Each tag carries its own foreground: white on the blue and on the deep
     light-mode orange, near-black on the bright dark-mode amber. Fixing white
     for both put the GPP badge at 1.8:1 in dark and dim. */
  --x-cash-fg: #ffffff;
  --x-gpp-fg:  #ffffff;
  --x-badge-fg: #ffffff;
  --x-sans:   'Archivo', var(--font, system-ui, sans-serif);
  --x-mono:   'JetBrains Mono', ui-monospace, monospace;
  color: var(--x-text);
  font-family: var(--x-sans);
}
:root:not([data-theme="light"]) .nxs {
  --x-good: #35d07f; --x-warn: #ffb020; --x-gpp: #ffb020;
  --x-gpp-fg: #2a1a00;
}

.nxs-slateline {
  font: 700 13px var(--x-mono); color: var(--x-text2);
  letter-spacing: .04em; margin-bottom: 14px;
}

/* ── Section chrome ──────────────────────────────────────────────── */
.nxs-sec { margin: 26px 0 0; }
.nxs-sec-hd {
  display: flex; align-items: baseline; gap: 12px;
  padding-bottom: 8px; margin-bottom: 14px; border-bottom: 1px solid var(--x-line);
}
.nxs-sec-hd h2 {
  margin: 0; font: 800 14px/1.1 var(--x-sans);
  letter-spacing: .11em; text-transform: uppercase; color: var(--x-text);
}
.nxs-sec-sub { font: 500 12px var(--x-mono); color: var(--x-text3); margin-left: auto; }
.nxs-empty, .nxs-none {
  padding: 22px; text-align: center; color: var(--x-text3); font: 500 13px var(--x-sans);
}
.nxs-k { font: 700 9px var(--x-sans); letter-spacing: .13em; text-transform: uppercase; color: var(--x-text3); }

/* ── KPI cards: the four calls that define the slate ─────────────
   Team colour behind, player and team art ghosted into it. */
.nxs-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(238px, 100%), 1fr)); gap: 12px; }
.nxs-kpi {
  position: relative; overflow: hidden; min-height: 118px;
  border: 1px solid var(--x-line); border-radius: 10px;
  background: var(--t-bg); color: var(--t-fg);
}
.nxs-kpi-photo {
  position: absolute; right: -6px; bottom: 0; height: 108%;
  object-fit: contain; object-position: bottom right;
  opacity: .5; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 55%);
          mask-image: linear-gradient(90deg, transparent, #000 55%);
}
.nxs-kpi-logo {
  position: absolute; left: -14px; bottom: -14px; width: 96px; height: 96px;
  object-fit: contain; opacity: .17; pointer-events: none;
}
.nxs-kpi-in {
  position: relative; z-index: 1; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 3px;
}
.nxs-kpi-hd {
  font: 800 9px var(--x-sans); letter-spacing: .14em; text-transform: uppercase;
  opacity: .82;
}
.nxs-kpi-name {
  font: 800 17px/1.15 var(--x-sans); text-shadow: 0 1px 5px rgba(0,0,0,.35);
  max-width: 74%;
}
.nxs-kpi-sub { font: 600 10.5px var(--x-mono); opacity: .85; max-width: 74%; }
.nxs-kpi-stat { font: 500 12px var(--x-mono); margin-top: 4px; opacity: .95; }
.nxs-kpi-stat b { font: 800 19px var(--x-mono); }

/* ── Environment badge ───────────────────────────────────────────── */
.nxs-env {
  font: 800 11px var(--x-mono); padding: 3px 8px; border-radius: 5px;
  color: var(--x-badge-fg); background: var(--x-text3);
}
.nxs-env-hi  { background: var(--x-good); }
.nxs-env-mid { background: var(--x-warn); }
.nxs-env-lo  { background: #64748b; color: #f1f5f9; }
.nxs-env-hi, .nxs-env-mid { color: #04101f; }

/* ── Top games: A | B | C/D | E/F ────────────────────────────────── */
.nxs-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1.3fr)) repeat(2, minmax(0, 1fr));
  gap: 14px; align-items: start;
}
.nxs-minicol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.nxs-hero {
  border: 1px solid var(--x-line); border-radius: 12px; overflow: hidden;
  background: var(--x-panel); display: flex; flex-direction: column;
}
.nxs-hero-art, .nxs-mini-art {
  position: relative; overflow: hidden;
  background: linear-gradient(100deg, var(--a) 0%, var(--a) 44%, var(--h) 56%, var(--h) 100%);
}
.nxs-hero-art { min-height: 132px; display: flex; align-items: flex-end; padding: 14px; }
.nxs-ghost {
  position: absolute; top: 46%; transform: translateY(-50%);
  width: 106px; height: 106px; object-fit: contain; opacity: .3; pointer-events: none;
}
.nxs-ghost-a { left: 5%; }
.nxs-ghost-h { right: 5%; }
.nxs-mini-art .nxs-ghost { width: 78px; height: 78px; }

.nxs-hero-rank, .nxs-mini-rank {
  position: absolute; top: 11px; left: 13px;
  font: 800 10px var(--x-sans); letter-spacing: .13em; text-transform: uppercase;
  color: rgba(255,255,255,.88); text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.nxs-hero-art .nxs-env, .nxs-mini-art .nxs-env { position: absolute; top: 9px; right: 11px; }

.nxs-hero-id { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; }
.nxs-hero-id b { font: 800 26px var(--x-sans); color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.55); }
.nxs-hero-id span { font: 600 11px var(--x-mono); color: rgba(255,255,255,.9); text-shadow: 0 1px 4px rgba(0,0,0,.6); }

.nxs-hero-nums {
  display: flex; gap: 18px; padding: 8px 14px;
  background: var(--x-panel2); border-bottom: 1px solid var(--x-line);
  font: 600 11px var(--x-mono); color: var(--x-text2);
}
.nxs-hero-nums b { color: var(--x-text); font-weight: 800; }

/* plays under the logos, one row per player */
.nxs-hero-plays { display: flex; flex-direction: column; }
.nxs-hp {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 9px; align-items: center;
  padding: 7px 14px; border-bottom: 1px solid var(--x-line);
}
.nxs-hero-plays .nxs-hp:last-child { border-bottom: 0; }
.nxs-hp i { font-style: normal; font: 700 10px var(--x-sans); color: var(--x-text3); }
.nxs-hp span { font: 600 13px var(--x-sans); color: var(--x-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nxs-hp b { font: 700 13px var(--x-mono); color: var(--x-text); }

.nxs-mini { border: 1px solid var(--x-line); border-radius: 10px; overflow: hidden; background: var(--x-panel); }
.nxs-mini-art { height: 78px; display: flex; align-items: center; justify-content: center; }
.nxs-mini-id { position: relative; z-index: 1; font: 800 16px var(--x-sans); color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.nxs-mini-ft {
  display: flex; justify-content: space-between; padding: 7px 11px;
  font: 500 11px var(--x-mono); color: var(--x-text2); border-top: 1px solid var(--x-line);
}
.nxs-mini-ft b { color: var(--x-text); }
.nxs-mini-names {
  padding: 6px 11px 9px; font: 500 11px var(--x-sans); color: var(--x-text3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 1240px) {
  .nxs-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .nxs-top { grid-template-columns: 1fr; }
}

/* ── Implied team totals ─────────────────────────────────────────── */
.nxs-tt {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr));
  gap: 0 22px; background: var(--x-panel);
  border: 1px solid var(--x-line); border-radius: 10px; padding: 10px 14px;
}
.nxs-tt-row { display: grid; grid-template-columns: 86px 62px 1fr 50px; gap: 10px; align-items: center; padding: 6px 6px; }
.nxs-tt-row:nth-child(even) { background: var(--x-panel2); }
.nxs-tt-team { display: flex; align-items: center; gap: 7px; font: 700 14px var(--x-mono); }
.nxs-tt-team .nxs-logo { width: 21px; height: 21px; flex: 0 0 21px; }
.nxs-tt-opp { font: 500 11px var(--x-mono); color: var(--x-text3); }
.nxs-tt-bar { height: 9px; background: var(--x-panel2); border-radius: 5px; overflow: hidden; }
.nxs-tt-bar i { display: block; height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--x-accent) 45%, transparent), var(--x-accent)); }
.nxs-tt-v { font: 700 14px var(--x-mono); text-align: right; }

/* ── Stacks ──────────────────────────────────────────────────────── */
.nxs-stacks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(272px, 100%), 1fr)); gap: 12px; }
.nxs-stack { border: 1px solid var(--x-line); border-radius: 10px; overflow: hidden; background: var(--x-panel); }
.nxs-stack-hd {
  display: flex; align-items: center; gap: 8px; padding: 9px 13px;
  background: var(--t-bg); color: var(--t-fg); font: 800 16px var(--x-sans);
}
.nxs-stack-hd .nxs-logo { width: 25px; height: 25px; flex: 0 0 25px; }
.nxs-stack-combo { margin-left: auto; font: 800 18px var(--x-mono); }
.nxs-stack-leg {
  display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 10px; align-items: center;
  padding: 9px 13px; border-top: 1px solid var(--x-line);
}
.nxs-stack-leg .nxs-pp { color: var(--x-text3); }
.nxs-stack-leg .nxs-pn { font: 600 14px var(--x-sans); color: var(--x-text); }
.nxs-stack-leg .nxs-pj { font: 700 14px var(--x-mono); color: var(--x-text); }
.nxs-stack-ft {
  padding: 7px 13px; background: var(--x-panel2); border-top: 1px solid var(--x-line);
  font: 600 11px var(--x-mono); color: var(--x-text2);
}

/* ── Top plays by position ───────────────────────────────────────── */
.nxs-pos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(392px, 100%), 1fr)); gap: 14px; }
.nxs-pos { border: 1px solid var(--x-line); border-radius: 10px; background: var(--x-panel); overflow: hidden; }
.nxs-pos-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; background: var(--x-panel2); border-bottom: 1px solid var(--x-line);
  font: 800 15px var(--x-sans); letter-spacing: .05em;
}
.nxs-pos-hd span { font: 500 11px var(--x-mono); color: var(--x-text3); }
.nxs-pos-split { display: flex; align-items: center; gap: 10px; padding: 11px 14px 5px; }
.nxs-tag {
  font: 800 10px var(--x-sans); letter-spacing: .11em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 5px;
}
.nxs-tag-cash { background: var(--x-cash); color: var(--x-cash-fg); }
.nxs-tag-gpp  { background: var(--x-gpp);  color: var(--x-gpp-fg); }
.nxs-pos-note { font: 500 11px var(--x-mono); color: var(--x-text3); }

.nxs-tbl { width: 100%; border-collapse: collapse; }
.nxs-tbl th {
  font: 700 10px var(--x-sans); letter-spacing: .09em; text-transform: uppercase;
  color: var(--x-text3); padding: 6px 12px; border-bottom: 1px solid var(--x-line);
}
.nxs-tbl td { padding: 8px 12px; font: 500 13px var(--x-mono); color: var(--x-text2); }
.nxs-tbl tbody tr:nth-child(even) { background: var(--x-panel2); }
.nxs-tbl .l { text-align: left; }
.nxs-tbl .r { text-align: right; }
.nxs-tbl .b { font-weight: 700; color: var(--x-text); }
.nxs-tbl-team { display: flex; align-items: center; gap: 6px; }
.nxs-tbl-team .nxs-logo { width: 19px; height: 19px; flex: 0 0 19px; }
.nxs-logo { object-fit: contain; }

@media (max-width: 1180px) {
  .nxs-top { grid-template-columns: 1fr; }
  .nxs-hero { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nxs-mini-grid { grid-template-columns: 1fr; }
  .nxs-rests { grid-template-columns: 1fr; }
  .nxs-rest { grid-template-columns: 34px 1fr 18px 1fr; row-gap: 6px; }
}
