/* The shell: top bar, navigation (bottom bar on phones, left rail from 1024px), the screen,
   the slim "Your entry" bar, and the slip panel (from 1280px, while your own entry has picks: FP-1). */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body.nx {
  background:
    radial-gradient(120% 60% at 50% -12%, #13213A 0%, rgba(5, 7, 11, 0) 60%) fixed,
    var(--bg);
  color: var(--text); font: 400 var(--fs)/1.45 var(--body);
  -webkit-font-smoothing: antialiased; min-height: 100vh; min-height: 100dvh;
  overflow-x: hidden;
}
a { color: var(--text-2); }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
button, input, select, textarea { font: inherit; color: inherit; }
/* No single word left alone on a paragraph's last line (POL-1; browsers without it just wrap as before). */
p, li, dd, .pr-why, .td-lead-sub, .pk-lead-sub, .ps-lead-text { text-wrap: pretty; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 8px; top: -60px; z-index: 50; background: var(--accent); color: var(--accent-ink);
  min-height: var(--tap); display: inline-flex; align-items: center;
  padding: 0 16px; border-radius: var(--r-sm); font-weight: 700; text-decoration: none; }
.skip:focus { top: 8px; }

/* ---------- top bar ---------- */
.nx-top {
  position: sticky; top: 0; z-index: 20; height: calc(var(--top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--pad) 0; display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(5, 7, 11, .94), rgba(5, 7, 11, .78));
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.nx-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); min-height: var(--tap); }
.nx-mark { color: var(--accent); flex: none; }
.nx-word { font: 800 var(--fs-xl)/1 var(--display); letter-spacing: .06em; white-space: nowrap; }
.nx-word b { color: var(--accent); font-weight: 800; }
.nx-search {
  display: none; align-items: center; gap: 8px; flex: 1; max-width: 460px; margin: 0 auto;
  height: calc(var(--tap) + 2px); padding: 0 14px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-2);
  color: var(--muted);
}
.nx-search:focus-within { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 3px var(--accent-soft); }
.nx-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; height: 100%; color: var(--text); }
.nx-search input::placeholder { color: var(--faint); }
.nx-sport { display: inline-flex; margin-left: auto; padding: 2px; gap: 2px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line-2); }
.nx-sport button {
  min-width: var(--tap); height: var(--tap); padding: 0 10px; border: 0; border-radius: var(--r-sm); background: none; cursor: pointer;
  font: 700 var(--fs)/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nx-sport button[aria-checked="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.nx-sport button:not([aria-checked="true"]):hover { color: var(--text); }
/* V-16: only on the screens the filter changes (the router sets data-sport). */
body[data-sport="off"] .nx-sport { display: none; }
.nx-me-btn { display: none; width: var(--tap); height: var(--tap); border-radius: 50%; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); }
.nx-me-btn[aria-current="page"] { border-color: var(--accent); color: var(--accent); }

/* ---------- navigation: bottom bar (phones) ---------- */
.nx-nav {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr); align-items: stretch;
  background: linear-gradient(180deg, rgba(8, 11, 17, .86), rgba(5, 7, 11, .97));
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  border-top: 1px solid var(--line);
}
.nx-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: var(--tap); text-decoration: none; color: var(--muted);
  font: 600 var(--fs-2xs)/1 var(--body); letter-spacing: .02em; position: relative;
}
.nx-nav a > svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nx-nav a[aria-current="page"] { color: var(--text); }
.nx-nav a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--accent); box-shadow: 0 0 12px var(--accent-glow);
}
/* UX-0 (owner 2026-12-05): four equal tabs; only the one you're on is lit. */
.nx-nav a[aria-current="page"] > svg { color: var(--accent); }

/* ---------- the slim "Your entry" bar (FP-1): while your own entry has picks, on every screen but
   Your own itself; above the bottom bar on phones, along the bottom from 1024px; from 1280px the
   panel holds the builder instead. ---------- */
.nx-own {
  position: fixed; z-index: 29; left: 10px; right: 10px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 10px);
  min-height: var(--tap); padding: 0 6px 0 14px; border-radius: var(--r); display: flex; align-items: center; gap: 10px;
  background: rgba(20, 27, 39, .94); border: 1px solid var(--line-3); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  color: var(--text); text-decoration: none; font-weight: 600;
}
.nx-own[hidden] { display: none; }
.nx-own-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-own-t b { font: 800 var(--fs)/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-right: 6px; }
.nx-own-go { flex: none; min-height: 36px; padding: 0 12px; border-radius: var(--r-sm); display: inline-flex; align-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.nx-own:hover { color: var(--text); border-color: var(--accent); }
body[data-own="on"] .nx-screen { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 28px + var(--tap) + 24px); }
body[data-own="on"] .nx-toast { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px + var(--tap) + 24px); }

/* ---------- the screen ---------- */
.nx-screen {
  display: block; min-width: 0; outline: none;
  padding: 14px var(--pad) calc(var(--nav-h) + env(safe-area-inset-bottom) + 28px);
}
.nx-panel { display: none; }
.nx-toast {
  position: fixed; z-index: 40; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  transform: translateX(-50%); max-width: min(92vw, 420px); padding: 12px 16px; border-radius: var(--r);
  background: var(--surface-3); border: 1px solid var(--line-3); box-shadow: var(--shadow); font-weight: 600;
  display: flex; align-items: center; gap: 14px; width: max-content;
}
.nx-toast > span { min-width: 0; }
.nx-toast[hidden] { display: none; }
.nx-toast-act { flex: none; min-height: var(--tap); padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-3); background: none;
  color: var(--accent); font: 700 var(--fs-sm)/1 var(--body); text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }

