/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --purple: #7C6FE8;
  --purple-light: #9d92f0;
  --purple-dark: #5a4fd4;
  --text-primary: #ffffff;
  --text-secondary: rgba(255,255,255,0.65);
  --text-muted: rgba(255,255,255,0.4);
  --bg-dark: #0e0e18;
  --card-bg: #16161f;
  --card-border: rgba(255,255,255,0.08);
  --navbar-h: 52px;
}

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===========================
   NAVBAR
   =========================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--navbar-h);
  background: transparent;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.logo-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

@keyframes spinRing1 {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes spinRing2 {
  from { transform: rotate(60deg); }
  to { transform: rotate(420deg); }
}
@keyframes spinRing3 {
  from { transform: rotate(120deg); }
  to { transform: rotate(480deg); }
}

@keyframes pulseCore {
  0%, 100% { transform: scale(0.9); opacity: 0.8; filter: drop-shadow(0 0 0px rgba(124,111,232,0)); }
  50% { transform: scale(1.3); opacity: 1; filter: drop-shadow(0 0 5px rgba(124,111,232,0.9)); }
}

.multiverse-logo {
  transform-origin: center;
}

.ring-group-1 {
  transform-origin: 12px 12px;
  animation: spinRing1 4.7s linear infinite;
}
.ring-group-2 {
  transform-origin: 12px 12px;
  animation: spinRing2 7.1s linear infinite;
}
.ring-group-3 {
  transform-origin: 12px 12px;
  animation: spinRing3 9.4s linear infinite reverse;
}

.core-dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: pulseCore 2.9s ease-in-out infinite;
}

.logo-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  backdrop-filter: blur(8px);
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.btn-icon:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
}

.btn-primary {
  padding: 7px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  backdrop-filter: blur(8px);
  font-family: inherit;
}

.btn-primary:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.35);
}

/* ===========================
   HERO
   =========================== */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 20px;
}

