/**
 * prediction-card.css — Sovereign Console prediction card system
 *
 * Shared visual layer for every surface that renders a prediction card.
 * Consumed by ProbeEdge_Vault.html (chain-backed pick history) and
 * ImpulseEngine_v2.html (simulation cards: leg / parlay option / flat
 * parlay row).
 *
 * Hash chain indicator (.prediction-card__hash) is STRICTLY for
 * chain-backed rows — rendered only on the Vault pick-history surface
 * per architect decision C. Simulation cards get the glass restyle
 * without the ledger signal.
 *
 * Companion behavior (click-to-copy + toast + tooltip toggles) lives
 * in prediction-card.js.
 */

/* ── Base glass card ─────────────────────────────────────────────── */
.prediction-card {
  position: relative;
  background: rgba(20, 20, 24, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid #C9A84C;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  /* Padding intentionally unset — preserve host-surface internal
     padding per architect spec 2a. Surface-specific rules below
     override only where the legacy layout breaks with the new bg. */
}
.prediction-card:hover {
  border-color: rgba(201, 168, 76, 0.9);
  box-shadow:
    0 0 24px rgba(201, 168, 76, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ── Vault pick-history card (chain-backed, classed rewrap) ──────── */
.prediction-card--history {
  padding: 14px 16px 38px;      /* extra bottom space for hash indicator */
  margin-bottom: 8px;
}
.prediction-card__meta {
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 7px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 5px;
}
.prediction-card__prediction {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
}
.prediction-card__result {
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 8px;
  color: #C9A84C;
  margin-top: 6px;
  letter-spacing: 2px;
}
.prediction-card__result.pending {
  color: rgba(255, 255, 255, 0.28);
}

/* ── ImpulseEngine additive overrides (simulation cards) ─────────── */
/* eng-leg-card — v2 Monte Carlo per-leg analysis. Keep internal grid. */
.eng-leg-card.prediction-card,
.eng-parlay-card.prediction-card {
  /* Existing padding/margin from ImpulseEngine stylesheet preserved.
     Only background + border + radius are taken over by the glass class. */
}
/* pb-leg-row — flat parlay breakdown. Was a border-bottom row; now a
   discrete card. Add rhythmic spacing so stacked cards don't touch. */
.pb-leg-row.prediction-card {
  margin-bottom: 8px;
  padding: 10px 12px;
}
.pb-leg-row.prediction-card:last-child {
  margin-bottom: 0;
}

/* ── Hash chain indicator (CHAIN-BACKED SURFACES ONLY) ──────────── */
.prediction-card__hash {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: #C9A84C;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.prediction-card__hash:hover {
  background: rgba(201, 168, 76, 0.10);
}
.prediction-card__hash-icon {
  font-size: 12px;
  opacity: 0.85;
  line-height: 1;
}
.prediction-card__hash-short {
  color: #C9A84C;
}

/* Pending state — chain row not yet hashed (resolves on WIN/LOSS).
   Muted color, cursor:help, tooltip explains, click shows toast. */
.prediction-card__hash--pending {
  color: rgba(201, 168, 76, 0.4);
  cursor: help;
}
.prediction-card__hash--pending:hover {
  background: transparent;
}
.prediction-card__hash--pending .prediction-card__hash-icon {
  opacity: 0.4;
}
.prediction-card__hash--pending .prediction-card__hash-short {
  color: rgba(201, 168, 76, 0.4);
  letter-spacing: 0.5px;
}

/* Desktop hover tooltip — dark glass popover with full hash + prev */
.prediction-card__hash::after {
  content: "RECORD HASH\A" attr(data-hash) "\A\A" "PREVIOUS HASH\A" attr(data-prev-hash);
  white-space: pre;
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 320px;
  max-width: 440px;
  padding: 10px 14px;
  background: rgba(8, 8, 12, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 6px;
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 9.5px;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.82);
  word-break: break-all;
  line-height: 1.6;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 9100;
}
.prediction-card__hash:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* Pending tooltip — different content, no hashes to reveal */
.prediction-card__hash--pending::after {
  content: "HASH PENDING\A\A" "The daily_picks hash chain writes this entry when the pick resolves (WIN or LOSS). Pending picks remain unhashed by design.";
  max-width: 320px;
  color: rgba(255, 255, 255, 0.65);
}

/* ── Toast — transient confirmation on copy ─────────────────────── */
#prediction-card-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  background: rgba(8, 8, 12, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid #C9A84C;
  border-radius: 6px;
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 10.5px;
  letter-spacing: 3px;
  color: #C9A84C;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  z-index: 10000;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
#prediction-card-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Mobile: hover tooltip off (touch can't trigger :hover
       reliably on iOS Safari). Toast covers the confirmation path. */
@media (max-width: 640px) {
  .prediction-card__hash::after { display: none; }
  .prediction-card__hash { bottom: 6px; right: 8px; font-size: 10.5px; }
}
