/* ===== Superposition Page Specific CSS (v2.0 Refined) ===== */
:root {
  --sp-green: #00ffaa;
  --sp-red: #ff3c69;
  --sp-blue: #4ee3ff;
  --sp-purple: #8b6bff;
  --sp-yellow: #ffcf5c;
  --sp-bg-card: rgba(13, 15, 24, 0.15);
}

.superposition-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--void);
}

.sp-main {
  flex: 1;
  padding: var(--space-4) 0 var(--space-6);
}

/* Glassmorphism Panel */
.sp-panel {
  background: var(--sp-bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-bottom: var(--space-4);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.sp-panel:hover {
  border-color: rgba(255, 45, 170, 0.25);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 45, 170, 0.12);
}

.sp-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta), var(--magenta-light));
  opacity: 0.8;
}

.sp-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-3);
  color: var(--ink);
}

/* Wallet widget */
.wallet-widget {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 16px 24px;
  background: rgba(255, 45, 170, 0.04);
  border: 1px solid rgba(255, 45, 170, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
  backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.wallet-widget:hover {
  border-color: rgba(255, 45, 170, 0.4);
  box-shadow: 0 8px 24px rgba(255, 45, 170, 0.15);
}

.wallet-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  flex-wrap: wrap;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sp-red);
  box-shadow: 0 0 10px var(--sp-red);
}

.status-dot.connected {
  background: var(--sp-green);
  box-shadow: 0 0 10px var(--sp-green);
  animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 6px var(--sp-green); }
  50%       { box-shadow: 0 0 18px var(--sp-green), 0 0 30px rgba(0,255,170,0.3); }
}

/* EIP-6963 Wallet modal elements */
.wallet-option-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 48px;
  padding: 14px 20px;
  background: rgba(15, 18, 30, 0.8);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.wallet-option-btn:hover {
  border-color: var(--magenta);
  background: rgba(255, 45, 170, 0.12);
  box-shadow: 0 4px 20px rgba(255, 45, 170, 0.25);
  transform: translateY(-2px);
}

.wallet-option-btn img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
  background: transparent;
}

/* Dashboard layouts */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: var(--space-2);
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Forms and Inputs */
.sp-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--space-3);
}

.sp-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sp-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.sp-input,
input[type="text"],
input[type="number"],
select {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  background: rgba(10, 12, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1rem;
  backdrop-filter: blur(12px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sp-input::placeholder,
input::placeholder {
  color: rgba(148, 163, 184, 0.4);
}

.sp-input:focus,
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--magenta);
  box-shadow: 0 0 0 3px rgba(255, 45, 170, 0.25), 0 0 20px rgba(255, 45, 170, 0.3);
}

.sp-input-unit {
  position: absolute;
  right: 18px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--violet);
  pointer-events: none;
}

/* State phase view cards */
.phase-card {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
}

/* Badge tags */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.badge-awaiting-deposit {
  color: var(--sp-yellow);
  background: rgba(255, 207, 92, 0.08);
  border-color: rgba(255, 207, 92, 0.25);
}

.badge-awaiting-reveal {
  color: var(--sp-purple);
  background: rgba(139, 107, 255, 0.08);
  border-color: rgba(139, 107, 255, 0.25);
}

.badge-settled {
  color: var(--sp-green);
  background: rgba(0, 255, 170, 0.08);
  border-color: rgba(0, 255, 170, 0.25);
}

.badge-voided {
  color: var(--sp-red);
  background: rgba(255, 60, 105, 0.08);
  border-color: rgba(255, 60, 105, 0.25);
}

/* Wavefunction Animation */
.wave-container {
  height: 120px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #040612;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin: 15px 0;
}

.particle-wave {
  width: 100%;
  height: 100%;
}

