@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Raleway:wght@300;400;500&display=swap');

:root {
  --bg:        #050510;
  --bg2:       #0a0a1f;
  --bg3:       #0f0f2e;
  --card:      rgba(255,255,255,0.04);
  --border:    rgba(255,255,255,0.08);
  --purple:    #7c3aed;
  --purple2:   #a855f7;
  --gold:      #f59e0b;
  --gold2:     #fcd34d;
  --text:      #e8e4ff;
  --muted:     rgba(232,228,255,0.45);
  --radius:    16px;
  --glow:      0 0 40px rgba(124,58,237,0.3);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Raleway', sans-serif;
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Stars background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 40%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 10%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 60%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 25%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 75%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 45%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 80%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 90%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(2px 2px at 35% 55%, rgba(168,85,247,0.4) 0%, transparent 100%),
    radial-gradient(2px 2px at 75% 15%, rgba(168,85,247,0.3) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Nebula glow */
body::after {
  content: '';
  position: fixed;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, transparent 70%);
  top: -200px; right: -200px;
  pointer-events: none;
  z-index: 0;
  animation: nebula 8s ease-in-out infinite alternate;
}

@keyframes nebula {
  from { transform: scale(1) translate(0,0); opacity: 0.6; }
  to   { transform: scale(1.2) translate(-30px,30px); opacity: 1; }
}

/* ── Layout ─────────────────────────────────── */
.app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ── Screen system ──────────────────────────── */
.screen { display: none; flex-direction: column; min-height: 100vh; padding: 24px 20px; max-width: 440px; margin: 0 auto; width: 100%; }
.screen.active { display: flex; }

/* ── Header ─────────────────────────────────── */
.logo { text-align: center; margin-bottom: 40px; }
.logo-icon { font-size: 3.5rem; display: block; margin-bottom: 8px; filter: drop-shadow(0 0 20px rgba(168,85,247,0.8)); animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.logo-title { font-family: 'Cinzel', serif; font-size: 1.6rem; font-weight: 700; background: linear-gradient(135deg, var(--gold), var(--purple2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: 2px; }
.logo-sub { font-size: 0.8rem; color: var(--muted); letter-spacing: 3px; text-transform: uppercase; margin-top: 4px; }

/* ── Cards ──────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── Buttons ─────────────────────────────────── */
.btn {
  width: 100%; padding: 15px 24px;
  border-radius: 12px; border: none;
  font-family: 'Raleway', sans-serif;
  font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  letter-spacing: 0.5px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--purple2));
  color: white;
  box-shadow: 0 4px 24px rgba(124,58,237,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(124,58,237,0.6); }
.btn-primary:active { transform: translateY(0); }
.btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
  box-shadow: none;
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-secondary:hover { border-color: var(--purple); color: var(--text); }
.btn-gold {
  background: linear-gradient(135deg, #92400e, var(--gold));
  color: white;
  box-shadow: 0 4px 24px rgba(245,158,11,0.3);
}

/* ── Inputs ──────────────────────────────────── */
.input-group { margin-bottom: 16px; }
.input-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; display: block; }
.input {
  width: 100%; padding: 13px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Raleway', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s;
}
.input:focus { outline: none; border-color: var(--purple); background: rgba(124,58,237,0.08); }
.input::placeholder { color: var(--muted); }

/* ── Zodiac grid ─────────────────────────────── */
.zodiac-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.zodiac-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  color: var(--text);
  font-family: 'Raleway', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.zodiac-btn .zicon { font-size: 1.5rem; display: block; margin-bottom: 4px; }
.zodiac-btn:hover { border-color: var(--purple); background: rgba(124,58,237,0.1); }
.zodiac-btn.selected { border-color: var(--purple2); background: rgba(124,58,237,0.2); box-shadow: 0 0 16px rgba(168,85,247,0.3); }

/* ── Spheres ──────────────────────────────────── */
.spheres-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 16px 0; }
.sphere-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--muted);
  font-family: 'Raleway', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.sphere-btn:hover { border-color: var(--purple); color: var(--text); }
.sphere-btn.selected { border-color: var(--gold); color: var(--gold2); background: rgba(245,158,11,0.08); }

/* ── Time picker ─────────────────────────────── */
.time-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.time-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 4px;
  color: var(--muted);
  font-family: 'Raleway', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.time-btn:hover { border-color: var(--purple); color: var(--text); }
.time-btn.selected { border-color: var(--purple2); color: var(--purple2); background: rgba(168,85,247,0.1); }

/* ── Step indicator ──────────────────────────── */
.steps { display: flex; gap: 8px; justify-content: center; margin-bottom: 28px; }
.step { width: 32px; height: 4px; border-radius: 2px; background: var(--border); transition: all 0.3s; }
.step.active { background: var(--purple2); box-shadow: 0 0 8px rgba(168,85,247,0.6); }
.step.done { background: var(--gold); }

/* ── Horoscope card ──────────────────────────── */
.horoscope-card {
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(168,85,247,0.05));
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 20px;
  padding: 28px;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
}
.horoscope-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: conic-gradient(from 0deg, transparent 0%, rgba(124,58,237,0.05) 50%, transparent 100%);
  animation: rotate 20s linear infinite;
}
@keyframes rotate { to { transform: rotate(360deg); } }
.horoscope-date { font-size: 0.75rem; color: var(--gold); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 16px; }
.horoscope-text { font-size: 1rem; line-height: 1.8; color: var(--text); position: relative; z-index: 1; }
.horoscope-text p { margin: 0 0 14px; }
.horoscope-text p:last-child { margin-bottom: 0; }
.horoscope-sign { font-family: 'Cinzel', serif; font-size: 1.1rem; color: var(--purple2); margin-bottom: 8px; position: relative; z-index: 1; }

