/* ═══════════════════════════════════════════════════
   CoinRush — Bet Confirmation Modal  &  Notification Toast
   Uses the same Sora / Inter / JetBrains Mono
   font-stack as the rest of CoinRush.
   ═══════════════════════════════════════════════════ */

/* ─── Overlay ─── */
.cr-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background .28s cubic-bezier(.4,0,.2,1),
              backdrop-filter .28s cubic-bezier(.4,0,.2,1),
              -webkit-backdrop-filter .28s cubic-bezier(.4,0,.2,1);
  padding: 16px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.cr-confirm-overlay.cr-confirm-visible {
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cr-confirm-overlay.cr-confirm-closing {
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}
.cr-confirm-overlay.cr-confirm-closing .cr-confirm-modal {
  opacity: 0;
  transform: scale(.93) translateY(10px);
}

/* ─── Modal Card ─── */
.cr-confirm-modal {
  background: linear-gradient(168deg, #1c2a3a 0%, #101b28 100%);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 18px;
  max-width: 370px;
  width: 100%;
  padding: 0;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, .55),
    0  8px 32px rgba(0, 0, 0, .3),
    0  0  0  1px rgba(255, 255, 255, .04),
    inset 0 1px 0 rgba(255, 255, 255, .06);
  opacity: 0;
  transform: scale(.93) translateY(14px);
  transition: opacity .28s cubic-bezier(.4,0,.2,1),
              transform .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.cr-confirm-visible .cr-confirm-modal {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ─── Header ─── */
.cr-confirm-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.cr-confirm-icon {
  color: #f59e0b;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, .35));
}
.cr-confirm-title {
  font-family: 'Sora', 'Inter', -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #e8edf4;
  letter-spacing: -.01em;
  line-height: 1.25;
}

/* ─── Body ─── */
.cr-confirm-body {
  padding: 24px 24px 20px;
  text-align: center;
}
.cr-confirm-text {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #8b9bb4;
  margin: 0 0 14px;
  letter-spacing: .01em;
}
.cr-confirm-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 0 0 6px;
}
.cr-confirm-coins {
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  font-size: 38px;
  font-weight: 800;
  background: linear-gradient(135deg, #f0b90b 0%, #ffd54f 45%, #ffeb84 65%, #f0b90b 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  filter: drop-shadow(0 2px 8px rgba(240, 185, 11, .25));
}
.cr-confirm-unit {
  font-family: 'Sora', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #576a82;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.cr-confirm-game-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(91,255,178,.08);
  border: 1px solid rgba(91,255,178,.12);
  margin: 0 0 14px;
}
.cr-confirm-game-badge span {
  font-family: 'Sora', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #5bffb2;
  text-transform: uppercase;
  letter-spacing: .1em;
}
/* legacy fallback class */
.cr-confirm-game {
  font-family: 'Sora', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #5bffb2;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 0 0 14px;
  opacity: .9;
}
.cr-confirm-divider {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  margin: 10px auto 14px;
  border-radius: 2px;
}
.cr-confirm-subtext {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #576a82;
  margin: 0;
  line-height: 1.5;
}

/* ─── Actions ─── */
.cr-confirm-actions {
  display: flex;
  gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid rgba(255, 255, 255, .04);
}
.cr-confirm-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  font-family: 'Sora', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s cubic-bezier(.4,0,.2,1);
  letter-spacing: .01em;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
}
.cr-confirm-btn--cancel {
  background: rgba(255, 255, 255, .055);
  color: #8b9bb4;
  border: 1px solid rgba(255, 255, 255, .08);
}
.cr-confirm-btn--cancel:hover {
  background: rgba(255, 255, 255, .1);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, .12);
}
.cr-confirm-btn--cancel:active {
  transform: scale(.97);
}
.cr-confirm-btn--confirm {
  background: linear-gradient(135deg, #5bffb2 0%, #00d68f 100%);
  color: #0a1628;
  box-shadow: 0 4px 18px rgba(91, 255, 178, .22),
              inset 0 1px 0 rgba(255, 255, 255, .15);
}
.cr-confirm-btn--confirm:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 28px rgba(91, 255, 178, .32),
              inset 0 1px 0 rgba(255, 255, 255, .15);
  transform: translateY(-1px);
}
.cr-confirm-btn--confirm:active {
  transform: translateY(0) scale(.97);
  filter: brightness(.95);
}
.cr-confirm-btn:focus-visible {
  outline: 2px solid #5bffb2;
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════
   In-app notification toast (win / loss / info)
   Appears top-right, stacks downward — premium design
   ═══════════════════════════════════════════════════ */
.cr-notify-container {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Toast shell ── */
.cr-notify-toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 14px 18px;
  border-radius: 16px;
  background: linear-gradient(168deg, #1a2738 0%, #111d2c 100%);
  border: 1px solid rgba(255,255,255,.06);
  box-shadow:
    0 16px 48px rgba(0,0,0,.5),
    0  4px 16px rgba(0,0,0,.3),
    0  0  0  1px rgba(255,255,255,.03);
  min-width: 280px;
  max-width: 380px;
  overflow: hidden;
  opacity: 0;
  transform: translateX(100%) scale(.95);
  transition: opacity .32s cubic-bezier(.16,1,.3,1),
              transform .32s cubic-bezier(.16,1,.3,1);
}
.cr-notify-toast.cr-notify-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}
.cr-notify-toast.cr-notify-closing {
  opacity: 0;
  transform: translateX(40px) scale(.96);
  transition-duration: .22s;
}

/* ── Left accent stripe ── */
.cr-notify-toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
}
.cr-notify-toast--win::before  { background: linear-gradient(180deg, #5bffb2, #00d68f); }
.cr-notify-toast--loss::before { background: linear-gradient(180deg, #ff6b6b, #e74c4c); }
.cr-notify-toast--info::before { background: linear-gradient(180deg, #60a5fa, #3b82f6); }

/* ── Variant border glows ── */
.cr-notify-toast--win {
  border-color: rgba(91,255,178,.14);
  box-shadow:
    0 16px 48px rgba(0,0,0,.5),
    0  4px 16px rgba(0,0,0,.3),
    0  0  0  1px rgba(91,255,178,.06),
    0  0  32px rgba(91,255,178,.04);
}
.cr-notify-toast--loss {
  border-color: rgba(255,107,107,.12);
  box-shadow:
    0 16px 48px rgba(0,0,0,.5),
    0  4px 16px rgba(0,0,0,.3),
    0  0  0  1px rgba(255,107,107,.05);
}
.cr-notify-toast--info {
  border-color: rgba(96,165,250,.12);
  box-shadow:
    0 16px 48px rgba(0,0,0,.5),
    0  4px 16px rgba(0,0,0,.3),
    0  0  0  1px rgba(96,165,250,.05);
}

/* ── Auto-close progress bar ── */
.cr-notify-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 0 0 0 16px;
  animation: cr-notify-shrink linear forwards;
}
.cr-notify-toast--win  .cr-notify-progress { background: linear-gradient(90deg, #5bffb2, #00d68f); }
.cr-notify-toast--loss .cr-notify-progress { background: linear-gradient(90deg, #ff6b6b, #e74c4c); }
.cr-notify-toast--info .cr-notify-progress { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
@keyframes cr-notify-shrink {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ── Icon circle ── */
.cr-notify-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.cr-notify-icon svg {
  width: 18px;
  height: 18px;
}
.cr-notify-toast--win .cr-notify-icon {
  background: rgba(91,255,178,.1);
  box-shadow: 0 0 16px rgba(91,255,178,.1);
}
.cr-notify-toast--win .cr-notify-icon svg {
  color: #5bffb2;
}
.cr-notify-toast--loss .cr-notify-icon {
  background: rgba(255,107,107,.1);
}
.cr-notify-toast--loss .cr-notify-icon svg {
  color: #ff6b6b;
}
.cr-notify-toast--info .cr-notify-icon {
  background: rgba(96,165,250,.1);
}
.cr-notify-toast--info .cr-notify-icon svg {
  color: #60a5fa;
}

/* ── Text content ── */
.cr-notify-content {
  flex: 1;
  min-width: 0;
}
.cr-notify-title {
  font-family: 'Sora', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #eaf0f8;
  letter-spacing: -.01em;
  line-height: 1.35;
}
.cr-notify-body {
  font-size: 12.5px;
  font-weight: 500;
  color: #7e91a8;
  line-height: 1.45;
  margin-top: 3px;
}
.cr-notify-amount {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 12.5px;
}
.cr-notify-toast--win  .cr-notify-amount { color: #5bffb2; }
.cr-notify-toast--loss .cr-notify-amount { color: #ff6b6b; }
.cr-notify-toast--info .cr-notify-amount { color: #60a5fa; }

/* ── Game label pill ── */
.cr-notify-game-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: 'Sora', 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 6px;
}
.cr-notify-toast--win  .cr-notify-game-pill { background: rgba(91,255,178,.08); color: #5bffb2; }
.cr-notify-toast--loss .cr-notify-game-pill { background: rgba(255,107,107,.08); color: #ff6b6b; }
.cr-notify-toast--info .cr-notify-game-pill { background: rgba(96,165,250,.08); color: #60a5fa; }

/* ── Close button ── */
.cr-notify-close {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #4a5c72;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
  line-height: 1;
  padding: 0;
  margin-top: 1px;
}
.cr-notify-close svg {
  width: 14px;
  height: 14px;
}
.cr-notify-close:hover {
  background: rgba(255,255,255,.08);
  color: #c0cdd8;
}

/* ─── Compact mode ─── */
body.cr-compact-mode .cr-confirm-modal {
  max-width: 330px;
  border-radius: 14px;
}
body.cr-compact-mode .cr-confirm-coins { font-size: 30px; }
body.cr-compact-mode .cr-confirm-header { padding: 16px 20px 12px; }
body.cr-compact-mode .cr-confirm-body { padding: 18px 20px 14px; }
body.cr-compact-mode .cr-confirm-actions { padding: 12px 20px 18px; }

/* ─── Mobile ─── */
@media (max-width: 480px) {
  .cr-confirm-modal {
    max-width: 100%;
    border-radius: 16px;
  }
  .cr-confirm-coins { font-size: 32px; }
  .cr-confirm-actions {
    flex-direction: column;
    gap: 8px;
  }
  .cr-confirm-btn { padding: 14px 16px; }

  .cr-notify-container {
    top: auto;
    bottom: 16px;
    right: 8px;
    left: 8px;
  }
  .cr-notify-toast {
    min-width: 0;
    max-width: 100%;
    border-radius: 14px;
  }
}