.wave-line {
  fill: none;
  stroke: url(#wave-grad);
  stroke-width: 2;
  stroke-linecap: round;
  animation: waviness 6s ease-in-out infinite;
}

.wave-line-dim {
  fill: none;
  stroke: var(--violet);
  stroke-width: 1;
  stroke-opacity: 0.25;
  stroke-linecap: round;
  animation: waviness 8s ease-in-out infinite reverse;
}

@keyframes waviness {
  0%, 100% {
    d: path("M 0,60 Q 60,10 120,60 T 240,60 T 360,60 T 480,60 T 600,60 T 720,60 T 840,60 T 960,60");
  }
  50% {
    d: path("M 0,60 Q 60,110 120,60 T 240,60 T 360,60 T 480,60 T 600,60 T 720,60 T 840,60 T 960,60");
  }
}

/* ============================================================
   Intent Expiry Countdown Bar
   ============================================================ */
.intent-expiry-bar {
  margin: 14px 0 18px;
  padding: 14px 16px;
  background: rgba(10, 12, 28, 0.6);
  border: 1px solid rgba(78, 227, 255, 0.15);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
}

.intent-expiry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.intent-expiry-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.intent-expiry-timer {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(78, 227, 255, 0.5);
  transition: color 0.4s ease;
}

.intent-expiry-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.intent-expiry-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sp-green), var(--cyan));
  transition: width 1s linear, background 0.5s ease;
  box-shadow: 0 0 8px rgba(78, 227, 255, 0.4);
}

.intent-expiry-note {
  margin: 8px 0 0;
  font-size: 0.7rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  text-align: center;
}

/* Stats list */
.stat-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
  font-size: 0.9rem;
}

.stat-item:last-child {
  border-bottom: none;
}

.stat-name {
  color: var(--ink-dim);
}

.stat-value {
  font-family: var(--font-mono);
  color: var(--cyan);
}

.stat-value.address {
  font-size: 0.85rem;
  color: var(--ink);
}

/* Floating seed box */
.seed-box {
  background: rgba(255, 63, 176, 0.04);
  border: 1px solid rgba(255, 63, 176, 0.15);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-top: 15px;
}

.seed-title {
  color: var(--magenta);
  font-weight: 700;
  margin-bottom: 8px;
}

.seed-value {
  word-break: break-all;
  color: var(--ink-dim);
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Collapse visualization animation overlay */
.collapse-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 19, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.collapse-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.collapse-wave-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 30px var(--cyan);
  animation: collapse-ring-anim 1.5s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

@keyframes collapse-ring-anim {
  0%   { transform: scale(0.2); opacity: 1; }
  100% { transform: scale(2);   opacity: 0; }
}

.collapse-text {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--cyan);
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px var(--cyan);
}

/* ============================================================
   Withdraw Widget — always visible after wallet connects
   ============================================================ */
.withdraw-widget {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  background: rgba(139, 107, 255, 0.07);
  border: 1px solid rgba(139, 107, 255, 0.2);
  border-radius: var(--radius-sm);
  margin-top: 30px;
  gap: 20px;
  flex-wrap: wrap;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.withdraw-widget:hover {
  border-color: rgba(139, 107, 255, 0.4);
  box-shadow: 0 8px 30px rgba(139, 107, 255, 0.12);
}

.withdraw-info h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 5px;
  color: var(--ink);
}

.withdraw-info p {
  color: var(--ink-dim);
  font-size: 0.85rem;
  margin: 0;
}

/* ============================================================
   Enter Again Button
   ============================================================ */
.enter-again-btn {
  display: none; /* shown via JS after match ends */
  width: 100%;
  margin-top: 14px;
  padding: 13px 20px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, rgba(139,107,255,0.2) 0%, rgba(78,227,255,0.15) 100%);
  color: var(--cyan);
  border: 1px solid rgba(78, 227, 255, 0.35);
  box-shadow: 0 0 20px rgba(78, 227, 255, 0.1);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.enter-again-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--sp-purple), var(--cyan));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.enter-again-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(78, 227, 255, 0.25), 0 0 50px rgba(139,107,255,0.15);
  border-color: var(--cyan);
  color: #fff;
}

.enter-again-btn:hover::before {
  opacity: 0.15;
}