/* Phones: the filter slides away while scrolling down (main.js), back on the way up. */
@media (max-width: 599px) {
  .nx-sport { transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility 0s linear 0s; }
  body.nx-sport-away .nx-sport {
    opacity: 0; transform: translateY(-10px); visibility: hidden; pointer-events: none;
    transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility 0s linear var(--t-fast);
  }
}
@media (max-width: 599px) and (prefers-reduced-motion: reduce) {
  .nx-sport, body.nx-sport-away .nx-sport { transition: none; }
}
@media (min-width: 600px) {
  .nx-search { display: flex; }
  .nx-sport { margin-left: 0; }
}
@media (min-width: 1024px) {
  .nx-top { z-index: 32; padding-left: calc(var(--rail-w) + var(--pad)); }
  .nx-me-btn { display: inline-flex; }
  body[data-sport="off"] .nx-me-btn { margin-left: auto; }
  .nx-search + .nx-me-btn { margin-left: auto; }  /* server pages: no sport filter */
  .nx-brand { position: absolute; left: 0; top: env(safe-area-inset-top); width: var(--rail-w); height: var(--top-h); justify-content: center;
    border-right: 1px solid var(--line); background: #070A10; }
  .nx-word { display: none; }
  .nx-mark { width: 30px; height: 30px; }
  .nx-search { margin: 0; }
  .nx-sport { margin-left: auto; }
  .nx-nav {
    top: 0; bottom: 0; right: auto; width: var(--rail-w); height: auto; padding: calc(var(--top-h) + 18px) 10px 18px;
    display: flex; flex-direction: column; justify-content: flex-start; gap: 6px;
    border-top: 0; border-right: 1px solid var(--line);
    background: linear-gradient(180deg, #070A10, #05070B);
  }
  .nx-nav a { height: 64px; flex: none; border-radius: var(--r); font-size: var(--fs-xs); }
  .nx-nav a:hover { background: var(--surface); color: var(--text); }
  .nx-nav a[aria-current="page"] { background: var(--surface-2); }
  .nx-nav a[aria-current="page"]::before { top: 16px; bottom: 16px; left: -10px; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .nx-screen { margin-left: var(--rail-w); padding: 22px 32px 48px; }
  .nx-toast { bottom: 24px; }
  .nx-own { left: calc(var(--rail-w) + 32px); right: 32px; bottom: 16px; max-width: 560px; }
  body[data-own="on"] .nx-screen { padding-bottom: calc(48px + var(--tap) + 16px); }
  body[data-own="on"] .nx-toast { bottom: calc(24px + var(--tap) + 16px); }
}
@media (min-width: 1280px) {
  /* FP-1: the panel only while your own entry has picks (main.js sets data-panel), never on Your
     own itself (the screen is the builder); the slim bar's job is the panel's here. */
  .nx-own { display: none; }
  body[data-own="on"] .nx-screen { padding-bottom: 48px; }
  body[data-own="on"] .nx-toast { bottom: 24px; }
  body[data-panel] .nx-sport { margin-right: calc(var(--panel-w) + 32px - var(--pad) - var(--tap) - 10px); }
  body[data-panel] .nx-screen { margin-right: var(--panel-w); }
  body[data-panel] .nx-panel { display: block; }
  .nx-panel {
    position: fixed; z-index: 15; top: 0; right: 0; bottom: 0; width: var(--panel-w);
    padding: calc(var(--top-h) + 20px) 22px 24px; overflow-y: auto;
    border-left: 1px solid var(--line); background: linear-gradient(180deg, #0A0E15, #06080C);
  }
}
@media (min-width: 1600px) {
  .nx-screen { padding-left: 48px; padding-right: 48px; }
  body[data-panel] .nx-sport { margin-right: calc(var(--panel-w) + 48px - var(--pad) - var(--tap) - 10px); }
}

/* ---------- screen changes (View Transitions, V-13; main.js swap) ---------- */
/* The top bar, navigation and panel are lifted out and held still; the rest of the page (what's
   in view, not the whole long screen) eases in. A game's card and the game screen's hero share
   the name "hero" for the moment of the change, so one grows into the other. Taps go straight
   through to the new screen while it animates. */
::view-transition { pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .nx-top { view-transition-name: topbar; }
  .nx-nav { view-transition-name: nav; }
  .nx-panel { view-transition-name: panel; }
  .nx-own { view-transition-name: own; }
  ::view-transition-group(topbar), ::view-transition-group(nav), ::view-transition-group(panel), ::view-transition-group(own) { animation: none; }
  ::view-transition-old(topbar), ::view-transition-old(nav), ::view-transition-old(panel), ::view-transition-old(own) { display: none; }
  ::view-transition-new(topbar), ::view-transition-new(nav), ::view-transition-new(panel), ::view-transition-new(own) { animation: none; }
  ::view-transition-old(root) { animation: nx-vt-out .14s var(--ease) both; }
  ::view-transition-new(root) { animation: nx-vt-in .28s var(--ease) both; }
  html[data-vt="back"]::view-transition-new(root) { animation-name: nx-vt-in-back; }
  ::view-transition-group(hero) { animation-duration: .34s; animation-timing-function: var(--ease); }
  ::view-transition-old(hero), ::view-transition-new(hero) { height: 100%; object-fit: cover; }
}
@keyframes nx-vt-out { to { opacity: 0; } }
@keyframes nx-vt-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes nx-vt-in-back { from { opacity: 0; transform: translateY(-12px); } }
