/* Hooplytix — the 3D dashboard */

body.dash { padding-top: 0; }

/* ---------- game bar under the nav ---------- */
.gamebar {
  position: fixed;
  top: 66px;
  left: 0; right: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px max(20px, 4vw);
  background: rgba(8, 12, 22, 0.88);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
  flex-wrap: wrap;
}
.score { display: flex; align-items: baseline; gap: 12px; }
.score b {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.score b.win { color: var(--leather-hi); }
.score .vs { font-size: 12px; color: var(--chalk-2); }
.gamebar .meta { font-size: 12.5px; color: var(--chalk-2); display: flex; gap: 14px; }

.views { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.views a {
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  color: var(--chalk-2);
  border: 1px solid var(--line-soft);
  background: var(--ink-800);
  border-radius: var(--r-pill);
  padding: 5px 12px;
}
.views a:hover { border-color: var(--chalk-2); color: var(--chalk); }
.views a.on { background: var(--leather); border-color: var(--leather); color: #14202E; font-weight: 700; }

/* ---------- summary ---------- */
.summary {
  min-height: 100vh;
  display: grid;
  align-content: center;
  padding: calc(var(--chrome, 120px) + 6vh) max(20px, 4vw) 10vh;
  position: relative;
  z-index: 2;
}
.summary-in { width: var(--shell); margin: 0 auto; }
.summary h1 {
  font-size: clamp(30px, 4.2vw, 54px);
  max-width: 17ch;
  letter-spacing: -0.04em;
}
.summary p { margin-top: 16px; color: var(--chalk-2); }
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 40px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  max-width: 820px;
}
.kpis div { background: var(--ink-700); padding: 16px 18px; }
.kpis b {
  display: block;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.kpis span { font-size: 12px; color: var(--chalk-2); }

/* ---------- panel stations ---------- */
.station {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 12vh max(20px, 4vw);
  position: relative;
  z-index: 2;
  perspective: 1400px;
}
.station-in {
  width: var(--shell);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 4vw;
  align-items: center;
}
.station.flip .station-in { grid-template-columns: 1fr 1.35fr; }
.station .panel { grid-column: 1; }
.station.flip .panel { grid-column: 2; }
.station .aside { grid-column: 2; }
.station.flip .aside { grid-column: 1; grid-row: 1; }

.station-in > *, .panel > *, .figure, .figure > div, .shot-wrap > *, .more-in > *, .scroll-x { min-width: 0; }

.panel {
  background: var(--ink-700);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 20px 22px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  transform-style: preserve-3d;
  transform: rotateX(7deg) rotateY(-9deg) translateZ(-120px);
  opacity: 0.5;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease, border-color 0.5s ease;
}
.station.flip .panel { transform: rotateX(7deg) rotateY(9deg) translateZ(-120px); }
.station.live .panel,
.station.flip.live .panel {
  transform: none;
  opacity: 1;
  border-color: var(--line);
}
@media (prefers-reduced-motion: reduce) {
  .panel, .station.flip .panel { transform: none; opacity: 1; transition: none; }
}

.panel-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.panel-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.panel-head .stamp { margin-left: auto; }

.aside h3 {
  font-size: clamp(22px, 2.6vw, 32px);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.aside p { color: var(--chalk-2); font-size: 15.5px; }
.aside .read {
  margin-top: 18px;
  padding-left: 16px;
  border-left: 2px solid rgba(249, 148, 31, 0.5);
  font-size: 14px;
  color: var(--chalk-2);
}
.aside .read b { color: var(--chalk); font-weight: 700; }

/* panel internals */
.figure + .figure { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.figure h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--chalk-2);
  margin: 0 0 10px;
}

.statrow {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.statrow div { display: grid; gap: 1px; }
.statrow b {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.statrow span { font-size: 11.5px; color: var(--chalk-2); }

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

/* index leaderboard */
.board { display: grid; gap: 12px; }
.board-row { display: grid; grid-template-columns: 148px 1fr 52px; gap: 12px; align-items: center; }
.board-row .who { font-size: 13.5px; }
.board-row .who span { color: var(--chalk-2); font-size: 11.5px; }
.board-row .val { text-align: right; font-weight: 700; font-size: 15px; color: var(--s4); }
.board-row .split { order: 3; display: flex; height: 12px; border-radius: 4px; overflow: hidden; gap: 2px; }
.board-row .split i { display: block; height: 100%; border-radius: 2px; }

/* lineups table */
table.units { width: 100%; border-collapse: collapse; font-size: 13px; }
table.units th {
  text-align: right; font-size: 11px; font-weight: 500; color: var(--chalk-2); padding: 0 0 10px 14px;
}
table.units th:first-child, table.units td:first-child { text-align: left; padding-left: 0; }
table.units td { padding: 9px 0 9px 14px; border-top: 1px solid var(--line-soft); text-align: right; }
table.units td:first-child { overflow-wrap: anywhere; }
table.units td.net { font-weight: 700; }

/* shot chart */
.shot-wrap { display: grid; grid-template-columns: 1fr 190px; gap: 22px; align-items: start; }
.zone-list { font-size: 12.5px; min-width: 0; }
.zone-list > div { display: grid; gap: 7px; }
.zone-list .row { display: flex; justify-content: space-between; gap: 10px; color: var(--chalk-2); }
.zone-list b { color: var(--chalk); font-weight: 700; }

/* play by play */
.filters { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.filters button {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  background: var(--ink-800); color: var(--chalk-2);
  border: 1px solid var(--line-soft); border-radius: var(--r-pill); padding: 5px 13px;
}
.filters button:hover { color: var(--chalk); }
.filters button[aria-pressed="true"] {
  background: var(--leather);
  border-color: var(--leather);
  color: #14202E;
}
.stream { display: grid; gap: 2px; max-height: 340px; overflow-y: auto; }
.stream-row {
  display: grid;
  grid-template-columns: 62px 10px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 9px 8px;
  border-radius: 8px;
  font-size: 13px;
}
.stream-row:nth-child(odd) { background: var(--ink-800); }
.stream-row .side { width: 4px; height: 4px; border-radius: 50%; align-self: center; }
.stream-row em { font-style: normal; }
.stream-row small { display: block; color: var(--chalk-2); font-size: 11.5px; }
.stream-row .v { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--chalk-2); }
.stream-row.custom em::after {
  content: attr(data-tag);
  margin-left: 8px; font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--leather); border: 1px solid rgba(249, 148, 31, 0.45);
  border-radius: 4px; padding: 1px 6px;
}
.stream-row.custom em::after { content: attr(data-tag); }

/* closing */
.dash-outro {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: calc(64px + 4vh) max(20px, 4vw) 6vh;
  position: relative;
  z-index: 2;
}
.dash-outro .outro-in { width: var(--shell); margin: 0 auto; display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 5vw; }
.dash-outro .outro-in > div { grid-column: 2; }
.dash-outro h2 { font-size: clamp(30px, 4vw, 52px); max-width: 15ch; }
.dash-outro p { margin-top: 16px; color: var(--chalk-2); }

@media (max-width: 900px) {
  .gamebar { flex-wrap: nowrap; overflow-x: auto; gap: 14px; }
  .gamebar .meta { display: none; }
  .views { flex-wrap: nowrap; }
}

@media (max-width: 1000px) {
  /* a gentler tilt on small screens, so a panel edge never spills past the viewport */
  .station:not(.live) .panel,
  .station.flip:not(.live) .panel { transform: rotateX(6deg) translateZ(-70px); }
  .station-in, .station.flip .station-in { grid-template-columns: 1fr; gap: 24px; }
  .station .panel, .station.flip .panel,
  .station .aside, .station.flip .aside { grid-column: 1; }
  .station.flip .aside { grid-row: auto; }
  .station .aside { order: -1; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shot-wrap { grid-template-columns: 1fr; }
  .dash-outro { align-items: end; }
  .dash-outro .outro-in { grid-template-columns: 1fr; }
  .dash-outro .outro-in > div {
    grid-column: 1;
    background: rgba(9, 11, 16, 0.78);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 20px;
  }
  .gamebar { top: 58px; }
}
@media (max-width: 620px) {
  .board-row { grid-template-columns: 1fr auto; row-gap: 7px; }
  .board-row .split { grid-column: 1 / -1; }
  .board-row .val { align-self: center; }
  .stream-row { grid-template-columns: 56px 8px 1fr; }
  .stream-row .v { grid-column: 3; text-align: right; }
}

/* final score, revealed when the shot drops */
.scoreline {
  display: flex; align-items: baseline; gap: 16px; margin-bottom: 20px;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.dash-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; } }

/* Charts keep their type size on a phone and scroll sideways instead */
@media (max-width: 780px) {
  #wp, #mg { overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 4px; }
  #wp > svg, #mg > svg { min-width: 520px; }
}

/* the five-man table drops its rating split on a phone; the chart above still has it */
@media (max-width: 620px) {
  table.units th.opt, table.units td.opt { display: none; }
  table.units td:first-child { max-width: 200px; }
}

/* viewport units that do not jump when the mobile url bar moves */
@supports (min-height: 100svh) {
  .summary, .station, .dash-outro { min-height: 100svh; }
}

/* reduced motion wins over every tilt above */
@media (prefers-reduced-motion: reduce) {
  .station .panel, .station.flip .panel, .station:not(.live) .panel, .station.flip:not(.live) .panel {
    transform: none;
    opacity: 1;
    transition: none;
  }
}

/* ---------- the step markers ---------- */
.chapter {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--chalk-2);
}
.chapter i {
  font-style: normal;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #14202E;
  background: var(--leather);
  border-radius: var(--r-sm);
  padding: 3px 9px;
  font-variant-numeric: tabular-nums;
}

.views a { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.views a i {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--chalk-2);
  font-variant-numeric: tabular-nums;
}
.views a.on i { color: #14202E; opacity: .7; }


/* ---------- read more ---------- */
details.more {
  margin-top: 20px;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}
details.more > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--leather);
  padding: 4px 0;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after {
  content: "";
  width: 7px; height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.2s ease;
}
details.more[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
details.more > summary .close,
details.more[open] > summary .open { display: none; }
details.more[open] > summary .close { display: inline; }
details.more > summary:hover { color: var(--chalk); }
.more-in { padding-top: 14px; display: grid; gap: 18px; }
.note {
  font-size: 12.5px;
  color: var(--chalk-2);
  border-left: 2px solid var(--line);
  padding-left: 12px;
}

/* wide tables get their own scroller rather than squashing */
.scroll-x { overflow-x: auto; overscroll-behavior-x: contain; }
.scroll-x > table { min-width: 520px; }

/* ---------- tables ---------- */
table.units td .no {
  display: inline-block;
  min-width: 18px;
  font-size: 11px;
  color: var(--chalk-2);
  font-variant-numeric: tabular-nums;
}
table.units td.pos { color: var(--s3); font-weight: 700; }
table.units td.neg { color: var(--s5); font-weight: 700; }
table.units td.idx { color: var(--leather); font-weight: 700; }
table.units td.meaning { text-align: left; color: var(--chalk-2); font-size: 12px; max-width: 280px; }
b.code {
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--chalk);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  padding: 1px 5px;
}

.statrow.tight { gap: 22px; margin: 14px 0 0; }
.statrow.tight b { font-size: 18px; }

.zone-list h4 { font-size: 12px; font-weight: 600; color: var(--chalk-2); margin: 0 0 10px; }

/* ---------- the tag stream ---------- */
.stream-row em b.code { margin-right: 7px; }
.stream-row.custom em::after { content: attr(data-tag); }
.stream-row.default em::after { content: none; }