.enter-again-btn:active {
  transform: translateY(0);
}

.enter-again-icon {
  font-size: 1.1rem;
  position: relative;
  z-index: 1;
  animation: spin-slow 4s linear infinite;
}

.enter-again-btn span,
.enter-again-btn {
  position: relative;
  z-index: 1;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============================================================
   Match Sound Toast Notification
   ============================================================ */
.match-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 22px;
  background: rgba(6, 8, 22, 0.96);
  border: 1px solid rgba(78, 227, 255, 0.4);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(78,227,255,0.1),
    0 20px 60px rgba(0,0,0,0.6),
    0 0 40px rgba(78,227,255,0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  max-width: 360px;
  min-width: 280px;
  transform: translateX(110%) scale(0.95);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
  pointer-events: none;
}

.match-toast.show {
  transform: translateX(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.match-toast::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta));
  border-radius: var(--radius) var(--radius) 0 0;
}

.match-toast-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
  animation: toast-spin 2s ease-in-out infinite;
}

@keyframes toast-spin {
  0%, 100% { transform: rotate(-10deg) scale(1); }
  50%       { transform: rotate(10deg) scale(1.1); }
}

.match-toast-body {
  flex: 1;
}

.match-toast-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--cyan);
  margin-bottom: 4px;
  text-shadow: 0 0 10px rgba(78,227,255,0.5);
}

.match-toast-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-dim);
  line-height: 1.4;
}

/* ============================================================
   Back-link
   ============================================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 25px;
  transition: transform 0.2s;
}

.back-link:hover {
  transform: translateX(-4px);
  color: var(--ink);
}

.action-row {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  flex-wrap: wrap;
}

/* History / Queue / Stats panels */
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.history-item:last-child {
  margin-bottom: 0;
}

/* Responsive tweaks */
@media (max-width: 600px) {
  .match-toast {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
    min-width: 0;
  }

  .intent-expiry-bar {
    padding: 10px 12px;
  }

  .withdraw-widget {
    flex-direction: column;
    align-items: flex-start;
  }

  .withdraw-widget button {
    width: 100%;
  }
}

/* ============================================================
   QUANTUM ATOM ANIMATED ICON
   Pure CSS animation — 3 rotating orbits + glowing electrons
   ============================================================ */
.quantum-atom-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  overflow: visible;
}

.quantum-atom-icon--footer {
  width: 24px;
  height: 24px;
}

/* Orbit rotations — each ellipse tilted and spins */
.atom-orbit-1 {
  transform-origin: 24px 24px;
  transform: rotate(-30deg);
  animation: atom-spin-1 4s linear infinite;
}
.atom-orbit-2 {
  transform-origin: 24px 24px;
  transform: rotate(30deg);
  animation: atom-spin-2 5s linear infinite;
}
.atom-orbit-3 {
  transform-origin: 24px 24px;
  transform: rotate(90deg);
  animation: atom-spin-3 6s linear infinite;
}

@keyframes atom-spin-1 {
  from { transform: rotate(-30deg); }
  to   { transform: rotate(330deg); }
}
@keyframes atom-spin-2 {
  from { transform: rotate(30deg); }
  to   { transform: rotate(390deg); }
}
@keyframes atom-spin-3 {
  from { transform: rotate(90deg); }
  to   { transform: rotate(450deg); }
}

/* Electron orbital motion — each electron orbits along its ellipse */
.atom-electron-1 {
  transform-origin: 24px 24px;
  animation: electron-orbit-1 4s linear infinite;
}
.atom-electron-2 {
  transform-origin: 24px 24px;
  animation: electron-orbit-2 5s linear infinite;
}
.atom-electron-3 {
  transform-origin: 24px 24px;
  animation: electron-orbit-3 6s linear infinite;
}

