/* ═══════════════════════════════════════════════════════════════════════════
   Elequate Deck Engine — shared presentation-runtime stylesheet.
   Pairs with shared/deck-engine.js. Consumed by recap.html (The Recap) and
   (planned) assessment.html. Owns: the slide transition system, deck chrome
   (dots / edges / progress / corner tag / close / loading overlay) and the
   shared card design system (hero / standout / compact-row / board-label
   tooltip / reveal toggle+panel / two-tone slide titles).

   Consumers layer their OWN segment-renderer CSS on top and register their
   renderers with DeckEngine — they NEVER fork-copy this file.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg-primary: #1a2744;
  --bg-deep: #0d1e36;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-bg-hi: rgba(255, 255, 255, 0.07);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-hi: rgba(255, 255, 255, 0.16);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --cyan: #2AABE2;
  --cyan-glow: rgba(42, 171, 226, 0.35);
  --green: #4CAF50;
  --green-glow: rgba(76, 175, 80, 0.30);
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  /* ONE stacked-card gap token — identical vertical spacing between stacked
     hero cards AND stacked standout cards, in every column on every slide. */
  --card-stack-gap: 16px;
}

/* ========= DECK + SLIDE TRANSITIONS ========= */
#deck {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 6vw, 96px) clamp(48px, 7vw, 128px);
  opacity: 0;
  transform: translateX(60px) scale(0.985);
  transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  will-change: opacity, transform;
  overflow: hidden;
}
.slide.active {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}
.slide.prev {
  transform: translateX(-60px) scale(0.985);
}

/* ========= SLIDE HEADER + TWO-TONE TITLE ========= */
.slide-head { margin-bottom: clamp(20px, 3vw, 40px); }
.slide-head .slide-title { margin-bottom: 0; }
.slide-subtitle {
  margin-top: clamp(7px, 0.9vw, 11px);
  font-size: clamp(15px, 1.5vw, 20px);
  font-weight: 600; letter-spacing: 0.02em;
  color: var(--cyan);
}
.slide-subtitle .sep { color: var(--text-muted); margin: 0 0.45em; font-weight: 700; }

