/* The chess table's card (js/chess/table.js): the real DOM controls the table maps onto the stone or the
   hologram every frame (invisible there; the ink and the light are painted from them), and its plain look
   where it is shown flat. Shared by the safe room and the chess page; mountChess() loads it when the page
   has not. */

.sp-chess-card {
  position: fixed; left: 0; top: 0; z-index: 60;
  width: min(22.5rem, calc(100vw - 24px)); box-sizing: border-box;
  padding: 14px 16px 16px; border-radius: 12px;
  color: #1b1611; background: rgba(239, 232, 221, 0.95);
  box-shadow: 0 12px 32px rgba(18, 12, 8, 0.26), 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 0 0 1px rgba(27, 22, 17, 0.08);
  font: 500 15px/1.4 var(--font-body, system-ui, sans-serif);
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.sp-chess-card[hidden] { display: none; }
.sp-chess-card:focus { outline: none; }
.sp-chess-card p { margin: 0; }
/* (the board's stand-in for the keys: no box of its own; the blue square on the board is its focus) */
.sp-chess-kb, .sp-chess-card .sp-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sp-chess-kb:focus { outline: none; }
/* (the moves and what was taken share one block of fixed height: the buttons under it hold still, and a
   one-line move leaves no gap above the taken line) */
.sp-chess-msg { min-height: 6.3rem; }
.sp-chess-st { font: 600 1.25rem/1.25 var(--font-display, system-ui, sans-serif); letter-spacing: -0.01em; }
.sp-chess-sub { margin-top: 4px !important; font-size: 15px; line-height: 1.4; color: rgba(27, 22, 17, 0.74); }
/* What was taken: yours then CY-Bear's, each side's pieces as solid figures on a small tile of their own
   colour's ground (the black pieces you took in ink on the card's stone; the white ones CY-Bear took in
   white on ink), so a phone that cannot see the trays reads them at a glance; the side ahead adds +n */
.sp-chess-taken { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 6px !important; font-size: 14px; line-height: 1.5; color: rgba(27, 22, 17, 0.7); }
.sp-chess-tk { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.sp-chess-tk[hidden] { display: none; }
.sp-chess-who { font-weight: 600; color: rgba(27, 22, 17, 0.82); }
.sp-chess-figs { display: inline-flex; align-items: center; height: 24px; padding: 0 5px; border-radius: 6px; background: rgba(27, 22, 17, 0.09); font: 400 19px/1 "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", "DejaVu Sans", serif; color: #1b1611; }
.sp-chess-figs i { display: inline-block; width: 0.8em; font-style: normal; text-align: center; }
.sp-chess-figs.is-w { background: #2b231c; color: #fbf8f2; }
.sp-chess-lead { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: rgba(27, 22, 17, 0.72); }
.sp-chess-none { color: rgba(27, 22, 17, 0.56); }
.sp-chess-promo[hidden], .sp-chess-card button[hidden] { display: none; }
.sp-chess-promo, .sp-chess-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sp-chess-promo { padding-top: 10px; border-top: 1px solid rgba(27, 22, 17, 0.14); }
.sp-chess-card button {
  min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(27, 22, 17, 0.26); background: transparent; color: #1b1611;
  font: 600 14px/1 var(--font-body, system-ui, sans-serif); letter-spacing: 0.06em;
  cursor: pointer; touch-action: manipulation;
}
.sp-chess-card .sp-chess-back { margin-left: auto; border-color: #1b1611; background: #1b1611; color: #f5efe7; }
.sp-chess-card button.is-ask { border-color: #9a420c; color: #9a420c; }
.sp-chess-card button:focus-visible { outline: 2px solid #9a420c; outline-offset: 2px; }
@media (hover: hover) {
  .sp-chess-card button:hover { background: rgba(27, 22, 17, 0.07); }
  .sp-chess-card .sp-chess-back:hover { background: #3a2f25; }
}
.sp-chess-card button:active { background: rgba(240, 160, 102, 0.3); }

/* Challenge Luke: the sheet that starts a game against Luke himself (js/chess/remote/luke.js). Flat on the
   screen (a form you type in), the card's paper stock, every control a fingertip tall. */
.sp-chess-sheet {
  position: fixed; z-index: 80; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(26rem, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; box-sizing: border-box;
  margin: 0; padding: 20px 20px 16px; border-radius: 14px;
  color: #1b1611; background: rgba(243, 237, 228, 0.97);
  box-shadow: 0 18px 50px rgba(18, 12, 8, 0.35), inset 0 0 0 1px rgba(27, 22, 17, 0.08);
  font: 500 15px/1.45 var(--font-body, system-ui, sans-serif);
}
.sp-chess-sheet h2 { margin: 0 0 6px; font: 700 22px/1.15 var(--font-display, system-ui, sans-serif); letter-spacing: -0.01em; }
.sp-chess-sheet p { margin: 0 0 12px; color: rgba(27, 22, 17, 0.76); }
.sp-chess-sheet label { display: block; margin: 0 0 10px; font-weight: 600; font-size: 14px; }
.sp-chess-sheet label span { font-weight: 500; color: rgba(27, 22, 17, 0.62); }
.sp-chess-sheet input {
  display: block; width: 100%; box-sizing: border-box; min-height: 44px; margin-top: 4px; padding: 0 12px;
  border: 1px solid rgba(27, 22, 17, 0.3); border-radius: 10px; background: #fffdf9; color: #1b1611;
  font: 500 16px/1 var(--font-body, system-ui, sans-serif);
}
.sp-chess-sheet input:focus-visible { outline: 2px solid #9a420c; outline-offset: 1px; }
.sp-chess-sheet-err { color: #9a2a0c !important; font-weight: 600; }
.sp-chess-sheet-err[hidden] { display: none; }
.sp-chess-sheet-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.sp-chess-sheet-acts button {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(27, 22, 17, 0.3);
  background: transparent; color: #1b1611; font: 600 14px/1 var(--font-body, system-ui, sans-serif); cursor: pointer;
}
.sp-chess-sheet-acts button[type="submit"] { border-color: #c75b12; background: #c75b12; color: #fff; }
.sp-chess-sheet-acts button:focus-visible { outline: 2px solid #9a420c; outline-offset: 2px; }
.sp-chess-sheet button:disabled, .sp-chess-sheet input:disabled { opacity: 0.6; cursor: progress; }
@media (max-width: 560px) {
  .sp-chess-sheet { top: auto; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); }
}
