/* ═══════════════════════════════════════════════════════════
   🔮 TAROTAI v4.0 - Ultra Premium Style System
   ═══════════════════════════════════════════════════════════
   Mobile-First • Dark Mystic Theme • Premium Animations
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ──────────────────────────────────────── */
:root {
  --primary: #8b5cf6;
  --primary-light: #a78bfa;
  --primary-dark: #6d28d9;
  --primary-glow: rgba(139, 92, 246, 0.4);
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --accent-dark: #d97706;
  --success: #10b981;
  --success-light: #34d399;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-light: #f87171;
  --info: #3b82f6;
  --info-light: #60a5fa;
  --bg-primary: #0a0a1a;
  --bg-secondary: #111128;
  --bg-card: #161636;
  --bg-card-hover: #1c1c4a;
  --bg-elevated: #1e1e4a;
  --bg-glass: rgba(22, 22, 54, 0.85);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #c4b5fd;
  --text-gold: #fbbf24;
  --border: rgba(139, 92, 246, 0.12);
  --border-light: rgba(139, 92, 246, 0.06);
  --border-gold: rgba(245, 158, 11, 0.3);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-mystic: linear-gradient(135deg, #1a0533 0%, #0f0c29 50%, #1a0533 100%);
  --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-card: linear-gradient(145deg, rgba(30, 30, 74, 0.7), rgba(22, 22, 54, 0.95));
  --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px var(--primary-glow);
  --shadow-gold: 0 0 20px rgba(245, 158, 11, 0.3);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-height: 56px;
  --bottom-nav-height: 72px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(139,92,246,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(59,130,246,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(245,158,11,0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; outline: none; background: none; font-family: inherit; }
input, textarea { font-family: inherit; }
img { max-width: 100%; height: auto; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 4px; }

/* ═══════════════════════════════════════════════════════════
   SPLASH SCREEN
   ═══════════════════════════════════════════════════════════ */
.splash-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s, visibility 0.6s;
}
.splash-screen.hidden { opacity: 0; visibility: hidden; }
.splash-bg-stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.4), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 80% 50%, rgba(255,255,255,0.2), transparent),
    radial-gradient(2px 2px at 10% 80%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 90% 10%, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 50% 50%, rgba(139,92,246,0.3), transparent);
  animation: sparkle 4s linear infinite;
}
@keyframes sparkle { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }
.splash-content { text-align: center; z-index: 1; }
.splash-orb { position: relative; width: 120px; height: 120px; margin: 0 auto 24px; }
.splash-orb-inner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
  animation: float 3s ease-in-out infinite;
}
.splash-orb-ring {
  position: absolute; inset: -10px;
  border: 2px solid rgba(139,92,246,0.2);
  border-radius: 50%;
}
.splash-orb-ring.r1 { animation: ringPulse 2s ease-in-out infinite; }
.splash-orb-ring.r2 { inset: -20px; animation: ringPulse 2s ease-in-out infinite 0.5s; border-color: rgba(245,158,11,0.15); }
.splash-orb-ring.r3 { inset: -30px; animation: ringPulse 2s ease-in-out infinite 1s; border-color: rgba(59,130,246,0.1); }
@keyframes ringPulse { 0%,100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.1); opacity: 1; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.splash-title { font-family: 'Cinzel Decorative', serif; font-size: 36px; font-weight: 700; color: var(--text-primary); letter-spacing: 4px; }
.splash-tagline { font-family: 'Cinzel', serif; font-size: 12px; color: var(--text-gold); letter-spacing: 6px; margin-top: 8px; text-transform: uppercase; }
.splash-loader { width: 160px; height: 3px; background: rgba(255,255,255,0.1); border-radius: 4px; margin: 32px auto 0; overflow: hidden; }
.splash-loader-fill { height: 100%; width: 0%; background: var(--gradient-gold); border-radius: 4px; animation: loadFill 2.2s ease-in-out forwards; }
@keyframes loadFill { to { width: 100%; } }

/* ═══════════════════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════════════════ */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; position: relative; z-index: 1; }

