:root {
  --bg: #0A0B1A; --surface: #14152A; --card: #1A1B35;
  --border: #2A2B50; --text: #E8E6F0; --muted: #8A89A0;
  --gold: #D4A843; --gold-dim: rgba(212,168,67,0.2);
  --purple: #8B6FC7; --purple-dim: rgba(139,111,199,0.2);
  --fire: #E85D3F; --wood: #4CAF50; --earth: #D4A843;
  --metal: #E8E6F0; --water: #5B9BD5;
}
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh; line-height: 1.5;
  display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Nav ---- */
nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,11,26,1);
}
nav .logo { font-size: 1.3rem; font-weight: 800; color: #fff; letter-spacing: 0.03em; }
nav .logo span { color: var(--gold); }
nav .nav-links { display: flex; gap: 1rem; align-items: center; }
nav .nav-links a, nav .nav-links button {
  color: var(--muted); font-size: 0.9rem; padding: 0.4rem 0.8rem;
  border-radius: 0.5rem; transition: all 0.2s; background: none; border: none; cursor: pointer;
  font-family: inherit;
}
nav .nav-links a:hover, nav .nav-links button:hover { color: #fff; background: rgba(255,255,255,0.05); }
nav .nav-links .btn-gold {
  background: linear-gradient(135deg, var(--gold), #b8922e);
  color: #0A0B1A !important; font-weight: 600; border-radius: 2rem;
  padding: 0.5rem 1.2rem;
}
/* ---- Pages ---- */
.page { display: none; padding: 2rem 1.5rem; max-width: 1200px; margin: 0 auto; }
.page.active { display: block; }

/* ---- Terms ---- */
.terms-content { max-width: 760px; margin: 0 auto; }
.terms-content h1 { font-size: 1.8rem; margin-bottom: 2rem; color: var(--gold); }
.terms-content h2 { font-size: 1.1rem; margin-top: 2rem; margin-bottom: 0.5rem; color: var(--text); }
.terms-content p { color: var(--muted); font-size: 0.9rem; line-height: 1.7; margin-bottom: 1rem; }

/* ---- Welcome ---- */
.welcome-hero { text-align: center; padding: 3rem 1rem; }
.welcome-hero h1 {
  font-size: clamp(1.8rem, 3.8vw, 2.6rem); font-weight: 800; line-height: 1.2;
  white-space: nowrap;
  background: linear-gradient(180deg, #fff 0%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.welcome-hero .subtitle { color: var(--muted); font-size: 1.1rem; margin-top: 1rem; }
.welcome-hero .powered-by { color: var(--muted); font-size: 0.8rem; margin-top: 1.5rem; opacity: 0.6; }
.cosmic-quote-inline {
  text-align: center; padding: 0.3rem 1rem 0; margin: 0.5rem auto 0.2rem;
  font-size: clamp(0.78rem, 1.3vw, 0.9rem); font-weight: 500; font-style: italic;
  line-height: 1.4; max-width: 560px;
  background: linear-gradient(180deg, #fff 0%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.birthday-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 1.5rem; padding: 2rem; max-width: 420px; margin: 2rem auto;
  text-align: center;
}
.birthday-box h3 { font-size: 1.1rem; margin-bottom: 1rem; color: var(--gold); }
.birthday-inputs { display: flex; gap: 0.5rem; justify-content: center; margin-bottom: 1rem; flex-wrap: wrap; }
.birthday-inputs select, .birthday-inputs input {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 0.8rem; padding: 0.8rem 0.6rem; font-size: 1rem; font-family: inherit;
  text-align: center;
}
.birthday-inputs select:focus, .birthday-inputs input:focus { border-color: var(--gold); outline: none; }
.birthday-inputs input[type="number"] { -moz-appearance: textfield; }
.birthday-inputs input[type="number"]::-webkit-inner-spin-button,
.birthday-inputs input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.birthday-inputs input#birth-year, .birthday-inputs input#reg-year { width: 6rem; }
.birthday-inputs input#birth-month, .birthday-inputs input#reg-month { width: 5.5rem; }
.birthday-inputs input#birth-day, .birthday-inputs input#reg-day { width: 5.5rem; }
.birthday-box .btn-reveal {
  display: block; width: 100%; padding: 0.9rem; border: none;
  border-radius: 2rem; font-size: 1.1rem; font-weight: 700; cursor: pointer;
  background: linear-gradient(135deg, var(--gold), #b8922e);
  color: #0A0B1A; transition: all 0.3s; font-family: inherit;
}
.birthday-box .btn-reveal:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(212,168,67,0.3); }
.birthday-box .btn-reveal:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.age-check { display: block; text-align: center; margin: 0.8rem 0; font-size: 0.8rem; color: var(--muted); cursor: pointer; }
.age-check input { vertical-align: middle; margin-right: 0.3rem; accent-color: var(--gold); }
.cta-tagline { text-align: center; margin: 1rem 0 1.2rem; }
.cta-disclaimer { display: block; color: var(--muted); font-size: 0.72rem; opacity: 0.6; margin-bottom: 0.25rem; }
.cta-slogan { display: block; font-size: 0.95rem; font-weight: 700; color: var(--gold); }
.birthday-box .skip-link { display: block; margin-top: 1rem; color: var(--muted); font-size: 0.85rem; cursor: pointer; background: none; border: none; font-family: inherit; text-align: center; width: 100%; }
.birthday-box .skip-link:hover { color: var(--text); }
.birthday-box .skip-link:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---- Reveal Burst Animation ---- */
.btn-reveal.bursting {
  animation: goldenPulse 1.2s ease-out;
  pointer-events: none;
}
@keyframes goldenPulse {
  0%   { box-shadow: 0 0 0 0 rgba(212,168,67,0.9); }
  30%  { box-shadow: 0 0 50px 25px rgba(212,168,67,0.4); }
  100% { box-shadow: 0 0 100px 50px rgba(212,168,67,0); }
}
.particle-stage {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9999;
}
.particle {
  position: absolute;
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  animation: particleFly 1.3s ease-out forwards;
  opacity: 0;
  text-shadow: 0 0 6px rgba(212,168,67,0.6);
}
@keyframes particleFly {
  0%   { transform: translate(0, 0) scale(1.4); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

.element-display { margin: 0.5rem 0; font-size: 2rem; }

/* ---- Tianshi Bar ---- */
.tianshi-bar {
  text-align: center; padding: 0.8rem 1rem;
  color: var(--muted); font-size: 0.85rem;
  background: var(--surface); border-radius: 0.8rem; margin-bottom: 1.5rem;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem;
}
.tianshi-bar .ts-badge {
  background: var(--purple-dim); color: var(--purple);
  padding: 0.2rem 0.6rem; border-radius: 0.3rem; font-size: 0.75rem;
}

/* ---- Lottery Selector ---- */
.lottery-bar {
  display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.lottery-bar button {
  padding: 0.5rem 1rem; border: 1px solid var(--border);
  border-radius: 2rem; background: var(--surface); color: var(--text);
  cursor: pointer; font-size: 0.85rem; transition: all 0.2s;
  font-family: inherit;
}
.lottery-bar button.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.lottery-bar button:hover { border-color: var(--purple); }

.last-draw {
  text-align: center; margin-bottom: 1.2rem; font-size: 0.82rem; color: var(--muted);
}
.last-draw strong { color: var(--text); }
.last-draw .ball-mini {
  display: inline-block; width: 1.6rem; height: 1.6rem; line-height: 1.6rem;
  border-radius: 50%; font-size: 0.7rem; font-weight: 700; margin: 0 0.15rem;
  background: linear-gradient(135deg, #ffffff, #e0e0e0); color: #222;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.last-draw .ball-mini.special {
  background: var(--purple); color: #fff;
}

/* ---- Upgrade CTA ---- */
.upgrade-cta {
  background: linear-gradient(135deg, rgba(139,111,199,0.12), rgba(212,168,67,0.08));
  border: 1px solid var(--purple); border-radius: 1rem;
  padding: 1.2rem 1.5rem; margin: 1rem 0; text-align: center;
}
.upgrade-cta p { margin: 0 0 0.8rem; font-size: 0.9rem; color: var(--text); }
.upgrade-cta .upgrade-features { color: var(--muted); font-size: 0.8rem; margin-bottom: 1rem; }
.upgrade-cta .btn-upgrade {
  display: inline-block; padding: 0.6rem 2rem; border: none;
  border-radius: 2rem; font-size: 0.9rem; font-weight: 700; cursor: pointer;
  background: var(--purple); color: #fff; font-family: inherit; transition: all 0.3s;
}
.upgrade-cta .btn-upgrade:hover { opacity: 0.85; transform: translateY(-1px); }

/* ---- Mode Cards Grid ---- */
#grid { margin-top: 1rem; }
#grid.multi {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem; align-items: stretch;
}
#grid.multi .card { height: 100%; }
#grid.single { display: flex; justify-content: center; }
#grid.single .card { max-width: 420px; width: 100%; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 1rem; padding: 1.2rem; transition: all 0.3s;
  display: flex; flex-direction: column;
}
.card:hover { border-color: var(--purple); transform: translateY(-2px); }
.card h3 { font-size: 1.1rem; margin-bottom: 0.3rem; min-height: 1.6rem; }
.card .mode-desc { color: var(--muted); font-size: 0.8rem; margin-bottom: 0.8rem; min-height: 2.2rem; }
.card .balls { min-height: 3.1rem; }
.card .elem-row { min-height: 1.4rem; }
.card .mode-slogan { color: var(--gold); font-size: 0.78rem; font-weight: 600; margin-top: 0.5rem; font-style: italic; min-height: 2.6rem; }
.card .save-btn {
  position: absolute; top: 0.8rem; right: 0.8rem;
  background: none; border: none; font-size: 1.2rem; cursor: pointer;
  padding: 0.2rem; line-height: 1; transition: transform 0.2s;
}
.card .save-btn:hover { transform: scale(1.2); }
.card { position: relative; }

.balls { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.5rem 0; }
.ball {
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem;
}
.ball.front { background: var(--ball-front, linear-gradient(135deg, #ffffff, #e8e8e8)); color: #222; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.ball-spacer { width: 0.8rem; }
/* Powerball: red special ball */
.powerball .ball.back { background: linear-gradient(135deg, #D42B2B, #a61c1c); box-shadow: 0 2px 8px rgba(212,43,43,0.4); }
/* Mega Millions: gold special ball */
.megamillions .ball.back { background: linear-gradient(135deg, #D4A843, #b8922e); box-shadow: 0 2px 8px rgba(212,168,67,0.4); }
.elem-row { display: flex; gap: 0.3rem; margin: 0.3rem 0; }
.elem-tag { font-size: 0.7rem; padding: 0.15rem 0.4rem; border-radius: 0.3rem; font-weight: 600; }
.elem-fire { background: rgba(232,93,63,0.2); color: var(--fire); }
.elem-wood { background: rgba(76,175,80,0.2); color: var(--wood); }
.elem-earth { background: rgba(212,168,67,0.2); color: var(--earth); }
.elem-metal { background: rgba(232,230,240,0.2); color: var(--metal); }
.elem-water { background: rgba(91,155,213,0.2); color: var(--water); }

/* ---- Card actions ---- */
.card-actions { display: flex; justify-content: space-between; margin-top: auto; padding-top: 0.6rem; }
.copy-btn {
  background: none; border: none; color: var(--muted);
  padding: 0.25rem 0.4rem; font-size: 0.72rem;
  cursor: pointer; transition: all 0.25s; opacity: 0;
}
.card:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text); }
.share-btn {
  background: none; border: none; color: var(--muted);
  padding: 0.25rem 0.5rem; font-size: 0.72rem;
  cursor: pointer; transition: all 0.25s; opacity: 0;
  font-family: inherit;
}
.card:hover .share-btn { opacity: 1; }
.share-btn:hover { color: var(--gold); }

/* ---- Share Panel ---- */
.share-panel-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.6); }
.share-panel {
  position: fixed; z-index: 1001;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 0.5rem; padding: 0.6rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  min-width: 280px;
}
.share-panel-title {
  font-size: 0.8rem; color: var(--muted); padding: 0.3rem 0.7rem 0.5rem;
}
.share-panel-option {
  display: block; width: 100%; padding: 0.55rem 0.7rem;
  background: none; border: none; color: var(--text);
  cursor: pointer; text-align: left; border-radius: 0.3rem;
  font-family: inherit;
}
.share-panel-option:hover { background: var(--hover); }
.share-panel-copy-link {
  display: block; width: 100%; padding: 0.55rem 0.7rem;
  background: var(--hover); border: 1px solid var(--purple);
  color: var(--text); cursor: pointer; text-align: left; border-radius: 0.3rem;
  font-family: inherit; margin-bottom: 0.5rem; transition: border-color 0.2s;
}
.share-panel-copy-link:hover { border-color: var(--accent); }
.share-panel-copy-link.copied { border-color: #4ade80; }
.share-panel-copy-link .copy-link-icon { font-size: 0.85rem; }
.share-panel-copy-link .copy-link-label { font-weight: 600; font-size: 0.85rem; }
.share-panel-copy-link .platform-info { font-size: 0.72rem; color: var(--muted); }
.share-panel-option .ratio-label { font-weight: 600; font-size: 0.85rem; }
.share-panel-option .platform-info { font-size: 0.72rem; color: var(--muted); }

/* ---- Universe Decide Button ---- */
.universe-btn {
  display: block; margin: 24px auto; padding: 0.7rem 1.8rem;
  background: linear-gradient(135deg, rgba(139,111,199,0.3), rgba(212,168,67,0.3));
  border: 1px solid var(--purple); border-radius: 999px;
  color: #fff; font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: all 0.3s;
  animation: breath 3s ease-in-out infinite;
}
.universe-btn:hover { background: linear-gradient(135deg, rgba(139,111,199,0.5), rgba(212,168,67,0.5)); transform: scale(1.02); }

@keyframes breath {
  0%, 100% { box-shadow: 0 0 8px rgba(139,111,199,0.15); }
  50% { box-shadow: 0 0 20px rgba(139,111,199,0.35); }
}

/* Card glow animation for universe decide */
.card.glow { border-color: var(--purple); box-shadow: 0 0 20px rgba(139,111,199,0.5); transform: scale(1.03); }
.card.chosen { border-color: var(--gold); box-shadow: 0 0 30px rgba(212,168,67,0.6); transform: scale(1.06); z-index: 10; }

/* ---- Pulse animation ---- */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.save-btn.pulse { animation: pulse 0.3s ease; }

/* ---- Toast ---- */
.toast {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%) translateY(-300%);
  background: var(--purple); color: #fff; padding: 0.6rem 1.5rem;
  border-radius: 999px; font-size: 0.85rem; font-weight: 600; z-index: 999;
  transition: transform 0.3s ease; pointer-events: none; opacity: 0;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
/* ---- Save Drawer ---- */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.save-drawer {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface);
  border-radius: 1.5rem 1.5rem 0 0; padding: 1.5rem 1.5rem calc(2rem + env(safe-area-inset-bottom, 0px));
  z-index: 201; transform: translateY(100%); transition: transform 0.35s ease;
  text-align: center;
}
.save-drawer.open { transform: translateY(0); }
.drawer-handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 1rem; }
.drawer-msg { color: var(--text); font-size: 0.95rem; margin-bottom: 1.2rem; line-height: 1.5; }
.drawer-btn {
  display: inline-block; padding: 0.7rem 2rem; border: none;
  border-radius: 2rem; font-size: 0.9rem; font-weight: 700; cursor: pointer;
  background: var(--purple); color: #fff; font-family: inherit; transition: all 0.3s;
}
.drawer-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.drawer-close {
  display: block; margin: 0.8rem auto 0; background: none; border: none;
  color: var(--muted); font-size: 0.8rem; cursor: pointer;
}

/* ---- Auth Pages ---- */
.auth-card {
  max-width: 440px; margin: 2rem auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: 1.5rem; padding: 2rem;
}
.auth-card h2 { text-align: center; margin-bottom: 1.5rem; }
.auth-card .form-group { margin-bottom: 1rem; }
.auth-card label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.3rem; }
.auth-card input, .auth-card select {
  width: 100%; padding: 0.7rem 0.9rem; border: 1px solid var(--border);
  border-radius: 0.7rem; background: var(--bg); color: var(--text);
  font-size: 1rem; font-family: inherit;
}
.auth-card input:focus, .auth-card select:focus { border-color: var(--gold); outline: none; }
.auth-card .btn-submit {
  width: 100%; padding: 0.8rem; border: none; border-radius: 2rem;
  font-size: 1rem; font-weight: 700; cursor: pointer; margin-top: 0.5rem;
  background: linear-gradient(135deg, var(--gold), #b8922e);
  color: #0A0B1A; font-family: inherit;
}
.auth-card .auth-switch { text-align: center; margin-top: 1rem; font-size: 0.85rem; color: var(--muted); }
.auth-card .auth-forgot { text-align: center; margin-top: 0.5rem; font-size: 0.82rem; }
.auth-card .auth-forgot a { color: var(--muted); text-decoration: none; }
.auth-card .auth-forgot a:hover { color: var(--gold); }
.auth-card .auth-terms { text-align: center; margin-top: 0.6rem; font-size: 0.78rem; color: var(--muted); }
.auth-card .auth-terms a { color: var(--gold); text-decoration: none; }
.auth-card .auth-terms a:hover { text-decoration: underline; }
.auth-card .error-msg { color: var(--fire); font-size: 0.85rem; margin-bottom: 1rem; text-align: center; }
.auth-card .gender-why { font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; font-style: italic; }

/* ---- Profile ---- */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 700px) { .profile-grid { grid-template-columns: 1fr; } }
.profile-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 1rem; padding: 1.5rem;
}
.profile-card h3 { margin-bottom: 1rem; color: var(--gold); }

/* ---- Karma Pill Button (centered above profile cards) ---- */
#page-profile { padding-top: 0.75rem; }
.karma-pill {
  display: block;
  margin: 0 auto 0.75rem;
  padding: 0.35rem 1.25rem;
  font-size: 1.17rem;
  font-weight: 500;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.karma-pill:hover {
  background: var(--gold);
  color: var(--bg);
}
.karma-subtitle {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 0.15rem;
}
.karma-pill:hover .karma-subtitle {
  color: var(--bg);
}
.karma-blessing {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  margin: 0.4rem 0 0.2rem;
  font-style: italic;
  letter-spacing: 0.02em;
}
.bazi-chart { font-size: 0.9rem; line-height: 2.2; }
.bazi-chart span { color: var(--purple); font-weight: 600; }
.bazi-chart small { color: var(--muted); font-size: 0.75rem; display: block; line-height: 1.4; margin-bottom: 0.3rem; }
.guide-divider { border-top: 1px solid var(--border); margin: 1rem 0; }
.guide-card { font-size: 0.85rem; }
.guide-date { color: var(--gold); font-size: 0.9rem; margin-bottom: 0.3rem; font-weight: 600; }
.guide-day-tone { font-size: 0.78rem; color: var(--muted); font-style: italic; margin-bottom: 0.7rem; line-height: 1.4; }

.guide-item {
  background: rgba(212,168,67,0.04); border: 1px solid rgba(212,168,67,0.12);
  border-radius: 0.7rem; padding: 0.6rem 0.8rem; margin-bottom: 0.5rem;
}
.guide-vibe { color: var(--purple); font-size: 0.8rem; margin-bottom: 0.35rem; font-weight: 600; }
.guide-row { font-size: 0.78rem; color: var(--muted); line-height: 1.65; }
.guide-row span { color: var(--text); }
.guide-alerts { margin-top: 0.7rem; }
.guide-alert-title { font-size: 0.85rem; font-weight: 600; color: #E8A040; margin-bottom: 0.4rem; }
.guide-alert-item { font-size: 0.78rem; color: var(--muted); line-height: 1.7; }
.guide-dm-line {
  margin-top: 0.8rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--border);
  font-size: 0.8rem; color: var(--gold); font-style: italic; text-align: center;
}
.guide-disclaimer {
  margin-top: 0.5rem; font-size: 0.7rem; color: var(--muted); text-align: center;
  font-style: italic; line-height: 1.5;
}
.profile-tabs { display: flex; gap: 0.4rem; margin-bottom: 1rem; }
.profile-tab {
  padding: 0.35rem 0.9rem; border: 1px solid var(--border);
  border-radius: 999px; font-size: 0.78rem; cursor: pointer;
  background: transparent; color: var(--muted); transition: all 0.2s;
}
.profile-tab.active { background: var(--purple); color: #fff; border-color: var(--purple); }
.profile-tab:hover:not(.active) { border-color: var(--purple); color: var(--text); }
.history-item {
  padding: 0.8rem; border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
#history-content { flex: 1; overflow-y: auto; min-height: 0; }
.history-item:last-child { border-bottom: none; }
.history-meta { color: var(--muted); font-size: 0.75rem; margin-bottom: 0.3rem; }
.load-more-btn {
  display: block; width: 100%; margin-top: 0.6rem; padding: 0.5rem;
  background: transparent; border: 1px solid var(--border); border-radius: 0.6rem;
  color: var(--muted); font-size: 0.8rem; cursor: pointer; font-family: inherit;
  transition: all 0.2s;
}
.load-more-btn:hover { border-color: var(--gold); color: var(--gold); }
.hist-del {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.85rem; padding: 0.2rem 0.4rem; border-radius: 4px;
}
.hist-del:hover { color: #e55; background: rgba(238,85,85,0.1); }
.history-item { position: relative; }

/* ---- Suggestion ---- */
.suggest-section {
  margin-top: 3rem; padding: 1.5rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 1rem;
}
.suggest-section h3 { margin-bottom: 1rem; }
.suggest-input { display: flex; gap: 0.5rem; }
.suggest-input input {
  flex: 1; padding: 0.7rem 0.9rem; border: 1px solid var(--border);
  border-radius: 0.7rem; background: var(--bg); color: var(--text);
  font-family: inherit;
}
.suggest-input button {
  padding: 0.7rem 1.2rem; border: none; border-radius: 0.7rem;
  background: var(--purple); color: #fff; cursor: pointer;
  font-weight: 600; font-family: inherit;
}
.suggest-list { margin-top: 1rem; }
.suggest-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.suggest-item span:first-child { word-break: break-word; min-width: 0; }
.suggest-item span:last-child { white-space: nowrap; flex-shrink: 0; margin-left: 0.5rem; }
.suggest-item .vote-btn { color: var(--gold); cursor: pointer; background: none; border: 1px solid var(--gold); border-radius: 1rem; padding: 0.2rem 0.8rem; font-size: 0.8rem; font-family: inherit; transition: all 0.2s; }
.suggest-item .vote-btn:hover { background: var(--gold-dim); }
.suggest-item .vote-btn.voted { color: var(--muted); border-color: var(--border); }
.suggest-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 0.5rem; }
.suggest-tos { color: var(--muted); font-size: 0.72rem; }
.suggest-disclaimer { color: var(--muted); font-size: 0.72rem; white-space: nowrap; }
.delete-suggest-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 0 0.3rem; transition: color 0.2s; }
.delete-suggest-btn:hover { color: #e53935; }
.suggest-author { color: var(--muted); font-size: 0.75rem; }
.suggest-toggle { display: block; width: 100%; margin-top: 0.6rem; padding: 0.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.6rem; color: var(--gold); cursor: pointer; font-size: 0.82rem; font-family: inherit; transition: background 0.2s; }
.suggest-toggle:hover { background: var(--gold-dim); }
.suggest-last-visible { border-bottom: none; }

/* ---- Language Dropdown ---- */
.lang-dropdown { position: relative; }
.lang-trigger { background: none; border: 1px solid var(--border); border-radius: 0.5rem; cursor: pointer; font-size: 1rem; padding: 0.3rem 0.5rem; color: var(--text); font-family: inherit; }
.lang-trigger:hover { border-color: var(--gold); }
.lang-menu {
  position: absolute; right: 0; top: 2.2rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 0.8rem; padding: 0.4rem;
  min-width: 100px; z-index: 200; box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.lang-menu button {
  display: block; width: 100%; padding: 0.4rem 0.8rem; border: none;
  border-radius: 0.4rem; background: none; color: var(--text); cursor: pointer;
  text-align: left; font-size: 0.85rem; font-family: inherit;
}
.lang-menu button:hover { background: rgba(255,255,255,0.05); }
.lang-menu button.active { color: var(--gold); font-weight: 600; }

.hamburger { display: none; }
.mobile-overlay, .mobile-drawer { display: none; }

/* ---- Footer ---- */
footer { text-align: center; padding: 2rem; color: var(--muted); font-size: 0.75rem; opacity: 0.7; }
footer a { color: var(--gold); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ---- Random Mode Result ---- */
#random-result {
  background: linear-gradient(135deg, rgba(139,111,199,0.15), rgba(212,168,67,0.1));
  border: 1px solid var(--purple); border-radius: 1.5rem;
  margin-bottom: 1.5rem; padding: 1.5rem; display: none;
}

/* ---- Loading ---- */
#loading { display: none; text-align: center; padding: 4rem; color: var(--muted); }
.spinner { display: inline-block; width: 2rem; height: 2rem; border: 2px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Karma Panel (overlay + modal) ---- */
.karma-panel-overlay {
  position: fixed; inset: 0;
  background: rgba(8,8,20,0.85);
  z-index: 200;
}
.karma-panel {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  z-index: 201;
  width: 360px;
  max-width: 92vw;
  text-align: center;
}
.karma-panel h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--gold);
}
.karma-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  line-height: 1.5;
}
.karma-coins-hint {
  font-size: 0.72rem;
  color: var(--purple);
  margin-bottom: 1rem;
}
.karma-close {
  position: absolute;
  top: 0.5rem; right: 0.75rem;
  background: none; border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}
.karma-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.karma-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  color: var(--text);
}
.karma-option:hover {
  border-color: var(--gold);
  background: rgba(212,168,67,0.08);
}
.karma-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
}
.karma-label {
  font-size: 0.85rem;
  color: var(--muted);
}
.karma-disclaimer {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 1rem;
  line-height: 1.4;
}
.karma-network-btn {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.9rem 1rem; width: 100%;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 0.75rem; cursor: pointer; transition: all 0.2s;
  font-family: inherit; color: var(--text); text-align: left;
}
.karma-network-btn:hover { border-color: var(--gold); background: rgba(212,168,67,0.08); }
.karma-net-solana:hover { border-color: #9945FF; background: rgba(153,69,255,0.08); }
.karma-net-base:hover { border-color: #0052FF; background: rgba(0,82,255,0.08); }
.karma-net-tron:hover { border-color: #EB0029; background: rgba(235,0,41,0.06); }
.karma-net-icon { font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.karma-net-icon svg { width: 1.4rem; height: 1.4rem; display: block; }
.karma-net-name { font-size: 0.95rem; font-weight: 600; display: block; }
.karma-net-desc { font-size: 0.75rem; color: var(--muted); display: block; }
#karma-qr { display: flex; justify-content: center; margin-bottom: 0.8rem; }
#karma-qr svg { width: 180px; height: 180px; border-radius: 0.6rem; }
.karma-amount-hint {
  font-size: 1.1rem; font-weight: 700; color: var(--gold);
  margin-bottom: 0.6rem;
}
.karma-addr-box {
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(0,0,0,0.3); border: 1px solid var(--border);
  border-radius: 0.6rem; padding: 0.5rem 0.7rem; margin-bottom: 0.6rem;
}
.karma-addr-text {
  flex: 1; font-size: 0.7rem; font-family: monospace;
  color: var(--text); word-break: break-all; line-height: 1.4;
}
.karma-addr-copy {
  background: none; border: 1px solid var(--gold); border-radius: 0.5rem;
  color: var(--gold); font-size: 0.75rem; padding: 0.3rem 0.6rem;
  cursor: pointer; white-space: nowrap; font-family: inherit; transition: all 0.2s;
}
.karma-addr-copy:hover { background: var(--gold); color: var(--bg); }
.karma-network-warn {
  font-size: 0.75rem; color: #f59e0b; font-weight: 600;
  margin-bottom: 0.8rem; line-height: 1.4;
}
.karma-sent-btn {
  display: block; width: 100%; padding: 0.85rem 1rem;
  background: linear-gradient(135deg, var(--purple), var(--gold));
  border: none; border-radius: 0.75rem; color: #fff;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: all 0.2s; margin-bottom: 0.5rem;
}
.karma-sent-btn:hover { opacity: 0.9; transform: scale(1.02); }
.karma-back {
  display: block; margin: 0 auto; background: none; border: none;
  color: var(--muted); font-size: 0.8rem; cursor: pointer;
  font-family: inherit; padding: 0.3rem 0.5rem;
}
.karma-back:hover { color: var(--text); }
