/* ==========================================================
   Kesmat - Modern iOS/PWA Mobile Aesthetic
   Inspired by Reference UI: Soft Aurora Top Glow, 
   Rounded Cards, Dark Hero Progress Card, Floating Pill Dock, 
   and Sliding Sidebar Drawer.
   ========================================================== */

:root {
  --color-primary: #111827; /* Obsidian Dark */
  --color-accent: #2563eb;  /* Dynamic Blue */
  --color-gold: #d97706;    /* Amber Gold */
  --bg-page: #f8f6f2;       /* Warm Pearl / Off-white */
  --card-white: #ffffff;
  --card-dark: #111827;
  --text-primary: #0f172a;  /* Deep Slate / Black */
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-subtle: rgba(0, 0, 0, 0.06);
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  background-color: var(--bg-page);
  /* Top Ethereal Aurora Mesh (Lilac / Peach / Rose glow softly bleeding down) */
  background-image: 
    radial-gradient(at 0% 0%, #ede9fe 0%, transparent 45%),
    radial-gradient(at 100% 0%, #ffedd5 0%, transparent 42%),
    radial-gradient(at 50% 12%, #fce7f3 0%, transparent 45%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
  padding-bottom: 7rem; /* Room for floating bottom dock */
  position: relative;
  overflow-x: hidden;
}

.font-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ========================================================== */
/* CARD STYLES (MATCHING REFERENCE SCREENS)                   */
/* ========================================================== */

/* 1. Crisp White Card (e.g. Task Cards, Meeting Cards, Form Card) */
.card-white, .glass-card {
  background: #ffffff;
  border-radius: 26px;
  border: 1px solid var(--border-subtle);
  box-shadow: 
    0 12px 30px -6px rgba(0, 0, 0, 0.04),
    0 2px 8px rgba(0, 0, 0, 0.02);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.card-white:hover, .glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 16px 36px -8px rgba(0, 0, 0, 0.07),
    0 4px 12px rgba(0, 0, 0, 0.03);
}

/* 2. Dark Hero Card (Matching "Today's Progress" from Screen 1) */
.card-dark, .glass-panel {
  background: #111827;
  color: #ffffff;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 20px 40px -12px rgba(17, 24, 39, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-dark * {
  color: #f8fafc;
}

.card-dark .text-muted, .glass-panel .text-slate-400 {
  color: #94a3b8 !important;
}

/* Circular Chart & Progress Gauge */
.progress-ring-circle {
  transition: stroke-dashoffset 0.8s ease-in-out;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

/* ========================================================== */
/* PASTEL ACCENT BADGES (MATCHING PRIORITY & TAG BADGES)      */
/* ========================================================== */
.tag-green, .badge-low {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 9999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.tag-orange, .badge-medium {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fed7aa;
  border-radius: 9999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.tag-red, .badge-high {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 9999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.tag-purple, .badge-tag {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
  border-radius: 9999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.tag-blue {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ========================================================== */
/* FORM INPUTS & SELECTS                                      */
/* ========================================================== */
input, select {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
  border-radius: 18px !important;
  padding: 0.85rem 1.15rem !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  transition: all 0.2s ease !important;
}

input:focus, select:focus {
  outline: none !important;
  border-color: #0f172a !important;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08) !important;
  background: #ffffff !important;
}

input::placeholder {
  color: #94a3b8 !important;
}

/* Buttons */
.btn-primary, .btn-shimmer {
  background: #111827 !important;
  color: #ffffff !important;
  border-radius: 18px !important;
  padding: 0.95rem 1.5rem !important;
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  box-shadow: 0 10px 25px -5px rgba(17, 24, 39, 0.25) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-primary:hover, .btn-shimmer:hover {
  background: #000000 !important;
  transform: translateY(-1.5px);
  box-shadow: 0 14px 28px -6px rgba(17, 24, 39, 0.35) !important;
}

.btn-primary:active, .btn-shimmer:active {
  transform: translateY(0) scale(0.98);
}

/* ========================================================== */
/* FLOATING CAPSULE BOTTOM MENU (MATCHING REFERENCE SCREENS)  */
/* ========================================================== */
.bottom-nav-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0.85rem 1.25rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.bottom-nav {
  pointer-events: auto;
  width: 100%;
  max-width: 440px;
  height: 4.4rem;
  background: #ffffff;
  border-radius: 9999px; /* Floating capsule shape */
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 
    0 18px 45px -10px rgba(0, 0, 0, 0.12),
    0 4px 14px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0.35rem 0.6rem;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  text-decoration: none;
  cursor: pointer;
  border-radius: 9999px;
  padding: 0.35rem 0.55rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-icon-wrap {
  width: 1.65rem;
  height: 1.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.nav-svg {
  width: 1.35rem;
  height: 1.35rem;
  stroke: #64748b;
  transition: all 0.2s ease;
}

.nav-label {
  font-size: 0.65rem;
  font-weight: 600;
  margin-top: 0.1rem;
  color: #64748b;
  transition: all 0.2s ease;
}

.nav-active-pip {
  display: none;
}

/* ACTIVE ITEM (THE ICON IN A DARK PILL MATCHING SCREEN 1 & 2) */
.nav-item.active {
  background: #111827 !important;
  color: #ffffff !important;
  flex-direction: row !important;
  gap: 0.4rem !important;
  padding: 0.55rem 1.15rem !important;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.25) !important;
}

.nav-item.active .nav-icon-wrap {
  width: 1.25rem;
  height: 1.25rem;
}

.nav-item.active .nav-svg {
  stroke: #ffffff !important;
  width: 1.25rem;
  height: 1.25rem;
}

.nav-item.active .nav-label {
  color: #ffffff !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  margin-top: 0 !important;
}

.nav-item:hover:not(.active) {
  color: #0f172a;
}

.nav-item:hover:not(.active) .nav-svg {
  stroke: #0f172a;
  transform: translateY(-1px);
}

/* ========================================================== */
/* SLIDING SIDEBAR DRAWER (MATCHING USER REQUEST)             */
/* ========================================================== */
#appSidebarDrawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 340px;
  max-width: 88vw;
  background: #ffffff;
  z-index: 100;
  box-shadow: 12px 0 45px rgba(0, 0, 0, 0.15);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.25rem 1rem 1.25rem;
  overscroll-behavior: contain;
}

#appSidebarDrawer.open {
  transform: translateX(0);
}

#sidebarBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(5px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#sidebarBackdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  color: #334155;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.sidebar-nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
  transform: translateX(2px);
}

.sidebar-nav-item.active {
  background: #111827;
  color: #ffffff;
}

.sidebar-nav-item.active span,
.sidebar-nav-item.active div {
  color: #ffffff;
}

.sidebar-policy-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  color: #475569;
  font-weight: 500;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.sidebar-policy-item:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #e2e8f0;
  transform: translateX(2px);
}

.sidebar-policy-item.active {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
  border-color: #cbd5e1;
}

/* ========================================================== */
/* LEGAL & POLICY PROSE STYLING                               */
/* ========================================================== */
.policy-section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.5rem;
}

.policy-subheading {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
  margin-top: 1rem;
  margin-bottom: 0.35rem;
}

.policy-paragraph {
  font-size: 0.875rem;
  line-height: 1.65;
  color: #475569;
  margin-bottom: 0.75rem;
}

.policy-list {
  list-style: disc;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: #475569;
  margin-bottom: 0.85rem;
}

.policy-list li {
  margin-bottom: 0.4rem;
}

.policy-highlight-card {
  background: #f8fafc;
  border-left: 4px solid #0f172a;
  padding: 1rem 1.25rem;
  border-radius: 0 16px 16px 0;
  margin: 1rem 0;
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.6;
}

.policy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Print Optimization for Policies */
@media print {
  body {
    background: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
    padding-bottom: 0 !important;
  }
  header, #appSidebarDrawer, #sidebarBackdrop, .bottom-nav-container, #appSplashScreen, #toastContainer, #rechargeModal, #authModal, .no-print {
    display: none !important;
  }
  main {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .card-white {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}

/* ========================================================== */
/* PILL SELECTOR (MATCHING "All", "Work", "Personal" in UI)   */
/* ========================================================== */
.pill-tab {
  padding: 0.5rem 1.15rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  background: #ffffff;
  color: #64748b;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.pill-tab.active {
  background: #111827;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.15);
}

/* ========================================================== */
/* TAB TRANSITION ANIMATIONS                                  */
/* ========================================================== */
.tab-content {
  display: none;
  opacity: 0;
}

.tab-content.active {
  display: block;
  animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================================== */
/* KUNDLI CHART STYLING                                       */
/* ========================================================== */
.chart-box {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}

.kundli-svg line {
  stroke: #e2e8f0;
  stroke-width: 1.6;
}

.kundli-svg rect {
  fill: #0f172a;
  stroke: #334155;
  stroke-width: 2;
}

.kundli-svg .sign-num {
  fill: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}

.kundli-svg .plt-tag {
  font-size: 10px;
  font-weight: 700;
}

/* Toast Notifications */
#toastContainer {
  position: fixed;
  top: 1rem;
  right: 1rem;
  left: 1rem;
  max-width: 24rem;
  margin: 0 auto;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #111827;
  color: #ffffff;
  padding: 0.85rem 1.15rem;
  border-radius: 18px;
  box-shadow: 0 14px 34px -8px rgba(0, 0, 0, 0.3);
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

/* ========================================================== */
/* APP SPLASH SCREEN (4 SECONDS DURATION)                     */
/* ========================================================== */
.app-splash-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #F8F6F2;
  background-image: radial-gradient(circle at 50% 32%, rgba(254, 215, 170, 0.35) 0%, rgba(243, 232, 255, 0.4) 38%, rgba(248, 246, 242, 0.98) 75%);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.app-splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.03);
  pointer-events: none;
}

.splash-glow {
  position: absolute;
  inset: -14px;
  border-radius: 36px;
  background: radial-gradient(circle, rgba(251, 146, 60, 0.35) 0%, rgba(192, 132, 252, 0.35) 55%, transparent 75%);
  filter: blur(16px);
  animation: splashPulse 2.4s infinite ease-in-out;
}

@keyframes splashPulse {
  0%, 100% {
    transform: scale(0.92);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

.splash-progress-track {
  width: 160px;
  height: 4px;
  background: rgba(226, 232, 240, 0.85);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.splash-progress-fill {
  height: 100%;
  width: 0%;
  background: #0f172a;
  border-radius: 999px;
  animation: splashProgressFill 3.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes splashProgressFill {
  0% { width: 0%; }
  20% { width: 35%; }
  55% { width: 68%; }
  85% { width: 90%; }
  100% { width: 100%; }
}

/* ========================================================== */
/* FLATPICKR DD/MM/YYYY DATE PICKER CUSTOM THEME             */
/* ========================================================== */
.flatpickr-calendar {
  background: #ffffff !important;
  border-radius: 24px !important;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06) !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  padding: 14px !important;
  width: 320px !important;
}

.flatpickr-calendar::before,
.flatpickr-calendar::after {
  display: none !important;
}

.flatpickr-months {
  padding: 4px 0 10px 0 !important;
  align-items: center !important;
}

.flatpickr-month {
  color: #0f172a !important;
  font-weight: 700 !important;
  height: 38px !important;
}

.flatpickr-current-month {
  font-size: 105% !important;
  font-weight: 700 !important;
  padding-top: 2px !important;
}

.flatpickr-current-month .cur-month {
  font-weight: 800 !important;
  color: #0f172a !important;
}

.flatpickr-current-month input.cur-year {
  font-weight: 800 !important;
  color: #0f172a !important;
}

.flatpickr-weekdays {
  margin-bottom: 6px !important;
}

span.flatpickr-weekday {
  color: #94a3b8 !important;
  font-weight: 800 !important;
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.flatpickr-day {
  border-radius: 12px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  color: #334155 !important;
  height: 38px !important;
  line-height: 38px !important;
  transition: all 0.15s ease !important;
}

.flatpickr-day:hover {
  background: #f1f5f9 !important;
  border-color: transparent !important;
  color: #0f172a !important;
}

.flatpickr-day.today {
  border-color: #f59e0b !important;
  color: #b45309 !important;
  background: #fef3c7 !important;
  font-weight: 700 !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: #0f172a !important;
  border-color: #0f172a !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.3) !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: #cbd5e1 !important;
}

.flatpickr-prev-month,
.flatpickr-next-month {
  border-radius: 12px !important;
  padding: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  top: 10px !important;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
  background: #f1f5f9 !important;
}

.flatpickr-prev-month svg,
.flatpickr-next-month svg {
  fill: #0f172a !important;
  width: 14px !important;
  height: 14px !important;
}

/* ========================================================== */
/* ========================================================== */
/* TAROT ENGINE 3D LUXURY CARDS & SPREAD LAYOUTS              */
/* ========================================================== */
.tarot-perspective {
  perspective: 1400px;
}

.tarot-card-box {
  width: 100%;
  max-width: 190px;
  aspect-ratio: 2 / 3.35;
  position: relative;
  margin: 0 auto;
  transition: transform 0.3s ease;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tarot-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, filter 0.3s ease;
  transform-style: preserve-3d;
  border-radius: 16px;
  cursor: pointer;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
}

/* Subtle idle breathing pulse on face-down cards to invite tapping */
.tarot-card-inner:not(.flipped) {
  animation: tarotCardPulse 4s ease-in-out infinite;
}

@keyframes tarotCardPulse {
  0%, 100% {
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 6px rgba(245, 158, 11, 0.2));
  }
  50% {
    filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 16px rgba(245, 158, 11, 0.5));
  }
}

.tarot-card-inner:not(.flipped):hover {
  transform: translateY(-8px) scale(1.03);
  filter: drop-shadow(0 20px 32px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 22px rgba(251, 191, 36, 0.65));
}

.tarot-card-inner.flipped {
  transform: rotateY(180deg);
}

.tarot-card-inner.flipped:hover {
  transform: rotateY(180deg) translateY(-6px) scale(1.02);
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 18px rgba(251, 191, 36, 0.5));
}

.tarot-card-inner.is-reversed.flipped {
  transform: rotateY(180deg) rotate(180deg);
}

.tarot-card-inner.is-reversed.flipped:hover {
  transform: rotateY(180deg) rotate(180deg) translateY(6px) scale(1.02);
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 18px rgba(239, 68, 68, 0.5));
}

.tarot-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 16px;
  clip-path: inset(0 round 16px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(251, 191, 36, 0.35);
  border: 1.5px solid rgba(217, 119, 6, 0.6);
  background: #070b14;
  pointer-events: none;
}

.tarot-face svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.tarot-face-front {
  background: linear-gradient(150deg, #0f172a 0%, #1e293b 50%, #080c14 100%);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
}

.tarot-face-back {
  background: radial-gradient(circle at 50% 50%, #141f3d 0%, #070c1a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Explicit face visibility toggles guaranteeing flip works on every engine */
.tarot-card-inner:not(.flipped) .tarot-face-front {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.tarot-card-inner:not(.flipped) .tarot-face-back {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.tarot-card-inner.flipped .tarot-face-front {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.tarot-card-inner.flipped .tarot-face-back {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  .tarot-card-inner {
    transition: transform 0.01s ease !important;
    animation: none !important;
  }
}

.celtic-cross-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .celtic-cross-container {
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
  }
}

.celtic-circle-area {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 0.75rem;
  align-items: center;
  justify-items: center;
}

.celtic-staff-area {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  align-items: center;
}

/* ========================================================== */
/* TAROT MOBILE RESPONSIVENESS (Phones & Small Tablets)       */
/* ========================================================== */
@media (max-width: 768px) {
  .tarot-card-box {
    max-width: 150px;
  }
  .celtic-circle-area {
    gap: 0.5rem;
  }
  .celtic-staff-area {
    gap: 0.5rem;
  }
}

@media (max-width: 540px) {
  .tarot-card-box {
    max-width: 118px;
    border-radius: 12px;
  }
  .tarot-face {
    border-radius: 12px;
  }
  .celtic-cross-container {
    gap: 1rem;
  }
  .celtic-circle-area {
    gap: 0.35rem;
  }
  .celtic-staff-area {
    gap: 0.35rem;
  }
}

@media (max-width: 380px) {
  .tarot-card-box {
    max-width: 98px;
    border-radius: 10px;
  }
  .tarot-face {
    border-radius: 10px;
  }
}

/* Custom Scrollbar for Mobile-Friendly Modals */
.custom-modal-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
  -webkit-overflow-scrolling: touch;
}
.custom-modal-scroll::-webkit-scrollbar {
  width: 4px;
}
.custom-modal-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.custom-modal-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 9999px;
}

/* ========================================================== */
/* PLANETARY AR SKY VIEW STYLES                              */
/* ========================================================== */
.ar-viewport-wrap {
  position: relative;
  width: 100%;
  height: 520px;
  max-height: 75vh;
  border-radius: 28px;
  overflow: hidden;
  background: #020409;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.5);
}

@media (max-width: 640px) {
  .ar-viewport-wrap {
    height: 460px;
    border-radius: 22px;
  }
}

.ar-camera-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  pointer-events: none;
}

.ar-sky-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  cursor: grab;
}

.ar-sky-canvas:active {
  cursor: grabbing;
}

.ar-hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  pointer-events: none;
}

.ar-radar-disc {
  width: 72px;
  height: 72px;
  border-radius: 9999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
}



