/* ==========================================================================
   NEXUS NODE — shared styling
   Extracted verbatim from the stitch screens so the design/layout is
   byte-for-byte identical across every tab. Do not restyle here.
   ========================================================================== */

.material-symbols-outlined {
  display: inline-block;
  width: 1em;
  height: 1em;
  line-height: 1 !important;
  box-sizing: content-box;
  overflow: hidden;
  white-space: nowrap;
  direction: ltr;
  vertical-align: middle;
}

.nexus-bg {
  background:
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.35), transparent 60%),
    linear-gradient(180deg, #0D0718 0%, #1A0B2E 100%);
}

.glass-card {
  background: rgba(40, 20, 70, 0.55);
  border: 1px solid rgba(167, 139, 250, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px rgba(0, 0, 0, 0.4);
}

.glass-card-mint {
  background: rgba(40, 20, 70, 0.65);
  border: 1.5px solid rgba(52, 211, 153, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 30px rgba(0, 0, 0, 0.45);
}

.notched-card {
  background: rgba(40, 20, 70, 0.55);
  border: 1px solid rgba(167, 139, 250, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px rgba(0, 0, 0, 0.4);
  clip-path: polygon(0 0, calc(50% - 14px) 0, 50% 10px, calc(50% + 14px) 0, 100% 0, 100% 100%, 0 100%);
}

.btn-violet-glow {
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.5);
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* App-like scrolling: the page body does not scroll in the browser; the phone
   frame scrolls internally (no visible scrollbar), so it behaves like a native
   Telegram Mini App instead of a web page. */
html, body { height: 100%; }
body { overflow: hidden; overscroll-behavior: none; }
.app-shell {
  height: 100vh;      /* fallback */
  height: 100dvh;     /* tracks mobile browser chrome / Telegram viewport */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Subtle fade when a tab's content is swapped in by the router. Purely
   additive motion; it does not change any screen's layout. */
.page-enter {
  animation: pageEnter var(--surface-enter, 250ms) cubic-bezier(0.2, 0, 0, 1);
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .page-enter { animation: none; }
}

/* ==========================================================================
   Overlays: backdrop, bottom sheet / modal, and toast.
   Styled with the same glass + violet language as the screens.
   ========================================================================== */
.nx-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(5, 2, 12, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: nxFade 180ms ease-out;
}
.nx-backdrop.nx-center { align-items: center; }

.nx-sheet {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(40, 20, 70, 0.92) 0%, rgba(26, 11, 46, 0.96) 100%);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.55);
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  animation: nxSlideUp 240ms cubic-bezier(0.2, 0, 0, 1);
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nx-sheet::-webkit-scrollbar { display: none; }
.nx-modal {
  width: calc(100% - 32px);
  max-width: 400px;
  background: linear-gradient(180deg, rgba(40, 20, 70, 0.95) 0%, rgba(26, 11, 46, 0.97) 100%);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  padding: 20px;
  animation: nxPop 200ms cubic-bezier(0.2, 0, 0, 1);
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nx-modal::-webkit-scrollbar { display: none; }
.nx-grabber {
  width: 40px;
  height: 4px;
  border-radius: 9999px;
  background: rgba(167, 139, 250, 0.4);
  margin: 0 auto 14px;
}
.nx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid rgba(167, 139, 250, 0.2);
  background: rgba(40, 20, 70, 0.5);
  color: #fff;
  text-align: left;
  transition: background 150ms ease-out;
}
.nx-row:hover { background: rgba(56, 41, 77, 0.7); }
.nx-row.nx-active {
  border-color: rgba(52, 211, 153, 0.7);
  background: rgba(52, 211, 153, 0.12);
}

.nx-toast-wrap {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 96px;
  z-index: 60;
  width: 100%;
  max-width: 430px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.nx-toast {
  pointer-events: auto;
  background: rgba(26, 11, 46, 0.96);
  border: 1px solid rgba(52, 211, 153, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  border-radius: 12px;
  padding: 12px 14px;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: nxToastIn 200ms ease-out;
}
.nx-toast.nx-out { animation: nxToastOut 200ms ease-in forwards; }

/* Hide the native number-input spinner in the withdraw amount field so the
   in-field Max button sits cleanly. Purely cosmetic. */
.nx-sheet input[type="number"]::-webkit-outer-spin-button,
.nx-sheet input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.nx-sheet input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

@keyframes nxFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes nxSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes nxPop { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes nxToastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes nxToastOut { to { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  .nx-backdrop, .nx-sheet, .nx-modal, .nx-toast { animation: none; }
}
