/* ========================================================
   ORACLE MIRROR — Fantasy Fortune-Telling Experience
   ======================================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold: #d4af37;
  --gold-light: #f0d060;
  --gold-dark: #b8972e;
  --gold-glow: rgba(212, 175, 55, 0.4);
  --purple: #8b5cf6;
  --purple-deep: #4c1d95;
  --purple-glow: rgba(139, 92, 246, 0.3);
  --bg-deep: #05030d;
  --bg-mid: #0d0820;
  --bg-card: rgba(15, 8, 40, 0.85);
  --text-cream: #f5e6c7;
  --text-muted: #d4c7df;
  --text-gold: #e8d48b;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(212, 175, 55, 0.25);
  --glass-border-hover: rgba(212, 175, 55, 0.6);
  --shadow-gold: rgba(212, 175, 55, 0.3);
  --font-display: 'Cinzel Decorative', 'Cinzel', serif;
  --font-heading: 'Cinzel', serif;
  --font-body: 'Crimson Pro', serif;
  --transition: 0.3s ease;
  --ad-sticky-height: 60px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-cream);
  font-size: 1.05rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow-x: hidden;
  line-height: 1.6;
}

#particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* --- Header / Navigation --- */
header {
  width: 100%;
  background: linear-gradient(180deg, rgba(5, 3, 13, 0.98) 0%, rgba(8, 5, 19, 0.92) 100%);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--gold);
  transition: all var(--transition);
}

.nav-logo:hover {
  text-shadow: 0 0 20px var(--shadow-gold);
}

.logo-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 8px var(--gold-glow));
}

.logo-text {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  letter-spacing: 2px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.68rem 1rem;
  text-decoration: none;
  color: var(--text-cream);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  border-radius: 8px;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.14);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.18);
}

.dropdown-arrow {
  font-size: 0.72rem;
  transition: transform var(--transition);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 8, 32, 0.97);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 0.6rem;
  min-width: 230px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  z-index: 110;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
  animation: dropdownIn 0.2s ease;
}

.nav-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.dropdown-item {
  display: block;
  padding: 0.72rem 0.9rem;
  text-decoration: none;
  color: var(--text-cream);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  border-radius: 8px;
  transition: all var(--transition);
}

.dropdown-item:hover {
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.14);
}

.nav-link:focus-visible,
.dropdown-item:focus-visible,
.nav-logo:focus-visible,
.nav-hamburger:focus-visible,
.btn-gold:focus-visible,
.btn-back:focus-visible,
.card:focus-visible,
.zodiac-btn:focus-visible,
.realm-input:focus-visible,
.realm-text-input:focus-visible,
.realm-number-input:focus-visible,
.realm-date-input:focus-visible,
.realm-select:focus-visible,
.chat-text-input:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-hamburger span {
  width: 26px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  transition: all var(--transition);
}

/* --- Page System --- */
.page {
  display: none;
  width: 100%;
  flex: 1;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.5s ease;
}

.page.active { display: flex; }

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

/* --- Section Divider --- */
.section-divider {
  text-align: center;
  color: var(--gold);
  font-size: 1.2rem;
  letter-spacing: 12px;
  margin-bottom: 1rem;
  opacity: 0.6;
  text-shadow: 0 0 10px var(--shadow-gold);
}

/* --- Hero Section --- */
#hero {
  width: 100%;
  min-height: clamp(420px, 58vh, 620px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1rem 3rem;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(80, 40, 150, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 80%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mirror {
  position: relative;
  background: radial-gradient(ellipse at center, rgba(99, 60, 170, 0.18) 0%, rgba(5, 3, 13, 0.72) 70%);
  border: 2px solid var(--gold);
  border-radius: 50%;
  width: clamp(300px, 45vw, 440px);
  height: clamp(300px, 45vw, 440px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow:
    inset 0 0 70px rgba(138, 100, 200, 0.16),
    0 0 90px rgba(212, 175, 55, 0.18),
    0 0 180px rgba(138, 100, 200, 0.14);
  backdrop-filter: blur(8px);
  transition: box-shadow 0.6s ease;
}

.mirror::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.15);
  pointer-events: none;
}

.mirror:hover {
  box-shadow:
    inset 0 0 80px rgba(138, 100, 200, 0.15),
    0 0 100px rgba(212, 175, 55, 0.25),
    0 0 200px rgba(138, 100, 200, 0.15);
}

.mirror-glow {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.06) 0%, transparent 70%);
  animation: mirrorPulse 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes mirrorPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

