#collection-album .album-hero:has(.album-statistics-button:not([hidden])) > div:first-child { flex: 1 1 auto; }
.album-title-row { display: flex; align-items: center; gap: 10px; }
#collection-album .album-title-row h2 { margin-block: 0; }
#collection-album .album-title-row + p { margin-top: 5px; }

#collection-album .album-statistics-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid #778064;
  border-radius: 8px;
  background: #2b392c;
  color: #ffe2a0;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.collection-statistics-dialog {
  box-sizing: border-box;
  width: min(730px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(14px, 4vw, 24px);
  border: 1px solid #778064;
  border-radius: 16px;
  background: #14251b;
  color: #e4eee5;
  box-shadow: 0 24px 80px #0008;
}

.collection-statistics-dialog::backdrop { background: #050d09bf; }
.collection-statistics-dialog header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.collection-statistics-dialog h2 { margin: 0; color: #ffe2a0; font-size: clamp(20px, 4vw, 26px); }
.collection-statistics-dialog p { margin: 4px 0 14px; color: #c0d1c4; font-size: 13px; }
.collection-statistics-dialog button {
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid #5c715e;
  border-radius: 8px;
  background: #263e2e;
  color: inherit;
  cursor: pointer;
}
.collection-statistics-dialog header button { min-width: 36px; font-size: 21px; }
.collection-statistics-dialog :is(button,summary):focus-visible { outline: 2px solid #ffe2a0; outline-offset: 2px; }
.collection-stats-overview { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin: 0 0 12px; }
.collection-stats-overview div { display: flex; flex-direction: column-reverse; gap: 3px; padding: 9px; border: 1px solid #526c57; border-radius: 10px; background: #213d2d; }
.collection-stats-overview dt { color: #d0dfd4; font-size: 11px; }
.collection-stats-overview dd { margin: 0; color: #ffe2a0; font-size: clamp(16px, 4.4vw, 24px); font-weight: 650; font-variant-numeric: tabular-nums; }
.collection-stats-menus { display: grid; gap: 7px; }
.collection-stats-menus details { border: 1px solid #405647; border-radius: 10px; background: #192c21; }
.collection-stats-menus details[open] { border-color: #6f9278; }
.collection-stats-menus summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 8px 12px; border-radius: 9px; list-style: none; cursor: pointer; }
.collection-stats-menus summary::-webkit-details-marker { display: none; }
.collection-stats-menus summary:hover { background: #223b2c; }
.collection-stats-menus summary span { display: grid; gap: 2px; }
.collection-stats-menus summary strong { font-size: 14px; }
.collection-stats-menus summary small { color: #bbd3c3; font-size: 12px; }
.collection-stats-menus summary::after { content: ''; flex: 0 0 7px; height: 7px; margin-right: 3px; border: solid #c6dfcd; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.collection-stats-menus details[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.collection-stats-details { display: grid; gap: 12px; margin: 0 12px; padding: 10px 0 12px; border-top: 1px solid #405647; }
.collection-stats-group { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; align-items: start; }
.collection-stats-metrics { margin: 0; }
.collection-stats-metrics > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 5px 0; font-size: 13px; }
.collection-stats-metrics > div + div { border-top: 1px solid #354e3e; }
.collection-stats-metrics dd { margin: 0; color: #ffe2a0; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.collection-stats-player-list { min-width: 0; padding: 9px 10px; border-radius: 8px; background: #22392b; }
.collection-stats-player-list h3 { margin: 0 0 6px; color: #deebdf; font-size: 12px; font-weight: 600; }
.collection-stats-player-list p { margin: 0; font-size: 12px; }
.collection-stats-player-list ul { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.collection-stats-player-list li { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px 8px; align-items: center; font-size: 12px; }
.collection-stats-player-list li span { overflow-wrap: anywhere; }
.collection-stats-player-list li small { grid-column: 1 / -1; color: #bbd3c3; }
.collection-stats-player-list strong { color: #ffe2a0; font-variant-numeric: tabular-nums; }
.collection-stats-player-list meter { grid-column: 1 / -1; appearance: none; width: 100%; height: 5px; accent-color: #91c99f; }
.collection-stats-player-list meter::-webkit-meter-bar { border: 0; background: #3c5645; }
.collection-stats-player-list meter::-webkit-meter-optimum-value { border-radius: 10px; background: #91c99f; }
.collection-stats-player-list meter::-moz-meter-bar { border-radius: 10px; background: #91c99f; }

@media (max-width: 560px) {
  .collection-stats-group { grid-template-columns: 1fr; }
  #collection-album .album-statistics-button { min-height: 32px; padding-inline: 6px; font-size: 11px; }
  .album-title-row { gap: 6px; }
}

@media (min-width: 601px) and (max-width: 650px) {
  #collections #collection-album .album-hero:has(.album-statistics-button:not([hidden])) { flex-direction: row; align-items: center; }
}

@media (max-width: 360px) {
  html #collection-album .album-hero:has(.album-statistics-button:not([hidden])) h2 { font-size: 16px; }
}
