/* Daily chess puzzle. Board colours and Unicode pieces match the Couch to Chess diagrams. */
.cp-top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin: 0 0 .6rem; flex-wrap: wrap; }
.cp-turn { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; }
.cp-chip { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); }
.cp-chip-w { background: #fff; }
.cp-chip-b { background: #1a1a1a; }
.cp-count { color: var(--muted); font-size: .9rem; font-variant-numeric: lining-nums tabular-nums; }

.cp-board { display: grid; grid-template-columns: repeat(8, 1fr); width: 100%; max-width: 480px; aspect-ratio: 1; margin: 0 auto .8rem; border: 2px solid #6b4226; border-radius: 4px; overflow: hidden; user-select: none; -webkit-user-select: none; }
.cp-sq { position: relative; padding: 0; margin: 0; border: 0; border-radius: 0; min-width: 0; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; font: inherit; color: #1a1a1a; }
.cp-l { background: #f0e6d6; }
.cp-d { background: #b58863; }
.cp-l.cp-last { background: #e6d98a; }
.cp-d.cp-last { background: #c7a84f; }
.cp-sq.cp-sel { box-shadow: inset 0 0 0 4px var(--accent); }
.cp-sq.cp-check { background-image: radial-gradient(circle, rgba(210, 40, 40, .85) 0, rgba(210, 40, 40, .45) 45%, transparent 72%); }
.cp-dot::after { content: ""; position: absolute; width: 28%; height: 28%; border-radius: 50%; background: rgba(10, 77, 140, .45); pointer-events: none; }
.cp-cap::after { content: ""; position: absolute; inset: 4%; border-radius: 50%; border: 4px solid rgba(10, 77, 140, .5); pointer-events: none; }
.cp-sq:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; z-index: 1; }

/* Coordinates in the corner squares, like a printed board. */
.cp-rk, .cp-fl { position: absolute; font-size: 10px; font-weight: 700; line-height: 1; pointer-events: none; font-family: Arial, sans-serif; }
.cp-rk { top: 3px; left: 3px; }
.cp-fl { bottom: 3px; right: 3px; }
.cp-l .cp-rk, .cp-l .cp-fl { color: #b58863; }
.cp-d .cp-rk, .cp-d .cp-fl { color: #f0e6d6; }

/* Pieces: a solid glyph, and for White a white fill under the outline glyph. */
.cp-pc { position: relative; display: block; width: 100%; height: 100%; pointer-events: none; font-family: 'Segoe UI Symbol', 'Noto Sans Symbols 2', 'DejaVu Sans', 'Arial Unicode MS', sans-serif; font-size: clamp(26px, 8.6vw, 46px); line-height: 1; }
.cp-pc > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.cp-w .cp-fill { color: #fff; }
.cp-w .cp-line, .cp-b .cp-fill { color: #1a1a1a; }

.cp-promo { display: flex; justify-content: center; gap: .5rem; margin: -.2rem 0 .8rem; }
.cp-promo-b { width: 52px; height: 52px; padding: 0; border: 1px solid var(--rule); border-radius: 8px; background: #f0e6d6; cursor: pointer; }
.cp-promo-b .cp-pc { font-size: 36px; }
.cp-promo-b:hover, .cp-promo-b:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent); }

.cp-card { padding: .9rem 1rem .8rem; font-variant-numeric: lining-nums; }
.cp-msg { margin: 0; min-height: 1.4em; }
.cp-msg.ok { color: #2f7d4f; }
.cp-msg.bad { color: var(--bad); }
.cp-card #r .g-row { margin: .8rem 0 0; }
.cp-link { font-size: .9rem; }

/* On a phone the board runs edge to edge, so each square is a full tap target (45px at 360px). */
@media (max-width: 520px) and (hover: none) {
  .cp-board { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); border-left: 0; border-right: 0; border-radius: 0; }
}
