/* CardioRidiculo Shared Brand Design System (Option A: Warm Chalk + Dark Game Arena,
 * Typography #3: Rubik display + Lexend body + tabular-nums).
 * Safe to load pre-auth (added to PUBLIC_PATHS in lib/public-paths.js).
 */
:root {
  /* Warm Chalk / Gym-Poster Light Palette */
  --cr-chalk: #f5f1e8;
  --cr-card: #ffffff;
  --cr-tint: #ebe5d8;
  --cr-divider: #d6d0c4;
  --cr-border-soft: #bdb6a8;
  --cr-ink: #111114;
  --cr-muted: #55525c;

  /* Mascot Sweatband & Heart Brand Colors */
  --cr-red: #e1262d;
  --cr-red-hover: #c51d24;
  --cr-blue: #1b5be0;
  --cr-blue-hover: #1549b8;
  --cr-blue-soft: #e8f0fe;
  --cr-green: #1ca64c;
  --cr-green-hover: #168a3e;
  --cr-green-soft: #ecfdf5;
  --cr-green-ink: #146c32;
  --cr-gold: #f2a900;
  --cr-gold-soft: #fef9c3;
  --cr-gold-ink: #8a5a00;
  --cr-orange-ink: #c2410c;
  --cr-red-soft: #fef2f2;
  --cr-red-ink: #991b1b;

  /* Dark Game Arena (canvas stages & active gameplay overlays) */
  --cr-arena-bg: #121216;
  --cr-arena-panel: #1b1a20;
  --cr-arena-line: #34323c;
  --cr-arena-text: #f5f1e8;
  --cr-arena-muted: #b0acb8;

  /* Typography (#3: Rubik + Lexend) */
  --cr-font-display: 'Rubik', 'Trebuchet MS', system-ui, sans-serif;
  --cr-font-body: 'Lexend', system-ui, -apple-system, sans-serif;

  /* Geometry */
  --cr-radius-btn: 10px;
  --cr-radius-card: 14px;
  --cr-radius-badge: 999px;
}

/* Display typography for headings and brand wordmarks */
h1, h2, h3, h4,
.brand,
.nav-brand-title,
.seo-brand,
.topbar h1 {
  font-family: var(--cr-font-display);
  letter-spacing: -0.02em;
}

button,
.cr-btn,
.cr-seg-toggle {
  font-family: var(--cr-font-display);
}

/* ---------- Shared Unified Tactile Arcade Buttons ----------
 * One shape (10px radius, 2px solid Jet Ink border, 3px solid press lip).
 * Flat solid fills only — zero red-to-orange or green-to-teal AI gradients.
 */
.cr-btn,
.cr-btn-primary,
.cr-btn-go,
.cr-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--cr-radius-btn);
  border: 2px solid var(--cr-ink);
  box-shadow: 0 3px 0 var(--cr-ink);
  font-family: var(--cr-font-display);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 60ms ease, box-shadow 60ms ease, background-color 120ms ease;
}
.cr-btn:active:not(:disabled),
.cr-btn-primary:active:not(:disabled),
.cr-btn-go:active:not(:disabled),
.cr-btn-secondary:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--cr-ink);
}
.cr-btn:focus-visible,
.cr-btn-primary:focus-visible,
.cr-btn-go:focus-visible,
.cr-btn-secondary:focus-visible,
.cr-btn-quiet:focus-visible,
.cr-seg-toggle:focus-visible {
  outline: 3px solid var(--cr-blue);
  outline-offset: 2px;
}

.cr-btn-primary {
  background: var(--cr-red);
  color: #ffffff;
}
.cr-btn-primary:hover:not(:disabled) {
  background: var(--cr-red-hover);
  color: #ffffff;
  text-decoration: none;
}

.cr-btn-go {
  background: var(--cr-green);
  color: #ffffff;
}
.cr-btn-go:hover:not(:disabled) {
  background: var(--cr-green-hover);
  color: #ffffff;
  text-decoration: none;
}

.cr-btn-secondary {
  background: var(--cr-card);
  color: var(--cr-ink);
}
.cr-btn-secondary:hover:not(:disabled) {
  background: var(--cr-tint);
  color: var(--cr-ink);
  text-decoration: none;
}

.cr-btn-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--cr-tint);
  color: var(--cr-ink);
  border: 1.5px solid var(--cr-border-soft);
  border-radius: var(--cr-radius-btn);
  box-shadow: none;
  font-family: var(--cr-font-display);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.cr-btn-quiet:hover:not(:disabled) {
  background: var(--cr-divider);
  color: var(--cr-ink);
}

.cr-btn-primary:disabled,
.cr-btn-go:disabled,
.cr-btn-secondary:disabled,
.cr-btn-quiet:disabled {
  background: var(--cr-divider);
  color: var(--cr-muted);
  border-color: var(--cr-border-soft);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Segmented Player-Mode Switch (#onePlayerToggle) ---------- */
.cr-seg-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  background: var(--cr-tint);
  border: 2px solid var(--cr-ink);
  border-radius: var(--cr-radius-btn);
  box-shadow: 0 3px 0 var(--cr-ink);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--cr-ink);
}
.cr-seg-toggle:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--cr-ink);
}
.cr-seg-opt {
  padding: 6px 12px;
  border-radius: 7px;
  color: var(--cr-muted);
  font-weight: 800;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}
.cr-seg-opt.is-active {
  background: var(--cr-blue);
  color: #ffffff;
}

/* ---------- Explicit Action + Status Pill Switch ----------
 * Used by Sound (#muteBtn / #zSoundBtn) and Heart rate display (#menuShowHr / #showHrMenuToggle)
 * so action label and current status are visually unmistakable.
 */
.cr-toggle-label {
  font-weight: 700;
}
.cr-toggle-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 9px;
  border-radius: var(--cr-radius-badge);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.3;
  font-family: var(--cr-font-display);
  flex: 0 0 auto;
}
.cr-toggle-pill.is-on {
  background: var(--cr-green);
  color: #ffffff;
  border: 1.5px solid var(--cr-ink);
}
.cr-toggle-pill.is-mid {
  background: var(--cr-blue);
  color: #ffffff;
  border: 1.5px solid var(--cr-ink);
}
.cr-toggle-pill.is-off {
  background: var(--cr-tint);
  color: var(--cr-muted);
  border: 1.5px solid var(--cr-border-soft);
}

/* ---------- Shared Public Sticky Header (Privacy, etc.) ---------- */
.cr-public-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--cr-chalk);
  border-bottom: 2px solid var(--cr-ink);
  padding: 10px 18px;
}
.cr-public-header-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.cr-public-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--cr-ink);
}
.cr-public-brand:hover {
  text-decoration: none;
}
.cr-public-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 auto;
}
.cr-public-brand-title {
  font-family: var(--cr-font-display);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--cr-ink);
}
.cr-public-brand-title span {
  color: var(--cr-red);
}
.cr-public-brand-tag {
  display: block;
  font-family: var(--cr-font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cr-blue);
}
