/* ============================================================
   LottoIQ — Shared Section Styles
   Section wrappers, dataset selector, hot/cold panels,
   overdue rows, pairs, pattern cards, and shared buttons.
   ============================================================ */

/* ── Section Shell ── */
.section {
  margin-bottom: 48px;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-note {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}

.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  max-width: 600px;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--navy-3);
  margin: 0 0 48px;
}

/* ── Dataset Selector ── */
.dataset-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

.dataset-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--navy-2);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius-lg);
  padding: 5px;
  width: fit-content;
}

.ds-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  padding: 0 10px;
  white-space: nowrap;
}

.ds-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  position: relative;
}

.ds-btn:hover {
  color: var(--text);
  background: var(--navy-3);
}

.ds-btn.active {
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
}

.ds-btn.locked {
  color: var(--text-dim);
  cursor: default;
}

.ds-btn.locked:hover {
  background: transparent;
}

.ds-lock {
  font-size: 10px;
  margin-left: 3px;
}

.dataset-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* ── Hot / Cold Two-Column Layout ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.panel {
  background: var(--navy-2);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.ball-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Large balls used in hot/cold panels */
.ball-lg {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
}

.ball-hot {
  background: var(--gold);
  color: var(--navy);
}

.ball-cold {
  background: transparent;
  border: 2px solid var(--cold-clr);
  color: var(--cold-clr);
}

/* ── Overdue Numbers ── */
.overdue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.overdue-row {
  background: var(--navy-2);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.overdue-row:hover {
  border-color: var(--navy-5);
}

.overdue-row.selected {
  border-color: var(--gold-dim);
  background: rgba(255, 215, 0, 0.06);
}

.overdue-rank {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  width: 14px;
  flex-shrink: 0;
}

.overdue-ball {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy-3);
  border: 1px solid var(--navy-5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--cold-clr);
  flex-shrink: 0;
}

.overdue-bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--navy-4);
  border-radius: 2px;
}

.overdue-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--cold-clr);
}

.overdue-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.overdue-draws {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.overdue-sub {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.overdue-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-style: italic;
}

/* ── Due Score ── */
.due-score-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.due-score-row {
  background: var(--navy-2);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.due-score-rank {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  width: 14px;
  flex-shrink: 0;
}

.due-score-ball {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.due-score-bar-wrap {
  flex: 1;
  min-width: 40px;
  height: 4px;
  background: var(--navy-4);
  border-radius: 2px;
}

.due-score-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--gold);
}

.due-score-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}

.due-score-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.due-score-trend {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Insider-only per-signal breakdown, shown inline on the same row */
.due-score-breakdown {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  border-left: 1px solid var(--navy-4);
  padding-left: 12px;
  margin-left: 4px;
  flex-shrink: 0;
}

.due-score-empty {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  padding: 12px 0;
}

/* "Showing top 5 · Unlock ... with Insider" nudge — hidden for Insiders */
.due-score-note {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 10px;
}

.due-score-note a {
  color: var(--gold);
  text-decoration: none;
}

.due-score-note a:hover {
  text-decoration: underline;
}

/* ── Randomness Audit ── */
.randomness-audit-card {
  background: var(--navy-2);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.randomness-audit-empty {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  padding: 12px 0;
}

.ra-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 16px;
}

.ra-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ra-stat-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.ra-stat-value.ra-pvalue {
  color: var(--gold);
}

.ra-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ra-verdict {
  font-size: 14px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--navy-4);
  background: var(--navy-3);
  color: var(--text-muted);
}

/* p < 0.05 — flagged as a notable deviation, still not a prediction */
.ra-verdict-flagged {
  border-color: var(--gold-bd);
  background: var(--gold-glow);
  color: var(--gold);
}

.ra-verdict-normal {
  border-color: var(--navy-4);
  color: var(--text-muted);
}

.ra-explainer {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.ra-explainer summary {
  cursor: pointer;
  color: var(--cold-clr);
  font-weight: 500;
  list-style: none;
}

.ra-explainer summary::-webkit-details-marker {
  display: none;
}

.ra-explainer summary::before {
  content: "▸ ";
}

.ra-explainer[open] summary::before {
  content: "▾ ";
}

.ra-explainer p {
  margin-top: 8px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ── Proof teaser (Randomness-in-Action Simulator link-out) ── */
/* Small card placed on the Randomness Audit section of the 4
   built-in game pages, pointing members to /proof/. Reuses the
   same card look as .randomness-audit-card rather than inventing
   a new visual language. */
.proof-teaser {
  background: var(--navy-2);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-top: 16px;
}

.proof-teaser p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.proof-teaser a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
}

.proof-teaser a:hover {
  text-decoration: underline;
}

/* ── Top Pairs (Insider unlock) ── */
.pairs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}

.pair-card {
  background: var(--navy-2);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pair-balls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pair-ball {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  background: var(--navy-3);
  border: 1px solid var(--navy-5);
  color: var(--text);
}

.pair-plus {
  font-size: 11px;
  color: var(--text-dim);
}

.pair-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Pattern Statistics ── */
.pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.pattern-card {
  background: var(--navy-2);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.pattern-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.pattern-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.pattern-detail {
  font-size: 11px;
  color: var(--text-dim);
}

/* ── Shared Buttons ── */
.btn-primary {
  background: var(--gold);
  color: var(--navy);
  border: none;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  padding: 11px 26px;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover  { opacity: 0.9; }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--navy-4);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 11px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover {
  border-color: var(--navy-5);
  color: var(--text);
}

/* Inline spinner (used inside Generate button while loading) */
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(10, 14, 26, 0.3);
  border-top-color: var(--navy);
  animation: spin 0.65s linear infinite;
  display: inline-block;
}