@keyframes slowPanZoom {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.05) translate(-1%, -1%); }
  100% { transform: scale(1) translate(0, 0); }
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('background.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: brightness(0.81);
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(14, 14, 24, 0.4) 0%,
    rgba(14, 14, 24, 0.2) 20%,
    rgba(14, 14, 24, 0.3) 45%,
    rgba(14, 14, 24, 0.9) 75%,
    #0e0e18 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: var(--navbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* ===========================
   HERO TITLE
   =========================== */
.hero-title {
  margin-top: 30px;
  text-align: center;
  font-size: 34px;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
}

.hero-title-accent {
  color: var(--purple-light);
}

.hero-subtitle {
  margin-top: 12px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

/* ===========================
   SEARCH BAR
   =========================== */
.search-container {
  margin-top: 20px;
  width: 100%;
  max-width: 560px;
  padding: 0 20px;
}

.search-bar {
  display: flex;
  align-items: center;
  background: rgba(18, 18, 28, 0.5);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.search-bar:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.15);
}

.search-bar:focus-within {
  transform: translateY(-4px);
  background: rgba(18, 18, 28, 0.8);
  border-color: rgba(124, 111, 232, 0.6);
  box-shadow: 0 16px 48px rgba(124, 111, 232, 0.25), 0 8px 24px rgba(0,0,0,0.6);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  padding: 12px 16px;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 6px;
  border-radius: 10px;
  border: none;
  background: rgba(124, 111, 232, 0.15);
  color: var(--purple-light);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.search-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.search-bar:focus-within .search-btn,
.search-btn:hover {
  background: var(--purple);
  color: white;
  box-shadow: 0 4px 12px rgba(124, 111, 232, 0.4);
}

.search-btn:hover svg {
  transform: scale(1.1) rotate(15deg);
}

.search-btn:active {
  transform: scale(0.92);
}

/* ===========================
   TRY SECTION
   =========================== */
.try-section {
  margin-top: 18px;
  width: 100%;
  max-width: 960px; /* Narrowed to center the 4 cards properly */
  padding: 0 20px;
}

.try-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.try-star {
  width: 14px;
  height: 14px;
}

/* ===========================
   CARDS GRID
   =========================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

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

.story-card {
  position: relative;
  background: #111115;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  text-align: left;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.story-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  border-color: rgba(124, 111, 232, 0.3);
}

.card-bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.25;
  z-index: 0;
  transition: opacity 0.3s, transform 0.4s ease-out;
}

.story-card:hover .card-bg-image {
  opacity: 0.35;
  transform: scale(1.05);
}

.card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0 10px;
  border-radius: 12px;
  text-transform: uppercase;
  color: #fff;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-history {
  background: rgba(124, 111, 232, 0.15);
  border-color: rgba(124, 111, 232, 0.3);
  color: #c4baff;
}
.tag-disaster {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
  color: #bae6fd;
}
.tag-science {
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.3);
  color: #a7f3d0;
}
.tag-culture {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fde68a;
}

.card-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  background: rgba(0, 0, 0, 0.5);
  padding: 0 8px;
  border-radius: 12px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.05);
  white-space: nowrap;
  flex-shrink: 0;
}

.card-time-badge svg {
  color: #fff;
}

.card-time-badge .dot {
  opacity: 0.4;
  margin: 0 2px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 12px;
}

.card-title {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  text-align: left;
  flex: 1;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.card-arrow-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.story-card:hover .card-arrow-btn {
  background: rgba(124, 111, 232, 0.4);
  color: #fff;
}

/* ===========================
   AUDIO BANNER
   =========================== */
.audio-banner {
  max-width: 70%;
  margin: 0 auto;
  background: rgba(14, 14, 22, 1);
  padding: 0 20px 16px;
}

.audio-banner-inner {
  max-width: 100%;
  margin: 0 auto;
  background: rgba(20, 20, 31, 0.9); /* Darkened by 10% */
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.audio-icon-wrap svg {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.audio-text {
  flex-shrink: 0;
}

.audio-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.audio-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.audio-wave {
  flex: 1;
  height: 40px;
  overflow: hidden;
}

.audio-wave svg {
  width: 100%;
  height: 40px;
}

.wave-line {
  stroke: #7C6FE8;
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.35;
}

.wave-line.active {
  opacity: 0.85;
  stroke: #9d92f0;
  animation: wavePulse 1.8s ease-in-out infinite alternate;
}

@keyframes wavePulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* ===========================
   FEATURES
   =========================== */
.features {
  background: var(--bg-dark);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  max-width: 1160px;
  margin: 0 auto;
  padding: 16px 20px 28px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 0 24px 0 0;
}

.feature-item:last-child {
  padding-right: 0;
}

.feature-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon svg {
  width: 40px;
  height: 40px;
}

.feature-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.feature-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===========================
   SCROLLBAR
   =========================== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(124,111,232,0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(124,111,232,0.5);
}

/* ===========================
   FOOTER
   =========================== */
.app-footer {
  width: 100%;
  height: 80px;
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 40px;
}

.app-footer-inner {
  width: 100%;
  max-width: 1160px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.35);
}

.footer-left {
  flex-shrink: 0;
}

.footer-center {
  text-align: center;
  max-width: 600px;
  line-height: 1.4;
  font-size: 10.5px;
}

.footer-right {
  flex-shrink: 0;
}

/* ===========================
   AUTH MODAL & DROPDOWN
   =========================== */
.hidden { display: none !important; }

.auth-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.auth-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal-content {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.auth-modal-overlay.active .auth-modal-content {
  transform: translateY(0);
}

.auth-modal-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #fff;
}
.auth-modal-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  margin-bottom: 24px;
}
.auth-modal-btn {
  display: block;
  width: 100%;
  background: #2AABEE;
  color: #fff;
  text-decoration: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.2s ease;
}
.auth-modal-btn:hover {
  background: #2298D4;
}

/* User Menu */
.user-menu {
  position: relative;
  display: inline-block;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #7C6FE8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.1);
}
.user-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  background: rgba(30, 30, 40, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  min-width: 180px;
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  overflow: hidden;
}
.user-menu.active .user-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.dropdown-item {
  display: block;
  padding: 12px 16px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s ease;
}
.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 0;
}

/* ===========================
   LOADING & RESULT SCREENS
   =========================== */
/* PREMIUM LOADING OVERLAY */
.premium-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(14, 15, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.8s ease-in-out;
}

.premium-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

/* SVG ANIMATION */
.timeline-svg {
  width: 80px;
  height: 80px;
  overflow: visible;
}

.timeline-svg .line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.timeline-svg .base {
  stroke: rgba(255, 255, 255, 0.4);
}

.timeline-svg .node {
  fill: #fff;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

.timeline-svg .branch {
  stroke: rgba(255, 255, 255, 0.4);
}

.timeline-svg .alt-glow {
  stroke: #c8a27c;
  stroke-width: 2.5;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawPath 3s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 10px rgba(200, 162, 124, 0.6));
}

.timeline-svg .particle {
  fill: #c8a27c;
  opacity: 0;
}

.timeline-svg .p1 { animation: floatUp 3s 0s linear infinite; }
.timeline-svg .p2 { animation: floatUp 3s 1s linear infinite; }
.timeline-svg .p3 { animation: floatUp 3s 2s linear infinite; }

@keyframes drawPath {
  0% { stroke-dashoffset: 100; }
  100% { stroke-dashoffset: 0; }
}

@keyframes floatUp {
  0% { transform: translateY(0); opacity: 0; }
  50% { opacity: 0.8; }
  100% { transform: translateY(-40px); opacity: 0; }
}

/* TEXT */
.loading-text-container {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.premium-loading-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #fff;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
  text-align: center;
}

.premium-loading-text.fade-out {
  opacity: 0;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 30, 35, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.9);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.result-screen {
  position: absolute;
  top: 0; left: 0; width: 100%; min-height: 100%;
  background: #18181b;
  z-index: 500;
  padding: 80px 20px 120px;
  display: flex;
  justify-content: center;
}
.result-container {
  width: 100%;
  max-width: 900px;
}
.btn-back {
  background: none; border: none; color: rgba(255,255,255,0.4);
  font-size: 15px; cursor: pointer; margin-bottom: 40px;
  transition: color 0.2s;
  padding: 0;
}
.btn-back:hover { color: #fff; }

.result-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}
.result-prompt {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
}
.result-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 48px;
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  max-width: 900px;
  margin: 0;
}
@media (max-width: 768px) {
  .result-title { font-size: 36px; }
}

