:root {
  --font-size: 16px;

  /* ── Dark "golden glass" palette (shared with docs & admin) ── */
  --bg: #0b1730;
  --bg-panel: #16284a;
  --surface: rgba(33, 55, 96, 0.74);
  --surface-soft: rgba(255, 255, 255, 0.06);
  --surface-soft2: rgba(255, 255, 255, 0.09);
  --code-bg: #0c182e;

  --foreground: #f3f7ff;
  --text: #f3f7ff;
  --muted-foreground: #7d8db0;
  --muted: #7d8db0;
  --soft: #aebbd6;

  --blue: #4d8bff;
  --blue-hover: #7aa9ff;
  --blue-glow: rgba(77, 139, 255, 0.4);
  --green: #10b981;
  --amber: #f59e0b;
  --purple: #8b5cf6;
  --pink: #ec4899;
  --red: #ef4444;
  --destructive: #f87171;

  --border: rgba(150, 185, 255, 0.12);

  /* golden glass accents */
  --gold: #e9c87a;
  --gold-soft: #f6e2ac;
  --gold-line: rgba(233, 200, 122, 0.42);
  --gold-glow: rgba(233, 200, 122, 0.28);

  /* radius scale: cards → inner blocks → controls */
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --radius: var(--radius-md);
  --font-weight-medium: 600;
  --font-weight-normal: 400;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: var(--font-weight-normal);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Animated background ── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 60% at 18% -15%, rgba(77, 139, 255, 0.3) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 85% 0%, rgba(120, 170, 255, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 82% 112%, rgba(139, 92, 246, 0.16) 0%, transparent 60%),
    radial-gradient(ellipse 75% 60% at 50% 50%, rgba(110, 150, 220, 0.1) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 50% 60%, rgba(233, 200, 122, 0.06) 0%, transparent 55%);
  animation: bgShift 20s ease-in-out infinite alternate;
}

/* ── Random lightning layer ── */
.lightning-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* soft full-screen flash when a strong bolt strikes */
.lightning-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 20%, rgba(150, 190, 255, 0.16), transparent 70%);
  opacity: 0;
}

.lightning-layer.flash::after {
  animation: screenFlash 0.35s ease-out;
}

.bolt {
  position: absolute;
  will-change: opacity, transform;
  animation: boltFlash 0.9s ease-out forwards;
  filter:
    drop-shadow(0 0 5px rgba(170, 205, 255, 0.9))
    drop-shadow(0 0 14px var(--blue-glow));
}

.bolt-path {
  fill: none;
  stroke: #eaf2ff;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.bolt-branch {
  stroke-width: 1.4;
  opacity: 0.85;
}

.bolt.gold {
  filter:
    drop-shadow(0 0 5px var(--gold-soft))
    drop-shadow(0 0 14px var(--gold-glow));
}

.bolt.gold .bolt-path {
  stroke: var(--gold-soft);
}

@keyframes boltFlash {
  0% { opacity: 0; }
  6% { opacity: 1; }
  14% { opacity: 0.25; }
  22% { opacity: 0.95; }
  40% { opacity: 0.6; }
  100% { opacity: 0; }
}

@keyframes screenFlash {
  0% { opacity: 0; }
  10% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes bgShift {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  font-weight: 700;
  color: #fff;
}

/* ════════════ Login ════════════ */
.login-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  display: grid;
  gap: 28px;
  padding: 40px;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.035) 38%, rgba(150, 185, 255, 0.06) 100%),
    var(--surface);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow:
    0 6px 44px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 26px rgba(233, 200, 122, 0.04);
  animation: fade-up 480ms ease both;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
  opacity: 0.55;
}

.login-card h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand,
.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark,
.avatar {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 18px var(--blue-glow);
}

.lead {
  max-width: 620px;
  margin-top: 16px;
  color: var(--soft);
  line-height: 1.6;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ════════════ Buttons ════════════ */
.primary-action,
.secondary-action,
.ghost-button,
.profile-button,
.balance-button,
.segmented button,
.nav-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease, opacity 180ms ease;
}

.primary-action {
  background: linear-gradient(135deg, var(--blue), #6366f1);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.45);
}

.secondary-action,
.ghost-button {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-color: var(--border);
}

.secondary-action:hover,
.ghost-button:hover,
.profile-button:hover,
.balance-button:hover {
  transform: translateY(-1px);
  border-color: var(--gold-line);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35), 0 0 18px var(--gold-glow);
}

.primary-action:active,
.secondary-action:active,
.ghost-button:active,
.profile-button:active,
.balance-button:active,
.segmented button:active,
.copy-field button:active,
.nav-link:active {
  transform: translateY(0);
}

