/* Universe Exchange — Cosmic Dark Theme */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ue-bg:       #06080F;
  --ue-surface:  #0D1420;
  --ue-card:     #111827;
  --ue-card2:    #162033;
  --ue-border:   rgba(56,189,248,0.13);
  --ue-accent:   #38BDF8;
  --ue-accent2:  #818CF8;
  --ue-glow:     rgba(56,189,248,0.18);
  --ue-text:     #E2E8F0;
  --ue-muted:    #64748B;
  --ue-success:  #34D399;
  --ue-danger:   #F87171;
  --ue-buy:      #34D399;
  --ue-sell:     #FB923C;
  --radius:      14px;
  --radius-sm:   8px;
  --radius-lg:   22px;
}

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

html, body {
  background: var(--ue-bg);
  color: var(--ue-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ─── Dot-grid starfield background (no video, lightweight) ─── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(56,189,248,0.07) 1px, transparent 1px),
    radial-gradient(circle, rgba(129,140,248,0.045) 1px, transparent 1px);
  background-size: 42px 42px, 84px 84px;
  background-position: 0 0, 21px 21px;
}
body > * { position: relative; z-index: 1; }

/* ─── Buttons ─── */
.ue-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px;
  background: linear-gradient(135deg, var(--ue-accent) 0%, var(--ue-accent2) 100%);
  color: #060810; font-size: 14px; font-weight: 700;
  font-family: 'Syne', sans-serif; letter-spacing: 0.04em;
  border-radius: 50px; border: none; cursor: pointer;
  text-decoration: none; transition: opacity .15s, box-shadow .15s;
  box-shadow: 0 0 22px rgba(56,189,248,0.28);
  white-space: nowrap;
}
.ue-btn:hover { opacity: .87; box-shadow: 0 0 36px rgba(56,189,248,0.44); }
.ue-btn:active { transform: scale(.97); }
.ue-btn.full { width: 100%; }
.ue-btn-outline {
  background: transparent;
  border: 1px solid var(--ue-border);
  color: var(--ue-muted);
  box-shadow: none;
}
.ue-btn-outline:hover { border-color: var(--ue-accent); color: var(--ue-accent); box-shadow: none; }

/* ─── Mini App layout ─── */
.ue-ma-wrap {
  display: flex; flex-direction: column;
  min-height: 100vh; padding: 16px;
  max-width: 480px; margin: 0 auto;
}

/* ─── Header ─── */
.ue-ma-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; padding-top: 8px;
}
.ue-ma-logo { display: flex; align-items: center; gap: 10px; }
.ue-ma-logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--ue-accent), var(--ue-accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #060810;
  font-family: 'Syne', sans-serif; flex-shrink: 0;
}
.ue-ma-logo-text {
  font-family: 'Syne', sans-serif;
  font-size: 15px; font-weight: 700; color: var(--ue-text);
}
.ue-ma-logo-sub { font-size: 10px; color: var(--ue-muted); margin-top: -1px; }
.ue-ma-lang { display: flex; gap: 4px; }
.ue-ma-lang a {
  font-size: 11px; font-weight: 600;
  padding: 4px 9px; border-radius: 20px;
  border: 1px solid var(--ue-border);
  color: var(--ue-muted); text-decoration: none; transition: all .15s;
}
.ue-ma-lang a.active { color: var(--ue-accent); border-color: rgba(56,189,248,0.4); }

/* ─── Section header ─── */
.ue-sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.ue-sec-label {
  font-size: 10px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ue-muted);
}

/* ─── Live pulse ─── */
.ue-live {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  color: var(--ue-buy); text-transform: uppercase;
}
.ue-live::before {
  content: ''; display: block; width: 6px; height: 6px;
  background: var(--ue-buy); border-radius: 50%;
  animation: uePulse 1.8s ease-in-out infinite;
}
@keyframes uePulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.35; transform:scale(.6); }
}

