/* Hooplytix — the possession page */

main.possession { position: relative; z-index: 2; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-content: start;
  padding: 23vh max(20px, 4vw) 0;
}
.hero-in { width: var(--shell); margin: 0 auto; }

.hero h1 {
  font-size: clamp(42px, 7.4vw, 104px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.93;
  max-width: 14ch;
  text-shadow: 0 18px 60px rgba(9, 11, 16, 0.75);
}
.hero p.lede {
  margin-top: 22px;
  font-size: clamp(16px, 1.55vw, 19px);
  color: var(--chalk-2);
  max-width: 48ch;
}
.hero-actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }

.facts {
  display: flex;
  gap: 40px;
  margin-top: 48px;
  flex-wrap: wrap;
}
.facts div { display: grid; gap: 2px; }
.facts b { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.facts span { font-size: 13px; color: var(--chalk-2); }

.cue {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--chalk-2);
  display: grid;
  justify-items: center;
  gap: 6px;
}
.cue i {
  width: 1px; height: 26px;
  background: linear-gradient(180deg, transparent, var(--leather));
  animation: drop 1.9s ease-in-out infinite;
}
@keyframes drop { 0%, 100% { transform: scaleY(0.35); opacity: 0.4; } 45% { transform: scaleY(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cue i { animation: none; } }

/* ---------- the stops ---------- */
.stop {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 6vh max(20px, 4vw);
}
.stop-in > *, .exhibit, .exhibit > div { min-width: 0; }

.stop-in {
  width: var(--shell);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5vw;
  align-items: center;
}
.stop .copy { grid-column: 2; }             /* ball bounces left  */
.stop.flip .copy { grid-column: 1; grid-row: 1; }  /* ball bounces right */

.copy {
  border-left: 2px solid var(--line-soft);
  padding-left: 26px;
  opacity: 0.32;
  filter: saturate(0.4);
  transition: opacity 0.5s ease, filter 0.5s ease, border-color 0.5s ease;
}
.stop.live .copy { opacity: 1; filter: none; border-left-color: var(--leather); }
@media (prefers-reduced-motion: reduce) { .copy { opacity: 1; filter: none; } }

.clock {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.clock b {
  font-weight: 700;
  font-size: 12px;
  color: #14202E;
  background: var(--leather);
  border-radius: var(--r-sm);
  padding: 3px 9px;
}
.clock span { font-size: 13px; color: var(--chalk-2); }

.copy h2 {
  font-size: clamp(28px, 3.2vw, 42px);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.copy p { color: var(--chalk-2); font-size: 16.5px; }
.copy p + p { margin-top: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0; }

/* exhibits — the data that sits beside each claim */
.exhibit {
  margin-top: 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--ink-700);
  padding: 16px 18px;
}
.exhibit h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--chalk);
  margin-bottom: 14px;
}

.row-stats { display: flex; gap: 30px; flex-wrap: wrap; margin-top: 22px; }
.row-stats div { display: grid; gap: 1px; }
.row-stats b { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.row-stats span { font-size: 12.5px; color: var(--chalk-2); }

/* compact player table */
table.mini { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.mini th {
  text-align: right;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--chalk-2);
  padding: 0 0 10px;
}
table.mini th:first-child, table.mini td:first-child { text-align: left; }
table.mini td { padding: 7px 0 7px 10px; border-top: 1px solid var(--line-soft); text-align: right; }
table.mini th + th, table.mini td + td { padding-left: 12px; }
table.mini td:first-child { padding-left: 0; }
table.mini td.idx { color: var(--leather); font-weight: 700; }

/* lineup bars */
.lu { display: grid; gap: 10px; }
.lu-row { display: grid; grid-template-columns: 1fr 108px 44px; gap: 12px; align-items: center; font-size: 13px; }
.lu-bar { height: 8px; background: var(--ink-600); border-radius: 4px; position: relative; overflow: hidden; }
.lu-bar i { position: absolute; top: 0; bottom: 0; left: 50%; border-radius: 4px; }
.lu-row b { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* index breakdown */
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 12px; font-size: 12.5px; color: var(--chalk-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; }

/* custom event rule */
pre.rule {
  margin: 0;
  font-family: "DM Sans", monospace;
  font-size: 13px;
  line-height: 1.8;
  color: var(--chalk-2);
  white-space: pre-wrap;
}
pre.rule .k { color: var(--s4); font-weight: 700; }
pre.rule .s { color: var(--s3); }
pre.rule .c { color: var(--chalk-2); }

.evt { display: grid; gap: 8px; margin-top: 14px; }
.evt-row { display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; align-items: baseline; font-size: 13px; }
.evt-row .stamp { font-size: 11.5px; }
.evt-row em { font-style: normal; color: var(--chalk); }
.evt-row .v { color: var(--s3); font-weight: 600; font-variant-numeric: tabular-nums; }
.evt-row.tagged em::after {
  content: attr(data-tag);
  margin-left: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--s4);
  border: 1px solid rgba(144, 133, 233, 0.45);
  border-radius: 3px;
  padding: 1px 5px;
}

/* ---------- outro: the basket owns the middle, the ask sits to the right ---------- */
.outro {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: calc(64px + 4vh) max(20px, 4vw) 6vh;
}
.outro-in {
  width: var(--shell);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 5vw;
}
.outro-in > div { grid-column: 2; }
.scoreline {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 22px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.outro.scored .scoreline { opacity: 1; transform: none; }
.scoreline b {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.scoreline b:first-child { color: var(--leather-hi); }
.scoreline span {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--chalk-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
}
@media (prefers-reduced-motion: reduce) { .scoreline { opacity: 1; transform: none; } }

.outro h2 { font-size: clamp(32px, 4.2vw, 56px); max-width: 14ch; }
.outro p { margin: 18px 0 0; color: var(--chalk-2); }

/* ---------- narrow ---------- */
@media (max-width: 900px) {
  .hero { padding-top: 13vh; }
  .cue { left: max(20px, 4vw); transform: none; justify-items: start; text-align: left; }
  .outro-in { grid-template-columns: 1fr; }
  .outro { align-items: end; }
  .outro-in > div {
    grid-column: 1;
    background: rgba(8, 12, 22, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-lg);
    padding: 20px;
  }
  .stop-in > *, .exhibit, .exhibit > div { min-width: 0; }

.stop-in { grid-template-columns: 1fr; gap: 0; }
  .stop .copy, .stop.flip .copy { grid-column: 1; }
  .stop { align-items: end; padding-bottom: 8vh; }
  .copy {
    background: rgba(8, 12, 22, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line-soft);
    border-left: 2px solid var(--line-soft);
    border-radius: var(--r-lg);
    padding: 20px;
  }
  .lu-row { grid-template-columns: 1fr 72px 40px; }
  .hero h1 { font-size: clamp(36px, 10vw, 60px); }
  .facts { gap: 16px 28px; margin-top: 26px; }
  .facts b { font-size: 21px; }
  .copy h2 { font-size: clamp(26px, 8vw, 36px); }
  .copy p { font-size: 15.5px; }
  table.mini { font-size: 12px; }
  table.mini th { font-size: 10.5px; }
  #heroWinProb { overflow-x: auto; overscroll-behavior-x: contain; }
  #heroWinProb > svg { min-width: 480px; }
  pre.rule { font-size: 11.5px; }
}

@media (max-width: 640px) {
  .evt-row { grid-template-columns: 1fr auto; gap: 3px 10px; }
  .evt-row > span:nth-child(2) { grid-column: 1 / -1; }
  .evt-row .v { text-align: right; }
}

@supports (min-height: 100svh) {
  .hero, .stop, .outro { min-height: 100svh; }
}

/* the seventeen default tags, as chips with their code */
.chips .tag { gap: 7px; }
.chips .tag b {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--leather);
}

/* the Index is only ever this sum */
table.mini.formula td.pos { color: var(--s3); font-weight: 700; }
table.mini.formula td.neg { color: var(--s5); font-weight: 700; }
table.mini.formula tr.total td { border-top: 1px solid var(--line); padding-top: 10px; font-weight: 700; }
table.mini.formula tr.total td.idx { color: var(--leather); font-size: 17px; }
table.mini.formula td .stamp { font-size: 11px; }

.outro .soon {
  margin-top: 26px;
  font-size: 13px;
  color: var(--chalk-2);
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.outro .soon em {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: none;
  color: #b9b1ff;
  border: 1px solid rgba(144, 133, 233, 0.45);
  border-radius: 999px;
  padding: 2px 9px;
}

/* one tag list, in two halves */
.exhibit .grp {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--chalk-2);
  margin: 0 0 9px;
}
.exhibit .grp.own { margin-top: 16px; color: var(--leather); }
.exhibit .grp.note { margin: 14px 0 0; font-weight: 400; color: var(--chalk-2); }
.chips .tag.own { border-color: rgba(249, 148, 31, 0.4); background: rgba(249, 148, 31, 0.1); }
.chips .tag.own b { color: var(--leather); }

/* same game, two different leaders */
.leaders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.leader {
  background: var(--ink-800);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 13px 15px;
}
.leader.hi { border-color: rgba(249, 148, 31, 0.45); }
.leader .stamp { display: block; font-size: 11px; }
.leader .who { display: block; font-size: 16px; font-weight: 700; margin: 4px 0 10px; }
.leader .pair { display: grid; gap: 3px; font-size: 12.5px; color: var(--chalk-2); }
.leader .pair b { font-size: 16px; font-weight: 700; color: var(--chalk); margin-right: 4px; }
.leader .pair .dim b { color: var(--chalk-2); font-weight: 600; font-size: 14px; }
.leader.hi .pair span:last-child b { color: var(--leather); }
@media (max-width: 560px) { .leaders { grid-template-columns: 1fr; } }

/* ---------- one section at a time ---------- */
/* Each section centre is where a data point sits, so snapping the scroll to it
   lands the ball on its point every time. Only on wide screens, where the two
   column layout keeps a section inside the viewport — and `snap-off` is set by
   the page whenever a section outgrows the screen, so nothing gets trapped. */
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  html.snap { scroll-snap-type: y mandatory; }
  html.snap .hero,
  html.snap .stop,
  html.snap .outro { scroll-snap-align: center; }
  html.snap footer.foot { scroll-snap-align: end; }
}

/* the levels row on v2 */
.chips.levels .tag { font-weight: 600; color: var(--chalk); }

/* ---------- the AI coach panel (v2) ---------- */
.soon-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #b9b1ff;
  border: 1px solid rgba(144, 133, 233, 0.45);
  border-radius: var(--r-pill);
  padding: 2px 9px;
}
.ai2-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ai2-chips button {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  color: var(--chalk-2);
  background: var(--ink-800);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  padding: 6px 13px;
  cursor: pointer;
}
.ai2-chips button:hover { color: var(--chalk); border-color: var(--line); }
.ai2-chips button[aria-pressed="true"] {
  background: rgba(144, 133, 233, 0.16);
  border-color: rgba(144, 133, 233, 0.5);
  color: #b9b1ff;
}
.ai2-answer {
  border-left: 2px solid rgba(144, 133, 233, 0.5);
  padding-left: 16px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--chalk-2);
  min-height: 4.6em;
}
.ai2-src {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--chalk-2);
}

