/* Tablets: pages stay inside the screen and the tabs wrap instead of being cut off. */
@media (max-width: 860px) {
  .nnd-body { align-items: stretch; }
  .nnd-main { width: 100%; }
  .rt-views .rv-cap { display: none; }
  .game-mode-tabs { flex-wrap: wrap; align-items: stretch; gap: 3px; }
  .game-mode-btn { margin-bottom: 0; border-bottom: 2px solid var(--ls); padding-bottom: 5px; }
  .game-mode-btn.is-active { padding-bottom: 5px; border-bottom-color: var(--red-dark); }
}

/* Every page: the tabs stay on one row and scroll sideways if a phone can't fit them. */
.game-mode-bar .game-mode-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.game-mode-bar .game-mode-btn { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 860px) {
  .game-mode-bar .game-mode-btn { padding-left: 8px; padding-right: 8px; }
}

/* Four cards to a row on tablets. */
@media (min-width: 561px) and (max-width: 1080px) {
  .card-grid, .producer-grid, .vocalist-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Sidebar pages: every control sits behind one bar (index.html and nav-menu.js add it). */
.chart-menu-panel { display:none; }
@media (max-width: 860px) {
  .chart-menu-panel { display:block; width:100%; }
  .chart-menu-toggle { display:flex; justify-content:space-between; width:100%; border:0; cursor:pointer; }
  .chart-menu-toggle::after { content:"\25B8"; color:var(--red); }
  .chart-menu-toggle[aria-expanded="true"]::after { content:"\25BE"; }
  .nnd-sidebar.has-chart-menu:not(.is-open) { display:none; }
}
/* Phones: cards two to a row; #1 leads the top three, #2 and #3 sit beneath it. */
@media (max-width: 700px) {
  body .card-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  body .podium-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  .mosaic > .podium-card { grid-column:1 / -1; grid-row:auto; }
  .mosaic > .podium-card .podium-thumb { flex:none; aspect-ratio:16 / 9; width:100%; }
  body .podium-grid > .podium-card:first-child { grid-column:1 / -1; }
  .podium-grid > .podium-card:not(:first-child) .thumb-vtags { display:none; }
  .podium-grid > .podium-card:not(:first-child) .podium-meta { flex-wrap:wrap; }
  .ms-filters { flex-wrap:wrap !important; gap:2px !important; }
  .ms-filters > button { flex:1 1 10%; max-width:12.5%; }
  .ms-filters > :not(button) { flex:1 0 100%; }
  .ms-filters > button { flex:1 1 0; min-width:0; padding-left:1px !important; padding-right:1px !important; font-size:9px !important; letter-spacing:0 !important; white-space:nowrap; }
  .combine-btn { white-space:nowrap; flex:none; padding-left:10px; padding-right:10px; }
  .combine-switch ~ .rs-count { display:none; }
  .combine-switch { flex:none; }
  #pick-title { white-space:nowrap; }
}
