/* ==========================================================================
   Clock Solitaire practice board, and the table of its narrated deal.

   clock-solitaire-trainer.js works out where every pile sits (layout(): twelve
   piles on an oval and the kings' pile in the center) and how big a card is, so
   the clock fits the board; the narrated deal uses the same layout at a fixed
   card size. This file says what things look like. Every color comes from the
   site's variables (see brand.css), so the light and dark themes both work.
   Loaded after brand.css.
   ========================================================================== */

.clk-board { padding: 12px 16px 12px; }
.clk-board .pr-status { margin: 0 0 8px; padding: 7px 12px; font-size: 15px; line-height: 1.4; }
@media (min-width: 561px) { .clk-board .pr-status { min-height: 58px; } }
.clk-board .h-stats { margin: 0 0 8px; padding-bottom: 5px; }
.clk-board .pr-tip { margin-top: 10px; }

/* the clock: the face is as big as layout() says, centered in the space it has */
.clk-clock { display: flex; justify-content: center; align-items: flex-start; min-height: 200px; }
.clk-face { position: relative; flex: 0 0 auto; }

/* one pile: a button holding its caption and its cards, stacked downward */
.clk-pile {
  position: absolute; padding: 0; margin: 0; border: 0; background: transparent; color: inherit; font: inherit;
  cursor: pointer; border-radius: 6px;
}
.clk-pile:disabled { cursor: default; }
.clk-pile > .gcard, .clk-pile > .clk-empty { position: absolute; left: 0; }
.clk-cap {
  display: block; margin: 0; font-size: 11px; line-height: 1.2; font-weight: 700; color: var(--muted);
  text-align: center; white-space: nowrap; letter-spacing: .02em;
}
.clk-pile > .clk-cap { position: absolute; left: -6px; right: -6px; top: 0; }
.clk-empty { display: block; border: 1.5px dashed var(--line-firm); border-radius: 6px; box-sizing: border-box; }
.clk-pile:hover:not(:disabled) .gcard { border-color: var(--ink); }
.clk-pile:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; z-index: 5; }

/* the turned card, in the corner */
.clk-hand { position: absolute; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.clk-hand .clk-cap { text-align: left; }
.clk-current { box-shadow: 0 0 0 3px var(--brass); }

/* cards: the rank and suit in the top-left corner, so a card that is partly covered still reads */
.clk-face .gcard { flex: 0 0 auto; padding: 0; transition: none; }
.clk-face .gcard:not(.gcard--back) {
  flex-direction: row; justify-content: flex-start; align-items: flex-start; gap: 1px;
  padding: 1px 3px; line-height: 1; text-align: left; overflow: hidden; border-color: rgba(18, 20, 26, 0.34);
}
.clk-face .gcard .gr, .clk-face .gcard .gs { font-size: inherit; line-height: 1; }
.clk-face .gcard:not(.gcard--back)::after {
  content: attr(data-s); position: absolute; right: 4px; bottom: 3px; font-size: 2em; line-height: 1; opacity: .9;
}
.clk-count {
  position: absolute; right: 2px; bottom: 2px; padding: 0 5px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line-firm);
  font-size: 11px; font-weight: 700; line-height: 1.45;
}

/* what the Hint points at (gold), and the pile the turned card came from (a faint ring) */
.clk-pile.clk-hint { outline: 3px solid var(--brass); outline-offset: 3px; }
.clk-pile.clk-from > .clk-cap { color: var(--text); text-decoration: underline; text-decoration-color: var(--brass); text-decoration-thickness: 2px; }

.clk-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.clk-controls .btn:disabled { opacity: .38; cursor: not-allowed; }
.clk-controls .btn:disabled:hover { background: transparent; color: var(--text); }

@media (max-width: 560px) {
  .clk-board { padding: 10px 8px; }
  .clk-cap { font-size: 10px; }
}

