/* The Django-served pages of every puzzle on the kit (leaderboard,
   accounts), built only on the kit's tokens (games/static/games/puzzles/kit/puzzles.css)
   and the puzzle's accent. The account templates are shared with every
   game, so they keep their class names (rp-card, rp-form, rp-small). */

body.pz { min-height: 100vh; display: flex; flex-direction: column; }
/* the house's page skeleton (docs/design-language.md, "Layout and type"): a --page-max column inside the gutters, a --bar-h bar */
.pz-wrap { width: 100%; max-width: calc(var(--page-max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.pz-top { border-bottom: 1px solid var(--paper-edge); }
.pz-top .pz-wrap { padding-block: 4px; display: flex; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); flex-wrap: wrap; min-height: var(--bar-h); }
.pz-nav a, .pz-link { display: inline-flex; align-items: center; min-height: var(--tool-h); padding: var(--s1) var(--tool-pad); font: var(--w-tool) var(--t-tool)/1.1 var(--ui); }
.pz-nav { margin-right: calc(-1 * var(--tool-pad)); }
.pz-nav { display: flex; align-items: center; gap: var(--s1); flex-wrap: wrap; }
.pz-nav a, .pz-link { color: var(--soft); text-decoration: none; background: none; border: 0; cursor: pointer; }
.pz-nav a:hover, .pz-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.pz-nav form { display: inline; }
.pz-main { flex: 1; padding: var(--bar-gap) 0 var(--s5); }
.pz-foot { border-top: 1px solid var(--paper-edge); }
/* every link in the foot alike, Feedback and Analytics among them: ink, bold, underlined (docs/adr/0064) */
.pz-foot :is(a, .house-feedback) { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.pz-foot :is(a, .house-feedback):hover { text-decoration-thickness: 2px; }
.pz-foot .pz-wrap { display: flex; justify-content: flex-end; gap: var(--s3); flex-wrap: wrap; padding-top: var(--s3); padding-bottom: max(var(--s3), env(safe-area-inset-bottom, 0px)); color: var(--soft); font-size: var(--t-note); }

.pz h1 { margin-bottom: var(--s3); }
.pz .lead { margin-bottom: var(--s4); }
.pz .rp-card h2 { margin-bottom: var(--s3); }
.pz-messages { list-style: none; padding: 0; margin: 0 0 var(--s4); }
.pz-messages li { background: var(--paper-2); border: 1px solid var(--paper-edge); border-left: 3px solid var(--good); border-radius: var(--radius); padding: var(--s2) var(--s3); }

/* forms, on a sheet */
.rp-card { background: var(--paper-2); border: 1px solid var(--paper-edge); border-radius: var(--radius); padding: var(--s4); max-width: 460px; }
.rp-card + .rp-card { margin-top: var(--s3); }
.pz h1 + .rp-card { margin-top: var(--s4); }
.rp-form p { margin: 0 0 var(--s3); }
.rp-form p:last-child { margin-bottom: 0; }
.rp-form label { display: block; font: 600 var(--t-label)/1.3 var(--ui); margin-bottom: var(--s2); }
.rp-form input:not([type=hidden]) {
  width: 100%; min-height: 44px; padding: var(--s2) 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-2); color: var(--ink); font: var(--t-body) var(--ui);
}
/* (the ring is the kit's :focus-visible one, never removed) */
.rp-form input:focus { border-color: var(--focus); }
.rp-form .helptext { display: block; color: var(--soft); font-size: var(--t-note); margin-top: var(--s1); }
.rp-form .helptext ul { margin: var(--s1) 0 0; padding-left: 18px; }
.pz ul.errorlist { list-style: none; padding: 0; margin: var(--s1) 0 0; color: var(--bad); font-size: var(--t-note); font-weight: 600; }
.rp-small { color: var(--soft); font-size: var(--t-note); }
.rp-small a { color: var(--ink); text-underline-offset: 3px; }

/* the leaderboard: one switch to a row, so a pick never rewraps the page.
   The switches share one width, and each pick an equal share of it, so
   alike things line up (Rows in line); a level is its name over its size
   (or a chess level's ratings), as the home's ladder says them. */
.pz-switches { display: flex; flex-direction: column; align-items: stretch; gap: var(--s2); max-width: 34rem; margin: 0 0 var(--s3); }
.pz-switches .seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.pz-switches .seg > a { min-width: 0; min-height: 44px; padding-inline: 4px; }
.pz-switches .seg.levels > a { flex-direction: column; gap: 1px; min-height: 48px; padding-block: 5px; white-space: normal; text-align: center; line-height: 1.15; }
.pz-switches .seg .hint { font: 500 var(--t-kicker)/1.2 var(--ui); color: var(--soft); font-variant-numeric: tabular-nums; }
.pz-switches .seg .on .hint { color: var(--ink); }
/* (five picks on a phone: every range breaks after its dash, so all line up) */
.pz-switches .seg .hint br.narrow { display: none; }
@media (max-width: 480px) { .pz-switches .seg.levels:has(> a:nth-child(5)) .hint br.narrow { display: inline; } }
/* A day's board: Earlier, the day, Later, then Play at the end of the row;
   on a phone the day sits between Earlier and Later, Play the row under. */
.pz-daynav { display: grid; grid-template-columns: auto auto auto minmax(0, 1fr); align-items: center; gap: var(--s2) var(--s3); margin: 0 0 var(--s3); }
.pz-daynav strong { font: 400 var(--t-heading)/1.2 var(--display); min-width: 15em; text-align: center; }
.pz-daynav .pz-go { grid-column: -2 / -1; justify-self: end; }
@media (max-width: 560px) {
  .pz-daynav { grid-template-columns: auto minmax(0, 1fr) auto; }
  .pz-daynav strong { min-width: 0; }
  .pz-daynav .pz-go { grid-column: 1 / -1; justify-self: stretch; min-height: 44px; }
}
.pz-board { background: var(--paper-2); border: 1px solid var(--paper-edge); border-radius: var(--radius); padding: var(--s3) var(--s4) var(--s4); }
.pz-board-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2) var(--s3); flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: var(--s2); }
.pz-board-head span:first-child { font: 700 var(--t-heading)/1.3 var(--ui); }
.pz-board-head .code { color: var(--soft); font-size: var(--t-note); }
.pz-board table { width: 100%; border-collapse: collapse; margin-top: var(--s2); }
/* The name takes what's left and wraps if it must; the rank and figures
   keep to their width on one line, so a column never wraps or runs out of
   the panel on a phone. Every cell sits on one baseline, whatever its face. */
