/* Solitaire's Django-served pages (its leaderboard, accounts), on the card
   room's felt like every card game's (static/tables/pages.css) with the
   game's own type from games/static/games/solitaire/solitaire.css: Fraunces
   for titles and the board's heading. Only what the boards need beyond the
   card room's pages: the switches, the day's paging, the table's marks. */

/* One switch to a row, so a pick never rewraps the page. Choosing isn't
   doing (house rule 3): a pick is a tint, an inner ring and bold, inside a
   group on the soft line. */
/* (one to a row, all one width, each pick an equal share, as every
   leaderboard's switches are: docs/guide/design/components.md) */
.sp-switches { display: flex; flex-direction: column; align-items: stretch; gap: var(--s2); margin: 0 0 var(--s3); max-width: 46rem; }
.sp-switches .tp-nav {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 3px; margin: 0; border: var(--field-edge); border-radius: var(--btn-radius);
}
.sp-switches .tp-nav a {
  display: flex; flex-direction: column; justify-content: center; align-items: center; min-width: 0; min-height: 44px; padding: 6px 8px; border-radius: max(0px, calc(var(--btn-radius) - 3px));
  color: var(--ink); text-decoration: none; font-size: 15px; line-height: 1.2; text-align: center;
}
.sp-switches .tp-nav a:hover { background: color-mix(in srgb, currentColor 8%, transparent); text-decoration: none; }
.sp-switches .tp-nav a[aria-current="true"] { background: var(--pick-tint); box-shadow: var(--pick-ring); font-weight: var(--pick-weight); }
/* (every choice holds its bold width, so a pick moves nothing) */
.sp-switches .tp-nav a::after { content: attr(data-label); display: block; height: 0; overflow: hidden; visibility: hidden; font-weight: var(--pick-weight); }

/* the board */
.tp-panel h2 { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.tp-table td.rank { font: var(--display-weight) 18px/1 var(--display); color: var(--soft); width: 1%; min-width: 1.4em; white-space: nowrap; }
.tp-table tr.me td { font-weight: 600; }
.tp-table tr.me td.rank { color: var(--ink); }

@media (max-width: 720px) {
  .sp-switches .tp-nav a { padding: 6px 10px; }
  /* the five boards, in rows of two that line up; the fifth takes its row */
  .sp-switches .tp-nav[aria-label="Game"] { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .sp-switches .tp-nav[aria-label="Game"] a:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* the narrowest phones: the all-time table's five columns fit the panel without scrolling */
@media (max-width: 400px) {
  .tp-panel { padding-inline: 12px; }
  .tp-table :is(th, td), .tp-table:not(.tp-scores) :is(td, th).num { padding-inline: 4px; }
  .tp-table th { letter-spacing: .02em; font-size: 11px; }
}

/* Arriving from a result sheet (static/js/board.js): your row lights up once. */
.tp-table tr.arrived td { animation: board-arrived 1.8s ease-out; }
@keyframes board-arrived { 0%, 35% { background: color-mix(in srgb, var(--ink) 22%, transparent); } }
@media (prefers-reduced-motion: reduce) { .tp-table tr.arrived td { animation: none; } }
