/* ═══════════════════════════════════════════════════════════════════════════
   CoinzBack V2 — dedicated page styles
   Loaded ONLY on coinz-back.html (the canonical read + claim surface per
   CoinzBack V2 PRD §2.4 + the "Dedicated CoinzBack page" user story).

   The cadence cards deliberately share the lobby carousel's class names
   (.cb-card / .cb-build / .cb-ring / .cb-claimrow / .cb-state-chip / .cb-coin)
   so the two surfaces read identically — cross-surface consistency is a design
   requirement (2026-07-09 review). The card block below is byte-parallel with
   fun-machine.css; edit both together. Safe from collision: no lobby page loads
   THIS file, and this page does not load fun-machine.css, so the .cb-card family
   lives in exactly one stylesheet per page. Only .cb-section overlaps
   coinz-hub.css, and this file never redefines it.

   All colors are ratified tokens or allowlisted raw values. No invented palette.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Orientation line above the cards (§2.2 module opener, extended for Instant) */
.cb-lead {
  color: var(--text-primary);
  font-size: var(--text-18);
  line-height: 1.6;
  margin: 0 0 var(--sp-20);
  max-width: 64ch;
}
.cb-lead strong { color: var(--gc-coin-color); font-weight: 800; }

/* Section heading used outside the .cb-section box (cards live on the page bg) */
.cb-h2 {
  margin: 0 0 var(--sp-16);
  font-size: var(--text-24); font-weight: 600; color: #ffffff;
}

/* ───────── Cadence card grid ───────── */
.cb-cadence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-16);
  margin-bottom: var(--sp-12);
}
.cb-card {
  display: flex; flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-secondary);
  background:
    radial-gradient(130% 110% at 100% 0%, rgba(0, 252, 253, 0.10), transparent 55%),
    var(--surface-lighter);
  padding: var(--sp-16);
}
.cb-card[data-cb-state="claimable"], .cb-card[data-cb-state="ready"] { border-color: rgba(38, 255, 34, 0.35); }
.cb-head { margin-bottom: var(--sp-12); min-height: 20px; }
.cb-cadence { font-weight: 800; font-size: var(--text-14); letter-spacing: 0.02em; color: var(--text-primary); }
.cb-cadence .bi { color: #00fcfd; margin-right: 4px; }

/* above the line: building amount + circular ring + "Claim in" */
.cb-build { display: flex; align-items: center; gap: var(--sp-12); }
.cb-ring { flex: 0 0 auto; }
.cb-ring-track { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 4; }
.cb-ring-prog {
  fill: none; stroke: #00fcfd; stroke-width: 4; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: center;
  transition: stroke-dashoffset 1s linear;
}
/* Instant's ring tracks amount-to-threshold, not time — gold to read differently */
.cb-card--instant .cb-ring-prog { stroke: var(--gc-coin-color); }
.cb-build-info { min-width: 0; }
.cb-build-amount { font-family: var(--third-family); font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1.15; }
.cb-build-timer { font-size: var(--text-12); color: var(--text-secondary); margin-top: 2px; }
.cb-build-timer strong { color: var(--text-primary); font-family: var(--third-family); font-variant-numeric: tabular-nums; }
.cb-coin { font-size: 11px; font-weight: 800; color: var(--sc-coin-color); }

.cb-divider { border-top: 1px dashed var(--border-secondary); margin: var(--sp-12) 0; }

/* below the line: one state-carrying CTA (2026-07-09 follow-up). Enabled cyan to
   claim/collect, ghost + disabled when there is nothing, green success flash on
   claim. Replaces the earlier earned-line + separate button. */
.cb-cta {
  display: block; width: 100%;
  font: inherit; font-weight: 900; font-size: 15px; text-transform: uppercase; letter-spacing: 0.02em;
  text-align: center; padding: 12px 16px;
  border: 0; border-radius: var(--radius-pill); cursor: pointer;
  transition: transform .15s, filter .15s;
}
.cb-cta .bi { margin-right: 6px; }
.cb-cta--go { color: var(--text-on-cyan); background: var(--accent-cyan-gradient); }
.cb-cta--go:hover { filter: brightness(1.08); }
.cb-cta--go:active { transform: scale(0.98); }
.cb-cta--off, .cb-cta--done { cursor: default; text-transform: none; letter-spacing: 0; font-weight: 700; font-size: var(--text-14); }
.cb-cta--off { color: var(--text-secondary); background: var(--surface-lightest-x2); }
.cb-cta--done { color: var(--sc-coin-color); background: rgba(38, 255, 34, 0.15); }

.cb-pulse { animation: cb-pulse 0.6s ease; }
@keyframes cb-pulse { 0% { color: var(--sc-coin-color); } 100% { color: inherit; } }

/* Per-card state switcher (review tool, styled apart) */
.cb-poc-tools {
  margin-top: var(--sp-12); padding-top: var(--sp-8);
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  display: flex; align-items: center; gap: var(--sp-8);
}
.cb-poc-label {
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-tertiary); flex: 0 0 auto;
}
.cb-poc-select {
  flex: 1 1 auto; min-width: 0;
  font: inherit; font-size: var(--text-12); font-weight: 600;
  color: var(--text-secondary); background: var(--surface-lightest);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--radius-pill);
  padding: 4px 10px; cursor: pointer;
}
.cb-poc-select:hover { color: var(--text-primary); border-color: var(--border-secondary); }
.cb-poc-note { color: var(--text-tertiary); font-size: var(--text-12); margin: var(--sp-8) 0 var(--sp-28); }

/* ───────── "How CoinzBack works" explainer ───────── */
.cb-how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-16);
  margin-top: var(--sp-8);
}
.cb-how-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: var(--sp-16);
  border-radius: var(--radius-md);
  background: var(--surface-lightest);
  border: 1px solid var(--border-secondary);
}
.cb-how-icon {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 252, 253, 0.12);
  color: #00fcfd; font-size: var(--text-18);
  margin-bottom: 2px;
}
.cb-how-title { font-weight: 800; font-size: var(--text-16); color: var(--text-primary); }
.cb-how-body { font-size: var(--text-14); line-height: 1.55; color: var(--text-secondary); }
.cb-how-body strong { color: var(--text-primary); font-weight: 700; }

/* Tier-table: reframed "reach it by" column, relative rate pips, caption */
.cb-tier-reach { color: var(--text-secondary); font-size: var(--text-14); }
.cb-rate-col { text-align: right; }
.cb-rate-pips { color: var(--gc-coin-color); letter-spacing: 2px; font-size: var(--text-16); }
.cb-tier-note { color: var(--text-tertiary); font-size: var(--text-12); margin: var(--sp-12) 0 0; line-height: 1.5; }
.cb-tier-note strong { color: var(--text-secondary); font-weight: 700; }

@container page (max-width: 600px) {
  .cb-cadence-grid { grid-template-columns: 1fr; }
}
