/* mod_uno_statistic */
.unostat {
  --unostat-border: #e3e3e3;
  --unostat-head: #f4f4f4;
  --unostat-muted: #666;
  --unostat-schnaps: #fff0b3;
  --unostat-low: rgba(217, 83, 79, .12);
  --unostat-high: rgba(92, 184, 92, .14);
}

/* The template limits articles to 46rem; articles with statistics use the full content width */
.view-article .article-details:has(.unostat) {
  max-width: 75rem;
}

.unostat h2 {
  margin-top: 2rem;
}

.unostat-scroll {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.unostat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}

.unostat-table th,
.unostat-table td {
  padding: .35rem .4rem;
  border-bottom: 1px solid var(--unostat-border);
  white-space: nowrap;
  vertical-align: top;
}

.unostat-table thead th,
.unostat-table tfoot th {
  background: var(--unostat-head);
  font-weight: bold;
}

.unostat-table th {
  text-align: left;
}

.unostat-table .unostat-num {
  text-align: right;
}

.unostat-guest {
  font-style: italic;
}

.unostat-sortable thead th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.unostat-sortable thead th[aria-sort="ascending"]::after {
  content: " ▲";
  font-size: .7em;
}

.unostat-sortable thead th[aria-sort="descending"]::after {
  content: " ▼";
  font-size: .7em;
}

/* Long player names may wrap in the header, which leaves more room for the details column */
.unostat-table thead th {
  white-space: normal;
  vertical-align: bottom;
}

.unostat-table .unostat-details {
  min-width: 15rem;
  padding-left: 1.5rem;
}

.unostat-details details {
  display: inline-block;
  margin-left: .5rem;
  vertical-align: top;
}

.unostat-details summary {
  cursor: pointer;
  color: var(--unostat-muted);
}

.unostat-details ul {
  margin: .25rem 0 0;
  padding: 0;
  list-style: none;
}

.unostat .unostat-schnapps {
  background: var(--unostat-schnaps);
  font-weight: bold;
}

.unostat .unostat-won {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.unostat-legend-text span {
  display: inline-block;
  margin-left: .5rem;
  padding: 0 .3rem;
}

.unostat-unit {
  margin: 1rem 0 1.5rem;
}

.unostat-empty {
  color: var(--unostat-muted);
}

/* Schnaps glasses */
.unostat-drink {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-right: 1px;
}

.unostat-drink.is-paid {
  fill: #3c9a3c;
}

.unostat-drink.is-open {
  fill: #d9534f;
}

.unostat-drinks {
  white-space: normal !important;
  max-width: 16rem;
}

/* Charts */
.unostat-chart {
  max-width: 960px;
  margin: 1.5rem auto 2rem;
}

.unostat-chart figcaption {
  font-weight: bold;
  font-size: 1.05rem;
  text-align: center;
  margin-bottom: .25rem;
}

.unostat-chart svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: inherit;
}

.unostat-chart .unostat-grid {
  stroke: #e6e6e6;
  stroke-width: 1;
}

.unostat-chart .unostat-axis {
  font-size: 11px;
  fill: var(--unostat-muted);
}

.unostat-chart .unostat-value {
  font-size: 12px;
  fill: #333;
}

.unostat-chart .unostat-reference {
  stroke: #333;
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
}

.unostat-chart .unostat-reference-label {
  font-size: 12px;
  fill: #333;
}

.unostat-chart .unostat-band-low {
  fill: var(--unostat-low);
}

.unostat-chart .unostat-band-high {
  fill: var(--unostat-high);
}

.unostat-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1rem;
  margin: .5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: .9rem;
}

.unostat-legend li {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
  padding: 0;
  background: none;
}

.unostat-legend li::before {
  content: none;
}

.unostat-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.unostat-swatch-reference {
  width: 20px;
  height: 0;
  border-top: 2px dashed #333;
  border-radius: 0;
}