.mirror-inner {
  padding: 2.5rem;
}

.mirror-tagline {
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 0.88rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  opacity: 0.8;
}

.mirror h1 {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: clamp(1.55rem, 3vw, 2rem);
  margin-bottom: 0.4rem;
  line-height: 1.2;
  text-shadow: 0 0 20px var(--shadow-gold);
}

.mirror-headline {
  font-family: var(--font-heading);
  color: var(--text-cream);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  text-shadow: 0 0 20px rgba(245, 230, 199, 0.2);
  margin-bottom: 0.5rem;
  font-weight: 400;
  line-height: 1.5;
}

.mirror-desc {
  color: var(--text-muted);
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.btn-enter {
  font-size: 0.95rem;
  padding: 0.85rem 2.2rem;
}

/* --- Buttons --- */
.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--bg-deep);
  border: none;
  padding: 0.75rem 1.8rem;
  border-radius: 6px;
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 20px rgba(212, 175, 55, 0.1);
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.btn-gold::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(transparent, rgba(255,255,255,0.12), transparent);
  transform: rotate(45deg);
  transition: 0.5s;
  opacity: 0;
}

.btn-gold:hover::after { opacity: 1; }

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5), 0 0 35px rgba(212, 175, 55, 0.25);
}

.btn-gold:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.btn-gold:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-back {
  background: none;
  border: 1px solid var(--glass-border);
  color: var(--gold);
  padding: 0.65rem 1.1rem;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  cursor: pointer;
  transition: all var(--transition);
  backdrop-filter: blur(4px);
}

.btn-back:hover {
  background: rgba(212, 175, 55, 0.08);
  border-color: var(--gold);
}

.btn-small {
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}

/* --- Realm Cards --- */
#modules {
  width: 100%;
  padding: 2rem 1rem 3rem;
}

#modules h2 {
  text-align: center;
  font-family: var(--font-display);
  color: var(--gold);
  font-size: clamp(1.4rem, 3vw, 2rem);
  text-shadow: 0 0 20px var(--shadow-gold);
  margin-bottom: 0.3rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.15rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-cream);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-family: var(--font-heading);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(212, 175, 55, 0.1);
  transition: all 0.4s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(212, 175, 55, 0.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.card:hover::before, .card:hover::after { opacity: 1; }

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(212, 175, 55, 0.12);
  border-color: var(--glass-border-hover);
}

.card-frame {
  padding: 1.6rem 1rem 1.35rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.card-icon {
  font-size: 2.55rem;
  margin-bottom: 0.6rem;
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.3));
}

.card h3 {
  font-size: 1rem;
  text-align: center;
  margin-bottom: 0.4rem;
  line-height: 1.3;
  color: var(--text-gold);
}

.card-desc {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
}

