/* ==================================================================
   replay.css — forecast replay ("time machine") card, app.neurostats.ai.
   Everything is scoped under .replay-*. The card reuses .demo, which
   keeps the dark instrument well (--well) in BOTH page themes — the
   same convention as the surface card — so in-card ink uses the same
   literal white alphas style.css already uses inside .demo; everything
   else rides the design tokens from style.css.
   ================================================================== */

/* the control bar wraps on narrow cards instead of overflowing */
.replay-bar { flex-wrap: wrap; row-gap: 10px; }

.replay-group { display: inline-flex; align-items: center; gap: 9px; }

.replay-label {
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(245, 245, 247, 0.42);
}

/* ----------------------- symbol select --------------------------- */

.replay-select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-color: rgba(255, 255, 255, 0.06);
  color: rgba(245, 245, 247, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em;
  padding: 6px 28px 6px 14px;
  /* inline chevron: data: URI, allowed by the app CSP (img-src data:) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23a7a7ad'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.replay-select:hover {
  color: rgba(245, 245, 247, 1);
  border-color: rgba(255, 255, 255, 0.35);
}
.replay-select option { background: var(--well); color: rgba(245, 245, 247, 0.9); }

/* ----------------------- session slider -------------------------- */

.replay-session { flex: 1 1 220px; min-width: 200px; }

.replay-slider {
  -webkit-appearance: none; appearance: none;
  flex: 1 1 90px; min-width: 90px;
  height: 4px; margin: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
}
.replay-slider:disabled { opacity: 0.4; cursor: default; }
.replay-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(245, 245, 247, 0.92);
  border: 0; cursor: grab;
  transition: transform 0.15s var(--ease-out);
}
.replay-slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.12); }
.replay-slider::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(245, 245, 247, 0.92);
  border: 0; cursor: grab;
}
.replay-slider::-moz-range-track {
  height: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.replay-date {
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  color: rgba(245, 245, 247, 0.85);
  min-width: 10ch; text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ----------------------- window buttons -------------------------- */

.replay-windows {
  display: inline-flex; gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px; padding: 4px;
}
.replay-win {
  appearance: none; border: 0; cursor: pointer;
  background: transparent; color: rgba(245, 245, 247, 0.6);
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em;
  padding: 6px 13px; border-radius: 999px;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.replay-win:hover { color: rgba(245, 245, 247, 0.9); }
.replay-win[aria-pressed="true"] {
  background: rgba(245, 245, 247, 0.92);
  color: var(--well);
}

/* --------------------- play / speed buttons ----------------------- */

.replay-btn {
  appearance: none; cursor: pointer;
  background: transparent; color: rgba(245, 245, 247, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  padding: 7px 14px; border-radius: 999px;
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out),
    background 0.2s var(--ease-out);
}
.replay-btn:hover {
  color: rgba(245, 245, 247, 0.9);
  border-color: rgba(255, 255, 255, 0.35);
}
.replay-btn[aria-pressed="true"] {
  background: rgba(245, 245, 247, 0.92);
  color: var(--well);
  border-color: transparent;
}

/* fixed widths so Play/Pause and 1x/4x don't reflow the bar */
.replay-play { min-width: 5.5em; text-align: center; }
.replay-speed { min-width: 3.5em; text-align: center; }

/* -------------------------- focus rings --------------------------- */

.replay-select:focus, .replay-slider:focus,
.replay-btn:focus, .replay-win:focus { outline: none; }
.replay-select:focus-visible, .replay-slider:focus-visible,
.replay-btn:focus-visible, .replay-win:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------------------------- canvas ------------------------------ */

.replay-canvas {
  width: 100%;
  height: clamp(320px, 44vw, 520px);
  outline-offset: -3px;
}

/* ------------------------- verdict strip -------------------------- */
/* mirrors #surface-readout so the two instrument cards read as one kit */

.replay-verdict {
  min-height: 40px;
  padding: 10px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  color: rgba(245, 245, 247, 0.66);
  font-variant-numeric: tabular-nums;
}
.replay-verdict strong {
  color: rgba(245, 245, 247, 0.95);
  font-weight: 600;
}

/* -------------------------- breakpoints --------------------------- */

@media (max-width: 720px) {
  .replay-session { flex-basis: 100%; order: 5; } /* slider gets its own row */
  .replay-canvas { height: clamp(280px, 62vw, 380px); }
}