.full-width {
  width: 100%;
}

/* ════════════ Dashboard layout ════════════ */
.dashboard {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 26px;
  padding: 26px 18px;
  background: linear-gradient(180deg, var(--bg-panel) 0%, rgba(8, 13, 24, 0.95) 100%);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px);
}

.sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.4), transparent);
}

.sidebar-brand {
  padding: 0 8px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 16px var(--blue);
  animation: pulse-dot 2200ms ease-in-out infinite;
  -webkit-text-fill-color: initial;
}

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 2px;
}

.sidebar-nav p {
  margin: 22px 12px 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-link,
.support-link {
  width: 100%;
  justify-content: flex-start;
  gap: 12px;
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  font-size: 0.92rem;
  position: relative;
}

.nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--blue);
  opacity: 0;
  transition: opacity 0.2s;
}

.nav-link:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--blue-hover);
}

.nav-link.is-active,
.nav-link[href]:hover {
  background: rgba(59, 130, 246, 0.12);
  color: var(--blue-hover);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.nav-link.is-active::before {
  opacity: 1;
}

.support-link {
  border: 1px solid var(--gold-line);
  background: rgba(233, 200, 122, 0.06);
  color: var(--gold-soft);
}

.support-link:hover {
  border-color: var(--gold-line);
  background: rgba(233, 200, 122, 0.12);
  box-shadow: 0 0 22px var(--gold-glow);
}

.dashboard-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 22px;
  padding: 28px;
}

/* ════════════ Glass surfaces ════════════ */
.dashboard-topbar,
.hero-card,
.panel,
.metric-grid article,
.balance-popover {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.035) 38%, rgba(150, 185, 255, 0.06) 100%),
    var(--surface);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  color: var(--text);
  box-shadow:
    0 6px 44px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 26px rgba(233, 200, 122, 0.04);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.dashboard-topbar::before,
.hero-card::before,
.panel::before,
.metric-grid article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
  opacity: 0.5;
  transition: opacity 0.3s;
}

.hero-card:hover,
.panel:hover,
.metric-grid article:hover {
  transform: translateY(-3px);
  border-color: rgba(233, 200, 122, 0.6);
  box-shadow:
    0 12px 64px rgba(0, 0, 0, 0.42),
    0 0 30px var(--gold-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.hero-card:hover::before,
.panel:hover::before,
.metric-grid article:hover::before {
  opacity: 1;
}

.dashboard-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
}

.toolbar-copy {
  display: grid;
  gap: 4px;
}

.toolbar-title {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.toolbar-subtitle {
  color: var(--muted);
  line-height: 1.5;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.balance-menu {
  position: relative;
}

.balance-button {
  min-width: 156px;
  gap: 8px;
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.25);
  color: var(--text);
}

.balance-button span {
  color: var(--muted);
}

.balance-button strong {
  color: var(--gold-soft);
}

.balance-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: 300px;
  display: grid;
  gap: 12px;
  padding: 18px;
  animation: popover-in 180ms ease both;
}

.qr-box {
  width: 176px;
  height: 176px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px;
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

code {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--code-bg);
  color: #a5f3fc;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  white-space: nowrap;
}

.profile-button {
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--border);
}

.avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.view-stack {
  position: relative;
  min-height: 620px;
}

.view-panel {
  display: none;
  gap: 18px;
  align-content: start;
  animation: view-enter 280ms ease both;
}

.view-panel.is-active {
  display: grid;
}

.hero-card {
  min-height: 188px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(77, 139, 255, 0.12), transparent 55%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.035) 38%, rgba(150, 185, 255, 0.06) 100%),
    var(--surface);
}

.hero-copy {
  display: grid;
  gap: 10px;
}

