/* Current pools sit above the persistent mode switch without changing its size. */
.game-mode-switch a { position: relative; }
.game-mode-bank {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  width: 90%;
  max-width: 108px;
  height: 22px;
  padding: 2px 4px 0;
  border: 1px solid #b9b9bc;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: #f5f4f2;
  color: #777b86;
  font-size: 11px;
  line-height: 19px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.game-mode-switch .is-active .game-mode-bank {
  color: #f26321;
  border-color: #ff6a24;
  background: #fff0e5;
}
:root[data-theme=dark] .game-mode-bank {
  border-color: #656c77;
  background: #24272c;
  color: #b7bdc8;
}
:root[data-theme=dark] .game-mode-switch .is-active .game-mode-bank {
  border-color: #ff752d;
  background: #35291f;
  color: #ff8b43;
}

/* The same twelve-row viewport and row rhythm for all three histories. */
.recent-history {
  --recent-row-height: 56px;
  --recent-head-height: 36px;
  padding: 20px 20px 16px;
  min-width: 0;
  overflow: hidden;
}
.recent-history .section-heading {
  height: 34px;
  min-height: 34px;
  margin-bottom: 14px;
  align-items: center;
}
.recent-history .section-heading h2 { font-size: 22px; }
.recent-history-scroll {
  height: calc(var(--recent-head-height) + var(--recent-row-height) * var(--recent-games-count, 12));
  min-width: 0;
  overflow: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.recent-history :is(.table-head, .history-row) {
  display: grid;
  grid-template-columns: .6fr 1.4fr 1fr .7fr 1.2fr 18px;
  gap: 10px;
  min-width: 680px;
  padding: 8px 12px;
  align-items: center;
  line-height: 18px;
}
.recent-history .table-head {
  height: var(--recent-head-height);
  font-size: 11px;
}
.recent-history .history-row {
  height: var(--recent-row-height);
  min-height: var(--recent-row-height);
  font-size: 12px;
}
.recent-history .history-row .avatar { --a: 27px; }
.recent-history .history-row .winner-cell {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
}
.recent-history .history-row :is(.row-bank, .row-chance) { text-align: left; }
.recent-history .history-row .row-bank { font-size: 12px; }
.recent-history .history-row .row-date,
.recent-history .table-head > span:nth-child(5),
.recent-history .history-row > svg { display: block; }
.recent-history table {
  min-width: 680px;
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  line-height: 18px;
  font-size: 12px;
}
.recent-history[data-mode=dice] table { min-width: 760px; }
.recent-history th {
  height: var(--recent-head-height);
  padding: 8px;
  font-size: 11px;
}
.recent-history td {
  height: var(--recent-row-height);
  padding: 10px 8px;
  white-space: nowrap;
}
.recent-history :is(.empty-history, .mode-history-empty) {
  min-height: calc(var(--recent-row-height) * var(--recent-games-count, 12));
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.recent-history .mode-history-empty[hidden] { display: none; }
@media (max-width: 1000px) {
  .recent-history { padding: 18px 14px 14px; }
  .recent-history .section-heading h2 { font-size: 20px; }
}
@media (max-width: 760px) {
  .game-mode-bank { font-size: 10px; }
  .recent-history { padding: 16px 14px 14px; }
  .recent-history .section-heading h2 { font-size: 19px; }
  .recent-history :is(.history-row, .winner-cell, .row-bank),
  .recent-history table { font-size: 11px; }
  .recent-history .history-row .row-bank,
  .recent-history .history-row .winner-cell { font-size: 11px; }
}
.recent-history-scroll {
  height: calc(var(--recent-head-height) + var(--recent-row-height) * var(--recent-games-count, 12) + 8px);
}
.recent-history-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.recent-history-scroll::-webkit-scrollbar-thumb { background: #b5b5bb; border-radius: 8px; }
:root[data-theme=dark] .recent-history-scroll::-webkit-scrollbar-thumb { background: #454a54; }
@media (min-width: 1451px) {
  .game-mode-switch { margin-top: 10px; }
}
.game-mode-switch { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.game-mode-switch a { min-width: 0; }
.recent-history thead { background: #f5f3f0; }
:root[data-theme=dark] .recent-history thead { background: #24272e; }
.recent-history tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 380px) {
  .game-mode-switch a { padding-inline: 2px; gap: 4px; }
  .game-mode-switch a > svg { width: 18px; height: 18px; }
}
