/* BackgammonX v0.2.6 — 06-geometry-calibration.css — Alpha Foundation 1
   Owns: checker-stack circles (state-driven, from js/18-checker-renderer.js)
   and the temporary Geometry Calibration Lab overlay/panel
   (js/19-calibration-lab.js). Does not own the board frame/image itself
   (still css/02, unchanged) or shell chrome (css/05, unchanged).

   Checker colors below are diagnostic placeholders only — BGXMASTER.png
   has not been calibrated for checker color/theme art at all (this was
   explicitly retired in v0.0.3 and remains unestablished; see
   js/18-checker-renderer.js's header comment). Nothing here encodes a
   rule: PlayerSide P1/P2 is an abstract identity, not a color. */

:root { --bgx-css-06: 1; }

/* ---------------- Checker layer ---------------- */

.checker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none; /* Alpha Foundation 1: display-only, no click/drag authority */
}

.checker {
  position: absolute;
  width: var(--checker-size, 6%);
  height: var(--checker-size, 6%);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
}

.checker-p1 {
  /* v0.2.19 §E — driven by the player's own colour choice (js/24's
     BGX.presentationControls), defaulting to the ORIGINAL cream/tan
     gradient as a fallback so a page load before JS applies anything
     (or a JS failure) never leaves a checker unstyled. */
  background: radial-gradient(circle at 35% 30%, var(--bgx-p1-light, #fbf6ea), var(--bgx-p1-mid, #d8cfb8) 70%, var(--bgx-p1-dark, #b7ab8c));
  /* v0.2.19 PATCH-1 §8 — per-colour border (was a single fixed value
     regardless of colour). Black/White specifically get a border
     calibrated for contrast against the board itself, not merely
     against the checker's own fill — see js/24's own COLOR_PALETTE
     comment for why those two colours needed different treatment from
     the rest. */
  border: 1.5px solid var(--bgx-p1-border, rgba(0, 0, 0, 0.35));
}

.checker-p2 {
  background: radial-gradient(circle at 35% 30%, var(--bgx-p2-light, #3a4640), var(--bgx-p2-mid, #1c2620) 70%, var(--bgx-p2-dark, #0f1713));
  border: 1.5px solid var(--bgx-p2-border, rgba(241, 235, 221, 0.25));
}

.checker-overflow-badge {
  font-size: 0.6em;
  font-weight: 700;
  color: var(--felt-900);
  background: var(--gold);
  border-radius: 999px;
  padding: 0.05em 0.35em;
  line-height: 1.3;
  pointer-events: none;
}

/* ---------------- Geometry Calibration Lab overlay ---------------- */

.geometry-calibration-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.calib-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border-radius: 50%;
  background: rgba(255, 0, 200, 0.75);
  border: 2px solid #ffffff;
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.calib-marker.is-selected {
  background: rgba(0, 220, 255, 0.9);
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 220, 255, 0.35);
}

/* ---------------- Geometry Calibration Lab control panel ---------------- */

.calibration-lab-panel {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: 1px dashed rgba(255, 0, 200, 0.6);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.calib-panel-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
}

.calib-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.calib-select {
  font: inherit;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
}

.calib-readout {
  font-size: var(--fs-sm);
  font-family: monospace, monospace;
  color: var(--text-muted);
}

.calib-nudge-btn {
  min-width: 44px;
  padding: var(--space-1) var(--space-2);
}

/* ---------------- Export / Import Calibration JSON (Patch 1) ---------------- */

.calib-export-box {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.calib-json-textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: monospace, monospace;
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--felt-900);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  resize: vertical;
}

.calib-status-text {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.calib-status-error {
  color: #ff6b6b;
}

.calib-hint {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* v0.2.6: the "PATCH 2: temporary OFF/borne-off preview" rules that used
   to sit here (.off-preview-layer / .off-preview-checker*) are removed —
   borne-off checkers are no longer rendered on the board at all; see
   js/18-checker-renderer.js's own v0.2.6 header note and
   css/07-player-status.css's BORNE OFF rail. */



/* ---------------- v0.2.6 calibration-only zoom ---------------- */
.board-frame.calibration-zoom-active {
  overflow: hidden;
}

.board-frame.calibration-zoom-active .board-art {
  will-change: transform;
}

.calib-zoom-row {
  margin-top: 2px;
}

.calib-zoom-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 2px;
}

.calib-zoom-btn {
  min-width: 38px;
  padding: var(--space-1) var(--space-2);
}

.calib-zoom-readout {
  min-width: 44px;
  text-align: center;
  font-family: monospace, monospace;
  font-size: var(--fs-sm);
  color: var(--text);
}