.hero-copy h2 {
  font-size: 32px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-copy p {
  color: var(--soft);
  max-width: 660px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.metric-grid article {
  min-height: 132px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 18px;
  text-align: center;
}

.metric-grid span,
.metric-grid small {
  color: var(--muted);
}

.metric-grid span {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.metric-grid strong {
  margin: 10px 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.panel {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 24px;
}

.action-panel {
  max-width: 860px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-title h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.icon-chip {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
  font-weight: 700;
  flex-shrink: 0;
  transition: transform 180ms ease, background 180ms ease;
}

.panel:hover .icon-chip {
  transform: rotate(-4deg) scale(1.05);
}

.deposit-inline {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
}

.deposit-inline span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.mini-qr {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 6px;
}

.mini-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

label {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-weight: 600;
  font-size: 0.9rem;
}

input {
  min-height: 46px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.065);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input::placeholder {
  color: var(--muted);
}

input:focus {
  border-color: var(--blue);
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

button:disabled {
  cursor: progress;
  opacity: 0.62;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
  touch-action: pan-y;
}

.mode-switch button,
.segmented button {
  min-height: 38px;
  border: 0;
  border-radius: calc(var(--radius-md) - 4px);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mode-switch button.is-active,
.segmented .is-active {
  background: rgba(59, 130, 246, 0.18);
  color: var(--blue-hover);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.panel-row {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.panel-row:last-child,
.panel-row + .form-message {
  border-bottom: none;
}

/* drop the divider on the row directly above the action button / message */
.panel-row:has(+ .form-message),
.panel-row:has(+ .primary-action),
.panel-row:has(+ .secondary-action) {
  border-bottom: none;
}

.panel-row strong {
  color: var(--gold-soft);
}

.form-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.form-message[data-kind="success"] {
  color: var(--green);
}

.form-message[data-kind="error"] {
  color: var(--destructive);
}

.promo-list {
  display: grid;
  gap: 8px;
}

.promo-item,
.empty-state {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
}

.promo-item span,
.promo-item small,
.empty-state {
  color: var(--muted);
}

.promo-item strong {
  color: var(--gold-soft);
}

.profile-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
}

.profile-card {
  min-width: 0;
}

.referral-card {
  grid-column: 1 / -1;
}

.profile-lines,
.ref-grid {
  display: grid;
  gap: 10px;
}

.profile-lines div,
.ref-grid div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
}

.profile-lines span,
.ref-grid span {
  color: var(--muted);
  font-size: 13px;
}

.profile-lines strong,
.ref-grid strong {
  color: var(--text);
  font-size: 1.05rem;
}

.ref-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ref-grid strong {
  background: linear-gradient(135deg, #fff, var(--blue));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.copy-field input {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85rem;
}

.copy-field button {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.copy-field button:hover {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.12);
  color: var(--blue-hover);
}

/* ════════════ Toast ════════════ */
.status-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    var(--surface);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45), 0 0 24px var(--gold-glow);
  animation: toast-in 220ms ease both;
}

.status-toast-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green), #34d399);
  color: #04261b;
  font-size: 18px;
  font-weight: 700;
}

.status-toast-copy {
  display: grid;
  gap: 3px;
}

.status-toast-copy strong {
  font-size: 14px;
  color: #fff;
}

.status-toast-copy span {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.45;
}

/* ════════════ Custom golden cursor: dot + lightning trail ════════════ */
@media (hover: hover) and (pointer: fine) {
  html,
  html * {
    cursor: none;
  }

  .cursor-dot,
  .cursor-bolt {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 99999;
    will-change: transform, opacity;
  }

  .cursor-dot {
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, #fff7dd, var(--gold) 72%);
    box-shadow: 0 0 10px var(--gold-glow), 0 0 4px var(--gold);
    transition: width 0.18s ease, height 0.18s ease, margin 0.18s ease;
  }

  body.cursor-hover .cursor-dot {
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
  }

  body.cursor-down .cursor-dot {
    width: 9px;
    height: 9px;
    margin: -4.5px 0 0 -4.5px;
  }

  .cursor-bolt {
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    color: var(--gold-soft);
    filter: drop-shadow(0 0 4px var(--gold-glow));
  }

  .cursor-bolt svg {
    display: block;
    width: 100%;
    height: 100%;
  }
}

@media (pointer: coarse) {
  .cursor-dot,
  .cursor-bolt {
    display: none !important;
  }
}

/* ════════════ Animations ════════════ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes popover-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 8px var(--blue); }
  50% { box-shadow: 0 0 20px var(--blue); }
}

@media (max-width: 1100px) {
  .metric-grid,
  .overview-grid,
  .profile-grid,
  .ref-grid {
    grid-template-columns: 1fr;
  }

  .referral-card {
    grid-column: auto;
  }
}

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

  .sidebar {
    min-height: auto;
  }

  .sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-nav p {
    grid-column: 1 / -1;
  }

  .dashboard-topbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    justify-content: stretch;
  }

  .balance-button,
  .profile-button,
  .ghost-button {
    width: 100%;
  }

  .balance-popover {
    position: static;
    width: 100%;
    margin-top: 10px;
  }

  .hero-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .dashboard-main {
    padding: 16px;
  }

  .login-card {
    padding: 26px;
  }

  .sidebar {
    padding: 18px 14px;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .copy-field {
    grid-template-columns: 1fr;
  }

  .status-toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