/* ─── Rate cards ─── */
.ue-rates-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.ue-rate-card {
  background: var(--ue-card); border: 1px solid var(--ue-border);
  border-radius: var(--radius); padding: 14px 12px;
  text-decoration: none; display: flex; flex-direction: column; gap: 5px;
  transition: border-color .15s, box-shadow .15s; cursor: pointer;
}
.ue-rate-card:hover { border-color: rgba(56,189,248,.3); box-shadow: 0 0 18px var(--ue-glow); }
.ue-rate-card.buy  { border-top: 2px solid var(--ue-buy); }
.ue-rate-card.sell { border-top: 2px solid var(--ue-sell); }
.ue-rate-lbl {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ue-muted);
}
.ue-rate-val {
  font-family: 'Inter', sans-serif;
  font-size: 21px; font-weight: 800; line-height: 1.1;
  color: var(--ue-accent);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.ue-rate-card.buy  .ue-rate-val { color: var(--ue-buy); }
.ue-rate-card.sell .ue-rate-val { color: var(--ue-sell); }
.ue-rate-sub { font-size: 11px; color: var(--ue-muted); }

/* ─── Main CTA block ─── */
.ue-ma-cta { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.ue-ma-cta .ue-btn { font-size: 15px; padding: 15px; }
.ue-ma-cta .ue-btn-outline { font-size: 14px; padding: 12px; }

/* ─── Quick links ─── */
.ue-links { display: flex; flex-direction: column; gap: 7px; }
.ue-link-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--ue-surface); border: 1px solid var(--ue-border);
  border-radius: var(--radius-sm); text-decoration: none;
  color: var(--ue-text); font-size: 13px; font-weight: 500;
  transition: border-color .15s;
}
.ue-link-row:hover { border-color: rgba(56,189,248,.3); }
.ue-link-arrow { margin-left: auto; color: var(--ue-muted); font-size: 14px; }

/* ─── Apply page ─── */
.ue-apply-wrap { padding: 0 0 32px; max-width: 480px; margin: 0 auto; }
.ue-page-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 0; color: var(--ue-muted); font-size: 13px;
  text-decoration: none; margin-bottom: 14px;
  transition: color .15s;
}
.ue-page-back:hover { color: var(--ue-accent); }
.ue-apply-title {
  font-family: 'Syne', sans-serif;
  font-size: 20px; font-weight: 800; color: var(--ue-text);
  margin-bottom: 18px; letter-spacing: -.01em;
}

/* ─── Segmented control ─── */
.ue-seg { display: flex; gap: 4px; margin-bottom: 16px; }
.ue-seg-btn {
  flex: 1; padding: 11px; text-align: center;
  background: var(--ue-surface); border: 1px solid var(--ue-border);
  border-radius: var(--radius-sm); color: var(--ue-muted);
  cursor: pointer; font-size: 13px; font-weight: 700;
  font-family: 'Syne', sans-serif; letter-spacing: .04em;
  transition: all .15s; user-select: none;
}
.ue-seg-btn.active {
  background: var(--ue-accent); border-color: var(--ue-accent);
  color: #060810; box-shadow: 0 0 14px rgba(56,189,248,.32);
}

/* ─── Amount input ─── */
.ue-amount-wrap {
  background: var(--ue-surface); border: 1px solid var(--ue-border);
  border-radius: var(--radius-sm); display: flex; align-items: center;
  margin-bottom: 8px; transition: border-color .15s;
}
.ue-amount-wrap:focus-within { border-color: var(--ue-accent); }
.ue-amount-inp {
  flex: 1; padding: 14px 14px; background: transparent;
  border: none; outline: none; color: var(--ue-text);
  font-size: 22px; font-weight: 700; font-family: 'Inter', sans-serif;
  font-variant-numeric: tabular-nums;
}
.ue-amount-inp::placeholder { color: var(--ue-muted); font-size: 16px; font-weight: 400; font-family: 'Inter', sans-serif; }
.ue-amount-cur {
  padding: 0 14px; color: var(--ue-muted);
  font-size: 12px; font-weight: 700; font-family: 'Syne', sans-serif;
  letter-spacing: .06em; white-space: nowrap;
}

.ue-arrow-row { text-align: center; padding: 4px 0; color: var(--ue-muted); font-size: 18px; }

.ue-result-wrap {
  display: flex; align-items: center;
  background: rgba(56,189,248,.06); border: 1px solid rgba(56,189,248,.18);
  border-radius: var(--radius-sm); padding: 14px; margin-bottom: 8px;
}
.ue-result-inp {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--ue-accent); font-size: 22px; font-weight: 700;
  font-family: 'Syne', sans-serif;
}
.ue-result-cur { color: var(--ue-accent); font-size: 12px; font-weight: 700; font-family: 'Syne', sans-serif; letter-spacing: .06em; }