@keyframes electron-orbit-1 {
  from { transform: rotate(-30deg); }
  to   { transform: rotate(330deg); }
}
@keyframes electron-orbit-2 {
  from { transform: rotate(210deg); }
  to   { transform: rotate(570deg); }
}
@keyframes electron-orbit-3 {
  from { transform: rotate(90deg); }
  to   { transform: rotate(450deg); }
}

/* Nucleus glow pulse */
.atom-nucleus {
  animation: nucleus-glow-pulse 2.5s ease-in-out infinite;
}

@keyframes nucleus-glow-pulse {
  0%, 100% { r: 4;   opacity: 1;   }
  50%      { r: 4.8; opacity: 0.85; }
}

/* ============================================================
   SINGLE-WINDOW GAMEPLAY PANELS
   State machine transitions — only one panel active at a time
   ============================================================ */
#gameplay-viewport {
  position: relative;
  min-height: 200px;
}

.gameplay-panel {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 300ms ease, transform 300ms ease;
  will-change: opacity, transform;
}

.gameplay-panel.panel-active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: qpanel-enter 320ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.gameplay-panel.panel-exiting {
  display: block;
  opacity: 0;
  transform: translateY(-8px);
  filter: blur(2px);
  animation: qpanel-exit 260ms ease both;
  pointer-events: none;
}

@keyframes qpanel-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes qpanel-exit {
  from {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
    filter: blur(3px);
  }
}

/* ============================================================
   REVEAL COUNTDOWN BAR (inside reveal action box)
   ============================================================ */
.reveal-countdown-bar {
  margin: 0 0 14px;
  padding: 10px 14px;
  background: rgba(139, 107, 255, 0.06);
  border: 1px solid rgba(139, 107, 255, 0.2);
  border-radius: var(--radius-sm);
}

.reveal-countdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.reveal-countdown-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.reveal-countdown-timer {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--sp-purple);
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(139, 107, 255, 0.5);
  transition: color 0.4s ease;
}

.reveal-countdown-timer.countdown-urgent {
  color: var(--sp-red);
  text-shadow: 0 0 12px rgba(255, 60, 105, 0.6);
  animation: countdown-pulse 1s ease-in-out infinite;
}

@keyframes countdown-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

.reveal-countdown-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.reveal-countdown-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sp-purple), var(--magenta));
  transition: width 1s linear, background 0.5s ease;
  box-shadow: 0 0 8px rgba(139, 107, 255, 0.4);
}

/* ============================================================
   CINEMATIC COLLAPSE OVERLAY (full-screen)
   ============================================================ */
#cinematic-collapse-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: radial-gradient(ellipse at center,
    rgba(10, 12, 30, 0.92) 0%,
    rgba(4, 6, 16, 0.98) 70%,
    rgba(0, 0, 0, 1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  will-change: opacity;
  overflow: hidden;
}

#cinematic-collapse-overlay.coll-active {
  opacity: 1;
  pointer-events: auto;
}

/* Scanlines */
.coll-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(255, 255, 255, 0.015) 2px,
    rgba(255, 255, 255, 0.015) 4px
  );
  animation: coll-scanlines-scroll 8s linear infinite;
  z-index: 1;
}

@keyframes coll-scanlines-scroll {
  from { background-position: 0 0; }
  to   { background-position: 0 100px; }
}

/* Chromatic aberration layers */
.coll-chroma-r,
.coll-chroma-b {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  z-index: 2;
}

.coll-chroma-r {
  box-shadow: inset 0 0 120px rgba(255, 60, 120, 0.08);
  animation: coll-chroma-shift-r 3s ease-in-out infinite alternate;
}

.coll-chroma-b {
  box-shadow: inset 0 0 120px rgba(78, 227, 255, 0.08);
  animation: coll-chroma-shift-b 3.5s ease-in-out infinite alternate;
}

#cinematic-collapse-overlay.coll-active .coll-chroma-r,
#cinematic-collapse-overlay.coll-active .coll-chroma-b {
  opacity: 1;
}

@keyframes coll-chroma-shift-r {
  from { transform: translate(-2px, 1px); }
  to   { transform: translate(2px, -1px); }
}
@keyframes coll-chroma-shift-b {
  from { transform: translate(2px, -1px); }
  to   { transform: translate(-2px, 1px); }
}