.result-meta {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  align-items: center;
  margin: 8px 0 16px;
}

.btn-voice {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  color: #fff; border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 24px; border-radius: 40px; font-weight: 500;
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  transition: all 0.2s;
}
.btn-voice:hover {
  background: rgba(255, 255, 255, 0.1);
}

.image-wrapper {
  width: 100%;
  margin: 40px 0;
}

.skeleton-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: linear-gradient(90deg, #1e1e24 25%, #2a2a35 50%, #1e1e24 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 16px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.result-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.result-content {
  font-family: 'Lora', serif;
  font-size: 21px; 
  line-height: 1.85; 
  color: #d4d4d8; /* Softer text color for better reading */
  max-width: 800px;
  margin: 0 auto;
}
.result-content p { 
  margin-bottom: 36px; 
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

/* Drop cap for first paragraph */
.result-content > p:first-of-type::first-letter {
  font-family: 'Playfair Display', serif;
  font-size: 3.8em;
  float: left;
  line-height: 0.85;
  padding-right: 12px;
  padding-top: 8px;
  color: #7C6FE8;
  font-weight: 700;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-content h2, .result-content h3 { 
  margin: 50px 0 24px; 
  color: #fff; 
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
}
.result-content h2 { font-size: 28px; }

/* ===========================
   RESPONSIVE (MOBILE)
   =========================== */
@media (max-width: 992px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-title { font-size: 26px; padding: 0 16px; }
  .hero-subtitle { font-size: 14px; padding: 0 16px; margin-top: 16px; }
  .search-container { padding: 0 16px; margin-top: 24px; }
  
  .features {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 20px;
  }
  .feature-item { padding: 0; align-items: center; text-align: left; }
  
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 16px;
    gap: 12px;
  }
  
  .story-card {
    min-height: 170px;
    border-radius: 12px;
  }
  
  .card-content {
    padding: 10px;
  }
  
  .card-header, .card-footer {
    gap: 6px;
  }
  
  .card-tag {
    height: 18px;
    font-size: 8.5px;
    padding: 0 6px;
    border-radius: 8px;
  }
  
  .card-time-badge {
    height: 18px;
    font-size: 8.5px;
    padding: 0 6px;
    gap: 4px;
    border-radius: 8px;
  }
  
  .card-time-badge svg {
    width: 11px;
    height: 11px;
  }
  
  .card-title {
    font-size: 13px;
    line-height: 1.2;
  }
  
  .card-arrow-btn {
    width: 26px;
    height: 26px;
  }
  
  .card-arrow-btn svg {
    width: 14px;
    height: 14px;
  }
  
  .btn-how-it-works span { display: none; }
  .btn-how-it-works { padding: 8px !important; }
  .logo-text { font-size: 13px; max-width: 100px; line-height: 1.1; }
  
  .result-screen {
    padding: 32px 16px 60px;
  }
  .result-title {
    font-size: 26px;
    word-break: break-word;
  }
  .result-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .result-content {
    font-size: 18px;
    line-height: 1.6;
    padding: 0;
  }
  .result-content p {
    margin-bottom: 24px;
  }
  .result-content > p:first-of-type::first-letter {
    font-size: 3em;
    padding-right: 8px;
    padding-top: 6px;
  }
  
  .search-bar {
    flex-direction: column;
    padding: 6px;
    background: rgba(18, 18, 28, 0.7);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    backdrop-filter: blur(16px);
  }
  .search-input {
    width: 100%;
    margin-bottom: 6px;
    border-radius: 12px;
    background: transparent;
    border: none;
    padding: 16px;
    font-size: 16px; /* prevent iOS zoom */
  }
  .search-btn {
    width: 100%;
    margin: 0 !important;
    border-radius: 12px !important;
    justify-content: center;
    padding: 16px;
    font-size: 16px;
  }
  
  .navbar {
    padding: 0 16px;
  }
  .nav-logo { font-size: 20px; }
  .nav-links { gap: 12px; }
  .btn-outline { padding: 6px 12px; font-size: 13px; }

  .audio-banner {
    max-width: 100%;
    padding: 0 16px 16px;
  }
  .audio-banner-inner {
    flex-wrap: wrap;
    gap: 12px;
  }
  .audio-text {
    flex-shrink: 1;
  }
  .audio-wave {
    display: none; /* Hide wave on very small screens to save space */
  }

  .app-footer {
    height: auto;
    padding: 24px 16px;
  }
  .app-footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  .footer-center {
    font-size: 11px;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .btn-how-it-works {
    padding: 5px 10px;
    font-size: 11px;
    gap: 5px;
    border-radius: 16px;
    white-space: nowrap;
  }
  .btn-how-it-works svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
  }
  .nav-actions {
    gap: 6px;
  }
  .btn-primary {
    padding: 5px 12px;
    font-size: 12px;
  }
  .how-modal-card {
    padding: 20px 16px;
    border-radius: 18px;
    max-height: 92vh;
    overflow-y: auto;
  }
  .how-step-visual {
    height: 150px;
  }
  .how-modal-title {
    font-size: 18px;
  }
  .how-step-title {
    font-size: 15px;
  }
  .how-step-desc {
    font-size: 13px;
  }
}

@media (max-width: 400px) {
  .btn-how-it-works span {
    font-size: 10px;
  }
}
@keyframes spin {
  100% { transform: rotate(360deg); }
}
.spin {
  animation: spin 1s linear infinite;
}

/* ===========================
   HOW IT WORKS BUTTON & MODAL
   =========================== */
.btn-how-it-works {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid rgba(124, 111, 232, 0.3);
  background: rgba(124, 111, 232, 0.08);
  color: #e2e0ff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
  font-family: inherit;
}

.btn-how-it-works:hover {
  background: rgba(124, 111, 232, 0.2);
  border-color: rgba(124, 111, 232, 0.6);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(124, 111, 232, 0.3);
  transform: translateY(-1px);
}

.btn-how-it-works svg {
  color: var(--purple-light);
  transition: transform 0.25s ease;
}

.btn-how-it-works:hover svg {
  transform: scale(1.1);
}

/* Modal Overlay */
.how-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 5, 10, 0.75);
  backdrop-filter: blur(16px);
  opacity: 1;
  transition: opacity 0.3s ease;
}

