/* Trend Rankers: the talent-show stage + mini periodic table row, the ranking chain and the "Why?" chain, inside the
 * practice shell's stage. The stage stays a dark theater in both themes (it is a picture of a stage). */
.tr { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; padding: 8px 12px 10px; overflow: hidden; }
.tr-top { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; flex: none; }
.tr-stage { position: relative; border-radius: var(--tlg-radius-lg); overflow: hidden; background: #211433; height: 262px; border: var(--tlg-border-width) solid var(--tlg-border); }
.tr-stage-svg { display: block; width: 100%; height: 100%; }
.tr-cap { position: absolute; left: 10px; right: 10px; bottom: 3px; margin: 0; font-size: 16px; line-height: 1.2; color: #efe6ff; text-align: center; pointer-events: none; z-index: 1; }
.tr-pt { display: flex; flex-direction: column; gap: 0; background: var(--tlg-surface); border: var(--tlg-border-width) solid var(--tlg-border); border-radius: var(--tlg-radius-lg); padding: 6px 8px; height: 262px; }
.tr-pt-h { margin: 0; font-size: 16px; line-height: 1.25; font-weight: var(--tlg-weight-bold); color: var(--tlg-text-muted); }
.tr-pt-svg { display: block; width: 100%; flex: 1; min-height: 0; }

/* portraits (SVG text and shapes) */
.tr-atom text { text-anchor: middle; font-family: inherit; }
.tr-nuc { fill: #ffd166; stroke: #1b1029; stroke-width: 1.5; }
.tr-nuc-t { font-size: 16.2px; font-weight: 800; fill: #1b1029; }
.tr-nucdot { fill: #ffd166; stroke: #1b1029; stroke-width: 1; }
.tr-e { fill: #ffffff; stroke: #1b1029; stroke-width: .8; }
.tr-pull line { stroke: #ffd166; stroke-linecap: round; opacity: .9; }
.tr-sym { font-size: 19px; font-weight: 800; fill: #ffffff; }
.tr-name { font-size: 16.2px; fill: #d9cdf0; }
.tr-val { font-size: 16.2px; font-weight: 800; fill: #ffd166; }
.tr-bar { fill: #ffd166; }
.tr-jbar { fill: #a99bd6; }
.tr-jbar.is-core { fill: #5d4b8f; stroke: #ffd166; stroke-width: 1; }
.tr-jval { font-size: 16.2px; font-weight: 700; fill: #ffffff; text-anchor: start !important; }
.tr-jval.is-in { fill: #1b1029; }
.tr-jval.is-in.is-core { fill: #ffffff; }
.tr-jlab { font-size: 16.2px; fill: #d9cdf0; }
.tr-jline { stroke: #ffd166; stroke-width: 2; stroke-dasharray: 4 3; }

/* mini periodic table */
.tr-cell rect { fill: var(--tlg-surface-2); stroke: var(--tlg-border); stroke-width: .8; }
.tr-cell text { font-size: 16px; text-anchor: middle; fill: var(--tlg-text-muted); font-family: inherit; }
.tr-cell.is-lit rect { stroke: #1b1029; stroke-width: 2; }
.tr-cell.is-lit text { fill: #1b1029; font-weight: 800; }
.tr-pt-gap { fill: var(--tlg-border); }
.tr-pt-num { font-size: 16px; font-weight: 700; text-anchor: middle; fill: var(--tlg-text-muted); }
.tr-pt-key { font-size: 16px; fill: var(--tlg-text-muted); }
.tr-pt-arrow line { stroke: #9b2242; stroke-width: 3; stroke-linecap: round; }
.tr-pt-arrow path { fill: #9b2242; }
.tr-pt-arrow text, .tr-pt-arrow-t { font-size: 16px; font-weight: 800; fill: #9b2242; }
html[data-theme="dark"] .tr-pt-arrow line { stroke: #ff8fb0; } html[data-theme="dark"] .tr-pt-arrow path { fill: #ff8fb0; }
html[data-theme="dark"] .tr-pt-arrow text, html[data-theme="dark"] .tr-pt-arrow-t { fill: #ff8fb0; }

/* the chains */
.tr-rank { flex: none; }
.tr .pcb-slot { min-height: 74px; }
.tr .pcb-card { min-height: 44px; }
.tr .pcb-card-t b { font-size: 18px; }
.tr-why .pcb { display: grid; grid-template-columns: 320px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 14px; align-items: start; }
.tr-why .pcb-row { grid-row: 1 / span 2; grid-column: 1; }
.tr-why .pcb-tray-h { grid-column: 2; grid-row: 1; }
.tr-why .pcb-tray { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tr-why .pcb-card { align-items: center; min-height: 52px; }
.tr-why .pcb-card-t b { line-height: 1.2; }
.tr-why .pcb-card-t b { font-size: 16px; font-weight: 600; }
.tr-why .pcb-chip { font-size: 16px; }
.tr .pcb-note.tr-right-why { background: var(--tlg-status-done-fg); color: #fff; white-space: normal; font-size: 16px; }
/* the assignment card sits bottom-right of the stage while playing: keep the trays clear of it */
body:has(.lga-card) .tr .pcb-tray { padding-right: 250px; }

/* Briefing example + Start art */
.tr-stage--static { height: auto; aspect-ratio: 660 / 236; }
.tr-stage--static .tr-stage-svg { height: auto; }
.tr-start { width: 100%; height: 100%; display: grid; place-items: center; }
.tr-start .tr-stage { width: 100%; height: auto; aspect-ratio: 660 / 236; }

@media (max-width: 900px) {
  .tr { position: static; overflow: visible; }
  .tr-top { grid-template-columns: 1fr; }
  .tr-why .pcb { display: flex; }
}
