@import url('./league-v2.css');
@import url('/arena/src/pack/ceremony.css');
@import url('/arena/src/pack/board.css');
@import url('/arena/src/pack/reveal.css');
@import url('./shot-lab.css');
@import url('./stats.css');

:root {
  /* Team theme (default Lakers). app/src/theme.js swaps these; the 3D court keeps its own Lakers paint. */
  --accent: 253 185 39;
  --accent-hi: 255 214 120;
  --accent-lo: 214 152 22;
  --accent-ink: 26 18 6;
  --second: 143 91 214;
  --second-hi: 185 138 255;
  color-scheme: dark;
  font-family: Geist, system-ui, sans-serif;
  color: #f4f1ea;
  background: #020306;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
canvas {
  display: block;
  position: fixed;
  inset: 0;
  /* The 3D world owns every gesture (pack tear, swipes); without this phones cancel the pointer as a pan. */
  touch-action: none;
}
h1 {
  position: fixed;
  z-index: 2;
  top: max(20px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.42em;
  pointer-events: none;
}
#narrator {
  position: fixed;
  z-index: 4;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  padding: 0 24px;
  font:
    italic clamp(18px, calc(2.2 * var(--vw)), 26px) 'Instrument Serif',
    serif;
  text-shadow: 0 2px 12px #000;
  pointer-events: none;
}
#overlay,
#pack-overlay {
  position: fixed;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}