.how-modal-overlay.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.how-modal-card {
  position: relative;
  width: 100%;
  max-width: 680px;
  background: rgba(18, 18, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(124, 111, 232, 0.15);
  overflow: hidden;
}

.how-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.how-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.how-modal-header {
  margin-bottom: 24px;
}

.how-step-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(124, 111, 232, 0.15);
  border: 1px solid rgba(124, 111, 232, 0.3);
  color: var(--purple-light);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.how-modal-title {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.how-step-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}

.how-step-visual {
  position: relative;
  width: 100%;
  height: 220px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.how-image-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.how-step-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.how-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18, 18, 28, 0.9), transparent 70%);
}

.how-icon-wrapper {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(18, 18, 28, 0.85);
  border: 1px solid rgba(124, 111, 232, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.how-step-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.how-step-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.how-step-desc {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
}

.how-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.how-dots {
  display: flex;
  gap: 8px;
}

.how-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.how-dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--purple-light);
}

.how-controls {
  display: flex;
  gap: 10px;
}

.how-btn-prev, .how-btn-next {
  padding: 8px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.how-btn-prev {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.how-btn-prev:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.how-btn-prev:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.how-btn-next {
  background: var(--purple);
  border: 1px solid var(--purple-light);
  color: #fff;
}

.how-btn-next:hover {
  background: var(--purple-dark);
  box-shadow: 0 0 12px rgba(124, 111, 232, 0.4);
}




/* DIVERGENCE & PROBABILITY BLOCKS */
.divergence-block {
    background: rgba(124, 111, 232, 0.1);
    border-left: 4px solid #7C6FE8;
    padding: 16px 20px;
    margin: 30px 0;
    border-radius: 0 12px 12px 0;
    font-family: 'Inter', sans-serif;
}
.divergence-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #7C6FE8;
    font-weight: 700;
    margin-bottom: 8px;
}
.divergence-text {
    font-size: 16px !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    color: #fff !important;
    font-weight: 500;
}

.probability-block {
    margin: 40px 0 20px;
    background: #111;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 24px;
    font-family: 'Inter', sans-serif;
}
.prob-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
}
.prob-label {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.prob-value {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    font-family: 'Fredoka', 'Inter', sans-serif;
}
.prob-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.prob-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7C6FE8, #4facfe);
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(124, 111, 232, 0.6);
    transition: width 1s ease-out;
}

