/* Chess Puzzles layout. Board colours and the dark and light themes come from ../rocket-chess/board.css. */
.cpz { max-width: 900px; margin: 0 auto; padding: 10px 8px 16px; color: var(--ui-text); border-radius: 14px; user-select: none; -webkit-user-select: none; }
.cpz[data-theme="light"] { background: #f7efe0; }
.cpz [hidden] { display: none !important; }
.cpz svg { flex: none; }
.cpz-top { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.cpz-modes { flex: 1 1 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 3px; border-radius: 13px; background: var(--ui-bg); border: 1px solid var(--ui-line); }
.cpz-mode { appearance: none; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 6px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--ui-muted); font: 800 14px/1.1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .15s, color .15s, box-shadow .15s; }
.cpz-mode svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cpz-mode span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) { .cpz-mode:hover { color: var(--ui-strong); background: rgba(85,214,255,.07); } }
.cpz-mode[aria-pressed="true"] { background: var(--ui-bg2); color: var(--ui-strong); box-shadow: inset 0 0 0 1.5px var(--ui-accent), 0 2px 12px rgba(85,214,255,.16); }
.cpz-mode:focus-visible { outline: 2px solid var(--ui-gold); outline-offset: 1px; }
.cpz-icons { display: flex; gap: 4px; flex: none; }
.cpz-main { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.cpz-boardcol { width: 100%; max-width: 580px; margin: 0 auto; min-width: 0; }
.cpz-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 34px; margin: 0 0 8px; }
.cpz-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--ui-bg); border: 1px solid var(--ui-line); font-size: 13px; color: var(--ui-muted); white-space: nowrap; }
.cpz-pill b { color: var(--ui-strong); font-weight: 800; }
.cpz-pill svg { width: 16px; height: 16px; }
.cpz-fire svg { fill: #ff9f43; stroke: #ff6b3d; stroke-width: 1.5; }
.cpz-pill.up { color: var(--ui-good); border-color: var(--ui-good); font-weight: 800; }
.cpz-pill.down { color: var(--ui-bad); border-color: var(--ui-bad); font-weight: 800; }
.cpz-clock { font: 800 17px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--ui-strong); font-variant-numeric: tabular-nums; border-color: var(--ui-accent); padding: 6px 12px; }
.cpz-clock.low { color: #fff; background: #b8283f; border-color: #ff6b81; animation: cpz-low 1s ease-in-out infinite alternate; }
@keyframes cpz-low { to { background: #7d1426; } }
.cpz-strikes i { font-style: normal; font-weight: 900; color: var(--ui-line); font-size: 14px; }
.cpz-strikes i.on { color: var(--ui-bad); text-shadow: 0 0 8px rgba(255,107,129,.5); }
.cpz-boardbox { position: relative; }
.cpz-cover { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; border-radius: 6px; background: rgba(6,10,24,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.cpz-cover.solid { background: rgba(6,10,24,.78); }
.cpz[data-theme="light"] .cpz-cover { background: rgba(250,244,232,.6); } .cpz[data-theme="light"] .cpz-cover.solid { background: rgba(250,244,232,.85); }
.cpz-cover-in { text-align: center; max-width: 380px; width: 100%; }
.cpz-cover-in h3 { margin: 0 0 6px; font-size: 24px; color: var(--ui-strong); }
.cpz-cover-in p { margin: 0 0 14px; color: var(--ui-text); }
.cpz-spin { display: inline-block; width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--ui-line); border-top-color: var(--ui-accent); animation: cpz-spin .8s linear infinite; }
@keyframes cpz-spin { to { transform: rotate(360deg); } }
.cpz-replay { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; padding: 6px; border-radius: 12px; background: var(--ui-bg); border: 1px solid var(--ui-line); }
.cpz-rbtn { appearance: none; width: 40px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--ui-line); background: var(--ui-bg2); color: var(--ui-text); cursor: pointer; padding: 0; }
.cpz-rbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cpz-rbtn.cpz-rplay svg path { fill: currentColor; }
.cpz-rbtn:disabled { opacity: .35; cursor: default; }
@media (hover: hover) { .cpz-rbtn:hover:not(:disabled) { border-color: var(--ui-accent); } }
.cpz-rbtn:focus-visible, .cpz-btn:focus-visible, .cpz-tag:focus-visible, .cpz-band:focus-visible, .cpz-kind:focus-visible, .cpz-chip:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
.cpz-rpos { flex: 1 1 auto; text-align: center; font-size: 13px; color: var(--ui-muted); white-space: nowrap; }
.cpz-side { background: var(--ui-bg); border: 1px solid var(--ui-line); border-radius: 12px; padding: 14px; min-width: 0; }
.cpz-status { font-weight: 700; font-size: 16px; line-height: 1.35; color: var(--ui-strong); min-height: 44px; }
.cpz-status.good { color: var(--ui-good); } .cpz-status.bad { color: var(--ui-bad); } .cpz-status.hint { color: var(--ui-gold); }
.cpz[data-theme="light"] .cpz-status.hint { color: #9a6400; }
.cpz-turn { display: inline-block; width: 13px; height: 13px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; border: 2px solid var(--ui-muted); }
.cpz-turn.w { background: #f4f7fa; } .cpz-turn.b { background: #1e2638; }
.cpz-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.cpz-actions:empty { display: none; }
.cpz-btn { appearance: none; flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--ui-line); background: var(--ui-bg2); color: var(--ui-text); font: 700 14px/1.1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; cursor: pointer; white-space: nowrap; }
.cpz-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cpz-btn:disabled { opacity: .4; cursor: default; }
@media (hover: hover) { .cpz-btn:hover:not(:disabled) { border-color: var(--ui-accent); } .cpz-btn-primary:hover:not(:disabled) { filter: brightness(1.07); } }
.cpz-btn:active:not(:disabled) { transform: translateY(1px); }
.cpz-btn-primary { background: var(--ui-gold); border-color: var(--ui-gold); color: var(--ui-gold-ink); }
.cpz-panel h3 { margin: 0 0 6px; font-size: 15px; color: var(--ui-strong); }
.cpz-panel p { margin: 0 0 10px; font-size: 13px; line-height: 1.45; color: var(--ui-muted); }
.cpz-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0; }
.cpz-stats div { background: var(--ui-bg2); border: 1px solid var(--ui-line); border-radius: 9px; padding: 7px 4px; text-align: center; }
.cpz-stats div.on { border-color: var(--ui-accent); }
.cpz-stats dt { font-size: 11px; color: var(--ui-muted); text-transform: uppercase; letter-spacing: .05em; }
.cpz-stats dd { margin: 2px 0 0; font-size: 18px; font-weight: 800; color: var(--ui-strong); font-variant-numeric: tabular-nums; }
.cpz-week { display: flex; gap: 5px; margin: 0 0 10px; }
.cpz-day { flex: 1; aspect-ratio: 1; max-width: 34px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--ui-line); font-size: 11px; font-weight: 800; color: var(--ui-muted); }
.cpz-day.ok { background: var(--ui-good); border-color: var(--ui-good); color: #fff; }
.cpz-day.no { border-color: var(--ui-bad); }
.cpz-day.today { box-shadow: 0 0 0 2px var(--ui-bg), 0 0 0 4px var(--ui-accent); }
.cpz-rating { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.cpz-rating b { font-size: 34px; line-height: 1; color: var(--ui-strong); font-variant-numeric: tabular-nums; }
.cpz-rating sup { font-size: 16px; color: var(--ui-muted); margin-left: 2px; }
.cpz-spark { width: 120px; height: 34px; }
.cpz-spark polyline { fill: none; stroke: var(--ui-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cpz-themes { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 10px; }
.cpz-tag { appearance: none; padding: 7px 10px; border-radius: 999px; border: 1px solid var(--ui-line); background: var(--ui-bg2); color: var(--ui-text); font: 700 13px/1.1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; cursor: pointer; }
.cpz-tag[aria-pressed="true"] { background: var(--ui-accent); border-color: var(--ui-accent); color: #04121c; }
.cpz-bands, .cpz-kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 3px; border-radius: 11px; background: var(--ui-bg2); border: 1px solid var(--ui-line); }
.cpz-kinds { grid-template-columns: repeat(3, 1fr); }
.cpz-band, .cpz-kind { appearance: none; min-width: 0; padding: 8px 4px; border: 0; border-radius: 8px; background: transparent; color: var(--ui-muted); font: 700 13px/1.15 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cpz-kind b { color: inherit; white-space: nowrap; } .cpz-kind small { font-size: 11px; font-weight: 600; opacity: .85; white-space: nowrap; }
.cpz-band[aria-pressed="true"], .cpz-kind[aria-pressed="true"] { background: var(--ui-bg); color: var(--ui-strong); box-shadow: inset 0 0 0 1.5px var(--ui-accent); }
.cpz-kind:disabled { cursor: default; opacity: .6; }
.cpz-kinds.big { display: flex; flex-direction: column; gap: 8px; padding: 0; background: none; border: 0; }
.cpz-kinds.big .cpz-kind { flex-direction: row; justify-content: space-between; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--ui-line); background: var(--ui-bg); color: var(--ui-strong); font-size: 16px; }
.cpz-kinds.big .cpz-kind[data-default] { border-color: var(--ui-gold); box-shadow: 0 0 0 1px var(--ui-gold); }
.cpz-kinds.big .cpz-kind small { font-size: 12.5px; color: var(--ui-muted); }
@media (hover: hover) { .cpz-tag:hover, .cpz-band:hover, .cpz-kind:hover:not(:disabled) { color: var(--ui-strong); } .cpz-kinds.big .cpz-kind:hover { border-color: var(--ui-accent); } }
.cpz-chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: 4px 0 6px; max-height: 120px; overflow: auto; }
.cpz-chips.small { justify-content: flex-start; margin: 10px 0 0; }
.cpz-chip { appearance: none; width: 28px; height: 28px; border-radius: 7px; border: 0; display: inline-grid; place-items: center; font: 900 14px/1 system-ui, sans-serif; color: #fff; cursor: pointer; padding: 0; }
.cpz-chips.small .cpz-chip { width: 20px; height: 20px; font-size: 11px; border-radius: 5px; cursor: default; }
.cpz-chip.ok { background: var(--ui-good); } .cpz-chip.no { background: var(--ui-bad); }
.cpz-small { font-size: 12.5px; color: var(--ui-muted); }
.cpz-link { appearance: none; border: 0; background: none; padding: 0; color: var(--ui-accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.cpz-info { margin: 12px 0 0; font-size: 12px; line-height: 1.45; color: var(--ui-muted); }
.cpz-credit { display: block; margin-top: 3px; opacity: .8; }
.cpz-overlay { position: fixed; inset: 0; background: rgba(2,5,14,0.72); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.cpz-overlay:not([hidden]) .cpz-dialog { animation: cpz-pop .2s ease-out; }
@keyframes cpz-pop { from { transform: scale(.94); opacity: 0; } }
.cpz-dialog { background: var(--ui-bg); color: var(--ui-text); border: 1px solid var(--ui-line); border-radius: 16px; padding: 22px; width: min(100%, 430px); max-height: calc(100% - 16px); overflow: auto; text-align: center; box-shadow: 0 24px 60px var(--ui-shadow); }
.cpz-dialog h3 { margin: 0 0 6px; color: var(--ui-strong); font-size: 22px; }
.cpz-dialog p { margin: 0 0 12px; color: var(--ui-muted); line-height: 1.45; }
.cpz-dialog .cpz-big { font-size: 42px; font-weight: 900; color: var(--ui-strong); margin: 4px 0 6px; line-height: 1; }
.cpz-dialog .cpz-big span { font-size: 16px; font-weight: 700; color: var(--ui-muted); }
.cpz-dlg-ic svg { width: 46px; height: 46px; fill: #ff9f43; stroke: #ff6b3d; stroke-width: 1.2; }
.cpz-dlg-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.cpz-dlg-actions .cpz-btn { flex: 0 1 auto; padding: 10px 18px; }
.cpz-rules { text-align: left; margin: 6px 0 14px; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; font-size: 14px; line-height: 1.45; }
@media (max-width: 760px) {
  .cpz-main { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cpz-side { padding: 10px 12px; }
  .cpz-status { min-height: 0; font-size: 15px; }
  .cpz-actions { margin: 8px 0 10px; }
}
@media (max-width: 480px) {
  .cpz { padding: 6px 2px 12px; }
  .cpz-top { gap: 6px; }
  .cpz-mode { flex-direction: column; gap: 2px; min-height: 46px; padding: 4px 2px; font-size: 12.5px; }
  .cpz-mode svg { width: 17px; height: 17px; }
  .cpz-icons .rb-icon { width: 38px; height: 38px; }
  .cpz-icons { flex-direction: column; gap: 3px; }
  .cpz-icons { display: grid; grid-template-columns: repeat(3, 1fr); }
  .cpz-hide-s { display: none; }
  .cpz-pill { font-size: 12.5px; padding: 4px 9px; }
}
@media (pointer: coarse) { .cpz-btn { min-height: 44px; } .cpz-rbtn { width: 46px; height: 44px; } }
/* full screen (set by game.js inside the site's immersive stage): the board sized to fit, nothing scrolls */
.cpz.cpz-fit { max-width: none; height: 100%; margin: 0; padding: 6px 6px 8px; border-radius: 0; display: flex; flex-direction: column; overflow: auto; }
.cpz-fit .cpz-top { margin: 0 0 6px; }
.cpz-fit .cpz-main { flex: 1 1 auto; min-height: 0; justify-content: center; grid-template-columns: var(--cpz-bs); }
.cpz-fit .cpz-boardcol { width: var(--cpz-bs); max-width: none; }
.cpz-fit .cpz-bar { margin-bottom: 6px; }
/* landscape full screen: the board on the left at full height; modes, status and panel in a column on the right */
.cpz.cpz-land { display: grid; grid-template-columns: var(--cpz-bs) 290px; grid-template-rows: auto minmax(0, 1fr); gap: 6px 14px; justify-content: center; align-content: start; overflow: hidden; }
.cpz-land .cpz-main { display: contents; }
.cpz-land .cpz-boardcol { grid-column: 1; grid-row: 1 / -1; }
.cpz-land .cpz-top { grid-column: 2; grid-row: 1; margin: 0; flex-wrap: wrap; }
.cpz-land .cpz-mode { flex-direction: column; gap: 1px; min-height: 40px; padding: 3px 2px; font-size: 12px; }
.cpz-land .cpz-mode svg { width: 16px; height: 16px; }
.cpz-land .cpz-icons .rb-icon { width: 34px; height: 34px; }
.cpz-land .cpz-side { grid-column: 2; grid-row: 2; min-height: 0; overflow: auto; padding: 10px; }
.cpz-land .cpz-status { min-height: 0; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .cpz-spin, .cpz-clock.low, .cpz-overlay:not([hidden]) .cpz-dialog { animation: none; } }
/* phones: result cards sit high, clear of the site's reward card at the bottom of the screen */
@media (max-width: 760px) { .cpz-overlay { align-items: flex-start; padding-top: max(64px, 8vh); } }