/* Energy field */
.coll-energy-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(circle at 50% 50%,
    rgba(78, 227, 255, 0.06) 0%,
    rgba(139, 107, 255, 0.04) 30%,
    transparent 60%);
  animation: coll-energy-pulse 2s ease-in-out infinite;
}

@keyframes coll-energy-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.5; }
  50%      { transform: scale(1.15); opacity: 1;   }
}

/* Rings container */
.coll-rings-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 4;
}

.coll-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  opacity: 0;
  will-change: transform, opacity;
}

.coll-ring.ring-expand {
  animation: coll-ring-expand 1.2s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes coll-ring-expand {
  0%   { transform: scale(0.1); opacity: 1; border-width: 3px; }
  60%  { opacity: 0.6; }
  100% { transform: scale(3);   opacity: 0; border-width: 0.5px; }
}

/* Particle canvas */
#collapse-particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* Center content */
.coll-center-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

/* Nucleus burst */
.coll-nucleus-burst {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(78, 227, 255, 0.6) 30%,
    rgba(139, 107, 255, 0.3) 60%,
    transparent 100%);
  box-shadow:
    0 0 30px rgba(78, 227, 255, 0.5),
    0 0 60px rgba(139, 107, 255, 0.3),
    0 0 100px rgba(78, 227, 255, 0.15);
  opacity: 0;
  transform: scale(0.2);
  transition: transform 0.6s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.3s ease;
}

.coll-nucleus-burst.burst-visible {
  opacity: 1;
  transform: scale(1);
}

.coll-nucleus-burst.burst-collapse {
  transform: scale(0);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.6, 0, 0.7, 0.2), opacity 0.4s ease;
}

/* Typing text */
.coll-typing-wrapper {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 15px rgba(78, 227, 255, 0.6);
  text-align: center;
  min-height: 1.4em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coll-cursor {
  display: inline-block;
  animation: coll-blink 0.6s step-end infinite;
  color: var(--cyan);
}

@keyframes coll-blink {
  50% { opacity: 0; }
}

/* Flash */
.coll-flash {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center,
    rgba(255, 255, 255, 0.8) 0%,
    rgba(78, 227, 255, 0.4) 40%,
    transparent 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.1s ease;
}

.coll-flash.flash-fire {
  opacity: 1;
  animation: coll-flash-fade 0.5s ease-out forwards;
}

@keyframes coll-flash-fade {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* Screen shake */
@keyframes coll-screen-shake {
  0%, 100% { transform: translate(0, 0); }
  10%      { transform: translate(-2px, 1px); }
  20%      { transform: translate(2px, -1px); }
  30%      { transform: translate(-1px, 2px); }
  40%      { transform: translate(1px, -2px); }
  50%      { transform: translate(-2px, -1px); }
  60%      { transform: translate(2px, 1px); }
  70%      { transform: translate(-1px, -2px); }
  80%      { transform: translate(1px, 2px); }
  90%      { transform: translate(-2px, 1px); }
}

body.coll-shaking {
  animation: coll-screen-shake 0.4s ease-in-out;
}

/* ============================================================
   REDUCED MOTION OVERRIDES
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .quantum-atom-icon * {
    animation: none !important;
  }
  .gameplay-panel,
  .gameplay-panel.panel-active,
  .gameplay-panel.panel-exiting {
    animation: none !important;
    transition: none !important;
  }
  #cinematic-collapse-overlay,
  #cinematic-collapse-overlay * {
    animation: none !important;
    transition-duration: 0.001ms !important;
  }
}
.stake-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    border: 1px dashed rgba(78,227,255,.4);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    background: rgba(10,12,28,.4);
}

.stake-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stake-amount {
    color: var(--cyan);
    font-family: var(--font-mono);
    font-size: 1.1rem;
}

.stake-token {
    color: var(--violet);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
}

.switch-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
}