.astro-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(252,211,77,0.12);
  border-radius: 16px;
  padding: 16px;
  margin: 14px 0 8px;
}
.astro-kicker {
  font-size: 0.75rem;
  color: var(--gold2);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}
.astro-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.astro-card {
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(168,85,247,0.18);
  border-radius: 12px;
  padding: 12px;
}
.astro-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.astro-value {
  font-family: 'Raleway', sans-serif;
  color: var(--text);
  font-size: 0.96rem;
  margin-top: 4px;
  line-height: 1.5;
  font-weight: 600;
}
.astro-sub {
  font-size: 0.82rem;
  color: var(--purple2);
  margin-top: 4px;
  line-height: 1.4;
}
.astro-block {
  margin-top: 10px;
}
.astro-line {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
  margin-top: 6px;
}
.astro-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.astro-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.18);
  color: var(--gold2);
  font-size: 0.78rem;
  line-height: 1.35;
}

/* ── Nav bar ──────────────────────────────────── */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(5,5,16,0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 12px 0 max(12px, env(safe-area-inset-bottom));
  z-index: 100;
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 20px; cursor: pointer; color: var(--muted); transition: color 0.2s; border: none; background: none; font-family: 'Raleway', sans-serif; }
.nav-item.active { color: var(--purple2); }
.nav-item .nav-icon { font-size: 1.4rem; }
.nav-item .nav-label { font-size: 0.7rem; letter-spacing: 0.5px; }

/* ── Profile ──────────────────────────────────── */
.profile-header { text-align: center; padding: 20px 0 32px; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, var(--purple), var(--purple2)); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; margin: 0 auto 16px; box-shadow: var(--glow); }
.profile-name { font-family: 'Cinzel', serif; font-size: 1.3rem; color: var(--text); }
.profile-sign { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

.stat-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 20px 0; }
.stat-box { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; }
.stat-num { font-family: 'Cinzel', serif; font-size: 1.4rem; color: var(--purple2); }
.stat-lbl { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }

/* ── Loader ───────────────────────────────────── */
.loader { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 40px 0; }
.spinner { width: 48px; height: 48px; border: 3px solid var(--border); border-top-color: var(--purple2); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ────────────────────────────────────── */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 20px;
  font-size: 0.9rem; white-space: nowrap;
  opacity: 0; transition: all 0.3s; z-index: 200; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Utilities ────────────────────────────────── */
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.mb16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); font-size: 0.85rem; }
.section-title { font-family: 'Cinzel', serif; font-size: 1rem; color: var(--gold); letter-spacing: 1px; margin-bottom: 12px; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.main-content { flex: 1; padding-bottom: 80px; }

/* ── Install banner ───────────────────────────── */
.install-banner {
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(252,211,77,0.05));
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 12px; padding: 16px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; cursor: pointer;
}
.install-banner .install-icon { font-size: 1.8rem; flex-shrink: 0; }
.install-banner .install-text { flex: 1; font-size: 0.85rem; color: var(--text); }
.install-banner .install-text strong { color: var(--gold); }
.install-banner .install-arrow { color: var(--gold); font-size: 1.2rem; }

.hint-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 16px;
  margin-top: 18px;
}

.hint-title {
  font-size: 0.88rem;
  color: var(--gold2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.hint-steps {
  display: grid;
  gap: 10px;
}

.hint-step {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
}

.hint-step strong {
  color: var(--purple2);
  margin-right: 6px;
}

.hint-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

@media (min-width: 440px) {
  .screen { padding: 32px 24px; }
}