#overlay > * {
  pointer-events: auto;
}
.identity {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 20px;
  background: #020306ed;
  text-align: center;
}
.identity h2 {
  letter-spacing: 0.2em;
  font-size: 20px;
}
.identity input {
  border: 0;
  border-bottom: 1px solid #7597a8;
  background: transparent;
  color: white;
  padding: 14px;
  font: inherit;
  text-align: center;
  max-width: 300px;
}
.identity button,
.primary {
  font: 700 12px Geist;
  letter-spacing: 0.18em;
  padding: 15px 30px;
  border: 1px solid rgb(var(--accent));
  background: rgb(var(--accent));
  color: rgb(var(--accent-ink));
}
.identity small {
  max-width: 300px;
  line-height: 1.7;
  color: #a5b6c2;
}
.feed,
.plate,
.game-page {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(90 * var(--vw)));
  top: 14%;
  max-height: 72%;
  overflow: auto;
  overscroll-behavior: contain;
  font-variant-numeric: tabular-nums;
}
.strip,
.plate,
.game-page {
  background: #07101ad9;
  backdrop-filter: blur(16px);
  border: 1px solid #a8d1ec22;
}
.strip {
  padding: 16px 20px;
  margin: 0 0 8px;
  line-height: 1.6;
}
.strip button,
.text-action {
  background: none;
  color: rgb(var(--accent-hi));
  border: 0;
  padding: 4px 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #98b6cb;
}
.plate {
  top: auto;
  bottom: 13%;
  padding: 22px;
  width: min(560px, calc(90 * var(--vw)));
  max-height: 38%;
}
.plate h2,
.game-page h2 {
  margin: 0 0 16px;
  font-size: 18px;
}
.bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}
.bar {
  font-size: 10px;
  letter-spacing: 0.04em;
}
.bar meter {
  width: 100%;
  height: 8px;
  display: block;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
th,
td {
  padding: 10px 7px;
  border-bottom: 1px solid #ffffff15;
  text-align: right;
  white-space: nowrap;
}
th:first-child,
td:first-child {
  text-align: left;
}
caption {
  text-align: left;
  padding: 14px 0;
  color: #98b6cb;
  font-size: 11px;
}
.game-page {
  padding: 24px;
}
.score {
  text-align: center;
  font-size: clamp(24px, calc(4 * var(--vw)), 40px);
  font-weight: 900;
  margin: 16px 0;
}
.bug {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 10px 20px;
  background: #020306bb;
  letter-spacing: 0.1em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.end {
  position: absolute;
  bottom: 16%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}
.hot {
  color: #ff9373;
}
.cold {
  color: #8fc6ff;
}
.muted {
  color: #a6b8c5;
  font-size: 12px;
  line-height: 1.7;
}
.call-sides {
  display: flex;
  gap: 24px;
}
.call-sides button {
  min-height: 40px;
  touch-action: none;
}
.call-sides .selected {
  color: white;
  text-decoration: underline;
}
.projected {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 8px #000;
}
#pack-overlay[hidden] {
  display: none;
}
.error {
  color: #ffa08b;
}
.wp {
  width: 100%;
  height: 120px;
}
svg text {
  fill: #9bb4c5;
  font-size: 10px;
}
@media (max-width: 600px) {
  .feed {
    top: 12%;
    max-height: 75%;
    width: calc(92 * var(--vw));
  }
  .strip {
    padding: 12px 14px;
    font-size: 12px;
  }
  .game-page {
    padding: 16px;
    width: calc(96 * var(--vw));
  }
  .game-page table {
    font-size: 10px;
  }
  td,
  th {
    padding: 9px 4px;
  }
  .plate {
    bottom: 12%;
    padding: 16px;
  }
  .bug {
    font-size: 11px;
    padding: 9px 10px;
  }
  .bars {
    gap: 8px 16px;
  }
}
@media (max-height: 500px) {
  .plate {
    right: 4%;
    left: auto;
    transform: none;
    top: 17%;
    bottom: auto;
    width: calc(40 * var(--vw));
    max-height: 68%;
  }
  .feed,
  .game-page {
    top: 12%;
    max-height: 72%;
  }
}
.pack-heading,
.pack-narration,
.pack-card-caption,
.pack-card-caption {
  font-size: 11px;
  font-weight: 700;
}
.pack-inspect meter {
  height: 6px;
}
.fit-plate {
  width: min(calc(94 * var(--vw)), 640px);
  font-size: 10px;
  letter-spacing: 0;
  line-height: 1.7;
  color: #bed0dc;
}
.fit-plate b {
  font-size: 11px;
  color: #fff;
}
#overlay > .projected {
  pointer-events: none;
}
/* A quick dark tunnel cut masks the jump between isolated physical sets. */
body.whip::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 70%, #142331, #020306 65%);
  backdrop-filter: blur(12px);
  animation: tunnel-whip 0.32s ease-out forwards;
}
@keyframes tunnel-whip {
  0%,
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.bug {
  top: max(68px, 9%);
  left: max(16px, env(safe-area-inset-left));
  transform: none;
  min-width: 142px;
  padding: 9px 12px;
  letter-spacing: 0.04em;
  border: 1px solid #b3ccdf33;
  border-radius: 3px;
}
.bug-clock {
  font-size: 9px;
  color: #a9becd;
  letter-spacing: 0.16em;
  margin-bottom: 6px;
}
.bug-team {
  display: grid;
  grid-template-columns: 3.2em 2.4em auto;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}
.bug-team abbr {
  text-decoration: none;
  font-size: 12px;
}
.bug-team strong {
  text-align: right;
  font-size: 17px;
}
.edge-chip {
  border: 1px solid #d1b47755;
  color: rgb(var(--accent-hi));
  font-size: 8px;
  padding: 2px 4px;
  white-space: nowrap;
}
.court-final {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: calc(10 * var(--vh)) calc(7 * var(--vw));
  background: linear-gradient(#020610aa, #020610ed);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.final-score {
  padding: 22px 30px;
  background: #0b1c2de8;
  border: 1px solid #b2d7f033;
}
.final-score .bug-team {
  grid-template-columns: 3em 2.6em auto;
  gap: 18px;
}
.final-score .bug-team abbr {
  font-size: 21px;
}
.final-score .bug-team strong {
  font-size: 40px;
}
.humiliation {
  max-width: 460px;
  margin: 0;
  font:
    italic 23px 'Instrument Serif',
    serif;
}
#narrator[hidden] {
  display: none;
}

.account {
  position: absolute;
  bottom: 8%;
  left: 5%;
  font-size: 11px;
  color: #a6b8c5;
}
.account button {
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.league-moment {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  width: min(calc(88 * var(--vw)), 440px);
  max-height: 65%;
  overflow: auto;
  text-align: center;
  z-index: 11;
  background: #07101a;
  padding: 24px;
}
.league-moment h2 {
  font-size: 13px;
  letter-spacing: 0.2em;
}
.league-moment ul {
  list-style: none;
  padding: 0;
}
.league-moment li {
  padding: 8px;
  touch-action: pan-y;
}
.league-moment label {
  display: block;
  padding: 8px;
}
.league-moment input {
  width: 60px;
  margin-left: 12px;
}

.push-moment {
  position: fixed;
  z-index: 12;
  bottom: 14%;
  left: 50%;
  transform: translateX(-50%);
  padding: 24px;
  width: min(calc(88 * var(--vw)), 400px);
  text-align: center;
  background: #07101af5;
}

.gesture-hint {
  position: absolute;
  bottom: 6%;
  width: 100%;
  padding: 0 24px;
  text-align: center;
  color: #a6b8c5;
  font-size: 11px;
  pointer-events: none;
}
.league-moment label:has([data-preference]) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  min-height: 44px;
  gap: 12px;
  font-size: 12px;
}

.league-moment .invite-copy {
  display: block;
  width: 100%;
  margin: 16px 0 0;
  padding: 10px;
  color: #fff;
  background: transparent;
  border: 1px solid #a6b8c5;
  font:
    12px Geist,
    sans-serif;
}

/* ---------- First screen: the players' tunnel (concept: assets/concepts/first-screen/hybrid.jpg) ---------- */
body:has(.tunnel) #title,
body:has(.tunnel) #narrator {
  display: none;
}
.tunnel {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  background: #000;
  color: #f3ead6;
  font-family: Geist, system-ui, sans-serif;
}
/* The plate keeps its photo's aspect and covers the viewport; the jumbotron text rides inside it. */
.tunnel .backplate {
  position: absolute;
  top: 50%;
  right: 0;
  aspect-ratio: 4096 / 2294;
  width: max(calc(100 * var(--vw)), calc(calc(100 * var(--vh)) * 4096 / 2294));
  transform: translateY(-50%);
  container-type: size;
}
.tunnel .scene {
  position: absolute;
  inset: 0;
  background: url('../img/tunnel-wide.webp') center / 100% 100% no-repeat;
  transform-origin: 70% 38%;
  animation: tunnel-push 28s ease-in-out infinite alternate;
}
.tunnel .scene::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 30% 22% at 70% 82%, #ffcf7a33, transparent 70%);
  mix-blend-mode: screen;
  animation: tunnel-glint 7s ease-in-out infinite alternate;
}
.tunnel .backplate::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #000 0%, #000c 22%, #0000 46%);
}
@keyframes tunnel-push {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}
@keyframes tunnel-glint {
  from { opacity: 0.35; }
  to { opacity: 1; }
}
.tunnel .jumbo {
  position: absolute;
  left: 62.68%;
  top: 8.11%;
  width: 15.09%;
  height: 17.45%;
  display: grid;
  place-items: center;
  text-align: center;
  font: 700 1.85cqw/1.02 Oswald, Impact, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(var(--accent-hi));
  text-shadow: 0 0 0.35cqw #ffb81c, 0 0 1.2cqw #ffb81c88;
  background: repeating-linear-gradient(0deg, #0000 0 2px, #0003 2px 3px);
  animation: tunnel-led 4.5s steps(1) infinite;
}
.tunnel .jumbo span {
  padding: 0 6%;
}
@keyframes tunnel-led {
  0%, 100% { opacity: 1; }
  96% { opacity: 0.86; }
}
.tunnel .copy {
  position: absolute;
  left: max(28px, calc(6 * var(--vw)));
  top: 50%;
  transform: translateY(-50%);
  width: min(calc(36 * var(--vw)), 640px);
}
.tunnel .brand {
  position: absolute;
  top: max(22px, calc(3.5 * var(--vh)));
  left: max(28px, calc(6 * var(--vw)));
  width: min(calc(30 * var(--vw)), 440px);
}
.tunnel h2 {
  margin: 0 0 18px;
  font: 500 clamp(54px, calc(5.3 * var(--vw)), 104px) / 0.95 'Playfair Display', Georgia, serif;
  white-space: nowrap;
  letter-spacing: -0.02em;
  color: rgb(var(--accent));
  text-shadow: 0 2px 30px #0008;
}
.tunnel .meta {
  margin: 0 0 26px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #eadbb5;
}
.tunnel .seats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}
.tunnel .seat {
  position: relative;
  width: clamp(64px, calc(6.4 * var(--vw)), 104px);
  aspect-ratio: 5 / 7;
  border: 1px solid rgb(var(--accent) / 40%);
  background: #07060a;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.tunnel .seat.gold,
.tunnel .seat.filled {
  border-color: rgb(var(--accent));
  background: linear-gradient(135deg, #8a5a12, #f6cf62 30%, #b07a1c 55%, #ffe08a 75%, #9c6a16);
  box-shadow: 0 8px 30px rgb(var(--accent) / 20%), inset 0 0 0 1px #fff4;
  animation: seat-arrive 0.9s cubic-bezier(0.2, 0.9, 0.2, 1.2) both;
}
.tunnel .seat.filled {
  background: linear-gradient(135deg, #2c1747, #6b3aa8 35%, #3a1d60 60%, #8a57c9 80%, #2c1747);
  border-color: #b48ae6;
}
.tunnel .seat-mark {
  position: absolute;
  inset: 0 0 18%;
  display: grid;
  place-items: center;
  font: 600 clamp(30px, calc(3.4 * var(--vw)), 54px) 'Playfair Display', Georgia, serif;
  color: #5a3a08;
  text-shadow: 0 1px 0 #ffe9a888, 0 -1px 0 #3a2404aa;
}
.tunnel .seat.filled .seat-mark {
  color: #e9dcff;
  text-shadow: 0 2px 10px #0008;
}
.tunnel .seat-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8%;
  font-size: clamp(9px, calc(0.8 * var(--vw)), 12px);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: rgb(var(--accent-ink));
  line-height: 1.15;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 0 5px;
}
.tunnel .seat-name.long {
  font-size: clamp(7px, calc(0.62 * var(--vw)), 10px);
  letter-spacing: 0.04em;
}
.tunnel .seat.filled .seat-name {
  color: #f3ead6;
}
.tunnel .seat.open button {
  position: absolute;
  inset: 0;
  border: 0;
  background: none;
  color: rgb(var(--accent));
  font: 200 clamp(26px, calc(2.4 * var(--vw)), 38px) Geist, sans-serif;
  cursor: pointer;
}
.tunnel .seat.open:hover {
  border-color: rgb(var(--accent));
  background: rgb(var(--accent) / 6%);
}
@keyframes seat-arrive {
  from { transform: rotateY(90deg) scale(0.9); filter: brightness(2.2); }
  to { transform: none; filter: none; }
}
.tunnel button.primary {
  display: block;
  width: 100%;
  height: 64px;
  border: 0;
  border-radius: 2px;
  background: rgb(var(--accent));
  color: rgb(var(--accent-ink));
  font: 700 15px Geist, sans-serif;
  letter-spacing: 0.24em;
  cursor: pointer;
  box-shadow: 0 10px 40px rgb(var(--accent) / 20%);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.tunnel button.primary:hover {
  background: rgb(var(--accent-hi));
  box-shadow: 0 14px 50px rgb(var(--accent) / 33%);
}
.tunnel button.primary:active {
  transform: scale(0.985);
}
.tunnel button.quiet {
  display: inline-block;
  margin-top: 18px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: rgb(var(--accent));
  font: 500 15px Geist, sans-serif;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgb(var(--accent) / 50%);
  cursor: pointer;
}
.tunnel .note {
  margin: 16px 0 0;
  font-size: 13px;
  color: #a99e86;
}
.tunnel .settings {
  display: flex;
  gap: 18px;
  margin: 0 0 18px;
  font-size: 13px;
  color: #eadbb5;
}
.tunnel .settings input {
  width: 56px;
  margin-left: 8px;
  padding: 6px;
  border: 1px solid rgb(var(--accent) / 40%);
  background: #0008;
  color: #fff;
  font: inherit;
}
body:has(.tunnel) .account {
  position: fixed;
  z-index: 21;
  left: max(28px, calc(6 * var(--vw)));
  bottom: max(18px, calc(3 * var(--vh)));
  margin: 0;
  font-size: 12px;
  color: #8f8673;
}
body:has(.tunnel) .account button {
  border: 0;
  background: none;
  color: #b9ad92;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
/* Portrait phones: the tunnel takes the top, the copy sits on the dark floor below it. */
@media (orientation: portrait) {
  .tunnel .backplate {
    top: 0;
    right: auto;
    left: 50%;
    aspect-ratio: 2294 / 4096;
    width: max(calc(100 * var(--vw)), calc(calc(100 * var(--vh)) * 2294 / 4096));
    transform: translateX(-50%);
  }
  .tunnel .scene {
    background-image: url('../img/tunnel-tall.webp');
    transform-origin: 50% 24%;
  }
  .tunnel .backplate::after {
    background: linear-gradient(180deg, #0000 38%, #000a 52%, #000 64%);
  }
  .tunnel .jumbo {
    left: 33.99%;
    top: 3.16%;
    width: 32.55%;
    height: 11.05%;
    font-size: 4.3cqw;
  }
  .tunnel .copy {
    left: 24px;
    right: 24px;
    top: auto;
    bottom: calc(52px + env(safe-area-inset-bottom));
    transform: none;
    width: auto;
    text-align: center;
  }
  /* Phones: the jumbotron owns the top; the lockup sits over the court floor, above the copy. */
  .tunnel .brand {
    left: 50%;
    top: 29%;
    transform: translateX(-50%);
    width: min(calc(58 * var(--vw)), 240px);
  }
  .tunnel h2 {
    font-size: clamp(48px, calc(14.5 * var(--vw)), 84px);
    margin-bottom: 12px;
  }
  .tunnel .meta {
    font-size: 11px;
    margin-bottom: 20px;
  }
  .tunnel .seats {
    justify-content: center;
    gap: 10px;
    margin-bottom: 22px;
  }
  .tunnel .seat {
    width: clamp(58px, calc(19 * var(--vw)), 92px);
  }
  .tunnel .seat-name {
    font-size: 9px;
    letter-spacing: 0.08em;
  }
  .tunnel .settings {
    justify-content: center;
  }
  body:has(.tunnel) .account {
    left: 0;
    right: 0;
    text-align: center;
    bottom: calc(14px + env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  .tunnel .scene,
  .tunnel .scene::after,
  .tunnel .jumbo,
  .tunnel .seat {
    animation: none;
  }
}

body:has(#pack-overlay:not([hidden])) .gesture-hint {
  bottom: 21%;
}

/* ---------- Shared full-screen pages (home, today, game) ---------- */
body:has(.page) #title,
body:has(.page) #narrator {
  display: none;
}
.page {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(28px, calc(5 * var(--vh))) max(24px, calc(5 * var(--vw))) 80px;
  background: #000 center / cover no-repeat;
  color: #eadbb5;
  font-family: Geist, system-ui, sans-serif;
}
.page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: inherit;
  background-image: var(--bg);
  background-size: cover;
  background-position: center;
}
.page::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #0008 0%, #0004 40%, #000c 100%);
}
.page h2 {
  margin: 0;
  font: 500 clamp(52px, calc(6 * var(--vw)), 104px) / 0.95 'Playfair Display', Georgia, serif;
  color: rgb(var(--accent));
  letter-spacing: -0.02em;
}
.page .meta {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.page h3 {
  margin: 30px 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: rgb(var(--accent));
  display: flex;
  align-items: center;
  gap: 14px;
}
.page h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgb(var(--accent) / 40%), transparent);
}
.page button.primary {
  height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 2px;
  background: rgb(var(--accent));
  color: rgb(var(--accent-ink));
  font: 700 13px Geist, sans-serif;
  letter-spacing: 0.22em;
  cursor: pointer;
}
.page button.quiet {
  border: 0;
  background: none;
  color: rgb(var(--accent));
  font: 600 13px Geist, sans-serif;
  letter-spacing: 0.2em;
  cursor: pointer;
}
.glass {
  background: #0a0710b3;
  backdrop-filter: blur(14px);
  border: 1px solid rgb(var(--accent) / 20%);
}
/* Home */
.home {
  --bg: url('../img/locker-wide.webp');
}
.home-head {
  max-width: 60%;
}
.home .last {
  position: absolute;
  top: max(28px, calc(5 * var(--vh)));
  right: max(24px, calc(5 * var(--vw)));
  width: min(360px, calc(34 * var(--vw)));
  padding: 18px 20px;
  background: #0a0710b3;
  backdrop-filter: blur(14px);
  border: 1px solid rgb(var(--accent) / 20%);
}
.home .last small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: #a99e86;
}
.home .last p {
  margin: 6px 0 14px;
  font-size: 16px;
  color: #f3ead6;
}
.home .last b.w {
  color: rgb(var(--accent));
}
.home .last b.l {
  color: #ff8a7a;
}
.home .last button.primary {
  width: 100%;
}
.home .fuel {
  max-width: 560px;
  margin: 26px 0 0;
}
.home .fuel span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
}
.home .fuel i {
  display: block;
  height: 4px;
  margin-top: 10px;
  background: linear-gradient(90deg, rgb(var(--accent)) var(--v), #ffffff1f var(--v));
  box-shadow: 0 0 18px rgb(var(--accent) / 27%);
}
.cards {
  display: flex;
  gap: clamp(10px, calc(1.2 * var(--vw)), 18px);
}
.pcard {
  position: relative;
  flex: 0 0 auto;
  width: clamp(120px, calc(13 * var(--vw)), 190px);
  aspect-ratio: 5 / 7;
  padding: 0;
  border: 1px solid #ffffff22;
  border-radius: 6px;
  overflow: hidden;
  background: #111;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 14px 34px #000a;
  transition: transform 0.18s, box-shadow 0.18s;
}
.pcard.small {
  width: clamp(92px, calc(9.6 * var(--vw)), 140px);
}
.pcard:hover {
  transform: translateY(-4px);
}
.pcard.picked {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 3px;
  transform: translateY(-8px);
  box-shadow: 0 0 40px rgb(var(--accent) / 40%);
}
.pcard img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pcard::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, #000d 88%);
}
.pcard.r-rare {
  border-color: #75b9ff;
}
.pcard.r-epic {
  border-color: #be8aff;
}
.pcard.r-legendary {
  border-color: #ffd477;
  box-shadow: 0 0 26px #ffd47744, 0 14px 34px #000a;
}
.pcard .pc-pos,
.pcard .pc-name,
.pcard .pc-ovr,
.pcard .form {
  position: absolute;
  z-index: 1;
}
.pcard .pc-pos {
  left: 8px;
  bottom: 26px;
  font-size: 10px;
  font-weight: 700;
  color: rgb(var(--accent));
  letter-spacing: 0.1em;
}
.pcard .pc-name {
  left: 8px;
  right: 40px;
  bottom: 9px;
  font-size: clamp(10px, calc(0.9 * var(--vw)), 13px);
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}
.pcard.small .pc-name {
  font-size: 10px;
}
.pcard .pc-ovr {
  right: 8px;
  bottom: 7px;
  font: 800 clamp(18px, calc(1.8 * var(--vw)), 26px) / 1 Geist, sans-serif;
  font-style: normal;
  text-align: right;
}
.pcard .pc-ovr small {
  display: block;
  font-size: 8px;
  letter-spacing: 0.12em;
  color: #cbbf9f;
}
.pcard .form {
  top: 7px;
  right: 7px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 800;
  font-style: normal;
  letter-spacing: 0.1em;
  background: #000a;
}
.pcard .form.hot {
  color: #ff9a5a;
}
.pcard .form.cold {
  color: #7fc4ff;
}
.pcard .form.out {
  color: #ff8a7a;
}
.home .today-link {
  display: block;
  margin: 34px auto 0;
}
body:has(.page) .account {
  position: fixed;
  z-index: 21;
  right: max(24px, calc(5 * var(--vw)));
  bottom: 18px;
  margin: 0;
  font-size: 12px;
  color: #8f8673;
}
body:has(.page) .account button {
  border: 0;
  background: none;
  color: #b9ad92;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
@media (orientation: portrait) {
  .home {
    --bg: url('../img/locker-tall.webp');
    padding-top: calc(28px + env(safe-area-inset-top));
  }
  .home-head {
    max-width: none;
    text-align: center;
  }
  .home .last {
    position: static;
    width: auto;
    margin-top: 22px;
  }
  .home .fuel {
    max-width: none;
  }
  .cards {
    overflow-x: auto;
    margin: 0 calc(-1 * max(24px, calc(5 * var(--vw))));
    padding: 4px max(24px, calc(5 * var(--vw))) 10px;
    scroll-snap-type: x mandatory;
  }
  .pcard {
    width: calc(38 * var(--vw));
    scroll-snap-align: start;
  }
  .pcard.small {
    width: calc(28 * var(--vw));
  }
  body:has(.page) .account {
    left: 0;
    right: 0;
    text-align: center;
  }
}
/* TODAY */
.today-page {
  --bg: url('../img/pressbox.webp');
}
.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: clamp(20px, calc(3 * var(--vw)), 44px);
  margin-top: 28px;
  align-items: start;
}
.today-page .games {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.today-page .games li {
  padding: 16px 18px;
  background: #0a0710b3;
  backdrop-filter: blur(14px);
  border: 1px solid rgb(var(--accent) / 15%);
}
.today-page .game {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  grid-template-areas: 'when match gain' 'when players gain';
  gap: 6px 14px;
  align-items: center;
}
.today-page .when {
  grid-area: when;
  font-size: 15px;
  font-weight: 700;
  color: #f3ead6;
}
.today-page .when.live {
  color: #ff6b5a;
}
.today-page .match {
  grid-area: match;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #a99e86;
}
.today-page .match b {
  color: #f3ead6;
  margin-left: 6px;
}
.today-page .players {
  grid-area: players;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.today-page .who {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px 3px 3px;
  background: #ffffff0d;
  border-radius: 999px;
  font-size: 13px;
  color: #f3ead6;
}
.today-page .who img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 20%;
}
.today-page .who.out {
  opacity: 0.6;
}
.today-page .who em {
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  color: #ff8a7a;
}
.today-page .gain {
  grid-area: gain;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgb(var(--accent));
}
.today-page .note,
.today-page .empty {
  font-size: 13px;
  color: #c9bd9d;
}
.today-page .calls {
  padding: 20px 22px;
  background: #0a0710cc;
  backdrop-filter: blur(14px);
  border: 1px solid rgb(var(--accent) / 25%);
}
.today-page .calls h4 {
  margin: 0;
  font: 500 34px / 1 'Playfair Display', Georgia, serif;
  color: rgb(var(--accent));
}
.today-page .calls .sub {
  margin: 8px 0 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
}
.today-page .calls .sub button {
  font-size: 11px;
  text-decoration: underline;
}
.today-page .call {
  margin-bottom: 18px;
}
.today-page .call p {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #a99e86;
}
.today-page .pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 6px;
}
.today-page .side {
  height: 48px;
  border: 1px solid #ffffff1f;
  background: #ffffff08;
  color: #f3ead6;
  font: 700 14px Geist, sans-serif;
  cursor: pointer;
}
.today-page .side + .side {
  border-left: 0;
}
.today-page .side.chosen {
  background: rgb(var(--accent));
  color: rgb(var(--accent-ink));
  border-color: rgb(var(--accent));
}
.today-page .side.locked::before {
  content: '🔒 ';
}
.today-page .tip {
  margin: 4px 0 0;
  font-size: 12px;
  color: #a99e86;
}
.today-page .sharp {
  margin: 0;
  padding: 0;
  list-style: none;
}
.today-page .sharp li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #ffffff14;
  font-size: 14px;
}
.today-page .back {
  display: block;
  margin: 30px auto 0;
}
@media (orientation: portrait) {
  .today-grid {
    grid-template-columns: 1fr;
  }
  .today-page header {
    text-align: center;
  }
  .today-page .game {
    grid-template-columns: 58px 1fr auto;
  }
}
/* Game result */
.game-result {
  --bg: url('../img/draft-arena-wide.webp');
  text-align: center;
  overflow-x: hidden;
}
.game-result.lost {
  --bg: url('../img/draft-arena-wide.webp');
  filter: saturate(0.75);
}
/* Reveal: the verdict slams after the count-up, the story line draws, the deciders cascade in. */
.game-result .verdict {
  animation: verdict-slam 0.55s cubic-bezier(0.2, 1.6, 0.4, 1) 1.25s both;
}
.game-result.won .verdict.w {
  text-shadow: 0 0 40px rgb(var(--accent) / 67%), 0 0 90px rgb(var(--accent) / 40%);
}
@keyframes verdict-slam {
  0% {
    opacity: 0;
    transform: scale(3.2) rotate(-8deg);
  }
  70% {
    opacity: 1;
    transform: scale(0.92) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}
.game-result .wp polyline {
  clip-path: inset(0 100% 0 0);
  animation: wp-draw 1.6s ease-out 1.6s forwards;
}
@keyframes wp-draw {
  to {
    clip-path: inset(0 0 0 0);
  }
}
.game-result .star {
  animation: star-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.game-result .star:nth-child(1) {
  animation-delay: 1.9s;
}
.game-result .star:nth-child(2) {
  animation-delay: 2.05s;
}
.game-result .star:nth-child(3) {
  animation-delay: 2.2s;
}
@keyframes star-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.94);
  }
}
.game-result .confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.game-result .confetti i {
  position: absolute;
  top: -4vh;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  background: rgb(var(--accent));
  opacity: 0;
  animation: confetti-fall 3.4s cubic-bezier(0.3, 0.2, 0.6, 1) 1.3s forwards;
}
@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0);
  }
  100% {
    opacity: 0.9;
    transform: translate3d(var(--dx, 20px), calc(110 * var(--vh)), 0) rotate(var(--r, 540deg));
  }
}
@media (prefers-reduced-motion: reduce) {
  .game-result .verdict,
  .game-result .wp polyline,
  .game-result .star,
  .game-result .confetti i {
    animation: none;
    clip-path: none;
  }
  .game-result .confetti {
    display: none;
  }
}

