/* A game's Stats tab (docs/adr/0034): tiles of numbers, a spread of times
   (or places), a rating over time. Structure only, like house.css: every
   color comes from the tokens the game's root already declares (the room's
   names, or the --house-* ones and the game's accent), so it wears the look
   of whichever game's pages it's in, light or dark. Charts: house/charts.js. */

.uo-stats {
  --st-ink: var(--house-ink, var(--ink));
  --st-soft: var(--house-soft, var(--soft));
  --st-panel: var(--panel, var(--house-surface, transparent));
  --st-edge: var(--panel-edge, var(--house-edge, 1px solid color-mix(in srgb, currentColor 20%, transparent)));
  --st-radius: var(--panel-radius, 12px);
  /* the one series: the game's accent (its primary fill), or a table's turn color */
  --st-mark: var(--accent, var(--turn, var(--st-ink)));
  --st-grid: color-mix(in srgb, var(--st-ink) 14%, transparent);
  color: var(--st-ink);
}
.uo-stats .lead { margin-bottom: var(--s4, 24px); }
.uo-stats .lead a { color: inherit; text-underline-offset: 3px; }
.uo-pair + .uo-guest { margin-top: var(--panel-gap, 16px); }

/* the numbers: four tiles in a row (two by two on a phone) */
.uo-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--panel-gap, 16px); margin: 0 0 var(--panel-gap, 16px); padding: 0; list-style: none; }
.uo-tile { display: flex; flex-direction: column; gap: 2px; padding: var(--panel-pad, 16px); background: var(--st-panel); border: var(--st-edge); border-radius: var(--st-radius); min-width: 0; }
.uo-tile b { font-size: 32px; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; }
.uo-tile span { font-size: var(--t-note, 14px); color: var(--st-soft); }

.uo-panel { padding: var(--panel-pad, 16px); background: var(--st-panel); border: var(--st-edge); border-radius: var(--st-radius); margin: 0 0 var(--panel-gap, 16px); min-width: 0; }
.uo-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2, 8px) var(--s3, 16px); margin: 0 0 var(--s2, 8px); }
.uo-head h2 { margin: 0; }
.uo-head .house-seg { margin: 0; }
.uo-stats .uo-panel h2 { margin: 0 0 var(--s1, 4px); font-size: var(--t-heading, 20px); font-weight: 700; line-height: var(--lh-heading, 1.2); }
.uo-panel > p { margin: 0 0 var(--s3, 16px); font-size: var(--t-note, 14px); color: var(--st-soft); }
.uo-panel > p b { color: var(--st-ink); font-variant-numeric: tabular-nums; }
.uo-panel .house-seg { margin: 0 0 var(--s3, 16px); }
.uo-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--panel-gap, 16px); align-items: start; }
.uo-pair .uo-panel { margin: 0; }
.uo-empty { margin: 0; font-size: var(--t-note, 14px); color: var(--st-soft); }
.uo-news { margin: 0 0 var(--s2, 8px); }
.uo-empty a, .uo-panel > p a { color: var(--st-ink); text-underline-offset: 3px; }

/* charts (house/charts.js): one series in the mark color, words in the inks */
.uo-figure { margin: 0; }
.uo-chart { width: 100%; min-height: 28px; }
.uo-chart svg { display: block; overflow: visible; }
.uo-chart text { fill: var(--st-soft); font: 400 13px/1 var(--house-font, var(--ui-font, inherit)); font-variant-numeric: tabular-nums; }
.uo-chart text.value { fill: var(--st-ink); font-weight: 700; }
.uo-chart .bar { fill: var(--st-mark); }
.uo-chart .row:hover .bar { opacity: .85; }
.uo-chart .hit { fill: transparent; }
.uo-chart .base { stroke: var(--st-soft); stroke-width: 1; }
.uo-chart .grid { stroke: var(--st-grid); stroke-width: 1; }
.uo-chart .line { fill: none; stroke: var(--st-mark); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.uo-chart .line.provisional { stroke-dasharray: 2 5; }
.uo-chart .wash { fill: var(--st-mark); opacity: .06; }
.uo-chart .dot { fill: var(--st-mark); stroke: var(--st-panel-solid, transparent); stroke-width: 2; }
.uo-chart .cross { stroke: var(--st-soft); stroke-width: 1; }
.uo-line-wrap:not(.reading) :is(.cross, .dot.hover) { visibility: hidden; }
.uo-chart:focus-visible { outline: 2px solid currentColor; outline-offset: -4px; border-radius: 4px; }
.uo-line-wrap { position: relative; padding-top: 32px; }
/* what a point says, over the chart where you're reading it */
.uo-tip {
  position: absolute; top: 0; left: var(--x, 50%); transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  padding: 4px 10px; border-radius: 8px; font-size: var(--t-note, 14px); background: var(--st-ink); color: var(--house-surface, var(--sheet, #fff));
  opacity: 0; transition: opacity 120ms ease;
}
.uo-tip b { font-variant-numeric: tabular-nums; }
.uo-line-wrap.reading .uo-tip { opacity: 1; }
.uo-key { display: flex; flex-wrap: wrap; gap: var(--s1, 4px) var(--s3, 16px); margin: var(--s2, 8px) 0 0; font-size: var(--t-note, 14px); color: var(--st-soft); }
.uo-key i { display: inline-block; vertical-align: middle; width: 22px; height: 0; margin-right: 6px; border-top: 2px solid var(--st-mark); }
.uo-key i.dashed { border-top-style: dotted; }

@media (max-width: 760px) {
  .uo-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 400px) {
  .uo-head .house-seg { width: 100%; }
  .uo-head .house-seg > button { padding-inline: 6px; }
}
@media (max-width: 560px) {
  .uo-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2, 8px); }
  .uo-tile { padding: 12px; }
  .uo-tile b { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { .uo-tip { transition: none; } }

/* the "?" beside Your rating: what goes into it (stats-page.js ratingHelp) */
.uo-head.uo-titled { justify-content: flex-start; }
.uo-help {
  display: inline-grid; place-items: center; box-sizing: border-box; flex: none; width: 28px; height: 28px; padding: 0;
  border: 1.5px solid currentColor; border-radius: 50%; background: transparent; color: var(--st-soft);
  font: 700 15px/1 var(--house-font, var(--ui-font, inherit)); cursor: pointer;
}
.uo-help:hover { color: var(--st-ink); }
.uo-help-points { margin: 0 0 var(--s3, 16px); padding-left: 1.2em; }
.uo-help-points li + li { margin-top: var(--s2, 8px); }