.slide-title {
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: clamp(20px, 3vw, 40px);
  color: var(--cyan); /* two-tone: first word white (.tw), remainder flat brand cyan */
}
.slide-title .tw { color: #ffffff; } /* leading word painted white */
.slide-title .accent { color: var(--cyan); }
.slide-title .accent-g { color: var(--cyan); }
/* NB: a `.cat-tag` category pill lived here (green, uppercase, beside the slide
   title). data-findings.html was its only consumer in the repo and dropped it,
   so the rule went with it rather than lingering as dead shared CSS. */

/* ========= SHARED TWO-COLUMN LAYOUT =========
   Columns STRETCH to full height so expanded panels stay bounded. Top alignment
   of the first cards comes from the fixed .board-label-row height. */
.v4-two-col {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(28px, 3.5vw, 56px);
  align-items: stretch;
  flex: 1; min-height: 0;
}
.v4-two-col.even { grid-template-columns: 1fr 1fr; }
.v4-col { min-height: 0; display: flex; flex-direction: column; }
.board-label-row {
  min-height: 40px;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
  position: relative;
  flex: 0 0 auto;
}
.board-label {
  font-size: 13px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
}
/* Column body: fills the column; direct children keep natural height, only a
   .reveal-panel is allowed to shrink + scroll internally. */
.v4-col-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.v4-col-body > * { flex: 0 0 auto; }
.v4-col-body > .reveal-panel { flex: 0 1 auto; min-height: 0; }

/* ========= BOARD-LABEL INFO TOOLTIP =========
   .info-btn + .info-pop MUST stay adjacent siblings for the hover selector. */
.info-btn {
  width: 20px; height: 20px; flex: none;
  border-radius: 50%;
  background: var(--card-bg-hi);
  border: 1px solid var(--border-hi);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  transition: border-color 0.2s, color 0.2s;
}
.info-btn:hover { border-color: var(--cyan); color: var(--text-primary); }
.info-pop {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 25;
  width: min(440px, 78vw);
  background: var(--bg-primary);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  /* Large type — read aloud in class. */
  font-size: 18px;
  line-height: 1.42;
  font-weight: 500;
  text-transform: none;   /* never inherit uppercase from a caps parent (e.g. .standout-h) */
  letter-spacing: normal;
  color: var(--text-primary);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  display: none;
}
.info-btn:hover + .info-pop,
.info-pop.open { display: block; }

/* ========= HERO CARD =========
   THE leader card — reused by Scoreboard First-to-Finish, Practice Calls Top
   Reps + Engagement top-3, identical size everywhere. */
.hero-card {
  display: flex; align-items: center; gap: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 26px;
}
.hero-card + .hero-card { margin-top: var(--card-stack-gap); }
.hero-card.top {
  border-color: rgba(42,171,226,0.4);
  background: linear-gradient(90deg, rgba(42,171,226,0.1), var(--card-bg) 60%);
}
.hero-rank {
  width: 56px; height: 56px; min-width: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: var(--card-bg-hi); border: 1px solid var(--border-hi);
  color: var(--text-secondary);
}
.hero-card.top .hero-rank { background: rgba(42,171,226,0.9); border-color: transparent; color: #fff; }
.hero-body { flex: 1; min-width: 0; }
.hero-name {
  font-size: clamp(24px, 2.6vw, 36px); font-weight: 800; line-height: 1.05;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero-detail {
  margin-top: 5px; font-size: clamp(13px, 1.35vw, 16px);
  color: var(--text-secondary);
}
.hero-value {
  font-size: clamp(26px, 2.8vw, 38px); font-weight: 800; color: var(--cyan);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.hero-value .unit { font-size: 0.5em; color: var(--text-muted); font-weight: 700; }
/* Small muted caps label preceding the big number (e.g. "POINTS 77"). */
.hero-value-pre {
  font-size: 0.32em; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-muted);
  margin-right: 0.55em; vertical-align: middle;
}

/* ========= COMPACT ROW =========
   Ranks 4+, full rosters, quiz-results expansions. */
.compact-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-light);
  font-variant-numeric: tabular-nums;
}
.compact-row:first-child { border-top: none; }
.compact-rank { min-width: 28px; text-align: right; color: var(--text-muted); font-weight: 700; font-size: 14px; }
.compact-name {
  flex: 1; min-width: 0; font-weight: 600; font-size: clamp(15px, 1.5vw, 17px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.compact-detail { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; }
.compact-val { font-weight: 800; font-size: clamp(15px, 1.5vw, 17px); color: var(--cyan); min-width: 42px; text-align: right; }
.compact-row.zero { opacity: 0.5; }
.compact-row.zero .compact-val { color: var(--text-muted); }

/* ========= STANDOUT CARD =========
   The right-column award recipe (single award OR small list). Consumer-specific
   decorations (ace stars, score %, sweep badges) live in the consumer's CSS. */
.standout-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 1.8vw, 26px);
}
.standout-card + .standout-card { margin-top: var(--card-stack-gap); }
.standout-h {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--cyan);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
  position: relative;   /* anchors an inline info-pop tooltip */
}
.standout-h.green { color: var(--green); }
.standout-top { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.standout-name {
  font-size: clamp(23px, 2.5vw, 33px); font-weight: 800; line-height: 1.05;
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.standout-val {
  font-size: clamp(20px, 2.1vw, 28px); font-weight: 800; color: var(--cyan);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.standout-val .unit { font-size: 0.6em; color: var(--text-muted); font-weight: 700; margin-left: 3px; }
.standout-line { margin-top: 8px; font-size: clamp(13px, 1.35vw, 16px); color: var(--text-secondary); font-weight: 500; }
.standout-line b { color: var(--text-primary); font-weight: 700; }
.standout-list { display: flex; flex-direction: column; }
.standout-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-top: 1px solid var(--border-light);
}
.standout-item:first-child { border-top: none; }
.standout-item-name {
  font-size: clamp(15px, 1.5vw, 18px); font-weight: 700; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.standout-item-val { font-size: clamp(15px, 1.5vw, 18px); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.standout-item-val.cyan { color: var(--cyan); }
.standout-item-val.green { color: var(--green); }
.standout-item-val .unit { font-size: 0.72em; color: var(--text-muted); font-weight: 700; margin-left: 4px; }

/* ========= REVEAL TOGGLE + INTERNAL-SCROLL PANEL =========
   One recipe for every "view all" list. The panel shrinks to the remaining
   column height and scrolls internally, so an expanded list never clips. */
.reveal-toggle {
  margin-top: 16px; height: 34px; padding: 0 18px; align-self: flex-start;
  background: var(--card-bg-hi); border: 1px solid var(--border-light);
  border-radius: 999px; color: var(--text-secondary);
  font-family: inherit; font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: border-color 0.2s, color 0.2s;
}
.reveal-toggle:hover { border-color: var(--cyan); color: var(--text-primary); }
.reveal-toggle svg { transition: transform 0.25s; }
.reveal-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.reveal-panel {
  margin-top: 12px; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
}
.reveal-panel[hidden] { display: none; }
/* When a reveal is open, the SLIDE itself scrolls so the full list gets real
   room instead of a cramped in-card window. */
.slide.deck-scroll { overflow-y: auto; justify-content: flex-start; }
.slide.deck-scroll .v4-two-col { flex: 0 0 auto; }
.slide.deck-scroll .v4-col-body { flex: 0 0 auto; }
.slide.deck-scroll .reveal-panel { overflow: visible; max-height: none; margin-bottom: 8px; }

/* ========= NAV DOTS ========= */
#dots {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  gap: 10px;
  align-items: center;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  cursor: pointer;
  transition: all 0.25s;
}
.dot.active { background: var(--cyan); width: 26px; border-radius: 999px; box-shadow: 0 0 12px var(--cyan-glow); }

/* ========= EDGE CLICK ZONES ========= */
.edge {
  position: fixed;
  top: 0; bottom: 0;
  width: 12vw;
  max-width: 180px;
  z-index: 20;
  cursor: pointer;
}
#edge-prev { left: 0; }
#edge-next { right: 0; }

/* ========= PROGRESS BAR ========= */
#progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  z-index: 30;
  transition: width 0.35s cubic-bezier(0.22,1,0.36,1);
  box-shadow: 0 0 10px var(--cyan-glow);
}

/* ========= CORNER TAG + CLOSE ========= */
.deck-corner-tag {
  position: fixed;
  top: clamp(20px, 3vw, 40px);
  left: clamp(28px, 4vw, 56px);
  z-index: 40;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}
.deck-corner-tag::before {
  content: '';
  width: 26px;
  height: 1.5px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}
.deck-close {
  position: fixed;
  top: clamp(18px, 2.6vw, 34px);
  right: clamp(24px, 3.4vw, 48px);
  z-index: 40;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--card-bg-hi);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.deck-close:hover { border-color: var(--cyan); color: var(--text-primary); }

/* ========= LOADING / ERROR OVERLAY ========= */
#overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--bg-deep);
}
#overlay.hidden { display: none; }
.spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(255,255,255,0.12);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay-msg { font-size: 14px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-secondary); font-weight: 600; }
.overlay-err { color: #f87171; }
.retry-btn {
  margin-top: 8px;
  background: var(--card-bg-hi);
  border: 1px solid var(--border-hi);
  color: var(--text-primary);
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 22px; border-radius: 10px; cursor: pointer;
}
.retry-btn:hover { border-color: var(--cyan); }

/* ========= RESPONSIVE (shared layout) =========
   Consumers add their own segment-grid collapses on top of this. */
@media (max-width: 900px) {
  .v4-two-col, .v4-two-col.even { grid-template-columns: 1fr; }
  .slide { padding: 40px 32px 72px; overflow-y: auto; justify-content: flex-start; }
}