.ue-rate-row {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; color: var(--ue-muted); margin-bottom: 18px;
}
.ue-rate-row strong { color: var(--ue-text); }

/* ─── Form fields ─── */
.ue-fields { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.ue-field {}
.ue-field label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ue-muted); margin-bottom: 6px;
}
.ue-field .ue-help { font-size: 12px; color: var(--ue-muted); margin-bottom: 6px; line-height: 1.45; }
.ue-field input[type="text"],
.ue-field input[type="email"],
.ue-field input[type="tel"],
.ue-field input[type="number"],
.ue-field input[type="password"] {
  width: 100%; padding: 12px 14px;
  background: var(--ue-surface); border: 1px solid var(--ue-border);
  border-radius: var(--radius-sm); outline: none;
  color: var(--ue-text); font-size: 15px; font-family: 'Inter', sans-serif;
  transition: border-color .15s;
}
.ue-field input:focus { border-color: var(--ue-accent); }
.ue-field input::placeholder { color: var(--ue-muted); }

/* ─── Success page ─── */
.ue-success-wrap {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 70vh; padding: 32px 16px; text-align: center;
}
.ue-success-ring {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(52,211,153,.1); border: 2px solid var(--ue-success);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px; font-size: 34px;
  box-shadow: 0 0 32px rgba(52,211,153,.2);
}
.ue-success-title {
  font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800;
  color: var(--ue-text); margin-bottom: 10px;
}
.ue-success-text { font-size: 14px; color: var(--ue-muted); max-width: 300px; line-height: 1.65; }
.ue-success-actions { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 280px; }

/* ─── Category / Option page ─── */
.ue-page-wrap { padding: 16px; max-width: 480px; margin: 0 auto; }
.ue-item-hero { margin-bottom: 16px; border-radius: var(--radius); overflow: hidden; }
.ue-item-hero img { width: 100%; max-height: 220px; object-fit: cover; display: block; }
.ue-item-title {
  font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800;
  color: var(--ue-text); margin-bottom: 12px; letter-spacing: -.01em;
}
.ue-item-body { color: var(--ue-muted); font-size: 14px; line-height: 1.7; margin-bottom: 18px; }
.ue-item-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.ue-item-card {
  background: var(--ue-card); border: 1px solid var(--ue-border);
  border-radius: var(--radius-sm); padding: 14px 12px;
  text-decoration: none; color: var(--ue-text); font-size: 13px; font-weight: 600;
  transition: border-color .15s, box-shadow .15s;
}
.ue-item-card:hover { border-color: rgba(56,189,248,.3); box-shadow: 0 0 12px var(--ue-glow); }
.ue-item-card-name { font-family: 'Syne', sans-serif; font-weight: 700; }
.ue-item-card-rate { font-size: 11px; color: var(--ue-muted); margin-top: 4px; }
.ue-item-actions { display: flex; flex-direction: column; gap: 8px; }

/* ─── Pagination ─── */
.ue-pagination { display: flex; gap: 8px; margin-top: 12px; }
.ue-pagination a {
  padding: 8px 16px; background: var(--ue-surface);
  border: 1px solid var(--ue-border); border-radius: var(--radius-sm);
  color: var(--ue-muted); text-decoration: none; font-size: 13px;
  transition: border-color .15s;
}
.ue-pagination a:hover { border-color: var(--ue-accent); color: var(--ue-accent); }

/* ─── Static page ─── */
.ue-prose { color: var(--ue-muted); font-size: 14px; line-height: 1.75; }
.ue-prose h1, .ue-prose h2, .ue-prose h3 {
  font-family: 'Syne', sans-serif; color: var(--ue-text); margin: 18px 0 8px;
}
.ue-prose p { margin-bottom: 12px; }
.ue-prose a { color: var(--ue-accent); }
.ue-prose ul, .ue-prose ol { padding-left: 18px; margin-bottom: 12px; }
.ue-prose li { margin-bottom: 4px; }

/* ─── Invite code ─── */
.ue-invite-row { margin-bottom: 18px; }
.ue-invite-toggle {
  background: none; border: none; color: var(--ue-muted); font-size: 12px;
  cursor: pointer; padding: 0; text-decoration: underline;
  font-family: 'Inter', sans-serif;
}
