/* The All Game Statistics page (F17). Built on dicehawk.css's classes (top, card, card-head, stat,
   stat-boxes, hist, log, btn) and colour variables, so every skin restyles it through them with no
   rules of its own. */

.as-title { font: 700 24px/1 var(--gothic); color: var(--muted); }
.all-stats .wrap { max-width: 1180px; }

/* ---- counters ---- */
.counters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ctr { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px 16px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); }
.ctr.live-c { border-top: 3px solid var(--ok); }
.ctr .k { font-size: 12px; color: var(--muted); }
/* At most 5 characters (DiceHawkAllStats.short), so the box keeps its size from 0 to billions. */
.ctr b { font: 700 34px/1.05 var(--mono); color: var(--text); white-space: nowrap; }
.ctr .n { font-size: 12px; color: var(--faint); }

/* ---- the ticker ---- */
.mq { position: relative; overflow: hidden; padding: 0; }
.mq-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 14px 16px 0; }
.mq-head h2 { margin: 0; font: 700 22px/1.1 var(--gothic); }
.mq-head small { color: var(--muted); font-size: 12px; }
.mq-view { overflow: hidden; padding: 12px 16px 16px; }
.mq-view:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* One row, wider than the page when there are many: then it moves (all-stats.js adds .moving). */
.mq-track { display: flex; gap: 12px; width: max-content; }
.mq-track.moving { animation: as-marquee 70s linear infinite; }
.mq-copy { display: flex; gap: 12px; }
.mq-view:hover .mq-track, .mq-view:focus-within .mq-track { animation-play-state: paused; }
@keyframes as-marquee { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 6px)); } }
.mq-empty { margin: 0; }
.chip { display: flex; flex: none; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius); white-space: nowrap; }
.chip .nm { font: 700 19px/1.05 var(--gothic); }
.chip small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.chip .ago { margin-left: 6px; padding-left: 12px; border-left: 1px solid var(--border); text-align: right; font-size: 12px; color: var(--muted); }
.chip .ago b { display: block; font: 700 13px var(--mono); color: var(--text); }
/* Still under reduced motion: one wrapped list, the second copy gone. */
@media (prefers-reduced-motion: reduce) {
  .mq-track, .mq-track.moving { animation: none; width: auto; flex-wrap: wrap; }
  .mq-copy { display: none; }
}

/* ---- Big Roll icons and colours, as on the match pages ---- */
.ic { display: flex; flex: none; width: 36px; height: 36px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); }
.ic svg { width: 18px; height: 18px; }
.k-on-fire .ic, .k-on-fire .nm, .k-back-on-top .ic, .k-back-on-top .nm, .k-hot-dice .ic, .k-hot-dice .nm { color: var(--burning); }
.k-oh-no .ic, .k-oh-no .nm, .k-giveth .ic, .k-giveth .nm { color: var(--freezing); }
.k-hot-streak .ic, .k-hot-streak .nm { color: var(--hot); }
.k-cold-streak .ic, .k-cold-streak .nm, .k-consistent .ic, .k-consistent .nm { color: var(--cold); }
.k-streak-end .ic, .k-streak-end .nm { color: var(--muted); }
.b-burning { color: var(--burning); } .b-hot { color: var(--hot); } .b-average { color: var(--average); }
.b-cold { color: var(--cold); } .b-freezing { color: var(--freezing); }

/* ---- All Dice and Dice Temperature ---- */
.as-two { gap: 14px; align-items: start; }
.as-two > .card { min-width: 0; }
.stat-boxes.as-dice { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 12px; }
.as-hist { height: 150px; }
.as-hist .bar i { background: var(--accent); }
.band-rows { display: flex; flex-direction: column; gap: 10px; }
.band-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 110px; gap: 12px; align-items: center; font-size: 13px; }
.band-row .track { position: relative; height: 18px; background: var(--bg); border-radius: 4px; }
.band-row .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.band-row .mark { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--text); opacity: .6; }
.band-row .v { text-align: right; font: 700 13px var(--mono); }
.band-row .v small { margin-left: 6px; font: 400 11px var(--sans); color: var(--faint); }
.f-burning { background: var(--burning); } .f-hot { background: var(--hot); } .f-average { background: var(--average); }
.f-cold { background: var(--cold); } .f-freezing { background: var(--freezing); }

/* ---- Big Rolls ---- */
.br-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.br { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.br .c { font-size: 14px; font-weight: 600; line-height: 1.2; }
.br small { display: block; margin-top: 2px; font-size: 11px; color: var(--faint); }
.br .cnt { text-align: right; font: 700 20px var(--mono); white-space: nowrap; }
.br .cnt small { font: 400 11px var(--sans); color: var(--muted); }

/* ---- Records and Pace ---- */
.stat-boxes.as-records { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; }

/* ---- Unlikely Rolls ---- */
.as-unlikely .rank { font: 700 13px var(--mono); color: var(--accent); }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.as-foot { margin: 0; font-size: 12px; line-height: 1.6; color: var(--faint); }

@media (max-width: 1000px) {
  .counters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .br-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .as-two { grid-template-columns: minmax(0, 1fr); }
}

/* Phones: counters two to a row, sections one under another, Unlikely Rolls as stacked rows. */
@media (max-width: 760px) {
  .counters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ctr b { font-size: 28px; }
  .br-grid, .stat-boxes.as-records { grid-template-columns: minmax(0, 1fr); }
  .stat-boxes.as-dice, .stat-boxes.as-records { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band-row { grid-template-columns: 64px minmax(0, 1fr) 92px; gap: 8px; }
  .as-unlikely thead { display: none; }
  /* Each roll as three lines beside its rank: odds and date, what they measure, player and band. */
  .as-unlikely, .as-unlikely tbody { display: block; }
  .as-unlikely tr { display: grid; grid-template-columns: 2.4em minmax(0, 1fr) auto; gap: 2px 8px; padding: 8px 0;
    border-bottom: 1px solid var(--border); }
  .as-unlikely td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .as-unlikely td:nth-child(1) { grid-row: 1 / 4; }
  .as-unlikely td:nth-child(2) { grid-column: 2; grid-row: 1; font-weight: 700; }
  .as-unlikely td:nth-child(6) { grid-column: 3; grid-row: 1; text-align: right; color: var(--muted); }
  .as-unlikely td:nth-child(3) { grid-column: 2 / 4; grid-row: 2; color: var(--muted); }
  .as-unlikely td:nth-child(4) { grid-column: 2; grid-row: 3; }
  .as-unlikely td:nth-child(5) { grid-column: 3; grid-row: 3; text-align: right; }
}
