/* Бодлого (/puzzles, /puzzles/daily, /puzzles/race): the board and its panels. */
@layer page {
  .pz { --board-max: min(100%, 640px, calc(100svh - 160px)); display: grid; gap: var(--sp-5); max-width: 1180px; margin: 0 auto; }
  .pz-banner { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
  .pz-status { min-height: 1.5em; margin: 0; font-weight: var(--fw-bold); text-align: center; }
  .pz-status.is-alert { color: var(--bad); }
  .pz-review { justify-content: center; }
  .pz-stats { display: flex; flex-wrap: wrap; gap: var(--sp-4); color: var(--muted); }
  .pz-stats b { color: var(--text); font-size: var(--fs-20); }
  .pz-chips { gap: var(--sp-2); }
  .pz-news { margin: 0; }
  /* Phones: with nothing on the board, the tab's own panel comes first. */
  .pz[data-idle='true'] .pz-board { display: none; }
  @media (min-width: 700px) {
    .pz[data-idle='true'] .pz-board { display: grid; }   /* .stack's own display */
  }
  @media (min-width: 1100px) {
    .pz { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  }
  .pz-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
  .pz-streak, .race-timer { display: inline-flex; align-items: center; gap: var(--sp-1); font-weight: var(--fw-bold); }
  .race-timer.is-low { color: var(--bad); }
  .pz-empty { margin: 0; padding: var(--sp-4); }
  .lb-row.is-me { background: var(--surface-2); }
  .lb-rank { min-width: 2ch; color: var(--muted); text-align: end; }
  .lb-detail { color: var(--muted); }
  .race-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: var(--sp-3); }
  .race-strip { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
  .race-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-pill); font-weight: var(--fw-bold); }
  .race-mark.is-ok { background: var(--good); color: var(--on-primary); }
  .race-mark.is-bad { background: var(--bad); color: var(--on-primary); }
  .race-bar { display: flex; overflow: hidden; height: 6px; margin-top: var(--sp-1); border-radius: var(--r-pill); background: var(--surface-2); }
  .race-bar .is-ok { background: var(--good); }
  .race-bar .is-bad { background: var(--bad); }
  .race-result { display: flex; align-items: center; gap: var(--sp-2); margin: 0; }
  /* A class's set: one mark per puzzle — solved first, solved later, not solved, not tried, tomorrow's. */
  .set-strip { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
  .set-mark { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 var(--sp-1); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--text); font-weight: var(--fw-bold); cursor: pointer; }
  .set-mark[aria-current='true'] { outline: 3px solid var(--focus); outline-offset: 1px; }
  .set-mark[data-state='first'] { border-color: transparent; background: var(--good); color: var(--on-primary); }
  .set-mark[data-state='later'] { border-color: var(--good); color: var(--good); }
  .set-mark[data-state='failed'] { border-color: var(--bad); color: var(--bad); }
  .set-mark[data-state='waits'] { border-style: dashed; color: var(--muted); }
  .set-mark:disabled { cursor: default; }
  /* A pointer is precise enough for smaller marks; fingers keep 44 px. */
  @media (min-width: 1100px) {
    .set-mark { min-width: 36px; height: 36px; }
  }
  .fr-dot { display: inline-block; width: 10px; height: 10px; border-radius: var(--r-pill); background: var(--line-strong); }
  .fr-dot[data-on='true'] { background: var(--good); }
}
