/* Celebration overlay — confetti, toast, level-up pulse, payoff, tape punch */

.pp-confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 80;
  opacity: 0;
}
.pp-confetti.is-on { opacity: 1; }

.pp-toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translate(-50%, -120%);
  z-index: 85;
  min-width: min(92vw, 340px);
  max-width: 440px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #1a1410;
  color: #fff8f0;
  box-shadow: 0 12px 40px rgba(26, 20, 16, 0.35);
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.pp-toast.is-on { transform: translate(-50%, 0); }
.pp-toast strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.pp-toast span { font-size: 0.82rem; opacity: 0.88; }

.pp-level-up {
  animation: pp-level-up 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}
@keyframes pp-level-up {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(232, 120, 72, 0.0); }
  35% { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(232, 120, 72, 0.22); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(232, 120, 72, 0); }
}

.pp-edge {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 70;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.pp-edge.is-on { opacity: 1; }
.pp-edge.kind-buy {
  box-shadow: inset 0 0 80px 12px rgba(63, 185, 80, 0.28);
}
.pp-edge.kind-sell {
  box-shadow: inset 0 0 80px 12px rgba(248, 81, 73, 0.22);
}

.pp-sound-toggle {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(60, 40, 20, 0.16);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-muted, #6a5a4a);
  cursor: pointer;
}
.pp-sound-toggle.is-on {
  color: #1a1410;
  border-color: rgba(232, 120, 72, 0.45);
  background: rgba(232, 120, 72, 0.14);
}

.pp-payoff {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(18, 14, 12, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.pp-payoff.is-on { opacity: 1; pointer-events: auto; }
.pp-payoff-card {
  width: min(92vw, 420px);
  padding: 22px 20px 18px;
  border-radius: 16px;
  background: #fffaf4;
  color: #1a1410;
  box-shadow: 0 20px 50px rgba(20, 12, 8, 0.28);
}
.pp-payoff-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c45c32;
}
.pp-payoff-card h3 { margin: 0 0 6px; letter-spacing: -0.02em; }
.pp-payoff-detail { margin: 0 0 14px; color: #6a5a4a; font-size: 0.9rem; }
.pp-payoff-bars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.pp-payoff-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(60, 40, 20, 0.05);
  overflow: hidden;
  font-size: 0.82rem;
}
.pp-payoff-row i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: #8a7a6a;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.pp-payoff-row.after i { background: #3fb950; }
.pp-payoff-close {
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: #1a1410;
  color: #fff8f0;
  font-weight: 700;
  cursor: pointer;
}

/* Stage ladder */
.pp-ladder {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 4px;
}
.pp-ladder-step {
  position: relative;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1.5px solid rgba(60, 40, 20, 0.1);
  background: rgba(255, 255, 255, 0.55);
  min-height: 72px;
}
.pp-ladder-step .n {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.68rem;
  font-weight: 700;
  color: #8a7a6a;
  letter-spacing: 0.04em;
}
.pp-ladder-step .name {
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: -0.02em;
  margin-top: 2px;
}
.pp-ladder-step .vol {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.7rem;
  color: #8a7a6a;
}
.pp-ladder-step .blurb {
  font-size: 0.68rem;
  color: #6a5a4a;
  margin-top: 4px;
  line-height: 1.35;
}
.pp-ladder-step.gate {
  border-color: rgba(196, 92, 50, 0.4);
  background: rgba(232, 120, 72, 0.1);
}
.pp-ladder-step.gate .name { color: #c45c32; }
@media (max-width: 720px) {
  .pp-ladder { grid-template-columns: 1fr 1fr; }
  .pp-ladder-step:last-child { grid-column: 1 / -1; }
}

.pp-exit-ladder {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.pp-exit-chip {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(60, 40, 20, 0.12);
  color: #6a5a4a;
  background: rgba(255, 255, 255, 0.5);
}
.pp-exit-chip.is-full { border-color: rgba(26, 122, 60, 0.35); color: #1a7a3c; }

.pp-leader {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(232, 120, 72, 0.1);
  font-size: 0.82rem;
  font-weight: 600;
}

/* Tape punch + pressure */
.rh-pressure {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #0d1117;
  border-bottom: 1px solid #21262d;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.68rem;
  color: #8b949e;
}
.rh-pressure-track {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: #f85149;
  overflow: hidden;
}
.rh-pressure-fill {
  height: 100%;
  width: 50%;
  background: #3fb950;
  transition: width 0.35s ease;
}
.rh-pressure.is-buy { color: #3fb950; }
.rh-pressure.is-sell { color: #f85149; }

.rh-tape-row {
  animation: rh-tape-slide 0.28s ease;
}
@keyframes rh-tape-slide {
  from { transform: translateX(-10px); opacity: 0.2; }
  to { transform: none; opacity: 1; }
}
.rh-tape-row.hit-md { font-size: 0.76rem; }
.rh-tape-row.hit-lg {
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(63, 185, 80, 0.08);
}
.rh-tape-row.hit-xl {
  font-size: 0.86rem;
  font-weight: 700;
  background: rgba(63, 185, 80, 0.14);
}
.rh-tape-row.kind-sell.hit-lg,
.rh-tape-row.kind-sell.hit-xl { background: rgba(248, 81, 73, 0.1); }
.rh-tape-row.is-new.hit-xl { animation: rh-tape-new 0.9s ease, rh-tape-slide 0.28s ease; }