/* DIVERGENCE PREMIUM */
.divergence-container {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(20,20,30,0.8), rgba(10,10,15,0.9));
    border: 1px solid rgba(124, 111, 232, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin: 40px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}
.div-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(124, 111, 232, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7C6FE8;
    margin-right: 20px;
    flex-shrink: 0;
}
.div-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #7C6FE8;
    font-weight: 700;
    margin-bottom: 4px;
}
.div-text {
    font-size: 16px !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    color: #fff !important;
    font-weight: 500;
}

/* PROBABILITY PREMIUM */
.prob-container {
    display: flex;
    align-items: center;
    background: #0d0d12;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 20px;
    margin: 40px 0;
}
.prob-circle {
    position: relative;
    width: 64px;
    height: 64px;
    margin-right: 20px;
    flex-shrink: 0;
}
.circular-chart {
    display: block;
    margin: 0;
    max-width: 100%;
    max-height: 100%;
}
.circle-bg {
    fill: none;
    stroke: rgba(255,255,255,0.05);
    stroke-width: 2.5;
}
.circle {
    fill: none;
    stroke: var(--theme);
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke-dasharray 1.5s ease-out;
    filter: drop-shadow(0 0 4px var(--theme));
}
.prob-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    font-family: 'Fredoka', 'Inter', sans-serif;
}
.prob-info {
    display: flex;
    flex-direction: column;
}
.prob-info .prob-label {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.prob-info .prob-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

/* NEUMORPHIC INDENTED BLOCKS */
.indented-block {
    background: rgba(0, 0, 0, 0.4);
    box-shadow: inset 0 4px 15px rgba(0,0,0,0.8), inset 0 1px 3px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 32px 0;
    border: 1px solid rgba(0,0,0,0.8);
}
.indented-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
    margin-bottom: 8px;
}
.indented-text {
    font-size: 16px !important;
    line-height: 1.6 !important;
    margin: 0 !important;
    color: rgba(255,255,255,0.9) !important;
    font-weight: 400;
}
.prob-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.prob-number {
    font-size: 32px;
    font-weight: 800;
    color: #7C6FE8;
    font-family: 'Fredoka', 'Inter', sans-serif;
    text-shadow: 0 0 20px rgba(124, 111, 232, 0.4);
}

