/* Standalone stylesheet for /chess/ - same isolation
   discipline as every other Perspective's own style.css (own file, not
   shared/imported), same token values chosen to match the main site by
   eye. */

:root {
  --color-bg: #f7f7f5;
  --color-surface: #ffffff;
  --color-border: #cfcfcb;
  --color-text-primary: #0a0a0a;
  --color-text-secondary: #555555;
  --color-text-tertiary: #737373;
  --color-accent: #2f6fed;
  --color-success: #1f9d55;
  --color-error: #c9432f;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #17181a;
    --color-surface: #1e2022;
    --color-border: #35383b;
    --color-text-primary: #ece9e4;
    --color-text-secondary: #a6a49f;
    --color-text-tertiary: #79776f;
    --color-accent: #5b8cff;
    --color-success: #4bcf8a;
    --color-error: #e2776a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  line-height: 1.55;
}

.masthead {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 24px 28px;
}

.wordmark {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-secondary);
  text-decoration: none;
  margin-bottom: 24px;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 600;
  margin: 0 0 10px;
}

.masthead h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.3rem);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.dek {
  color: var(--color-text-secondary);
  font-size: 1rem;
  margin: 0;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 20px;
}

.field-row {
  margin-bottom: 18px;
}

.field-row:last-of-type {
  margin-bottom: 22px;
}

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

select,
input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
}

.panel-title {
  font-size: 1.05rem;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.panel-subtitle {
  color: var(--color-text-secondary);
  font-size: 13.5px;
  margin: 0 0 18px;
}

/* Bulk show-all/hide-all links above the per-piece toggle row - plain
   text links, not full buttons, since they're a convenience shortcut
   for the checkboxes below, not a primary action. */
.piece-toggle-actions {
  display: flex;
  gap: 14px;
  margin: 0 0 10px;
}

.piece-toggle-actions button {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-accent);
  cursor: pointer;
  text-decoration: underline;
}

.piece-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}

.piece-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
}

.piece-toggle input {
  margin: 0;
  cursor: pointer;
}

/* Gallery of toggleable pieces - one card per piece TYPE (light+dark
   shown together, since they're the same shape) plus one board card
   plus one travel cover card. Unlike poker-chips' swipe carousel, every
   toggled-on card is visible at once, stacked - reviewing a piece's
   shape works better side by side than one at a time. */
.gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.gallery-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 18px;
}

.gallery-card-title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 12px;
}

.side-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.side-panel-label {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin: 0 0 6px;
}

.gallery-viewer {
  width: 100%;
  height: 180px;
  --poster-color: transparent;
  display: block;
  margin-bottom: 10px;
  border-radius: 8px;
  background: var(--color-bg);
}

.gallery-viewer.board-viewer {
  height: 280px;
}

.engraved-note {
  font-size: 12.5px;
  color: var(--color-text-tertiary);
  margin: 10px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--color-text-primary);
  color: var(--color-bg);
}

.btn-secondary {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

.btn-block { width: 100%; }

.feedback-text {
  min-height: 16px;
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--color-text-secondary);
}

.feedback-text.error { color: var(--color-error); }
.feedback-text.success { color: var(--color-success); }
.feedback-text[hidden] { display: none; }

.site-foot {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 24px 56px;
  border-top: 1px solid var(--color-border);
  font-size: 12.5px;
  color: var(--color-text-tertiary);
}

.site-foot a { color: var(--color-text-secondary); }

/* the perk under the buy button: there, and no louder than the fine print */
.chess-perk { margin-top: 10px; font-size: 12px; opacity: .72; }