/* HEADER */
.hdr {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-height); padding: 0 12px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 10;
  padding-top: var(--safe-top);
}
.hdr-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 18px; border-radius: var(--radius-md); transition: var(--transition-fast); }
.hdr-btn:active { background: rgba(255,255,255,0.05); color: var(--primary-light); }
.hdr-brand { display: flex; align-items: center; gap: 8px; }
.hdr-logo { font-size: 24px; }
.hdr-brand h1 { font-family: 'Cinzel Decorative', serif; font-size: 18px; font-weight: 700; background: linear-gradient(135deg, var(--primary-light), var(--text-gold)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* MAIN */
.main { flex: 1; overflow: hidden; position: relative; }
.scr { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0.35s; }
.scr.active { opacity: 1; visibility: visible; }
.scr-scroll { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px calc(16px + var(--safe-bottom)); scroll-behavior: smooth; }

/* BOTTOM NAV */
.bnav {
  display: flex; align-items: center; justify-content: space-around;
  height: var(--bottom-nav-height);
  padding-bottom: var(--safe-bottom);
  background: var(--bg-glass);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  position: relative; z-index: 10;
}
.bnav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 16px; color: var(--text-muted); font-size: 10px; font-weight: 500;
  transition: var(--transition-fast);
}
.bnav-btn i { font-size: 18px; }
.bnav-btn.active { color: var(--primary-light); }
.bnav-btn.active i { text-shadow: 0 0 12px var(--primary-glow); }
.bnav-main {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 20px;
  box-shadow: 0 4px 20px rgba(102,126,234,0.4);
  margin-top: -20px;
  transition: var(--transition-normal);
}
.bnav-btn:active .bnav-main { transform: scale(0.92); }

/* ═══════════════════════════════════════════════════════════
   HOME SCREEN
   ═══════════════════════════════════════════════════════════ */
.hero { text-align: center; padding: 32px 0 24px; position: relative; }
.hero-glow {
  position: absolute; top: -40px; left: 50%; transform: translateX(-50%);
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(139,92,246,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-orb-wrap { position: relative; width: 100px; height: 100px; margin: 0 auto 20px; }
.hero-orb { font-size: 56px; line-height: 100px; text-align: center; }
.floating { animation: float 3s ease-in-out infinite; }
.hero-sp { position: absolute; font-size: 12px; color: var(--text-gold); animation: sparkleFloat 3s ease-in-out infinite; }
.sp1 { top: 10px; left: 0; animation-delay: 0s; }
.sp2 { top: -5px; right: 0; animation-delay: 0.5s; }
.sp3 { bottom: 10px; left: -10px; animation-delay: 1s; }
.sp4 { bottom: 0; right: -10px; animation-delay: 1.5s; }
@keyframes sparkleFloat {
  0%,100% { transform: translateY(0) scale(1); opacity: 0.5; }
  50% { transform: translateY(-8px) scale(1.3); opacity: 1; }
}
.hero-h { font-family: 'Cinzel', serif; font-size: 26px; font-weight: 800; line-height: 1.3; margin-bottom: 12px; background: linear-gradient(135deg, var(--text-primary), var(--primary-light)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-p { font-size: 14px; color: var(--text-secondary); max-width: 340px; margin: 0 auto 20px; line-height: 1.6; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: var(--radius-full);
  font-size: 15px; font-weight: 600;
  transition: var(--transition-normal);
}
.btn-accent {
  background: var(--gradient-gold);
  color: #1a1a2e;
  box-shadow: var(--shadow-gold);
}
.btn-accent:active { transform: scale(0.96); }
.btn-glow { animation: buttonGlow 3s ease-in-out infinite; }
@keyframes buttonGlow {
  0%,100% { box-shadow: 0 0 15px rgba(245,158,11,0.3); }
  50% { box-shadow: 0 0 30px rgba(245,158,11,0.5), 0 0 60px rgba(245,158,11,0.2); }
}
.btn-xl { padding: 16px 36px; font-size: 16px; width: 100%; justify-content: center; }

/* Sections */
.sec { margin: 24px 0; }
.sec-h { font-family: 'Cinzel', serif; font-size: 18px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.sec-h i { color: var(--accent); }

/* Daily Card */
.daily-wrap {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

/* Features Grid */
.feat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
.feat {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px; text-align: center;
  transition: var(--transition-normal);
}
.feat:active { transform: scale(0.97); border-color: var(--primary); }
.feat span { font-size: 28px; display: block; margin-bottom: 8px; }
.feat h4 { font-family: 'Cinzel', serif; font-size: 13px; font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
.feat p { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }

/* Spread Info */
.spread-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spread-info-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px; text-align: center;
  transition: var(--transition-normal);
}
.spread-info-card.highlight { grid-column: 1 / -1; border-color: var(--border-gold); background: linear-gradient(145deg, rgba(245,158,11,0.08), rgba(22,22,54,0.9)); }
.si-icon { font-size: 28px; margin-bottom: 6px; }
.spread-info-card h4 { font-family: 'Cinzel', serif; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.spread-info-card p { font-size: 11px; color: var(--text-secondary); line-height: 1.3; }

/* Timeline */
.timeline { padding-left: 20px; border-left: 2px solid var(--border); }
.tl-item { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; position: relative; }
.tl-item::before { content: ''; position: absolute; left: -27px; top: 20px; width: 12px; height: 12px; background: var(--primary); border-radius: 50%; box-shadow: 0 0 10px var(--primary-glow); }
.tl-n { width: 32px; height: 32px; background: var(--gradient-primary); color: white; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; border-radius: 50%; flex-shrink: 0; }
.tl-item h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.tl-item p { font-size: 12px; color: var(--text-secondary); }

/* Testimonials */
.testi-scroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding: 4px 0; }
.testi-scroll::-webkit-scrollbar { display: none; }
.testi {
  min-width: 280px; max-width: 300px;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  scroll-snap-align: start;
}
.testi-stars { color: var(--accent); font-size: 14px; margin-bottom: 8px; letter-spacing: 2px; }
.testi p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; font-style: italic; margin-bottom: 10px; }
.testi span { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* Disclaimer */
.disc {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(59,130,246,0.06);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: var(--radius-md);
  padding: 14px; margin: 24px 0;
}
.disc i { color: var(--info); margin-top: 2px; flex-shrink: 0; }
.disc p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.disc b { color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════
   UPLOAD / READING SETUP SCREEN
   ═══════════════════════════════════════════════════════════ */
.up-hdr { text-align: center; padding: 16px 0 8px; }
.up-hdr h2 { font-family: 'Cinzel Decorative', serif; font-size: 22px; font-weight: 700; }
.up-hdr p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.up-sec { margin: 20px 0; position: relative; }
.up-step-badge {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-full);
  background: var(--gradient-primary); color: white;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 8px;
}
.up-sec-h { font-family: 'Cinzel', serif; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.up-sec-h i { color: var(--primary-light); }
.up-sec-h small { font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 400; color: var(--text-muted); }

/* Spread Selector */
.spread-sel { display: flex; flex-direction: column; gap: 8px; }
.spread-opt {
  display: flex; align-items: center; gap: 12px;
  background: var(--gradient-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: var(--transition-normal);
  cursor: pointer;
}
.spread-opt:active { transform: scale(0.98); }
.spread-opt.selected { border-color: var(--primary); background: linear-gradient(145deg, rgba(139,92,246,0.1), rgba(22,22,54,0.9)); box-shadow: 0 0 15px rgba(139,92,246,0.15); }
.so-icon { font-size: 24px; flex-shrink: 0; }
.so-info { flex: 1; min-width: 0; }
.so-name { font-size: 14px; font-weight: 600; }
.so-desc { font-size: 11px; color: var(--text-secondary); }
.so-count {
  padding: 4px 10px; border-radius: var(--radius-full);
  background: rgba(139,92,246,0.1); border: 1px solid rgba(139,92,246,0.2);
  font-size: 11px; font-weight: 600; color: var(--primary-light);
  white-space: nowrap; flex-shrink: 0;
}

/* Reading Type */
.rtype-sel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rtype-opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: var(--radius-md);
  background: var(--gradient-card);
  border: 1.5px solid var(--border);
  cursor: pointer; transition: var(--transition-normal);
}
.rtype-opt:active { transform: scale(0.95); }
.rtype-opt.selected { border-color: var(--primary); background: linear-gradient(145deg, rgba(139,92,246,0.12), rgba(22,22,54,0.9)); }
.rtype-opt span { font-size: 22px; }
.rtype-opt small { font-size: 11px; font-weight: 500; color: var(--text-secondary); }
.rtype-opt.selected small { color: var(--primary-light); }

/* Question Input */
.q-wrap { position: relative; }
.q-input {
  width: 100%; min-height: 80px; padding: 12px; padding-bottom: 28px;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-size: 14px; line-height: 1.5; resize: none;
  transition: var(--transition-fast);
}
.q-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,92,246,0.1); outline: none; }
.q-input::placeholder { color: var(--text-muted); }
.q-cnt { position: absolute; right: 12px; bottom: 8px; font-size: 11px; color: var(--text-muted); }

/* Photo Progress */
.up-prog { margin-bottom: 12px; }
.up-prog-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 13px; font-weight: 500; }
.up-badge {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 10px; border-radius: var(--radius-full);
  background: rgba(139,92,246,0.12); color: var(--primary-light);
  font-size: 13px; font-weight: 700;
}
.up-prog-bar { height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.up-prog-fill { height: 100%; width: 0%; background: var(--gradient-primary); border-radius: 3px; transition: width 0.4s ease; }

/* Upload Zone */
.upload-zone {
  border: 2px dashed rgba(139,92,246,0.3);
  border-radius: var(--radius-lg);
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
  background: linear-gradient(145deg, rgba(139,92,246,0.03), rgba(22,22,54,0.5));
  position: relative;
  overflow: hidden;
}
.upload-zone::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(139,92,246,0.05), transparent 70%);
  opacity: 0; transition: opacity 0.3s;
}
.upload-zone:active::before, .upload-zone.dragover::before { opacity: 1; }
.upload-zone.dragover { border-color: var(--primary); background: rgba(139,92,246,0.06); }
.uz-icon { font-size: 40px; color: var(--primary-light); margin-bottom: 12px; opacity: 0.8; }
.uz-p1 { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.uz-p2 { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.uz-p3 { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

/* Camera & Gallery Buttons */
.up-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.btn-act {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px;
  background: var(--gradient-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary); font-size: 14px; font-weight: 500;
  transition: var(--transition-normal);
}
.btn-act i { font-size: 18px; color: var(--primary-light); }
.btn-act:active { transform: scale(0.96); border-color: var(--primary); }

/* Preview Area */
.preview-area { margin: 16px 0; }
.prev-h { font-family: 'Cinzel', serif; font-size: 14px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.prev-h i { color: var(--primary-light); }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.preview-item {
  position: relative; aspect-ratio: 2/3; border-radius: var(--radius-md);
  overflow: hidden; border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-item .pi-pos {
  position: absolute; top: 4px; left: 4px;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  padding: 2px 7px; border-radius: var(--radius-sm);
  font-size: 10px; font-weight: 700; color: var(--text-gold);
}
.preview-item .pi-del {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px;
  background: rgba(239,68,68,0.85); backdrop-filter: blur(4px);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: white; font-size: 11px;
  transition: var(--transition-fast);
}
.preview-item .pi-del:active { transform: scale(0.85); }
.preview-item .pi-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 16px 6px 6px; font-size: 9px; color: var(--text-secondary);
  text-align: center; line-height: 1.2;
}

.btn-add {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 12px;
  background: rgba(139,92,246,0.06);
  border: 1.5px dashed rgba(139,92,246,0.25);
  border-radius: var(--radius-md);
  color: var(--primary-light); font-size: 13px; font-weight: 600;
  margin-top: 10px;
  transition: var(--transition-normal);
}
.btn-add:active { background: rgba(139,92,246,0.12); }

/* Tips */
.tips {
  background: linear-gradient(145deg, rgba(245,158,11,0.04), rgba(22,22,54,0.5));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 16px 0;
}
.tips h4 { font-size: 13px; font-weight: 700; color: var(--text-gold); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.tips ul { list-style: none; }
.tips li { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--text-secondary); padding: 4px 0; }
.tips li i { color: var(--success); font-size: 10px; margin-top: 4px; flex-shrink: 0; }

/* Analyze Button Wrap */
.analyze-wrap { padding: 8px 0 20px; }

/* ═══════════════════════════════════════════════════════════
   PROCESSING SCREEN
   ═══════════════════════════════════════════════════════════ */
.proc-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 32px 24px; text-align: center; }
.proc-vis { position: relative; width: 140px; height: 140px; margin-bottom: 28px; }
.proc-orb { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 56px; animation: float 2s ease-in-out infinite; }
.proc-rings { position: absolute; inset: -20px; }
.pr { position: absolute; inset: 0; border: 2px solid rgba(139,92,246,0.2); border-radius: 50%; }
.pr.r1 { animation: orbSpin 4s linear infinite; border-color: rgba(139,92,246,0.3); }
.pr.r2 { inset: -10px; animation: orbSpin 6s linear infinite reverse; border-color: rgba(245,158,11,0.2); }
.pr.r3 { inset: -20px; animation: orbSpin 8s linear infinite; border-color: rgba(59,130,246,0.15); }
@keyframes orbSpin { to { transform: rotate(360deg); } }
.proc-floats { position: absolute; inset: -40px; }
.pf { position: absolute; font-size: 18px; animation: procFloat 5s ease-in-out infinite; }
.pf1 { top: 0; left: 20%; animation-delay: 0s; }
.pf2 { top: 10%; right: 10%; animation-delay: 0.5s; }
.pf3 { top: 50%; right: 0; animation-delay: 1s; }
.pf4 { bottom: 10%; right: 20%; animation-delay: 1.5s; }
.pf5 { bottom: 0; left: 10%; animation-delay: 2s; }
.pf6 { top: 40%; left: 0; animation-delay: 2.5s; }
@keyframes procFloat {
  0%,100% { transform: translateY(0) scale(1); opacity: 0.6; }
  50% { transform: translateY(-15px) scale(1.2); opacity: 1; }
}
.proc-title { font-family: 'Cinzel', serif; font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.proc-status { font-size: 13px; color: var(--text-secondary); margin-bottom: 24px; min-height: 20px; }
.proc-bar-wrap { width: 100%; max-width: 280px; }
.proc-bar { height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.proc-fill { height: 100%; width: 0%; background: var(--gradient-primary); border-radius: 3px; transition: width 0.5s ease; }
.proc-pct { font-size: 13px; font-weight: 600; color: var(--primary-light); }
.proc-steps { margin-top: 24px; text-align: left; width: 100%; max-width: 280px; }
.ps {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; font-size: 12px; color: var(--text-muted);
  transition: var(--transition-normal);
}
.ps i { width: 18px; text-align: center; font-size: 12px; }
.ps.active { color: var(--primary-light); }
.ps.done { color: var(--success); }
.ps.done i { color: var(--success); }

/* ═══════════════════════════════════════════════════════════
   RESULTS SCREEN
   ═══════════════════════════════════════════════════════════ */
.res-header {
  text-align: center; padding: 20px 0;
  border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.res-header-icon { font-size: 48px; margin-bottom: 8px; }
.res-header h2 { font-family: 'Cinzel Decorative', serif; font-size: 22px; font-weight: 700; }
.res-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.res-spread-info { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--text-secondary); }
.res-question { font-size: 13px; color: var(--text-muted); font-style: italic; margin-top: 10px; }

/* Energy */
.energy-overview {
  background: var(--gradient-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; margin-bottom: 16px;
}
.energy-overview h3 { font-family: 'Cinzel', serif; font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.energy-bar-container { margin-bottom: 10px; }
.energy-bar-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.energy-bar { height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.energy-bar-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }
.energy-bar-fill.positive { background: linear-gradient(90deg, #10b981, #34d399); }
.energy-bar-fill.neutral { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.energy-bar-fill.challenging { background: linear-gradient(90deg, #ef4444, #f87171); }
.energy-flow { font-size: 13px; color: var(--text-secondary); margin-top: 12px; line-height: 1.5; padding-top: 12px; border-top: 1px solid var(--border); }
.dominant-element { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); margin-top: 10px; padding: 10px; background: rgba(139,92,246,0.06); border-radius: var(--radius-sm); }

/* Summary */
.res-summary {
  background: var(--gradient-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; margin-bottom: 16px;
}
.res-summary h3 { font-family: 'Cinzel', serif; font-size: 15px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.res-summary p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* Card Results */
.card-result {
  background: var(--gradient-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-bottom: 10px;
  overflow: hidden; transition: var(--transition-normal);
}
.card-result-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px; cursor: pointer;
}
.card-result-icon {
  width: 44px; height: 44px; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(139,92,246,0.1); border-radius: var(--radius-md);
  flex-shrink: 0;
}
.card-result-icon.reversed { transform: rotate(180deg); }
.card-result-info { flex: 1; min-width: 0; }
.card-result-position { font-size: 10px; color: var(--text-accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.card-result-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-result-reversed-badge { font-size: 10px; color: var(--danger-light); background: rgba(239,68,68,0.1); padding: 1px 6px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; gap: 3px; }
.card-result-energy { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: var(--radius-full); white-space: nowrap; }
.card-result-energy.positive { color: var(--success-light); background: rgba(16,185,129,0.1); }
.card-result-energy.neutral { color: var(--info-light); background: rgba(59,130,246,0.1); }
.card-result-energy.challenging { color: var(--danger-light); background: rgba(239,68,68,0.1); }
.card-result-toggle { color: var(--text-muted); font-size: 12px; transition: var(--transition-normal); flex-shrink: 0; }
.card-result.expanded .card-result-toggle { transform: rotate(180deg); }

.card-result-body { max-height: 0; overflow: hidden; transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.card-result.expanded .card-result-body { max-height: 800px; }
.card-result-body-inner { padding: 0 14px 14px; }

/* Photo in result */
.card-result-photo {
  width: 100%; max-height: 200px; object-fit: contain;
  border-radius: var(--radius-sm); margin-bottom: 10px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.3);
}

.card-result-meaning {
  font-size: 13px; color: var(--text-secondary); line-height: 1.6;
  padding: 10px 12px; margin-bottom: 8px;
  background: rgba(139,92,246,0.04);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.card-result-keywords { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.card-result-keywords span {
  padding: 3px 8px; border-radius: var(--radius-full);
  background: rgba(139,92,246,0.08); border: 1px solid rgba(139,92,246,0.15);
  font-size: 11px; color: var(--text-accent);
}
.card-result-advice { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-top: 8px; padding: 10px; background: rgba(245,158,11,0.04); border-radius: var(--radius-sm); border-left: 3px solid var(--accent); }
.card-result-warnings { margin-top: 8px; }
.card-result-warning-item { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--danger-light); padding: 6px 0; }
.card-result-warning-item i { margin-top: 2px; }

/* Connections */
.connections-section {
  background: var(--gradient-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; margin: 16px 0;
}
.connections-section h3 { font-family: 'Cinzel', serif; font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.connection-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.connection-item:last-child { border-bottom: none; }
.connection-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.connection-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.connection-strength { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Recommendations & Affirmations */
.recommendations-section, .affirmations-section {
  background: var(--gradient-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; margin: 16px 0;
}
.recommendations-section h3, .affirmations-section h3 { font-family: 'Cinzel', serif; font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.rec-item { font-size: 13px; color: var(--text-secondary); padding: 8px 0; border-bottom: 1px solid var(--border-light); line-height: 1.5; }
.rec-item:last-child { border-bottom: none; }
.affirmation-item { font-size: 14px; color: var(--text-accent); padding: 10px 0; font-style: italic; border-bottom: 1px solid var(--border-light); text-align: center; }
.affirmation-item:last-child { border-bottom: none; }

/* Special Combo */
.special-combo {
  background: linear-gradient(145deg, rgba(245,158,11,0.08), rgba(22,22,54,0.9));
  border: 1px solid var(--border-gold); border-radius: var(--radius-lg);
  padding: 18px; margin: 16px 0; text-align: center;
}
.special-combo h3 { font-family: 'Cinzel', serif; font-size: 15px; margin-bottom: 8px; color: var(--text-gold); }
.special-combo p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* Results Actions */
.res-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border-radius: var(--radius-md);
  background: var(--gradient-primary); color: white;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 15px rgba(102,126,234,0.3);
  transition: var(--transition-normal);
}
.btn-primary:active { transform: scale(0.96); }
.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border-radius: var(--radius-md);
  background: var(--gradient-card); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 14px; font-weight: 600;
  transition: var(--transition-normal);
}
.btn-secondary:active { transform: scale(0.96); }
.btn-sm { padding: 10px 20px; font-size: 13px; }

/* Yes/No */
.yesno-answer {
  text-align: center; padding: 20px;
  background: var(--gradient-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-bottom: 16px;
}
.yesno-icon { font-size: 48px; margin-bottom: 8px; }
.yesno-text { font-family: 'Cinzel', serif; font-size: 28px; font-weight: 900; margin-bottom: 4px; }
.yesno-confidence { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.yesno-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* Disclaimer Card */
.disclaimer-card {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(59,130,246,0.04); border: 1px solid rgba(59,130,246,0.12);
  border-radius: var(--radius-md); padding: 14px; margin: 20px 0;
}
.disclaimer-card .disclaimer-icon { color: var(--info); flex-shrink: 0; }
.disclaimer-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════
   LEARN SCREEN
   ═══════════════════════════════════════════════════════════ */
.lrn-hdr { text-align: center; padding: 16px 0; }
.lrn-hdr h2 { font-family: 'Cinzel Decorative', serif; font-size: 22px; font-weight: 700; }
.lrn-hdr p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.lrn-sec { margin: 12px 0; }
.lrn-sec-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px; background: var(--gradient-card);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition-normal);
}
.lrn-sec-h:active { background: var(--bg-card-hover); }
.lrn-sec-h span { display: flex; align-items: center; gap: 8px; font-family: 'Cinzel', serif; font-size: 14px; font-weight: 700; }
.lrn-sec-h > i { font-size: 12px; color: var(--text-muted); transition: var(--transition-normal); }
.lrn-sec-h.open > i { transform: rotate(180deg); }
.lrn-body { max-height: 0; overflow: hidden; transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.lrn-body.open { max-height: 5000px; }

/* Search */
.search-box { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); margin: 12px 0; }
.search-box i { color: var(--text-muted); font-size: 14px; }
.search-box input { flex: 1; background: none; border: none; color: var(--text-primary); font-size: 14px; outline: none; }
.search-box input::placeholder { color: var(--text-muted); }

/* Card List */
.card-list { padding: 8px 0; }
.card-dict-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; margin: 4px 0;
  background: var(--gradient-card); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition-normal);
}
.card-dict-item:active { border-color: var(--primary); }
.card-dict-icon { font-size: 24px; width: 36px; text-align: center; flex-shrink: 0; }
.card-dict-info { flex: 1; min-width: 0; }
.card-dict-name { font-size: 14px; font-weight: 600; }
.card-dict-keywords { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.card-dict-numeral { font-family: 'Cinzel', serif; font-size: 14px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }

/* Learn Steps */
.lrn-steps { padding: 12px 0; }
.lrn-step-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px; margin: 8px 0;
  background: var(--gradient-card); border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.lrn-step-icon { font-size: 28px; flex-shrink: 0; }
.lrn-step-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.lrn-step-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* Suits */
.suit-card {
  background: var(--gradient-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; margin: 10px 0;
}
.suit-card h4 { font-size: 15px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.suit-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.suit-card .suit-kw { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.suit-card .suit-kw span { padding: 3px 8px; border-radius: var(--radius-full); background: rgba(139,92,246,0.08); font-size: 11px; color: var(--text-accent); }

/* Best Practices */
.bp-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px; margin: 8px 0;
  background: var(--gradient-card); border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.bp-card .bp-icon { font-size: 24px; flex-shrink: 0; }
.bp-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.bp-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════
   HISTORY SCREEN
   ═══════════════════════════════════════════════════════════ */
.hist-hdr { text-align: center; padding: 16px 0; }
.hist-hdr h2 { font-family: 'Cinzel Decorative', serif; font-size: 22px; font-weight: 700; }
.hist-hdr p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.history-empty { text-align: center; padding: 48px 24px; }
.history-empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.6; }
.history-empty h3 { font-family: 'Cinzel', serif; font-size: 18px; margin-bottom: 8px; }
.history-empty p { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; margin: 8px 0;
  background: var(--gradient-card); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition-normal);
}
.history-item:active { border-color: var(--primary); }
.history-item-icon { font-size: 28px; flex-shrink: 0; }
.history-item-info { flex: 1; min-width: 0; }
.history-item-type { font-size: 14px; font-weight: 600; }
.history-item-spread { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.history-item-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.history-item-delete { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 13px; border-radius: 50%; transition: var(--transition-fast); flex-shrink: 0; }
.history-item-delete:active { color: var(--danger); background: rgba(239,68,68,0.1); }

/* ═══════════════════════════════════════════════════════════
   SIDE MENU
   ═══════════════════════════════════════════════════════════ */
.side-ov {
  position: fixed; inset: 0; z-index: 998;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: var(--transition-normal);
}
.side-ov.active { opacity: 1; visibility: visible; }
.side-menu {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 280px; z-index: 999;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column;
}
.side-menu.open { transform: translateX(0); }
.side-top {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 16px; padding-top: calc(20px + var(--safe-top));
  border-bottom: 1px solid var(--border);
}
.side-top span { font-size: 28px; }
.side-top h3 { font-family: 'Cinzel Decorative', serif; font-size: 18px; flex: 1; }
.side-top button { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 16px; }
.side-body { flex: 1; padding: 12px 0; overflow-y: auto; }
.side-body a {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer; transition: var(--transition-fast);
}
.side-body a:active { background: rgba(255,255,255,0.03); color: var(--text-primary); }
.side-body a i { width: 20px; text-align: center; color: var(--primary-light); }
.side-body hr { border: none; height: 1px; background: var(--border); margin: 8px 16px; }
.side-foot { padding: 16px 20px; border-top: 1px solid var(--border); }
.side-foot p { font-size: 11px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   IMAGE VIEWER
   ═══════════════════════════════════════════════════════════ */
.img-viewer {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0.92); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: var(--transition-normal);
  cursor: pointer;
}
.img-viewer.active { opacity: 1; visibility: visible; }
.iv-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; color: white; font-size: 20px; z-index: 1; }
.img-viewer img { max-width: 90%; max-height: 80vh; object-fit: contain; border-radius: var(--radius-md); }

/* ═══════════════════════════════════════════════════════════
   CARD DETAIL MODAL
   ═══════════════════════════════════════════════════════════ */
.card-modal {
  position: fixed; inset: 0; z-index: 9997;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: var(--transition-normal);
  padding: 20px;
}
.card-modal.active { opacity: 1; visibility: visible; }
.card-modal-content {
  max-width: 420px; width: 100%; max-height: 80vh;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.cm-header { text-align: center; padding: 24px 20px 16px; border-bottom: 1px solid var(--border); }
.cm-icon { font-size: 48px; margin-bottom: 8px; }
.cm-name { font-family: 'Cinzel Decorative', serif; font-size: 20px; font-weight: 700; }
.cm-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.cm-body { padding: 16px 20px; }
.cm-section { margin-bottom: 16px; }
.cm-section h4 { font-size: 13px; font-weight: 700; color: var(--text-accent); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.cm-section p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.cm-section ul { list-style: none; }
.cm-section li { font-size: 13px; color: var(--text-secondary); padding: 3px 0; padding-left: 16px; position: relative; }
.cm-section li::before { content: '•'; position: absolute; left: 4px; color: var(--primary-light); }
.cm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-tags span { padding: 3px 10px; border-radius: var(--radius-full); background: rgba(139,92,246,0.1); border: 1px solid rgba(139,92,246,0.15); font-size: 11px; color: var(--text-accent); }
.cm-close-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: calc(100% - 40px); margin: 0 20px 20px; padding: 12px; border-radius: var(--radius-md); background: var(--gradient-card); border: 1px solid var(--border); color: var(--text-primary); font-size: 14px; font-weight: 500; }

/* ═══════════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════════ */
.toasts { position: fixed; bottom: calc(var(--bottom-nav-height) + 10px + var(--safe-bottom)); left: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 500;
  animation: toastIn 0.35s ease forwards;
  pointer-events: auto;
}
.toast.success { border-color: rgba(16,185,129,0.3); }
.toast.success .toast-icon { color: var(--success); }
.toast.error { border-color: rgba(239,68,68,0.3); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info { border-color: rgba(59,130,246,0.3); }
.toast.info .toast-icon { color: var(--info); }
.toast.warning { border-color: var(--border-gold); }
.toast.warning .toast-icon { color: var(--accent); }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast.out { animation: toastOut 0.35s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(20px); } }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 480px) {
  .preview-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .rtype-sel { grid-template-columns: repeat(6, 1fr); }
  .hero-h { font-size: 32px; }
}
@media (min-width: 768px) {
  .scr-scroll { max-width: 560px; margin: 0 auto; }
  .hero-h { font-size: 36px; }
  .feat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ═══════════════════════════════════════════════════════════
   PARTICLES BACKGROUND
   ═══════════════════════════════════════════════════════════ */
.particles-bg {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.particles-canvas {
  width: 100%; height: 100%;
  position: absolute; inset: 0;
}

/* ═══════════════════════════════════════════════════════════
   LEGAL FOOTER
   ═══════════════════════════════════════════════════════════ */
.legal-footer {
  text-align: center;
  padding: 20px 0 8px;
  border-top: 1px solid var(--border-light);
  margin-top: 20px;
}
.legal-footer a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}
.legal-footer a:hover,
.legal-footer a:active {
  color: var(--primary-light);
  border-color: var(--border);
  background: rgba(139,92,246,0.04);
}

/* ═══════════════════════════════════════════════════════════
   LEGAL MODAL CONTENT
   ═══════════════════════════════════════════════════════════ */
.legal-modal-content {
  max-height: 85vh !important;
  max-width: 480px !important;
}
.legal-modal-header {
  text-align: center;
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(139,92,246,0.06), rgba(22,22,54,0.9));
}
.legal-modal-header h2 {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.legal-modal-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.legal-body {
  padding: 20px;
  max-height: 50vh;
  overflow-y: auto;
}
.legal-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}
.legal-section:last-child { border-bottom: none; margin-bottom: 0; }
.legal-section h3 {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.legal-section h3 i { color: var(--primary-light); font-size: 14px; }
.legal-section p, .legal-section li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}
.legal-section ul { list-style: none; padding-left: 0; }
.legal-section li { padding-left: 20px; position: relative; }
.legal-section li::before { content: '•'; position: absolute; left: 6px; color: var(--primary-light); }
.legal-accept-wrap {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: rgba(139,92,246,0.03);
}
.legal-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}
.legal-checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}
.legal-accept-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  color: white;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(102,126,234,0.3);
  transition: var(--transition-normal);
}
.legal-accept-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.5);
}
.legal-accept-btn:not(:disabled):active { transform: scale(0.96); }

/* ═══════════════════════════════════════════════════════════
   LANGUAGE MODAL
   ═══════════════════════════════════════════════════════════ */
.lang-modal-header {
  text-align: center;
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(139,92,246,0.06), rgba(22,22,54,0.9));
}
.lang-modal-header h2 {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
}
.lang-modal-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.lang-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--gradient-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-normal);
}
.lang-option:active { transform: scale(0.96); }
.lang-option.active {
  border-color: var(--primary);
  background: linear-gradient(145deg, rgba(139,92,246,0.12), rgba(22,22,54,0.9));
  box-shadow: 0 0 12px rgba(139,92,246,0.15);
}
.lang-flag { font-size: 22px; flex-shrink: 0; }
.lang-info { flex: 1; min-width: 0; }
.lang-native { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.lang-en { font-size: 11px; color: var(--text-muted); }
.lang-option.active .lang-native { color: var(--primary-light); }
.lang-option.active::after {
  content: '✓';
  color: var(--primary-light);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   PRIVACY NOTICE SECTION (Mexico LFPDPPP)
   ═══════════════════════════════════════════════════════════ */
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  font-size: 11px;
  font-weight: 600;
  color: var(--success-light);
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════
   LEGAL ACCEPTANCE CHECKBOX IN UPLOAD SECTION
   ═══════════════════════════════════════════════════════════ */
.legal-accept-inline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  margin: 12px 0;
  background: rgba(139,92,246,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-normal);
}
.legal-accept-inline input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}
.legal-accept-inline span {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.legal-accept-inline a {
  color: var(--primary-light);
  text-decoration: underline;
  cursor: pointer;
}
.legal-accept-inline.checked {
  border-color: var(--primary);
  background: rgba(139,92,246,0.08);
}

/* ═══════════════════════════════════════════════════════════
   RTL SUPPORT (Arabic)
   ═══════════════════════════════════════════════════════════ */
[dir="rtl"] .side-menu { left: auto; right: 0; transform: translateX(100%); border-right: none; border-left: 1px solid var(--border); }
[dir="rtl"] .side-menu.open { transform: translateX(0); }
[dir="rtl"] .timeline { padding-left: 0; padding-right: 20px; border-left: none; border-right: 2px solid var(--border); }
[dir="rtl"] .tl-item::before { left: auto; right: -27px; }
[dir="rtl"] .card-result-meaning { border-left: none; border-right: 3px solid var(--primary); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
[dir="rtl"] .card-result-advice { border-left: none; border-right: 3px solid var(--accent); }
[dir="rtl"] .legal-section li { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .legal-section li::before { left: auto; right: 6px; }
[dir="rtl"] .res-summary { border-left: none; }
[dir="rtl"] .res-summary[style*="border-left"] { border-left: none !important; border-right: 3px solid var(--accent); }
[dir="rtl"] .disc { direction: rtl; }

/* ═══════════════════════════════════════════════════════════
   PREMIUM ANIMATIONS EXTRA
   ═══════════════════════════════════════════════════════════ */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer-text {
  background: linear-gradient(90deg, var(--text-primary) 0%, var(--text-gold) 25%, var(--primary-light) 50%, var(--text-gold) 75%, var(--text-primary) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(139,92,246,0.2); }
  50% { box-shadow: 0 0 20px rgba(139,92,246,0.4), 0 0 40px rgba(139,92,246,0.1); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.5s ease forwards; }

/* ═══════════════════════════════════════════════════════════
   PRIVACY FOOTER LINKS
   ═══════════════════════════════════════════════════════════ */
.legal-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}
.legal-footer-links .separator {
  color: var(--text-muted);
  font-size: 11px;
}