.game-result .kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
}
.game-result .board {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(20px, calc(4 * var(--vw)), 64px);
  margin: 18px 0 24px;
}
.game-result .side small {
  display: block;
  font: 500 clamp(22px, calc(2.6 * var(--vw)), 40px) 'Playfair Display', Georgia, serif;
}
.game-result .side b {
  display: block;
  font: 500 clamp(64px, calc(9 * var(--vw)), 150px) / 1 'Playfair Display', Georgia, serif;
}
.game-result .us {
  color: rgb(var(--accent));
}
.game-result .them {
  color: #d9d0bd;
}
.game-result .verdict {
  font: 600 clamp(40px, calc(5 * var(--vw)), 80px) 'Playfair Display', Georgia, serif;
}
.game-result .verdict.w {
  color: rgb(var(--accent));
}
.game-result .verdict.l {
  color: #ff8a7a;
}
.game-result h3 {
  max-width: 1000px;
  margin: 34px auto 12px;
}
.game-result .wp {
  display: block;
  width: min(1000px, 100%);
  height: clamp(90px, calc(14 * var(--vh)), 160px);
  margin: 0 auto;
  background: linear-gradient(180deg, rgb(var(--accent) / 7%), transparent 50%, #ff8a7a0d);
  border-top: 1px solid #ffffff14;
  border-bottom: 1px solid #ffffff14;
}
.game-result .stars {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.game-result .star {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(320px, 100%);
  padding: 10px 16px 10px 10px;
  border: 1px solid rgb(var(--accent) / 20%);
  background: #0a0710b3;
  backdrop-filter: blur(14px);
  color: #f3ead6;
  text-align: left;
  cursor: pointer;
}
.game-result .star img {
  width: 64px;
  height: 84px;
  object-fit: cover;
  object-position: 50% 20%;
}
.game-result .star b {
  display: block;
  font: 500 19px 'Playfair Display', Georgia, serif;
  color: rgb(var(--accent));
}
.game-result .star small {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #a99e86;
  text-transform: uppercase;
}
.game-result .star em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
}
.game-result .box {
  max-width: 1000px;
  margin: 28px auto 0;
  text-align: left;
}
.game-result .box summary {
  text-align: center;
  color: rgb(var(--accent));
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  list-style: none;
}
.game-result table {
  width: 100%;
  margin-top: 18px;
  border-collapse: collapse;
  font-size: 13px;
  background: #0a0710b3;
}
.game-result caption {
  text-align: left;
  padding: 10px 0;
  font: 500 20px 'Playfair Display', Georgia, serif;
  color: rgb(var(--accent));
}
.game-result th,
.game-result td {
  padding: 8px 10px;
  border-bottom: 1px solid #ffffff12;
  text-align: right;
}
.game-result th:first-child,
.game-result td:first-child {
  text-align: left;
}
.game-result th {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #a99e86;
}
.game-result .back {
  display: block;
  margin: 30px auto 0;
}
/* Player */
.player-page {
  --bg: url('../img/locker-wide.webp');
}
.player-wrap {
  display: grid;
  grid-template-columns: minmax(220px, calc(34 * var(--vw))) 1fr;
  gap: clamp(24px, calc(4 * var(--vw)), 64px);
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(calc(100 * var(--vh)) - 120px);
}
.player-art {
  aspect-ratio: 5 / 7;
  border: 1px solid #ffffff33;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 30px 80px #000c;
}
.player-art.r-legendary {
  border-color: #ffd477;
  box-shadow: 0 0 60px #ffd47755, 0 30px 80px #000c;
}
.player-art.r-epic {
  border-color: #be8aff;
}
.player-art.r-rare {
  border-color: #75b9ff;
}
.player-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.player-page .kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.28em;
}
.player-page .meta .hot {
  color: #ff9a5a;
}
.player-page .meta .cold {
  color: #7fc4ff;
}
.player-page .meta .out {
  color: #ff8a7a;
}
.pbars {
  display: grid;
  gap: 10px;
  max-width: 520px;
  margin: 26px 0;
  padding: 0;
  list-style: none;
}
.pbars li {
  display: grid;
  grid-template-columns: 110px 1fr 32px;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.pbars i {
  height: 6px;
  background: linear-gradient(90deg, rgb(var(--accent)) var(--v), #ffffff1a var(--v));
}
.pbars b {
  text-align: right;
  color: #fff;
}
.player-page .lines {
  border-collapse: collapse;
  margin-bottom: 26px;
  font-size: 13px;
}
.player-page .lines th,
.player-page .lines td {
  padding: 7px 14px 7px 0;
  border-bottom: 1px solid #ffffff14;
  text-align: right;
}
.player-page .lines td:first-child {
  text-align: left;
  color: #a99e86;
}
.player-page .lines th {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #a99e86;
}
@media (orientation: portrait) {
  .player-wrap {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .player-art {
    width: calc(62 * var(--vw));
    margin: 0 auto;
  }
  .player-info {
    text-align: center;
  }
  .pbars,
  .player-page .lines {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Draft owns the whole screen: no shell title or narrator over the pack or the board. */
body:has(#pack-overlay:not([hidden])) #title,
body:has(#pack-overlay:not([hidden])) #narrator {
  display: none;
}
/* The one-time power hint floated over the cards; the ••• button is discoverable on its own. */
body:has(.draft-board) .gesture-hint {
  display: none;
}

/* ---------- NOMAD HOOPS lockup ---------- */
.logo {
  display: grid;
  gap: 0.35em;
  pointer-events: none;
  font-size: clamp(9px, calc(1.1 * var(--vw)), 16px);
  filter: drop-shadow(0 6px 18px #000a);
}
.logo-nomad {
  display: flex;
  align-items: center;
  gap: 1.1em;
}
.logo-nomad i {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(var(--accent-lo)) 30%, rgb(var(--accent-hi)) 70%, transparent);
}
.logo-nomad span {
  font: 300 2.2em / 1 Outfit, Geist, sans-serif;
  letter-spacing: 0.55em;
  margin-right: -0.55em;
  color: transparent;
  -webkit-text-stroke: 1.1px #f4f1ea;
  text-shadow: 0 0 12px #ffffff22;
}
.logo-hoops {
  display: block;
  width: 100%;
  height: auto;
}
.home-logo {
  width: min(calc(64 * var(--vw)), 340px);
  margin: 0 auto 14px;
  font-size: clamp(8px, calc(2.4 * var(--vw)), 12px);
}
.game-result .confetti i:nth-child(1) {
  left: 33.1%;
  background: rgb(var(--accent-hi));
  --dx: -63px;
  --r: -374deg;
  animation-delay: 2.04s;
  animation-duration: 2.75s;

}
.game-result .confetti i:nth-child(2) {
  left: 57.9%;
  background: rgb(var(--second));
  --dx: 74px;
  --r: -338deg;
  animation-delay: 1.38s;
  animation-duration: 3.27s;

}
.game-result .confetti i:nth-child(3) {
  left: 25.1%;
  background: #ffffff;
  --dx: 9px;
  --r: -879deg;
  animation-delay: 1.41s;
  animation-duration: 2.96s;

}
.game-result .confetti i:nth-child(4) {
  left: 62.2%;
  background: rgb(var(--accent-lo));
  --dx: 81px;
  --r: 350deg;
  animation-delay: 2.18s;
  animation-duration: 2.67s;

}
.game-result .confetti i:nth-child(5) {
  left: 84.4%;
  background: rgb(var(--second-hi));
  --dx: -38px;
  --r: -853deg;
  animation-delay: 1.41s;
  animation-duration: 3.09s;

}
.game-result .confetti i:nth-child(6) {
  left: 80.3%;
  background: rgb(var(--accent));
  --dx: -57px;
  --r: -681deg;
  animation-delay: 1.39s;
  animation-duration: 3.74s;

}
.game-result .confetti i:nth-child(7) {
  left: 56.2%;
  background: rgb(var(--accent-hi));
  --dx: 21px;
  --r: 844deg;
  animation-delay: 1.68s;
  animation-duration: 3.10s;

}
.game-result .confetti i:nth-child(8) {
  left: 58.2%;
  background: rgb(var(--second));
  --dx: -8px;
  --r: 554deg;
  animation-delay: 2.01s;
  animation-duration: 3.72s;

}
.game-result .confetti i:nth-child(9) {
  left: 25.4%;
  background: #ffffff;
  --dx: 13px;
  --r: 651deg;
  animation-delay: 1.96s;
  animation-duration: 3.06s;

}
.game-result .confetti i:nth-child(10) {
  left: 96.1%;
  background: rgb(var(--accent-lo));
  --dx: -69px;
  --r: 468deg;
  animation-delay: 1.98s;
  animation-duration: 2.84s;

}
.game-result .confetti i:nth-child(11) {
  left: 48.9%;
  background: rgb(var(--second-hi));
  --dx: -83px;
  --r: -871deg;
  animation-delay: 1.82s;
  animation-duration: 4.00s;

}
.game-result .confetti i:nth-child(12) {
  left: 32.1%;
  background: rgb(var(--accent));
  --dx: 35px;
  --r: 893deg;
  animation-delay: 2.02s;
  animation-duration: 2.71s;

}
.game-result .confetti i:nth-child(13) {
  left: 11.0%;
  background: rgb(var(--accent-hi));
  --dx: -41px;
  --r: -362deg;
  animation-delay: 1.96s;
  animation-duration: 3.10s;

}
.game-result .confetti i:nth-child(14) {
  left: 57.5%;
  background: rgb(var(--second));
  --dx: 33px;
  --r: 591deg;
  animation-delay: 1.94s;
  animation-duration: 4.02s;

}
.game-result .confetti i:nth-child(15) {
  left: 35.3%;
  background: #ffffff;
  --dx: 79px;
  --r: 472deg;
  animation-delay: 1.85s;
  animation-duration: 3.39s;

}
.game-result .confetti i:nth-child(16) {
  left: 22.9%;
  background: rgb(var(--accent-lo));
  --dx: -38px;
  --r: -707deg;
  animation-delay: 1.65s;
  animation-duration: 3.99s;

}
.game-result .confetti i:nth-child(17) {
  left: 9.7%;
  background: rgb(var(--second-hi));
  --dx: -9px;
  --r: 440deg;
  animation-delay: 2.04s;
  animation-duration: 3.98s;

}
.game-result .confetti i:nth-child(18) {
  left: 28.7%;
  background: rgb(var(--accent));
  --dx: -15px;
  --r: 689deg;
  animation-delay: 2.16s;
  animation-duration: 2.84s;

}
.game-result .confetti i:nth-child(19) {
  left: 18.9%;
  background: rgb(var(--accent-hi));
  --dx: -48px;
  --r: -312deg;
  animation-delay: 1.74s;
  animation-duration: 3.54s;

}
.game-result .confetti i:nth-child(20) {
  left: 27.2%;
  background: rgb(var(--second));
  --dx: -89px;
  --r: 847deg;
  animation-delay: 1.63s;
  animation-duration: 3.51s;

}
.game-result .confetti i:nth-child(21) {
  left: 93.5%;
  background: #ffffff;
  --dx: 34px;
  --r: -767deg;
  animation-delay: 2.11s;
  animation-duration: 3.85s;

}
.game-result .confetti i:nth-child(22) {
  left: 86.0%;
  background: rgb(var(--accent-lo));
  --dx: 54px;
  --r: 707deg;
  animation-delay: 1.66s;
  animation-duration: 2.77s;

}
.game-result .confetti i:nth-child(23) {
  left: 62.9%;
  background: rgb(var(--second-hi));
  --dx: -79px;
  --r: -513deg;
  animation-delay: 1.70s;
  animation-duration: 2.78s;

}
.game-result .confetti i:nth-child(24) {
  left: 59.7%;
  background: rgb(var(--accent));
  --dx: -72px;
  --r: -849deg;
  animation-delay: 1.39s;
  animation-duration: 3.18s;

}
.game-result .confetti i:nth-child(25) {
  left: 4.4%;
  background: rgb(var(--accent-hi));
  --dx: 67px;
  --r: 452deg;
  animation-delay: 1.87s;
  animation-duration: 4.13s;

}
.game-result .confetti i:nth-child(26) {
  left: 59.8%;
  background: rgb(var(--second));
  --dx: -5px;
  --r: -799deg;
  animation-delay: 2.19s;
  animation-duration: 3.35s;

}
.game-result .confetti i:nth-child(27) {
  left: 48.4%;
  background: #ffffff;
  --dx: -75px;
  --r: -650deg;
  animation-delay: 1.97s;
  animation-duration: 3.37s;

}
.game-result .confetti i:nth-child(28) {
  left: 68.4%;
  background: rgb(var(--accent-lo));
  --dx: 3px;
  --r: -840deg;
  animation-delay: 1.63s;
  animation-duration: 3.70s;

}
.game-result .confetti i:nth-child(29) {
  left: 89.8%;
  background: rgb(var(--second-hi));
  --dx: 46px;
  --r: 393deg;
  animation-delay: 1.93s;
  animation-duration: 3.02s;

}
.game-result .confetti i:nth-child(30) {
  left: 37.2%;
  background: rgb(var(--accent));
  --dx: -60px;
  --r: -845deg;
  animation-delay: 1.79s;
  animation-duration: 3.40s;

}
.game-result .confetti i:nth-child(31) {
  left: 63.1%;
  background: rgb(var(--accent-hi));
  --dx: 20px;
  --r: -545deg;
  animation-delay: 2.04s;
  animation-duration: 3.78s;

}
.game-result .confetti i:nth-child(32) {
  left: 23.8%;
  background: rgb(var(--second));
  --dx: 3px;
  --r: 329deg;
  animation-delay: 2.19s;
  animation-duration: 3.86s;

}
.game-result .confetti i:nth-child(33) {
  left: 47.3%;
  background: #ffffff;
  --dx: -55px;
  --r: 757deg;
  animation-delay: 2.03s;
  animation-duration: 3.76s;

}
.game-result .confetti i:nth-child(34) {
  left: 35.6%;
  background: rgb(var(--accent-lo));
  --dx: 85px;
  --r: -525deg;
  animation-delay: 1.39s;
  animation-duration: 3.35s;

}
.game-result .confetti i:nth-child(35) {
  left: 34.4%;
  background: rgb(var(--second-hi));
  --dx: -3px;
  --r: -790deg;
  animation-delay: 2.12s;
  animation-duration: 3.15s;

}
.game-result .confetti i:nth-child(36) {
  left: 63.7%;
  background: rgb(var(--accent));
  --dx: 60px;
  --r: -697deg;
  animation-delay: 2.00s;
  animation-duration: 3.80s;

}

/* Result layout: a big verdict medal between the scores, a real chart, legible over the bright arena. */
.game-result::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 70% at 50% 20%, #0a061466, #0a0614d9 70%);
  pointer-events: none;
}
.game-result .board {
  margin: 26px 0 30px;
}
.game-result .verdict {
  display: grid;
  place-items: center;
  width: clamp(72px, calc(16 * var(--vw)), 150px);
  aspect-ratio: 1;
  border-radius: 50%;
  font: 700 clamp(44px, calc(9 * var(--vw)), 92px) / 1 'Playfair Display', Georgia, serif;
}
.game-result .verdict.w {
  color: #2a1a04;
  background: radial-gradient(circle at 32% 25%, #fff0b8, rgb(var(--accent-lo)) 55%, #8a5d17);
  box-shadow: 0 0 0 4px rgb(var(--accent) / 33%), 0 10px 40px rgb(var(--accent) / 40%);
  text-shadow: 0 1px #fff3c4;
}
.game-result .verdict.l {
  color: #ffd8d0;
  background: radial-gradient(circle at 32% 25%, #5a3a4a, #2a1824 70%);
  box-shadow: 0 0 0 3px #ff8a7a44;
}
.game-result .wp {
  height: clamp(120px, calc(18 * var(--vh)), 200px);
  padding: 8px 0;
  border-radius: 14px;
  background: #0a0816b3;
  border: 1px solid #ffffff14;
}
.game-result .wp polygon {
  opacity: 0;
  animation: wp-fill 0.8s ease 2.6s forwards;
}
@keyframes wp-fill {
  to {
    opacity: 1;
  }
}
.game-result .star {
  background: #120d22d9;
}

.player-deep {
  margin: 18px 0 28px;
  text-align: left;
}
.player-page .player-info > .quiet {
  position: static;
  display: block;
  margin: 8px auto 40px;
}

/* Roster cards: names wrap to two lines instead of truncating; position moves to a top-left badge; a 3D press. */
.pcard .pc-pos {
  top: 8px;
  bottom: auto;
  padding: 2px 6px;
  border-radius: 4px;
  background: #0009;
  font-size: 11px;
}
.pcard .pc-name {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.05;
  font-size: clamp(12px, calc(1 * var(--vw)), 14px);
  text-shadow: 0 1px 6px #000;
}
.pcard.small .pc-name {
  font-size: 11px;
}
.pcard::after {
  content: '';
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, #000d);
  pointer-events: none;
}
.pcard .pc-name,
.pcard .pc-ovr,
.pcard .pc-pos,
.pcard .form {
  z-index: 2;
}
.pcard:active {
  transform: perspective(600px) rotateX(6deg) scale(0.97);
  box-shadow: 0 6px 18px #000c;
}

/* Settings: a real page with large switches, never the bare 3D world. */
.prefs-page {
  --bg: url('../img/locker-wide.webp');
}
@media (orientation: portrait) {
  .prefs-page {
    --bg: url('../img/locker-tall.webp');
  }
}
.prefs-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top);
}
.prefs-page h3 {
  margin: 36px 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgb(var(--accent));
}
.pref-group {
  background: #0a0710c7;
  backdrop-filter: blur(14px);
  border: 1px solid rgb(var(--accent) / 15%);
  border-radius: 18px;
  overflow: hidden;
}
.pref-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 14px 20px;
  cursor: pointer;
}
.pref-row + .pref-row {
  border-top: 1px solid #ffffff12;
}
.pref-row span {
  flex: 1;
  display: grid;
  gap: 3px;
}
.pref-row b {
  font-size: 18px;
  font-weight: 600;
  color: #f4ecda;
}
.pref-row small {
  font-size: 14px;
  color: #b9ad94;
}
.pref-row input[role='switch'] {
  appearance: none;
  flex: none;
  position: relative;
  width: 56px;
  height: 34px;
  margin: 0;
  border-radius: 17px;
  background: #ffffff1f;
  box-shadow: inset 0 0 0 1px #ffffff26;
  cursor: pointer;
  transition: background .25s;
}
.pref-row input[role='switch']::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f4ecda;
  box-shadow: 0 2px 6px #0008;
  transition: transform .25s cubic-bezier(.3, 1.4, .5, 1);
}
.pref-row input[role='switch']:checked {
  background: linear-gradient(180deg, rgb(var(--accent-hi)), rgb(var(--accent-lo)));
  box-shadow: 0 0 18px rgb(var(--accent) / 40%);
}
.pref-row input[role='switch']:checked::after {
  transform: translateX(22px);
  background: #fff;
}
.pref-row input[role='switch']:focus-visible {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 3px;
}
.prefs-note {
  margin: 14px 4px 28px;
  font-size: 15px;
  color: #b9ad94;
}

/* Roster card footer: full-width name line, then position (left) and OVR (right) on one row. Nothing collides. */
.pcard .pc-pos {
  top: auto;
  bottom: 9px;
  left: 8px;
  padding: 0;
  background: none;
  font-size: 12px;
}
.pcard .pc-name {
  left: 8px;
  right: 8px;
  bottom: 36px;
  overflow-wrap: normal;
}
.pcard .pc-ovr {
  bottom: 7px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.pcard .pc-ovr small {
  display: inline;
  font-size: 10px;
}
.pcard .form {
  font-size: 11px;
  border-radius: 4px;
}
.pcard.small .pc-name {
  bottom: 32px;
}

/* Fuel: what's next, a segmented meter that reads at a glance, and one line on how it fills. */
.home .fuel small {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .22em;
  color: rgb(var(--accent));
}
.home .fuel > p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 0;
}
.home .fuel b {
  font-size: 20px;
  font-weight: 600;
  color: #f4ecda;
}
.home .fuel > p span {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  color: rgb(var(--accent));
  white-space: nowrap;
}
.fuel-cells {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.fuel-cells li {
  height: 8px;
  border-radius: 4px;
  background: #ffffff1c;
}
.fuel-cells li.on {
  background: linear-gradient(180deg, rgb(var(--accent-hi)), rgb(var(--accent-lo)));
  box-shadow: 0 0 12px rgb(var(--accent) / 40%);
}
.home .fuel .fuel-hint {
  display: block;
  margin: 8px 0 0;
  font-size: 13px;
  color: #b9ad94;
}

/* TODAY news: big nights glow gold, injuries read red. */
.today-page .note {
  font-size: 16px;
  color: #d8ccb0;
}
.today-page .note b {
  color: #f4ecda;
  font-weight: 600;
}
.today-page .note.hot strong {
  color: rgb(var(--accent));
  font-weight: 800;
}
.today-page .note.injury em {
  font-style: normal;
  font-weight: 800;
  color: #ff8a7a;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 13px;
}

/* Win-probability chart: say what it is, which side is whom, and where the quarters fall. */
.wp-caption {
  margin: -4px 0 10px;
  font-size: 14px;
  color: #b9ad94;
}
.wp-frame {
  position: relative;
}
.wp-y {
  position: absolute;
  left: 12px;
  z-index: 1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #f4ecdacc;
  pointer-events: none;
}
.wp-y.top {
  top: 10px;
}
.wp-y.bottom {
  bottom: 34px;
  color: #b9ad94;
}
.wp-x {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  color: #b9ad94;
  text-align: center;
}
.wp-x li + li {
  border-left: 1px solid #ffffff1a;
}
.wp-y {
  padding: 3px 8px;
  border-radius: 6px;
  background: #07050cd9;
}
.game-result .wp-caption {
  text-align: left;
}

/* Score bug at broadcast size: legible on a phone at arm's length. */
.bug {
  min-width: 0;
  padding: 10px 14px 8px;
  border-radius: 10px;
  background: #07050cd9;
  backdrop-filter: blur(10px);
  border: 1px solid rgb(var(--accent) / 20%);
}
.bug-clock {
  font-size: 11px;
  color: rgb(var(--accent));
  letter-spacing: .2em;
}
.bug-team {
  grid-template-columns: 2.6em 2.2em auto;
  gap: 10px;
}
.bug-team abbr {
  font-size: 15px;
}
.bug-team strong {
  font: 700 24px/1 Oswald, Geist, sans-serif;
  font-variant-numeric: tabular-nums;
}
.edge-chip {
  font-size: 11px;
  border-radius: 4px;
  padding: 2px 6px;
}

/* Tunnel seats: readable names (first name, one line), inviting open seats. */
.tunnel .seat-name {
  left: 6px;
  right: 6px;
  font-size: clamp(11px, calc(0.9 * var(--vw)), 13px);
  letter-spacing: .06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tunnel .seat.open {
  border: 1.5px dashed rgb(var(--accent) / 50%);
  background: rgb(var(--accent) / 3%);
}
.tunnel .seat.open button {
  display: grid;
  place-content: center;
  gap: 2px;
  line-height: 1;
}
.tunnel .seat.open button small {
  font: 700 10px Geist, sans-serif;
  letter-spacing: .16em;
  color: rgb(var(--accent) / 70%);
}

/* Player page: deep stats made the info column tall; the card stays pinned beside the name. */
@media (orientation: landscape) {
  .player-wrap {
    align-items: start;
  }
  .player-art {
    position: sticky;
    top: max(28px, calc(5 * var(--vh)));
  }
}
.today-page .calls-why {
  margin: 8px 0 14px;
  font-size: 14px;
  line-height: 1.45;
  color: #b9ad94;
}
.game-result .wp-frame,
.game-result .wp-caption {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

/* Team colour picker: two-tone swatches, the chosen one lifted and ringed. */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 10px;
}
.theme-chip {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border: 1px solid #ffffff1a;
  border-radius: 14px;
  background: #0a0710c7;
  color: #d8ccb0;
  font: 700 13px Geist, sans-serif;
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.theme-chip i {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%);
  box-shadow: 0 2px 8px #0008, inset 0 0 0 1px #fff3;
}
.theme-chip.chosen {
  border-color: rgb(var(--accent));
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgb(var(--accent) / 35%);
}
.theme-chip:active {
  transform: scale(.95);
}

/* Non-Lakers themes: the purple-and-gold photo backdrops fall back to near-neutral with a wash of team colour. */
.page::before {
  filter: saturate(var(--bg-sat, 1));
}
html[data-theme]:not([data-theme='LAL']) .page::after {
  background: radial-gradient(ellipse 90% 60% at 50% 0%, rgb(var(--accent) / 18%), transparent 70%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgb(var(--second) / 14%), transparent 70%),
    linear-gradient(180deg, #0008 0%, #0004 40%, #000c 100%);
}

/* One quiet way into Settings from the locker room. */
.settings-gear {
  position: fixed;
  z-index: 21;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid #ffffff1f;
  border-radius: 50%;
  background: #0a0710b3;
  backdrop-filter: blur(10px);
  color: #e9dfc6;
  cursor: pointer;
}
.settings-gear svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.settings-gear:active {
  transform: scale(.94);
}
.pref-signout {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid #ff8a7a66;
  border-radius: 22px;
  background: none;
  color: #ff9a8c;
  font: 600 15px Geist, sans-serif;
  cursor: pointer;
}
.theme-pick summary {
  display: block;
  list-style: none;
  cursor: pointer;
}
.theme-pick summary::-webkit-details-marker {
  display: none;
}
.theme-pick .theme-dot {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgb(var(--accent)) 50%, rgb(var(--second)) 50%);
  box-shadow: inset 0 0 0 1px #fff3;
}
.theme-pick em {
  font-style: normal;
  font-weight: 700;
  color: rgb(var(--accent));
}
.theme-pick[open] em {
  visibility: hidden;
}
.theme-pick .theme-grid {
  margin-top: 12px;
}
@media (orientation: landscape) {
  .home .last {
    right: calc(max(24px, calc(5 * var(--vw))) + 60px);
  }
}

/* Type floor: nothing a player needs to read renders under 12px. */
.home .last small,
.pcard .pc-ovr small,
.pcard .form,
.today-page .calls .sub,
.today-page .calls .sub .quiet,
.today-page .call > p,
.game-result .side small,
.game-result .star small,
.game-result th,
.player-page th,
.bug-clock,
.edge-chip,
.tunnel .meta {
  font-size: max(12px, 1em) !important;
}
.today-page .call > p,
.today-page .calls .sub {
  font-size: 13px !important;
}
.tunnel .meta {
  font-size: 13px !important;
}
.tunnel .seat.open button small {
  font-size: 11px;
}

/* ══ Integrated UI (Jack 2026-11-02): no filled pills, bordered cards or object buttons. Type sits in the scene;
   panels become gradient scrims; lists become hairline rows; the main action is big accent words with an arrow. ══ */
.primary,
.page button.primary,
.tunnel button.primary,
.home .last button.primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: auto;
  min-height: 48px;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: rgb(var(--accent));
  font: 700 17px/1.2 Geist, sans-serif;
  letter-spacing: .16em;
  text-shadow: 0 2px 18px rgb(var(--accent) / 35%);
}
.primary::after {
  content: '→';
  letter-spacing: 0;
  transition: transform .2s;
}
.primary:hover,
.tunnel button.primary:hover {
  background: none;
  box-shadow: none;
  color: rgb(var(--accent-hi));
}
.primary:hover::after { transform: translateX(4px); }
.primary:active { transform: translateY(1px); }
/* Home: the last game reads as a caption in the corner, not a card. */
.home .last {
  border: 0;
  background: none;
  backdrop-filter: none;
  padding: 0;
  text-align: right;
}
.home .last p { font-size: 18px; }
@media (orientation: portrait) {
  .home .last { text-align: left; }
}
/* TODAY: rows on hairlines; CALLS as a quiet column with word-sides. */
.today-page .games li,
.today-page .calls {
  background: none;
  backdrop-filter: none;
  border: 0;
  border-radius: 0;
}
.today-page .games { gap: 0; }
.today-page .games li { padding: 16px 2px; border-bottom: 1px solid #ffffff17; }
.today-page .who { background: none; padding: 0 10px 0 0; }
.today-page .calls { padding: 0; }
.today-page .side {
  background: none;
  border: 0;
  border-bottom: 1px solid #ffffff1c;
  border-radius: 0;
  color: #f4ecdacc;
}
.today-page .side + .side { border-left: 1px solid #ffffff12; }
.today-page .side.chosen {
  background: none;
  color: rgb(var(--accent));
  border-bottom: 2px solid rgb(var(--accent));
}
/* Settings: hairline rows like Nomad-mon's setRow; swatches without boxes. */
.pref-group {
  background: none;
  backdrop-filter: none;
  border: 0;
  border-radius: 0;
  border-top: 1px solid #ffffff17;
}
.pref-row { padding: 14px 0; border-bottom: 1px solid #ffffff17; }
.pref-row + .pref-row { border-top: 0; }
.theme-chip { background: none; border: 0; padding: 8px 0; }
.theme-chip.chosen { box-shadow: none; transform: none; color: rgb(var(--accent)); }
.theme-chip.chosen i { box-shadow: 0 0 0 2px #05060b, 0 0 0 4px rgb(var(--accent)); }
.pref-signout { border: 0; padding: 10px 0; }
.settings-gear { background: none; border: 0; backdrop-filter: none; }
/* A soft shaped scrim (not a button) so the gear still reads when cards scroll under it. */
.settings-gear { background: radial-gradient(closest-side, #000b, #0006 60%, transparent); }
/* Game result: who decided it as rows, the chart as a bare line over the scene. */
.game-result .star {
  background: none;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid #ffffff17;
}
.game-result .wp { background: none; border: 0; }
/* Score bug: a corner scrim instead of a box. */
.bug {
  border: 0;
  border-radius: 0;
  background: radial-gradient(ellipse 120% 120% at 0% 0%, #05060be6 40%, transparent 75%);
  backdrop-filter: none;
  padding: 12px 40px 22px 16px;
}
.edge-chip { border: 0; padding: 0; color: rgb(var(--accent-hi)); }
/* Text-heavy pages: a deeper scrim so rows stay legible over the bright parts of the photo. */
.today-page::after,
.prefs-page::after,
.player-page::after {
  background: linear-gradient(180deg, #000a 0%, #000c 35%, #000000e0 100%);
}
.today-page .game { grid-template-columns: 84px 1fr auto; }
.today-page .when { white-space: nowrap; font-size: 17px; }
/* Fix: the OVR label is a small caption, not 1em of the big number. */
.pcard .pc-ovr small { font-size: 12px !important; letter-spacing: .12em; }
/* Desktop home: logo anchors the left column above the team name; last game owns the right. */
@media (orientation: landscape) {
  .home .home-logo { width: 260px; margin: 0 0 6px; font-size: 9px; }
}
/* Chart side labels: plain words on the scene, no pills. */
.wp-y {
  background: none;
  padding: 0;
  color: #f4ecdab3;
  text-shadow: 0 1px 8px #000;
}
.wp-y.bottom { color: #9fb0ff; }
.wp-frame { border: 0; }
/* Quarter ticks without words. */
.wp-x { margin-top: 0; height: 8px; }
.wp-x li { border-left: 1px solid #ffffff1f; }
.wp-x li:first-child { border-left: 0; }
.game-result .stars { margin-top: 26px; }
/* Tunnel: open seats are lit silhouettes, not dashed boxes; the fallback is quiet words. */
.tunnel .seat.open {
  border: 0;
  background: linear-gradient(180deg, rgb(var(--accent) / 12%), rgb(var(--accent) / 2%) 70%);
  box-shadow: inset 0 1px 0 rgb(var(--accent) / 35%);
}
.tunnel .seat.open:hover { background: linear-gradient(180deg, rgb(var(--accent) / 20%), rgb(var(--accent) / 4%) 70%); }
.tunnel button.quiet {
  text-decoration: none;
  color: #ffffff9c;
  letter-spacing: .02em;
}
.tunnel button.quiet:hover { color: #fff; }
/* Typography: headings balance their lines, text never leaves a lone word behind; numbers line up. */
h1, h2, h3, h4, .stats-header h2 { text-wrap: balance; }
p, li, small, figcaption, .stats-why, .fuel-hint { text-wrap: pretty; }
body { font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
/* Stats sheet rhythm: a label sits tight on its number; sections breathe. */
.stats-section { margin-top: 30px; padding-top: 26px; }
.stats-section h3 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #ffffffa8;

}
.stats-tiles { gap: 22px 16px; }
.stats-tiles span { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: #ffffff9a; }
.stats-tiles b { line-height: 1.05; margin: 4px 0 2px; }
.stats-shooting-row { margin-bottom: 16px; row-gap: 3px; }
.stats-scoring { margin-top: 18px; color: rgb(var(--accent-hi)); font-weight: 500; }
.stats-zones b { line-height: 1.15; margin: 4px 0 0; }
.stats-zones span { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: #ffffff9a; }
.stats-court path[stroke] { stroke-opacity: .55; }
.focus-stats .stats-shot-lab, .stats-shot-lab { color: rgb(var(--accent)); }
.stats-court.is-empty { opacity: .4; }
.game-result details.box summary {
  text-decoration: none;
  color: #ffffffb0;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 13px;

}
/* Ambience: every backdrop drifts like a slow camera move; light shafts sweep; dust floats in the light. */
.page::before, .tunnel .scene { animation: bg-drift 46s ease-in-out infinite alternate; will-change: transform; }
@keyframes bg-drift {
  0% { transform: scale(1.06) translate3d(-1.2%, 0.6%, 0); }
  50% { transform: scale(1.1) translate3d(0.8%, -0.8%, 0); }
  100% { transform: scale(1.07) translate3d(1.4%, 0.4%, 0); }
}
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.tunnel .ambient { z-index: 0; }
.ambient canvas { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: screen; opacity: .8; }
.ambient .shaft {
  position: absolute; top: -20%; width: 34vmax; height: 140%; transform-origin: 50% 0;
  background: linear-gradient(180deg, rgb(255 236 200 / 22%), rgb(255 236 200 / 7%) 45%, transparent 75%);
  clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%);
  mix-blend-mode: screen; filter: blur(14px);
  animation: shaft-sweep 19s ease-in-out infinite alternate, shaft-breathe 7s ease-in-out infinite alternate;
}
.ambient .s1 { left: 6%; animation-duration: 21s, 8s; }
.ambient .s2 { left: 38%; animation-delay: -7s, -3s; animation-duration: 25s, 6.5s;
  background: linear-gradient(180deg, rgb(var(--second) / 18%), rgb(var(--second) / 5%) 45%, transparent 75%); }
.ambient .s3 { left: 68%; animation-delay: -12s, -5s; animation-duration: 17s, 9s; }
@keyframes shaft-sweep { from { transform: rotate(-11deg); } to { transform: rotate(11deg); } }
@keyframes shaft-breathe { from { opacity: .45; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .page::before, .tunnel .scene { animation: none; }
}
/* ---------- TONIGHT, art-first: full-bleed bands, card art melting into a shaped scrim ---------- */
.today-page .games { display: grid; gap: 14px; }
.today-page .games li.band {
  position: relative; display: grid; grid-template-columns: 48% 1fr; align-items: center;
  min-height: 172px; padding: 0; margin: 0 calc(-1 * max(24px, calc(5 * var(--vw)))); border: 0; overflow: hidden;
  background: linear-gradient(90deg, rgb(var(--accent) / 9%), transparent 70%);
}
.band-art {
  position: relative; align-self: stretch; min-height: 172px;
  clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%);
}
.band-art img {
  position: absolute; top: 0; height: 100%; object-fit: cover; object-position: 50% 16%;
  z-index: calc(3 - var(--i));
  -webkit-mask-image: linear-gradient(90deg, #000 62%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 62%, transparent 100%);
}
.band-art.n1 img { left: 0; width: 100%; }
.band-art.n2 img { width: 66%; left: calc(var(--i) * 34%); }
.band-art.n3 img { width: 54%; left: calc(var(--i) * 23%); }
.band-art img.out { filter: grayscale(1) brightness(.6); }
/* The diagonal edge catches a sliver of light, so the art reads as a shaped panel, not a box. */
.band-art::after {
  content: ''; position: absolute; inset: 0; z-index: 4;
  background: linear-gradient(90deg, transparent 55%, #05060bb3 100%),
    linear-gradient(0deg, #05060b99, transparent 40%);
}
.today-page li.band::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 48%; width: 1px; z-index: 5;
  background: linear-gradient(180deg, transparent, rgb(var(--accent) / 70%), transparent);
  transform: translateX(-10%) skewX(-6.5deg); transform-origin: top;
}
.band-text { position: relative; z-index: 6; padding: 18px max(24px, calc(5 * var(--vw))) 18px 18px; display: grid; gap: 5px; }
.band-text .when { font: 500 34px/1 Oswald, sans-serif; color: #fff; letter-spacing: .01em; white-space: nowrap; }
.band-text .when.live { color: #ff5d6c; }
.band-text .match {
  font: 600 12px Geist, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #ffffff8c;

}
.band-text .match b { color: #fff; }
.band-text .names { display: flex; flex-wrap: wrap; gap: 0 10px; font: 500 17px/1.3 Geist, sans-serif; color: #f4ecda; }
.band-text .names .out { color: #ffffff70; }
.band-text .names em { font-style: normal; font-size: 12px; letter-spacing: .1em; color: #ff8a98; }
.band-text .gain {
  margin-top: 4px;
  font: 600 13px Geist, sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgb(var(--accent));

}
.band-text .big { font: 500 56px/0.9 Oswald, sans-serif; color: rgb(var(--accent)); }
.band-text .big small { font-size: 16px; letter-spacing: .14em; margin-left: 6px; color: rgb(var(--accent) / 75%); }
.band-text .status {
  font: 600 13px Geist, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #ff8a98;

}
.band-text .status::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 8px 1px 0;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;

}
/* CALLS: words, not a spreadsheet. */
.today-page .pair { display: flex; gap: 28px; margin: 0 0 4px; }
.today-page .side, .today-page .side + .side {
  flex: none; height: auto; padding: 8px 0; border: 0; border-bottom: 2px solid transparent;
  font: 500 21px Oswald, sans-serif; letter-spacing: .02em; color: #f4ecdacc;
}
.today-page .side.chosen { border-bottom-color: rgb(var(--accent)); color: rgb(var(--accent)); }
.today-page .call { margin-bottom: 24px; }
.today-page .calls .sub button { text-decoration: none; }
@media (orientation: landscape) and (min-width: 900px) {
  .today-page .games li.band { margin: 0; border-radius: 0; }
}
.today-page .games li.band { grid-template-areas: none; gap: 0; }
.band-text > * { grid-area: auto !important; }
.band-text .when { font-size: 34px; }
/* ---------- HOME, art-first: small brand, one result line, the players big ---------- */
.home .home-logo { width: min(calc(40 * var(--vw)), 190px); margin: 0 auto 6px; }
/* Landscape/tablet: the logo sits on the left column with the team name, not alone at page centre. */
@media (orientation: landscape) { .home .home-logo { margin: 0 0 6px; } }
.home .last { margin-top: 18px; text-align: center; }
.home .last-row {
  display: inline-flex; align-items: baseline; gap: 10px; flex-wrap: wrap; justify-content: center;
  padding: 8px 0; border: 0; background: none; color: #f4ecdacc; font: 400 18px Geist, sans-serif; cursor: pointer;
}
.home .last-row b { font: 500 22px Oswald, sans-serif; letter-spacing: .02em; }
.home .last-row b.w { color: rgb(var(--accent)); }
.home .last-row b.l { color: #ff8a98; }
.home .last-row span {
  font: 600 13px Geist, sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgb(var(--accent));

}
.home h3 { font-size: 12px; letter-spacing: .26em; color: #ffffff80; margin: 30px 0 12px; }
.home h3::after { display: none; }
.home .pcard { border: 0; border-radius: 4px; box-shadow: 0 24px 50px #000c, 0 0 0 1px #ffffff14; }
@media (orientation: portrait) {
  .home .starters .pcard { width: calc(60 * var(--vw)); }
  .home .bench .pcard { width: calc(34 * var(--vw)); }
  .home .starters { gap: 14px; }
}
@media (orientation: landscape) {
  .home .starters .pcard { width: clamp(150px, calc(16 * var(--vw)), 240px); }
}
/* GAME RESULT deciders as art bands (same language as Tonight). */
.game-result .stars { display: grid; gap: 12px; margin: 26px calc(-1 * max(24px, calc(5 * var(--vw)))) 0; }
.game-result .stars .band.decider {
  position: relative; display: grid; grid-template-columns: 46% 1fr; align-items: center; min-height: 150px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  text-align: left;
  overflow: hidden;
  color: inherit;
  cursor: pointer;
  background: linear-gradient(90deg, rgb(var(--accent) / 9%), transparent 70%);
}
.game-result .stars .band-art { min-height: 150px; }
.game-result .stars .band-text .who { font: 500 22px/1.1 'Playfair Display', Georgia, serif; color: #fff; }
.game-result .stars .band-text .big { font-size: 46px; }
@media (orientation: landscape) and (min-width: 700px) {
  .game-result .stars { grid-template-columns: repeat(3, 1fr); margin: 26px 0 0; }
  .game-result .stars .band.decider { grid-template-columns: 1fr; min-height: 0; }
  .game-result .stars .band-art { min-height: 220px; clip-path: none; }
  .game-result .stars .band-art img {
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
  mask-image: linear-gradient(180deg, #000 55%, transparent);

}
  .game-result .stars .band-text { margin-top: -60px; }
}
/* Landscape phones: three short bands side by side instead of one narrow column of wrapped names. */
@media (orientation: landscape) and (max-height: 520px) {
  .game-result .stars .band-art { min-height: 170px; }
  .game-result .stars .band.decider .band-text { margin-top: -50px; padding: 10px 12px 12px; }
  .game-result .stars .band-text .who { font-size: 19px; }
  .game-result .stars .band-text .big { font-size: 38px; }
}
.game-result .wp-frame, .game-result .wp { border: 0 !important; box-shadow: none !important; background: none !important; }
/* PLAYER: the art is the hero. Phones: full-bleed, fading into the page; desktop: tall, unframed, soft edge. */
.player-page .player-art.hero-art {
  border: 0; box-shadow: none; background: none; padding: 0; border-radius: 0; outline: 0;
}
.player-page .player-art.hero-art img {
  border: 0; border-radius: 0; box-shadow: none;
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 62%, transparent 100%);
}
.player-page .player-art.hero-art::before, .player-page .player-art.hero-art::after { display: none; }
@media (orientation: portrait) {
  .player-page { padding-top: 0; }
  .player-page .player-art.hero-art { width: auto; max-width: none; margin: 0 calc(-1 * max(24px, calc(5 * var(--vw)))); aspect-ratio: 4 / 4.6; overflow: hidden; }
  .player-page .player-art.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
  .player-page .player-info { margin-top: -90px; position: relative; }
}
.game-result .decider { animation: star-in .6s cubic-bezier(.2,.9,.3,1) both; }
.game-result .decider:nth-child(1) { animation-delay: 1.9s; }
.game-result .decider:nth-child(2) { animation-delay: 2.05s; }
.game-result .decider:nth-child(3) { animation-delay: 2.2s; }
.band-text .big { white-space: nowrap; }
.game-result .band.decider .band-text { display: grid; gap: 4px; padding: 16px max(24px, calc(5 * var(--vw))) 16px 18px; }
.game-result .band.decider .match { white-space: normal; }
/* The line breaks between team and numbers, never inside "7 REB". */
.game-result .band.decider .match > span { white-space: nowrap; }
@media (orientation: portrait) {
  .game-result .stars { max-width: none; width: auto; }
  .game-result .stars .band.decider { grid-template-columns: 50% 1fr; min-height: 170px; }
  .game-result .stars .band-art { min-height: 170px; }
  .game-result .stars .band-text .who { font-size: 19px; }
}
@media (orientation: portrait) {
  .game-result .stars { margin-left: 0; margin-right: 0; grid-template-columns: 1fr; }
  .game-result .stars .band.decider { width: 100%; max-width: none; justify-self: stretch; }
}
/* Arrivals: pages fade in with a slight focus pull; images fade up once decoded. */
/* backwards, not both: a kept transform/filter would make the page the containing block of its fixed ::before/::after,
   so the photo backdrop scrolled away after one screen (the lit band then black on long pages). */
.page { animation: page-in .7s cubic-bezier(.2,.7,.2,1) backwards; }
@keyframes page-in { from { opacity: 0; filter: blur(8px); transform: scale(1.012); } to { opacity: 1; filter: none; transform: none; } }
.page img { transition: opacity .6s ease; }
.page img.img-wait, .tunnel img.img-wait { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .page { animation: none; } }
/* No widows: short notes and captions never end on one lonely word. */
.page p, .page figcaption { text-wrap: pretty; }
@media (orientation: landscape) and (max-height: 560px) {
  .home .home-logo { width: 150px; margin: 0 0 4px; }
  .home .last { position: static; width: auto; text-align: left; margin-top: 6px; }
  .home .last-row { justify-content: flex-start; padding: 4px 0; }
  /* Bench cards are thumb-sized here: the bare number reads, "OVR" only collided with the position. */
  .home .bench .pcard .pc-ovr small { display: none; }
}
.court-veil {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  pointer-events: none;
  animation: court-veil 1.1s cubic-bezier(.4,0,.2,1) both;

}
@keyframes court-veil { from { opacity: 1; } 25% { opacity: 1; } to { opacity: 0; } }
/* Mid-draft guidance on home: one obvious way back. */
.home .draft-live {
  display: grid; gap: 4px; justify-items: start; margin: 22px 0 6px; padding: 18px 0; border: 0; background: none;
  color: #fff; text-align: left; cursor: pointer;
}
.home .draft-live small { font: 600 12px Geist, sans-serif; letter-spacing: .26em; color: rgb(var(--accent)); }
.home .draft-live b { font: 500 clamp(30px, calc(4 * var(--vw)), 44px)/1.05 'Playfair Display', Georgia, serif; }
.home .draft-live span { font: 600 14px Geist, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: rgb(var(--accent)); }
.home .draft-live .dots { display: flex; gap: 7px; margin-top: 8px; }
.home .draft-live .dots em { width: 9px; height: 9px; border-radius: 50%; background: #ffffff30; }
.home .draft-live .dots em.on { background: rgb(var(--accent)); }
@media (orientation: portrait) { .home .draft-live { justify-items: center; text-align: center; margin-inline: auto; } }
/* PLAYER, landscape/tablet: the art is a full-height hero bleeding off the left edge, melting into the page. */
@media (orientation: landscape) {
  .player-page { padding-top: 0; }
  .player-page::after { background: linear-gradient(90deg, #0000 0%, #0008 38%, #000d 62%) !important; }
  .player-page .player-wrap { grid-template-columns: minmax(320px, calc(40 * var(--vw))) 1fr; gap: clamp(24px, calc(3 * var(--vw)), 56px); align-items: start; }
  .player-page .player-art.hero-art {
    position: sticky; top: 0; width: auto; max-width: none; height: calc(100 * var(--vh)); margin: 0 0 0 calc(-1 * max(24px, calc(5 * var(--vw))));
    aspect-ratio: auto; overflow: hidden;
  }
  .player-page .player-art.hero-art img {
    width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%;
    -webkit-mask-image: linear-gradient(90deg, #000 62%, transparent 100%),
    linear-gradient(180deg, #000 70%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 62%, transparent 100%),
    linear-gradient(180deg, #000 70%, transparent 100%);
    -webkit-mask-composite: source-in; mask-composite: intersect;
  }
  .player-page .player-info { padding-top: max(36px, calc(6 * var(--vh))); }
}
/* TONIGHT, landscape/tablet: games take the stage, CALLS sit close beside — no dead middle. */
@media (orientation: landscape) and (min-width: 900px) {
  .today-page .today-grid { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: clamp(28px, calc(4 * var(--vw)), 72px); max-width: 1500px; }
  .today-page .games li.band { margin: 0; min-height: 210px; }
  .today-page .band-art { min-height: 210px; }
  .today-page .band-text .when { font-size: 44px; }
  .today-page .band-text .names { font-size: 20px; }
}
.tunnel button.primary + button.quiet { margin-left: 22px; }
@media (orientation: portrait) { .tunnel button.primary + button.quiet { margin-left: 0; } }
/* Landscape phones: the logo sits small in the corner and the copy below it, never on top of the heading. */
@media (orientation: landscape) and (max-height: 520px) {
  .tunnel .brand { width: 150px; top: 12px; }
  .tunnel .copy { top: calc(50% + 34px); }
  .tunnel h2 { font-size: 44px; margin-bottom: 8px; }
  .tunnel .meta { margin-bottom: 12px; }
  .tunnel .seat { width: 58px; }
  .tunnel .seats { margin-bottom: 14px; }
  .tunnel button.primary { font-size: 14px; }
}
/* Scaled DOM pages on big tablets (set by uiZoom in main.js); the 3D canvases are untouched. */
/* Under zoom, vw/vh still measure the real viewport and are then zoomed too (10vw rendered as 15.6vw on the Tab),
   so page CSS uses --vw/--vh: one viewport percent, whatever the zoom. Outside pages they are plain vw/vh. */
:root { --vw: 1vw; --vh: 1vh; }
.page { zoom: var(--ui-zoom, 1); --vw: calc(1vw / var(--ui-zoom, 1)); --vh: calc(1vh / var(--ui-zoom, 1)); }
.settings-gear { transition: opacity .25s ease, transform .25s ease; }
.settings-gear.is-tucked { opacity: 0; transform: translateY(-12px); pointer-events: none; }
/* Team names sit below the seat art; reserve two lines before the next action or row. */
.tunnel .seats { row-gap: 54px; margin-bottom: 64px; }
.tunnel .seat { overflow: visible; }
.tunnel .seat-name {
  top: calc(100% + 10px);
  bottom: auto;
  left: -4px;
  right: -4px;
  padding: 0;
  color: rgb(var(--accent));
  font-size: clamp(10px, calc(.9 * var(--vw)), 12px);
  letter-spacing: .025em;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tunnel .seat-name.long { font-size: clamp(9px, calc(.8 * var(--vw)), 11px); letter-spacing: .01em; }

.court-final .official-fantasy { margin: 12px 0 20px; text-align: center; }
.court-final .official-fantasy small { display: block; font-size: 10px; letter-spacing: .18em; opacity: .65; }
.court-final .official-fantasy b { display: block; margin-top: 6px; font-size: 24px; font-weight: 500; }
