/* LiveCrash curve canvas + animation keyframes */

.curve-canvas {
  position: relative;
  width: 100%;
  height: 240px;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(61, 240, 211, 0.06), transparent 60%),
    linear-gradient(180deg, #0d1216 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.curve-canvas svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.curve-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 32px;
  background-position: 0 100%;
  pointer-events: none;
}
.curve-mult-overlay {
  position: absolute;
  top: 18px;
  right: 16px;
  text-align: right;
  pointer-events: none;
}
.curve-mult-overlay .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
.curve-mult-overlay .value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
  text-shadow: 0 0 24px rgba(61, 240, 211, 0.3);
}
.curve-mult-overlay .value.crashed {
  color: var(--accent-hot);
  text-shadow: 0 0 24px rgba(255, 77, 109, 0.5);
}
.curve-mult-overlay .value.jackpot {
  color: var(--accent-jackpot);
  text-shadow: 0 0 24px rgba(255, 216, 74, 0.55);
}
.curve-mult-overlay .value.locked {
  color: var(--accent);
}
.curve-mult-overlay .sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
  margin-top: 2px;
}

/* baseline + axis ticks */
.curve-baseline-label {
  position: absolute;
  bottom: 8px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dimmer);
  letter-spacing: 0.08em;
}
.curve-axis-y {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--dimmer);
  letter-spacing: 0.04em;
}

/* pitch markers legend */
.pitch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.pitch-legend span { display: inline-flex; align-items: center; gap: 5px; }
.pitch-legend .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.pitch-legend .dot.ball { background: #5fa8ff; }
.pitch-legend .dot.strike { background: var(--accent-hot); }
.pitch-legend .dot.foul { background: var(--accent-jackpot); }
.pitch-legend .dot.inplay { background: var(--accent); }

/* idle state */
.curve-idle {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.curve-idle .countdown {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 40px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-transform: none;
}

/* hero curve loop (landing) */
.hero-curve {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
}
.hero-curve svg {
  width: 100%;
  height: 100%;
}
.hero-curve path.line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  filter: drop-shadow(0 0 8px rgba(61, 240, 211, 0.5));
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: hero-draw 8s linear infinite;
}
.hero-curve path.fill {
  fill: url(#heroFill);
  opacity: 0.5;
  animation: hero-fade 8s linear infinite;
}
@keyframes hero-draw {
  0% { stroke-dashoffset: 1000; }
  60% { stroke-dashoffset: 0; stroke: var(--accent); }
  72% { stroke: var(--accent-hot); stroke-dashoffset: 0; }
  85% { stroke: var(--accent-hot); stroke-dashoffset: 600; opacity: 0.4; }
  100% { stroke-dashoffset: 1000; stroke: var(--accent); opacity: 1; }
}
@keyframes hero-fade {
  0%, 60% { opacity: 0.4; }
  72% { opacity: 0.6; }
  100% { opacity: 0; }
}

/* live mini curve in lobby cards */
.mini-curve {
  width: 100%;
  height: 48px;
  display: block;
}
.mini-curve path.line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  filter: drop-shadow(0 0 4px rgba(61, 240, 211, 0.6));
}

/* multiplier display tick animation */
.mult-tick {
  display: inline-block;
  animation: mult-tick 100ms linear;
}
@keyframes mult-tick {
  0% { transform: translateY(0); }
  100% { transform: translateY(0); }
}

/* crash whip-down */
.curve-canvas.is-crashed .curve-line {
  stroke: var(--accent-hot);
  filter: drop-shadow(0 0 8px rgba(255, 77, 109, 0.6));
}
.curve-canvas.is-jackpot .curve-line {
  stroke: var(--accent-jackpot);
  filter: drop-shadow(0 0 8px rgba(255, 216, 74, 0.6));
}

/* cash-out lock-in pop */
@keyframes cashout-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(61, 240, 211, 0.15); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(61, 240, 211, 0); }
}
.cashout-pop { animation: cashout-pop 380ms cubic-bezier(0.2, 0.8, 0.2, 1); }

/* live tick dot */
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  margin-right: 6px;
  animation: lc-pulse 1.4s ease-in-out infinite;
}
.live-dot.hot { background: var(--accent-hot); box-shadow: 0 0 8px var(--accent-hot); }
.live-dot.idle { background: var(--dim); box-shadow: none; }

/* ticker (jackpots) */
.jp-ticker {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-bottom: 1px solid var(--border);
}
.jp-ticker-item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}
.jp-ticker-item .jp-mult {
  color: var(--accent-jackpot);
  font-weight: 600;
}

/* skeleton shimmer */
.skel {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-hi) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes skel {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* hero cta pulse */
@keyframes cta-pulse {
  0%, 100% { box-shadow: var(--glow-accent); }
  50% { box-shadow: 0 0 36px rgba(61, 240, 211, 0.5); }
}
.cta-pulse { animation: cta-pulse 4s ease-in-out infinite; }

/* fade-up scroll-trigger (CSS-only demo) */
.fade-up {
  opacity: 0;
  transform: translateY(8px);
  animation: fade-up 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes fade-up {
  to { opacity: 1; transform: translateY(0); }
}
