:root {
  --bg: #060709;
  --bg-card: rgba(255, 255, 255, .045);
  --bg-card2: rgba(255, 255, 255, .075);
  --border: rgba(255, 255, 255, .09);
  --border-glow: rgba(0, 240, 255, .35);
  --text: #f2f4f8;
  --text-dim: #8b93a7;
  --accent: #00f0ff;
  --accent2: #0066ff;
  --accent3: #7b2fff;
  --danger: #ff4d6d;
  --ok: #34f5a5;
  /* lamp palette (per-widget neon accents) */
  --c-cyan: #00f0ff;
  --c-green: #8bffb0;
  --c-orange: #ffb35c;
  --c-purple: #b44cff;
  --c-pink: #ff7ad9;
  --c-yellow: #e8ff6a;
  /* signature prism gradient (chat-bubble style) */
  --bubble: linear-gradient(100deg, #c8ffb0 0%, #8be9ff 45%, #c9a8ff 100%);
  --grad: linear-gradient(135deg, #0066ff, #00f0ff 55%, #7b2fff);
  --led: "Doto", "SF Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  background: var(--bg);
  /* dot-grid instead of flat black */
  background-image: radial-gradient(rgba(255, 255, 255, .055) 1px, transparent 1.4px);
  background-size: 22px 22px;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
}

/* ambient multi-hue glow backdrop over the dot grid */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(560px 320px at 12% -5%, rgba(180, 76, 255, .16), transparent 65%),
    radial-gradient(520px 300px at 92% 8%, rgba(0, 240, 255, .13), transparent 65%),
    radial-gradient(560px 420px at 50% 112%, rgba(139, 255, 176, .09), transparent 65%);
  pointer-events: none;
}

.hidden { display: none !important; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(6, 7, 9, .75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-title {
  font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase; font-size: 15px;
  background: var(--bubble);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 0 12px rgba(139, 233, 255, .25));
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-user { color: var(--text-dim); font-size: 13px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lang-toggle {
  display: flex; align-items: center; gap: 3px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--text-dim);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
}
.lang-toggle .lang-sep { opacity: .4; }
.lang-toggle span[data-l].active { color: var(--c-green); text-shadow: 0 0 8px rgba(139, 255, 176, .6); }

main { padding: 18px 16px 100px; max-width: 560px; margin: 0 auto; }

h1 { font-size: 23px; margin-bottom: 14px; letter-spacing: .3px; }
.section-title {
  font-size: 12px; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 2px; margin: 24px 0 12px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-cyan);
  box-shadow: 0 0 10px var(--c-cyan), 0 0 3px var(--c-cyan);
}
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }

/* total balance - hero card with prism border */
.total-balance-card {
  margin-top: 12px;
  position: relative;
  background:
    linear-gradient(165deg, rgba(19, 22, 26, .96), rgba(14, 16, 20, .96)) padding-box,
    linear-gradient(120deg, rgba(200, 255, 176, .55), rgba(139, 233, 255, .55) 45%, rgba(201, 168, 255, .55)) border-box;
  border: 1px solid transparent;
  border-radius: 22px;
  padding: 24px 20px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 0 44px rgba(139, 233, 255, .12), 0 0 24px rgba(200, 255, 176, .06), inset 0 1px 0 rgba(255, 255, 255, .07);
  overflow: hidden;
}
.total-balance-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .8), transparent);
  opacity: .7;
}
.tb-label { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 2px; }
.tb-value {
  font-family: var(--led);
  font-size: 46px; font-weight: 800; letter-spacing: 1px; line-height: 1.1;
  color: #e9fff2;
  text-shadow: 0 0 22px rgba(139, 255, 176, .45), 0 0 6px rgba(139, 255, 176, .3);
  font-variant-numeric: tabular-nums;
}
.total-balance-card .btn { align-self: flex-start; margin-top: 10px; }