/* Card accent colors on hover */
.card-crystal:hover { border-color: #a78bfa; box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 30px rgba(167, 139, 250, 0.2); }
.card-western:hover { border-color: #60a5fa; box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 30px rgba(96, 165, 250, 0.2); }
.card-chinese:hover { border-color: #f87171; box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 30px rgba(248, 113, 113, 0.2); }
.card-tarot:hover { border-color: #a78bfa; box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 30px rgba(167, 139, 250, 0.2); }
.card-love:hover { border-color: #fb7185; box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 30px rgba(251, 113, 133, 0.2); }
.card-magic8:hover { border-color: #34d399; box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 30px rgba(52, 211, 153, 0.2); }
.card-numerology:hover { border-color: #fbbf24; box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 30px rgba(251, 191, 36, 0.2); }
.card-daily:hover { border-color: #fb923c; box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 30px rgba(251, 146, 60, 0.2); }
.card-personas:hover { border-color: #c084fc; box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 30px rgba(192, 132, 252, 0.2); }
.card-archive:hover { border-color: #94a3b8; box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 30px rgba(148, 163, 184, 0.2); }

/* --- Trust Badges --- */
.trust-section {
  width: 100%;
  padding: 2rem 1rem;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.trust-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.trust-badge {
  text-align: center;
  min-width: 140px;
  max-width: 180px;
}

.trust-icon {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
  filter: drop-shadow(0 0 6px var(--gold-glow));
}

.trust-badge strong {
  display: block;
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 0.92rem;
  letter-spacing: 0;
  margin-bottom: 0.2rem;
}

.trust-badge p {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Search Overview --- */
.search-overview {
  width: 100%;
  padding: 2rem 1rem 3rem;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.search-overview-inner {
  max-width: 960px;
  margin: 0 auto;
}

.overview-kicker {
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.search-overview h2 {
  max-width: 760px;
  color: var(--text-gold);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  line-height: 1.35;
  margin-bottom: 0.8rem;
}

.overview-intro {
  max-width: 820px;
  color: var(--text-muted);
  font-size: 1.08rem;
  margin-bottom: 1.5rem;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.overview-item {
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  padding-top: 0.9rem;
}

.overview-item h3 {
  color: var(--text-gold);
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: 0.45rem;
}

.overview-item p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* =========================================================
   CRYSTAL BALL CHAT INTERFACE
   ========================================================= */
.chat-layout {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - 110px);
}

.chat-orb-container {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.chat-orb {
  width: 140px;
  height: 140px;
  position: relative;
}

.chat-orb .orb-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-style: italic;
  color: rgba(200, 180, 255, 0.7);
  padding: 1.5rem;
  z-index: 2;
}

/* Chat messages container */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  max-height: 50vh;
  margin-bottom: 1rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.2);
  border-radius: 3px;
}

/* Chat message bubbles */
.chat-msg {
  display: flex;
  gap: 0.75rem;
  animation: msgIn 0.4s ease;
}

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

.chat-msg.user {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 1px solid var(--glass-border);
}

.chat-msg.fortuna .chat-avatar {
  background: radial-gradient(circle, #a78bfa 0%, #4c1d95 100%);
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.3);
}

.chat-msg.user .chat-avatar {
  background: radial-gradient(circle, #60a5fa 0%, #1e3a8a 100%);
}

.chat-bubble {
  max-width: 80%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.chat-msg.fortuna .chat-bubble {
  background: rgba(80, 40, 150, 0.2);
  border: 1px solid rgba(167, 139, 250, 0.2);
  color: var(--text-cream);
  border-bottom-left-radius: 4px;
}

.chat-msg.user .chat-bubble {
  background: rgba(30, 58, 138, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.2);
  color: var(--text-cream);
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.8rem 1rem;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple);
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Chat input */
.chat-input-area {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.5rem;
  transition: border-color var(--transition);
}

.chat-input-area:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.1);
}

.chat-text-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-cream);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  outline: none;
}

.chat-text-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.btn-chat-send {
  padding: 0.6rem 1.2rem;
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- Form Elements --- */
textarea, .realm-input {
  width: 100%;
  min-height: 100px;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-cream);
  font-family: var(--font-body);
  font-size: 1rem;
  resize: vertical;
  margin-bottom: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

textarea:focus, .realm-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.1);
}

textarea::placeholder, .realm-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

input[type="number"], input[type="date"], input[type="text"], select,
.realm-number-input, .realm-date-input, .realm-text-input, .realm-select {
  width: 100%;
  max-width: 300px;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-cream);
  font-family: var(--font-body);
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: border-color var(--transition);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
}

select option {
  background: var(--bg-deep);
  color: var(--text-cream);
}

.realm-label {
  display: block;
  font-family: var(--font-heading);
  color: var(--gold);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

/* --- Oracle Response --- */
.oracle-response {
  white-space: pre-wrap;
  word-wrap: break-word;
  background: rgba(0, 0, 0, 0.4);
  padding: 1.5rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  color: var(--text-cream);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  min-height: 2rem;
  margin-top: 1rem;
  transition: all 0.5s ease;
}

.oracle-response:empty { display: none; }

.oracle-response.loading {
  color: var(--gold);
  font-style: italic;
  text-align: center;
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.oracle-response .cards-drawn {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.oracle-response .drawn-card {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--gold);
}

/* --- Realm Pages --- */
.realm-page {
  padding: 0 1rem 4rem;
  max-width: 800px;
  margin: 0 auto;
}

.realm-header {
  text-align: center;
  padding: 2rem 0;
}

.realm-header h2 {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  text-shadow: 0 0 20px var(--shadow-gold);
  margin: 1rem 0 0.5rem;
}

.realm-subtitle {
  color: var(--text-muted);
  font-style: italic;
  font-size: 1.02rem;
  max-width: 500px;
  margin: 0 auto;
}

.realm-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.realm-form .realm-input { width: 100%; }
.realm-form .oracle-response { width: 100%; }

.btn-realm { margin-bottom: 0.5rem; }

/* --- Realm Scenes --- */
.realm-scene {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  margin: 1rem 0 2rem;
  position: relative;
}

/* Crystal Ball */
.crystal-ball-orb {
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(200, 180, 255, 0.3), rgba(80, 40, 150, 0.2), rgba(20, 10, 50, 0.8));
  border: 2px solid rgba(212, 175, 55, 0.4);
  position: relative;
  box-shadow: 0 0 40px rgba(138, 100, 200, 0.3), 0 0 80px rgba(138, 100, 200, 0.1), inset 0 0 30px rgba(200, 180, 255, 0.15);
  animation: orbFloat 6s ease-in-out infinite;
}

.orb-inner {
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(220, 200, 255, 0.15), transparent);
  animation: orbSwirl 8s linear infinite;
}

.orb-shine {
  position: absolute;
  top: 15%; left: 25%;
  width: 30%; height: 20%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  filter: blur(4px);
  transform: rotate(-30deg);
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes orbSwirl {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Zodiac Wheel */
.zodiac-wheel {
  width: 160px; height: 160px;
  position: relative;
}

.zodiac-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(96, 165, 250, 0.3);
  border-radius: 50%;
  animation: wheelSpin 30s linear infinite;
}

.zodiac-ring::before {
  content: '\2726 \2605 \2726 \2605 \2726 \2605 \2726 \2605 \2726 \2605 \2726 \2605';
  position: absolute;
  inset: -12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: rgba(96, 165, 250, 0.5);
  letter-spacing: 8px;
}

@keyframes wheelSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Zodiac Sign Buttons */
.zodiac-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  max-width: 500px;
  margin-bottom: 1rem;
}

.zodiac-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.75rem 0.6rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-cream);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition);
}

.zodiac-btn:hover, .zodiac-btn.selected {
  border-color: #60a5fa;
  background: rgba(96, 165, 250, 0.1);
  box-shadow: 0 0 15px rgba(96, 165, 250, 0.2);
  color: #93c5fd;
}

.zodiac-symbol { font-size: 1.55rem; }

/* Chinese Zodiac Lanterns */
.lantern {
  width: 40px; height: 60px;
  background: radial-gradient(ellipse, #f87171 30%, #dc2626 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: 0 0 20px rgba(248, 113, 113, 0.3);
  position: absolute;
  animation: lanternSway 4s ease-in-out infinite;
}

.lantern::before {
  content: '';
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 8px;
  background: var(--gold);
  border-radius: 4px 4px 0 0;
}

.lantern-1 { left: 20%; animation-delay: 0s; }
.lantern-2 { left: 50%; transform: translateX(-50%); animation-delay: 1s; }
.lantern-3 { right: 20%; animation-delay: 2s; }

@keyframes lanternSway {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.animal-display {
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 1.3rem;
  text-align: center;
  margin-bottom: 1rem;
  text-shadow: 0 0 10px var(--shadow-gold);
}

.animal-display.hidden { display: none; }

/* Tarot Cards */
.tarot-spread {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.tarot-card-slot {
  width: 90px; height: 140px;
  perspective: 600px;
}

.tarot-card-back {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #2d1b69 0%, #1a0f3c 50%, #2d1b69 100%);
  border: 2px solid var(--gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--gold);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.tarot-card-back::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 6px;
}

.tarot-card-slot.revealed .tarot-card-back {
  background: linear-gradient(135deg, #3b2086 0%, #2d1b69 100%);
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.3);
}

/* Love Hearts */
.love-hearts {
  position: relative;
  width: 200px; height: 150px;
}

.floating-heart {
  position: absolute;
  color: #fb7185;
  font-size: 2rem;
  animation: heartFloat 5s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(251, 113, 133, 0.4));
}

.h1 { left: 20%; top: 20%; animation-delay: 0s; }
.h2 { left: 50%; top: 40%; animation-delay: 1.5s; font-size: 2.5rem; }
.h3 { left: 70%; top: 10%; animation-delay: 3s; }

@keyframes heartFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.7; }
  50% { transform: translateY(-15px) scale(1.1); opacity: 1; }
}

.love-names {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.love-ampersand {
  color: #fb7185;
  font-size: 1.5rem;
  font-family: var(--font-heading);
}

.love-names .realm-text-input { max-width: 180px; }

/* Magic 8 Ball */
.magic8-ball {
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #333 0%, #111 60%, #000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(52, 211, 153, 0.2), 0 8px 30px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.magic8-ball.shaking { animation: shake8 0.5s ease-in-out; }

@keyframes shake8 {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-15deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-10deg); }
  80% { transform: rotate(5deg); }
}

.magic8-window {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, #1a1a2e, #0a0a15);
  border: 2px solid rgba(52, 211, 153, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 15px rgba(52, 211, 153, 0.1);
}

.magic8-number {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: #34d399;
  text-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
}

.btn-neon {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 20px rgba(52, 211, 153, 0.1);
}

.btn-neon:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 30px rgba(52, 211, 153, 0.2);
}

/* Numerology Geometry */
.geometry-shape {
  width: 180px; height: 180px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.geo-ring {
  position: absolute;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 50%;
}

.geo-1 { inset: 0; animation: geoSpin 20s linear infinite; }
.geo-2 { inset: 20px; animation: geoSpin 15s linear infinite reverse; border-style: dashed; }
.geo-3 { inset: 40px; animation: geoSpin 10s linear infinite; }

@keyframes geoSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.geo-core {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--gold);
  text-shadow: 0 0 20px var(--shadow-gold);
  z-index: 1;
}

/* Daily Fortune */
.sunrise-glow {
  width: 200px; height: 100px;
  background: radial-gradient(ellipse at bottom, rgba(251, 146, 60, 0.3) 0%, rgba(251, 146, 60, 0.05) 50%, transparent 70%);
  border-radius: 50%;
  animation: sunPulse 5s ease-in-out infinite;
}

@keyframes sunPulse {
  0%, 100% { opacity: 0.6; transform: scaleX(1); }
  50% { opacity: 1; transform: scaleX(1.1); }
}

/* --- Personas Gallery --- */
.personas-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.persona-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all var(--transition);
}

.persona-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.1);
  transform: translateY(-4px);
}

.persona-portrait {
  width: 80px; height: 80px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  border: 2px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

.portrait-fortuna { background: radial-gradient(circle, #a78bfa 0%, #4c1d95 100%); }
.portrait-astaria { background: radial-gradient(circle, #60a5fa 0%, #1e3a8a 100%); }
.portrait-longwei { background: radial-gradient(circle, #f87171 0%, #991b1b 100%); }
.portrait-seraphina { background: radial-gradient(circle, #c084fc 0%, #581c87 100%); }
.portrait-rosalind { background: radial-gradient(circle, #fb7185 0%, #9f1239 100%); }
.portrait-8ball { background: radial-gradient(circle, #34d399 0%, #065f46 100%); }
.portrait-pythius { background: radial-gradient(circle, #fbbf24 0%, #92400e 100%); }
.portrait-dawn { background: radial-gradient(circle, #fb923c 0%, #9a3412 100%); }

.persona-card h3 {
  font-family: var(--font-heading);
  color: var(--text-gold);
  margin-bottom: 0.2rem;
  font-size: 1.05rem;
}

.persona-domain {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.persona-desc {
  font-size: 0.85rem;
  line-height: 1.5;
}

/* --- Archive --- */
.archive-controls {
  text-align: center;
  margin-bottom: 1.5rem;
}

.archive-list {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.archive-empty {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 3rem 1rem;
}

.archive-entry {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 1.2rem;
  animation: fadeIn 0.3s ease;
}

.archive-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.archive-realm {
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.archive-date {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.archive-question {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.archive-answer {
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* =========================================================
   AD CONTAINERS
   ========================================================= */
.ad-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1100px;
  margin: 1rem auto;
  padding: 0 1rem;
  min-height: 10px;
}

.ad-unit {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.ad-slot-leaderboard {
  width: min(728px, 100%);
  min-height: 90px;
}

.ad-slot-native,
.ad-slot-rectangle {
  width: min(300px, 100%);
  min-height: 250px;
}

.ad-slot-mobile-banner {
  width: min(320px, 100%);
  min-height: 50px;
}

.ad-slot-mid-banner {
  width: min(468px, 100%);
  min-height: 60px;
}

.ad-slot-half-page {
  width: 160px;
  min-height: 300px;
}

.ad-slot-skyscraper {
  width: 160px;
  min-height: 600px;
}

.ad-desktop-only {
  display: flex;
}

.ad-mobile-only {
  display: none;
}

.ad-leaderboard {
  margin: 0 auto 1.5rem;
}

.ad-mobile-top {
  margin: 0 auto 1.25rem;
}

.ad-native-home {
  margin: 1rem auto 2rem;
}

.ad-chat-bottom {
  margin-top: 1.5rem;
}

.ad-rectangle-home {
  margin: 0 auto 2rem;
}

.ad-mid-content {
  margin: 1.5rem auto;
}

.ad-tablet-up {
  display: flex;
}

.ad-sidebar {
  display: none;
  position: fixed;
  top: 50%;
  z-index: 50;
  transform: translateY(-50%);
}

.ad-sidebar-left {
  left: 8px;
}

.ad-sidebar-right {
  right: 8px;
}

@media (min-width: 1520px) {
  .ad-sidebar {
    display: block;
  }
}

/* Mobile sticky bottom ad */
.ad-mobile-sticky {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(5, 3, 13, 0.95);
  border-top: 1px solid var(--glass-border);
  padding: 5px 0 calc(5px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  backdrop-filter: blur(8px);
}

.ad-mobile-sticky .ad-unit {
  max-width: 320px;
  margin: 0 auto;
}

/* --- Footer --- */
footer {
  width: 100%;
  padding: 1.5rem 1rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  margin-top: auto;
  z-index: 1;
}

.footer-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-badge {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0;
}

.footer-badge span {
  margin-right: 0.3rem;
  filter: drop-shadow(0 0 4px var(--gold-glow));
}

.footer-copy {
  font-size: 0.88rem;
  color: rgba(212, 199, 223, 0.78);
}

/* --- Realm Background Themes --- */
.realm-crystal { background: radial-gradient(ellipse at center, rgba(80, 40, 150, 0.1) 0%, transparent 60%); }
.realm-western { background: radial-gradient(ellipse at top, rgba(30, 58, 138, 0.1) 0%, transparent 60%); }
.realm-chinese { background: radial-gradient(ellipse at center, rgba(153, 27, 27, 0.08) 0%, transparent 60%); }
.realm-tarot { background: radial-gradient(ellipse at bottom, rgba(88, 28, 135, 0.1) 0%, transparent 60%); }
.realm-love { background: radial-gradient(ellipse at center, rgba(159, 18, 57, 0.08) 0%, transparent 60%); }
.realm-magic8 { background: radial-gradient(ellipse at center, rgba(6, 95, 70, 0.08) 0%, transparent 60%); }
.realm-numerology { background: radial-gradient(ellipse at center, rgba(146, 64, 14, 0.08) 0%, transparent 60%); }
.realm-daily { background: radial-gradient(ellipse at top, rgba(154, 52, 18, 0.08) 0%, transparent 60%); }
.realm-personas { background: radial-gradient(ellipse at center, rgba(88, 28, 135, 0.08) 0%, transparent 60%); }
.realm-archive { background: radial-gradient(ellipse at center, rgba(51, 65, 85, 0.08) 0%, transparent 60%); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .cards {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  header { padding: 0; }

  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 3, 13, 0.98);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    z-index: 150;
    backdrop-filter: blur(20px);
  }

  .nav-links.open { display: flex; }

  .nav-link {
    font-size: 1.25rem;
    padding: 0.9rem 1.6rem;
  }

  .nav-dropdown-menu {
    position: static;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    display: block;
  }

  .nav-dropdown-trigger .dropdown-arrow { display: none; }

  .dropdown-item {
    font-size: 1.05rem;
    padding: 0.75rem 1.5rem;
  }

  .nav-hamburger { display: flex; }

  #hero { min-height: 470px; padding: 2rem 1rem; }

  .mirror {
    width: clamp(260px, 75vw, 360px);
    height: clamp(260px, 75vw, 360px);
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem;
  }

  .zodiac-grid { grid-template-columns: repeat(3, 1fr); }
  .tarot-spread { gap: 0.8rem; }
  .tarot-card-slot { width: 75px; height: 115px; }
  .personas-gallery { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

  .ad-desktop-only { display: none; }
  .ad-mobile-only { display: flex; }
  .ad-tablet-up { display: none; }

  /* Show mobile sticky ad */
  .ad-mobile-sticky { display: block; }

  /* Reserve exactly the visible banner height so fixed ads never cover the footer or controls. */
  html { scroll-padding-bottom: calc(var(--ad-sticky-height) + 1rem); }
  body { padding-bottom: var(--ad-sticky-height); }
  footer { padding-bottom: calc(var(--ad-sticky-height) + 0.5rem); }

  .chat-layout {
    min-height: calc(100svh - 96px - var(--ad-sticky-height));
  }

  .chat-container {
    max-height: 40vh;
  }
}

@media (max-width: 480px) {
  .mirror {
    width: 260px;
    height: 260px;
    padding: 1rem;
  }

  .mirror-inner { padding: 1.5rem; }

  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zodiac-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .love-names { flex-direction: column; }
  .love-names .realm-text-input { max-width: 100%; }
  .tarot-spread { gap: 0.5rem; }
  .tarot-card-slot { width: 65px; height: 100px; }
  .personas-gallery { grid-template-columns: 1fr; }

  .trust-badges { gap: 1rem; }
  .trust-badge { min-width: 120px; }

  .footer-badges { gap: 0.8rem; }

  .btn-chat-send {
    padding: 0.5rem 0.8rem;
    font-size: 0.7rem;
  }

  .chat-text-input {
    font-size: 0.9rem;
  }

  .chat-orb {
    width: 110px;
    height: 110px;
  }
}

/* --- Utility --- */
.hidden { display: none !important; }