/* Custom Language Switcher */
.custom-lang-wrapper {
  position: relative;
  margin-left: 10px;
  z-index: 100;
}
.custom-lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}
.custom-lang-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}
.custom-lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(20, 20, 25, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 6px;
  min-width: 130px;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}
.custom-lang-wrapper.active .custom-lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.custom-lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.custom-lang-option:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.custom-lang-option.active {
  background: rgba(124, 111, 232, 0.2);
  color: #7C6FE8;
  font-weight: 600;
}

/* --- Call Reality Banner at end of story --- */
.call-banner-container {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.call-banner {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(10px);
  transition: border-color 0.3s ease;
}

.call-banner:hover {
  border-color: rgba(124, 111, 232, 0.25);
}

.call-banner-icon {
  width: 40px;
  height: 40px;
  background: rgba(124, 111, 232, 0.1);
  border: 1px solid rgba(124, 111, 232, 0.25);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #a78bfa;
}

.call-banner-text {
  flex: 1;
  min-width: 200px;
}

.call-banner-text h4 {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 3px 0;
}

.call-banner-text p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  line-height: 1.4;
}

.btn-call-reality {
  background: rgba(124, 111, 232, 0.12);
  border: 1px solid rgba(124, 111, 232, 0.3);
  color: #a78bfa;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-call-reality:hover {
  background: rgba(124, 111, 232, 0.25);
  border-color: rgba(124, 111, 232, 0.5);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(124, 111, 232, 0.2);
}

/* --- Voice Call Modal --- */
.call-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 8, 12, 0.85);
  backdrop-filter: blur(20px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.call-modal-card {
  background: rgba(18, 18, 24, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(124, 111, 232, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.call-avatar-pulse {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(124, 111, 232, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border: 1px solid rgba(124, 111, 232, 0.3);
  color: #a78bfa;
}

.call-avatar-pulse::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  border: 1px solid rgba(124, 111, 232, 0.3);
  animation: callPulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes callPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.12); opacity: 0.2; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.call-avatar-icon {
  font-size: 32px;
}

.call-status-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 6px 0;
}

.call-status-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 16px 0;
  line-height: 1.4;
}

.call-timer {
  font-size: 24px;
  font-weight: 700;
  color: #a78bfa;
  letter-spacing: 2px;
  margin-bottom: 24px;
  font-family: monospace;
}

.btn-end-call {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 10px 28px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-end-call:hover {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

@media (max-width: 640px) {
  .call-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
    text-align: left;
  }
  .call-banner-text {
    min-width: 0;
  }
  .btn-call-reality {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
  }
}