/* cards */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color .2s, transform .15s;
  overflow: hidden;
}
.card:active { transform: scale(.99); border-color: var(--border-glow); }
.account-card { display: flex; align-items: center; gap: 12px; padding-left: 20px; }
/* prism edge - rotating lamp colors */
.account-card::before {
  content: "";
  position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  border-radius: 3px;
  background: var(--c-cyan);
  box-shadow: 0 0 10px var(--c-cyan);
}
.card-list > .account-card:nth-child(5n+2)::before { background: var(--c-purple); box-shadow: 0 0 10px var(--c-purple); }
.card-list > .account-card:nth-child(5n+3)::before { background: var(--c-green); box-shadow: 0 0 10px var(--c-green); }
.card-list > .account-card:nth-child(5n+4)::before { background: var(--c-orange); box-shadow: 0 0 10px var(--c-orange); }
.card-list > .account-card:nth-child(5n+5)::before { background: var(--c-pink); box-shadow: 0 0 10px var(--c-pink); }
.account-info { flex: 1; min-width: 0; }
.account-panel { font-weight: 700; letter-spacing: .3px; }
.account-username { color: var(--text-dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.account-balance { text-align: right; }
.balance-value {
  font-family: var(--led);
  font-weight: 700; font-size: 18px; letter-spacing: .5px;
  color: #d6fff6;
  text-shadow: 0 0 14px rgba(0, 240, 255, .4);
  font-variant-numeric: tabular-nums;
}
.balance-na { color: var(--text-dim); font-size: 13px; }
.empty-state { color: var(--text-dim); text-align: center; padding: 28px 12px; }

/* forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1.2px; font-weight: 600; }
.form input, .form select {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-size: 16px;
  padding: 13px 14px;
  width: 100%;
  outline: none;
  text-transform: none; letter-spacing: normal; font-weight: 400;
  transition: border-color .2s, box-shadow .2s;
}
.form input:focus, .form select:focus {
  border-color: var(--c-green);
  box-shadow: 0 0 0 3px rgba(139, 255, 176, .12), 0 0 18px rgba(139, 255, 176, .10);
}
.form select option { background: #0b0d14; }
.amount-row, .password-row { display: flex; gap: 8px; }
.amount-row input, .password-row input { flex: 1; }
.amount-row .btn, .password-row .btn { flex: 0 0 auto; }
.form-error { color: var(--danger); font-size: 13px; min-height: 0; text-transform: none; letter-spacing: normal; }
.form-error:empty { display: none; }
.panel-desc { font-size: 13px; color: var(--text-dim); background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; text-transform: none; letter-spacing: normal; }
.panel-desc:empty { display: none; }

/* buttons */
.btn {
  border: none; border-radius: 14px;
  font-size: 15px; font-weight: 700;
  padding: 13px 16px;
  cursor: pointer;
  color: var(--text);
  background: var(--bg-card2);
  border: 1px solid var(--border);
  white-space: normal;
  line-height: 1.25;
  height: auto;
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.btn:active { transform: scale(.97); }
/* solid neon-green primary button */
.btn-primary {
  background: #2ee6a8;
  color: #06130c;
  width: 100%;
  border: none;
  box-shadow: 0 4px 24px rgba(46, 230, 168, .30), 0 0 16px rgba(46, 230, 168, .18);
  letter-spacing: .4px;
}
.btn-primary:active { filter: brightness(1.1); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-dim); }
.btn-ghost:active { border-color: rgba(139, 255, 176, .5); color: var(--c-green); }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-block { width: 100%; margin-top: 10px; }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }

/* payment result panels */
.payment-panel {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 18px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 0 32px rgba(0, 240, 255, .10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.payment-panel::before {
  content: "";
  position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: var(--bubble);
  opacity: .8;
}
.payment-row { display: flex; flex-direction: column; gap: 4px; }
.payment-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 2px; }
.payment-value { font-size: 18px; font-weight: 700; word-break: break-all; font-variant-numeric: tabular-nums; }
.payment-value.copyable {
  color: var(--c-green); cursor: pointer; align-self: flex-start;
  border-bottom: 1px dashed rgba(139, 255, 176, .4);
  text-shadow: 0 0 12px rgba(139, 255, 176, .3);
}
.payment-note { font-size: 13px; color: var(--text-dim); }
.payment-note b { color: var(--text); }
.copy-hint { font-size: 12px; color: var(--text-dim); }

/* confirm screen */
.confirm-panel {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px;
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.confirm-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.confirm-row span:first-child { color: var(--text-dim); }
.confirm-row span:last-child { text-align: right; word-break: break-all; font-weight: 600; }
.confirm-actions { display: flex; gap: 10px; margin-top: 8px; }
.confirm-actions .btn { flex: 1; }

/* status banners */
.status-ok, .status-info { border-radius: 14px; padding: 14px 16px; font-size: 14px; }
.status-ok {
  background: rgba(139, 255, 176, .07);
  border: 1px solid rgba(139, 255, 176, .4);
  box-shadow: 0 0 24px rgba(139, 255, 176, .08);
}
.status-info { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim); }

/* history */
.history-item { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.history-item:last-child { border-bottom: none; }
.history-meta { color: var(--text-dim); font-size: 12px; }
.badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .5px;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-dim);
}
.badge.ok { color: var(--ok); border-color: rgba(52, 245, 165, .45); background: rgba(52, 245, 165, .07); }
.badge.warn { color: var(--accent); border-color: rgba(0, 240, 255, .4); background: rgba(0, 240, 255, .06); }
.badge.bad { color: var(--danger); border-color: rgba(255, 77, 109, .45); background: rgba(255, 77, 109, .07); }

/* support */
.support-hero {
  position: relative;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px;
  padding: 18px; display: flex; flex-direction: column; gap: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}
.support-hero::before {
  content: "";
  position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: var(--bubble);
  opacity: .7;
}
.faq-item { border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; overflow: hidden; background: var(--bg-card); }
.faq-q { width: 100%; text-align: left; background: none; border: none; color: var(--text); font-size: 14px; font-weight: 600; padding: 15px 16px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.faq-q::after { content: "+"; color: var(--c-pink); font-size: 18px; text-shadow: 0 0 10px rgba(255, 122, 217, .5); }
.faq-item.open .faq-q::after { content: "–"; }
.faq-a { display: none; padding: 0 16px 15px; color: var(--text-dim); font-size: 14px; }
.faq-item.open .faq-a { display: block; }

/* help guides - each guide gets its own lamp color */
.guide {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px;
  padding: 18px; margin-bottom: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.guide h2 { font-size: 15px; margin-bottom: 10px; letter-spacing: .3px; }
.guide:nth-of-type(5n+1) h2 { color: var(--c-cyan); text-shadow: 0 0 12px rgba(0, 240, 255, .35); }
.guide:nth-of-type(5n+2) h2 { color: var(--c-green); text-shadow: 0 0 12px rgba(139, 255, 176, .35); }
.guide:nth-of-type(5n+3) h2 { color: var(--c-orange); text-shadow: 0 0 12px rgba(255, 179, 92, .35); }
.guide:nth-of-type(5n+4) h2 { color: var(--c-purple); text-shadow: 0 0 12px rgba(180, 76, 255, .35); }
.guide:nth-of-type(5n+5) h2 { color: var(--c-pink); text-shadow: 0 0 12px rgba(255, 122, 217, .35); }
.guide ol { padding-left: 20px; display: flex; flex-direction: column; gap: 7px; font-size: 14px; color: var(--text); }
.anim-slot {
  margin-top: 14px;
  border: 1px dashed rgba(0, 240, 255, .25);
  border-radius: 14px;
  padding: 28px 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  background: rgba(0, 240, 255, .03);
}

/* bottom tab bar - each tab its own lamp color when active */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex;
  background: rgba(6, 7, 9, .88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tab-btn {
  flex: 1;
  min-width: 0;
  background: none; border: none;
  color: var(--text-dim);
  font-size: 10px; font-weight: 600;
  line-height: 1.15;
  padding: 7px 2px 8px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border-radius: 12px;
  transition: color .2s;
}
.tab-btn .tab-icon { font-size: 19px; filter: grayscale(.7) brightness(.8); transition: filter .2s, transform .2s, text-shadow .2s; }
.tab-btn .tab-label { white-space: normal; overflow-wrap: break-word; max-width: 100%; }
.tab-btn.active .tab-icon { filter: none; transform: translateY(-1px); }
.tab-btn:nth-child(1).active { color: var(--c-cyan); }
.tab-btn:nth-child(1).active .tab-icon { text-shadow: 0 0 14px rgba(0, 240, 255, .65); }
.tab-btn:nth-child(2).active { color: var(--c-green); }
.tab-btn:nth-child(2).active .tab-icon { text-shadow: 0 0 14px rgba(139, 255, 176, .65); }
.tab-btn:nth-child(3).active { color: var(--c-orange); }
.tab-btn:nth-child(3).active .tab-icon { text-shadow: 0 0 14px rgba(255, 179, 92, .65); }
.tab-btn:nth-child(4).active { color: var(--c-purple); }
.tab-btn:nth-child(4).active .tab-icon { text-shadow: 0 0 14px rgba(180, 76, 255, .65); }
.tab-btn:nth-child(5).active { color: var(--c-pink); }
.tab-btn:nth-child(5).active .tab-icon { text-shadow: 0 0 14px rgba(255, 122, 217, .65); }
.tab-btn:nth-child(6).active { color: var(--c-yellow); }
.tab-btn:nth-child(6).active .tab-icon { text-shadow: 0 0 14px rgba(232, 255, 106, .65); }

/* spinner */
#spinner-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6, 7, 9, .7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.spinner {
  width: 38px; height: 38px;
  border: 3px solid rgba(139, 255, 176, .15);
  border-top-color: var(--c-green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  box-shadow: 0 0 24px rgba(139, 255, 176, .25);
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-inline {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(139, 255, 176, .2);
  border-top-color: var(--c-green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}

/* subtle entrance for tab pages */
.tab-page { animation: pageIn .25s ease-out; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- motion ---------- */

/* staggered card entrance */
.card-list > * { animation: cardIn .35s ease-out backwards; }
.card-list > *:nth-child(1) { animation-delay: .04s; }
.card-list > *:nth-child(2) { animation-delay: .10s; }
.card-list > *:nth-child(3) { animation-delay: .16s; }
.card-list > *:nth-child(4) { animation-delay: .22s; }
.card-list > *:nth-child(n+5) { animation-delay: .28s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } }

/* breathing glow on primary actions */
.btn-primary { animation: btnPulse 2.6s ease-in-out infinite; }
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(46, 230, 168, .30), 0 0 16px rgba(46, 230, 168, .18); }
  50% { box-shadow: 0 4px 30px rgba(46, 230, 168, .48), 0 0 28px rgba(46, 230, 168, .32); }
}
.btn-primary:disabled { animation: none; }

/* result panels pop in */
.payment-panel, .confirm-panel, .status-ok { animation: popIn .3s ease-out; }
@keyframes popIn { from { opacity: 0; transform: scale(.96); } }

/* hero balance card entrance */
.total-balance-card { animation: heroIn .45s ease-out; }
@keyframes heroIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* tab icon pop on switch */
.tab-btn.active .tab-icon { animation: iconPop .25s ease-out; }
@keyframes iconPop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: translateY(-1px); } }

/* help screenshots */
.help-shot {
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: block;
  width: 100%;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}
