/* The screens opened from the menu that show lists: Stats, Game History and Achievements. A filter row and a heading stay fixed
   under the title, and a list scrolls below them. */

.screen-dialog { width: min(92vw, 420px); }
.screen-dialog[open] { display: flex; flex-direction: column; height: min(calc(100dvh - 90px), 760px); }   /* always the tallest it can be, so the filters don't make it change size */
.screen-dialog .dialog-buttons { flex: none; margin-top: 18px; }

/* the fixed part: --scrollbar-width is the width of a scroll bar on this device, measured at load (0 where scroll bars float over the
   content); the list below keeps that much room on both sides, so the header and the list line up and stay centered */
.screen-header { flex: none; padding: 0 var(--scrollbar-width, 0px) 8px; margin-top: -4px; }
.screen-heading { margin: 12px 0 4px; text-align: center; font-size: 24px; color: var(--text-color); }
.screen-heading .symbol { width: 1.1em; height: 1.1em; vertical-align: -0.2em; margin-right: 0.1em; }
.screen-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -12px; padding: 0 12px;
  scrollbar-gutter: stable both-edges;   /* the room for a scroll bar is always kept, on both sides, so the list stays centered */
}

/* ---- filter buttons in a row ---- */
.filter-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.filter-row.five { grid-template-columns: repeat(5, 1fr); gap: 4px; }
.filter-row label { display: block; cursor: pointer; }
.filter-row label[hidden] { display: none; }
.filter-row input { position: absolute; opacity: 0; pointer-events: none; }
.filter-row span {
  display: flex; align-items: center; justify-content: center; height: 40px; border: 2px solid var(--line-color); border-radius: 9px;
  background: var(--page-background); font-size: 16px;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.filter-row.small span { font-size: 14px; letter-spacing: 0; }   /* four or five word buttons in a row: "Unfinished" has to fit */
.filter-row span .symbol { width: 22px; height: 22px; vertical-align: 0; }
.filter-row label[data-player="1"] { --filter-color: var(--player-1-color); }
.filter-row label[data-player="2"] { --filter-color: var(--player-2-color); }
.filter-row label[data-player="3"] { --filter-color: var(--player-3-color); }
.filter-row .absurd-filter { --filter-color: var(--absurd-color); }
.filter-row input:checked + span { background: var(--filter-color, var(--button-background)); border-color: var(--filter-color, var(--button-background)); color: #fff; }
.filter-row input:checked + span .symbol { filter: brightness(0) invert(1); }
.filter-row input:focus-visible + span { outline: 2px solid var(--text-color); outline-offset: 2px; }

/* ---- the rows of the Stats list: a small label on the left, a large value on the right ---- */
.stat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 8px; border-bottom: 2px solid var(--line-color); }
.stat-row.starts-group { margin-top: 30px; }   /* a gap between the groups: games, points, times */
.stat-label { color: var(--muted-text-color); font-size: 17px; letter-spacing: 0.5px; }
.stat-value { font-size: 26px; color: var(--text-color); text-align: right; white-space: nowrap; }