.pz-board th { text-align: left; font: 600 var(--t-note)/1.3 var(--ui); color: var(--soft); padding: var(--s2) var(--s2) var(--s1); white-space: nowrap; vertical-align: bottom; }
.pz-board td { padding: var(--s2); border-top: 1px solid var(--line); vertical-align: baseline; overflow-wrap: anywhere; }
.pz-board .num { width: 1%; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: var(--s3); }
/* Ranks and times are set in the book's display face, as a printed table sets its figures. */
.pz-board .num b { font: 400 20px/1.2 var(--display); }
.pz-board .rank { width: 1%; min-width: 1.6em; padding-right: var(--s3); white-space: nowrap; color: var(--soft); font: 400 18px/1.2 var(--display); }
.pz-board tbody tr:first-child .rank { color: var(--accent); }
.pz-board .small { font-size: var(--t-note); color: var(--soft); }
.pz-board tr.me td { background: color-mix(in srgb, var(--pick) 10%, transparent); }
.pz-board tr.me td:first-child { box-shadow: inset 3px 0 0 var(--pick); }
.pz-board .empty { margin: var(--s3) 0 0; color: var(--soft); }
.pz-guest { margin-top: var(--s3); }
@media (max-width: 560px) {
  .pz-board { padding: var(--s2) var(--s3) var(--s3); }
  .pz-board th, .pz-board td { padding-inline: var(--s1); }
  .pz-board .num { padding-left: var(--s2); }
  .pz-board .rank { min-width: 1.2em; padding-right: var(--s2); }
}
/* A board ranked on moves has three figures a row: on the narrowest phones
   how many they've solved gives way, so the names keep their room. */
@media (max-width: 420px) { .pz-board table.scored .solved { display: none; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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