/* the analyst thinking, then writing */
.ai2-answer.thinking .dots { display: inline-flex; gap: 5px; padding: 6px 0; }
.ai2-answer.thinking .dots b {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b9b1ff;
  animation: think 1.1s ease-in-out infinite;
}
.ai2-answer.thinking .dots b:nth-child(2) { animation-delay: 0.15s; }
.ai2-answer.thinking .dots b:nth-child(3) { animation-delay: 0.3s; }
@keyframes think {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30%           { opacity: 1;    transform: translateY(-3px); }
}
.ai2-answer.streaming::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: #b9b1ff;
  animation: caret 0.8s step-end infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.ai2-answer.thinking, .ai2-answer.streaming { border-left-color: #b9b1ff; }
@media (prefers-reduced-motion: reduce) {
  .ai2-answer.thinking .dots b, .ai2-answer.streaming::after { animation: none; }
}

/* who does the tagging — answered where the question arises */
.copy p.roles {
  margin-top: 12px;
  padding-left: 14px;
  border-left: 2px solid var(--line);
  font-size: 14.5px;
  color: var(--chalk-2);
}

/* In the outro the strip sits between the copy and the buttons, so it needs
   air above it, not only below — the default strip spacing assumes it opens
   a page. */
.outro .promo-strip { margin: 26px 0 0; }
.outro .promo-strip + .hero-actions { margin-top: 18px; }

/* ---------- the shot map exhibit ---------- */
.shotmap { margin-top: 14px; }
/* The plate is capped so the section still fits a screen and the ball keeps
   landing where the snap puts it. */
.shotmap #shotMap svg {
  display: block;
  width: auto;
  max-width: 100%;
  height: min(304px, 46vh);
  margin: 0 auto;
}

.splits {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
}
.split {
  background: var(--ink-800);
  padding: 9px 12px;
  display: grid;
  gap: 2px;
  text-align: center;
}
.split b { font-size: 19px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.split span { font-size: 11.5px; color: var(--chalk-2); }
.split .mut { font-size: 11px; opacity: 0.75; font-variant-numeric: tabular-nums; }

@media (max-width: 620px) {
  .split { padding: 9px 6px; }
  .split span { font-size: 11px; }
  .split b { font-size: 18px; }
}