@media (forced-colors: active) {
  .clk-pile.clk-hint { outline: 3px double Highlight; }
  .clk-current { outline: 3px solid Highlight; box-shadow: none; }
  .clk-empty { border-color: CanvasText; }
}

/* fixed board: the clock takes the rest of the board, and on a phone too small for even the smallest cards it scrolls */
.pr-fixed .clk-board .pr-status { min-height: 0; }
.pr-fixed .clk-board .clk-clock { flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.pr-fixed .pr-dock .clk-controls { margin-top: 0; }
@container board (max-height: 470px) {
  .pr-fixed .clk-board .pr-status { font-size: 13px; padding: 6px 10px; margin-bottom: 6px; }
  .pr-fixed .clk-board .h-stats { margin-bottom: 4px; padding-bottom: 3px; }
}

/* ==========================================================================
   Watch a narrated deal: the table (clock-solitaire-watch.js draws it into the viewer's stage).
   Nothing here is clickable; the piles sit where layout() puts them for a card 28 pixels wide.
   ========================================================================== */
#clock-solitaire-watch .wv-stage { container: cwstage / inline-size; padding: 6px 8px 6px; }
.cw-table { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.cw-key { align-self: stretch; text-align: center; font-size: 11.5px; line-height: 1.3; color: var(--muted); min-height: 1.3em; margin: 0; }
.cw-face { position: relative; flex: 0 0 auto; width: var(--wn); height: var(--hn); }
.cw-face .cw-pos { position: absolute; left: var(--xn); top: var(--yn); }
/* a stage with room (a laptop): the same oval, drawn larger */
@container cwstage (min-width: 470px) and (max-width: 699.98px) { .cw-face { zoom: 1.2; } }
/* a very wide stage (a landscape video, which is short): the flat oval, which is about half as tall */
@container cwstage (min-width: 700px) {
  .cw-face { width: var(--ww); height: var(--hw); }
  .cw-face .cw-pos { left: var(--xw); top: var(--yw); }
}
.cw-pile > .gcard, .cw-pile > .clk-empty { position: absolute; left: 0; }
.cw-pile > .clk-cap { position: absolute; left: -6px; right: -6px; top: 0; font-size: 10px; }
.cw-face .clk-hand .clk-cap { font-size: 10px; }
.cw-face .gcard { flex: 0 0 auto; padding: 0; border-radius: 4px; border-width: 1.2px; transition: none; }
.cw-face .gcard:not(.gcard--back) {
  flex-direction: row; justify-content: flex-start; align-items: flex-start; gap: 1px; padding: 1px 2px; line-height: 1;
  text-align: left; overflow: hidden; font-size: 10px; border-color: rgba(18, 20, 26, 0.34);
}
.cw-face .gcard .gr, .cw-face .gcard .gs { font-size: inherit; line-height: 1; }
.cw-face .gcard:not(.gcard--back)::after { content: attr(data-s); position: absolute; right: 2px; bottom: 2px; font-size: 1.8em; line-height: 1; opacity: .9; }
.cw-face .clk-count { font-size: 10px; padding: 0 4px; }
.cw-face .gcard.wv-fresh { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 2; }
.cw-face .gcard.cw-turned { outline: 2px solid var(--brass); outline-offset: 1px; z-index: 2; }

#clock-solitaire-watch .wv-opt { font-size: 13px; line-height: 1.25; }
#clock-solitaire-watch .wv-options { gap: 2px; margin-top: 2px; }
#clock-solitaire-watch .wv-head { margin-bottom: 4px; }
#clock-solitaire-watch .wv-say { padding: 6px 14px 7px; margin-bottom: 5px; }
#clock-solitaire-watch .wv-text { font-size: 15px; line-height: 1.4; }
#clock-solitaire-watch .wv-stage { margin-bottom: 6px; }

@media (forced-colors: active) {
  .cw-face .gcard.wv-fresh, .cw-face .gcard.cw-turned { outline-color: Highlight; }
}
