/* Stage additions: photos, card reasons, deeper-analysis table, scorecards.
   Kept in its own file so an append can never be silently lost again. */

/* ---- scorecard photos on the board ---------------------------------- */
.ava {
  width: 5.4vh; height: 5.4vh; min-width: 5.4vh; border-radius: 50%;
  overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 2px solid var(--border);
}
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava.fallback { font-size: 1.7vh; font-weight: 700; color: var(--ink-muted); letter-spacing: .04em; }
.brow { grid-template-columns: 3vw auto 1fr; }

/* the card carries the reason it was issued */
.card b { font-weight: 600; opacity: .92; text-transform: none; letter-spacing: 0; }

/* grading rules stated on screen rather than implied by colour */
.rulebar { display: flex; gap: 2.2vw; margin-top: 1.3vh; font-size: .95vw; color: var(--ink-2); }
.rulebar .sw { display: inline-block; width: 11px; height: 15px; border-radius: 3px; margin-right: .5em; vertical-align: -2px; }
.rulebar .sw.red { background: var(--critical); }
.rulebar .sw.yellow { background: var(--warning); }
.rulebar .sw.green { background: var(--good); }

/* ---- deeper analysis ------------------------------------------------- */
.trend { font-size: 1.05vw; font-weight: 600; }
.trend.up { color: var(--good); }
.trend.down { color: var(--critical); }
.trend.flat, .trend.new { color: var(--ink-muted); }

table.deep { width: 100%; border-collapse: collapse; font-size: 1.45vw; }
table.deep th {
  text-align: left; font-size: .95vw; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-muted); font-weight: 600; padding: 0 1vw 1.2vh; border-bottom: 1px solid var(--border);
}
table.deep td { padding: 1.4vh 1vw; border-bottom: 1px solid rgba(255,255,255,.05); }
table.deep .n { text-align: right; font-variant-numeric: tabular-nums; }
table.deep td.bad { color: var(--warning); font-weight: 600; }
table.deep tbody tr {
  opacity: 0; animation: rowIn .5s cubic-bezier(.22,.61,.36,1) forwards;
  animation-delay: calc(var(--i) * 90ms + 180ms);
}

/* ---- individual scorecard -------------------------------------------- */
.sc { display: grid; grid-template-columns: 26vw 1fr; gap: 3vw; flex: 1; min-height: 0; align-items: center; }

.sc-who { display: flex; flex-direction: column; align-items: flex-start; gap: 1.6vh; }
.sc-photo {
  width: 20vw; height: 20vw; border-radius: 24px; overflow: hidden;
  background: var(--surface-2); border: 3px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.sc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-photo.fallback { font-size: 7vw; font-weight: 700; color: var(--ink-muted); }
.sc-name { font-size: 2.8vw; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
.sc-dept { font-size: 1.2vw; color: var(--ink-muted); }
.sc-tags { display: flex; flex-wrap: wrap; gap: .6vw; }

.sc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6vw; }
.sc-col {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 16px;
  padding: 2.4vh 1.5vw;
}
.sc-col h3 {
  margin: 0 0 1.8vh; font-size: 1.05vw; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-muted); font-weight: 700;
}
.sc-metric { margin-bottom: 2vh; }
.sc-metric:last-child { margin-bottom: 0; }
.sc-mv { font-size: 3vw; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.sc-mv.good { color: var(--good); }
.sc-mv.bad  { color: var(--critical); }
.sc-mv.warn { color: var(--warning); }
.sc-mk { font-size: .95vw; color: var(--ink-muted); margin-top: .5vh; }
.sc-bar { height: 1.1vh; border-radius: 4px; background: rgba(255,255,255,.07); margin-top: .9vh; }
.sc-bar i { display: block; height: 100%; border-radius: 4px; background: var(--series-1); }
.sc-bar i.good { background: var(--good); }
.sc-bar i.bad { background: var(--critical); }
.sc-bar i.warn { background: var(--warning); }


/* ---- overflow discipline --------------------------------------------
   `justify-content: center` overflows in BOTH directions when the content
   is taller than the box, so a long board rode up over the subtitle.
   `safe center` falls back to flex-start the moment it would overflow, and
   the hidden overflow guarantees nothing escapes the scene box. */
.sceneBody {
  justify-content: safe center;
  overflow: hidden;
}
.scene { overflow: hidden; }
.sceneTitle, .sceneSub { position: relative; z-index: 2; }

/* a little tighter so eight rows plus the legends fit at 1080p */
.board { gap: .9vh; }
.brow .bhead { margin-bottom: .55vh; }
