:root {
  --bg: #fbfdff;
  --card: #ffffff;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-2: #60a5fa;
  --gold: #d97706;
  --shadow-sm: 0 4px 16px rgba(16,24,40,0.06);
  --radius: 12px;
  --max-width: 1100px;
  --primary: #2563eb;
  --glass: rgba(255,255,255,0.06) !important;
  --glass2: rgba(0,0,0,0.35);
  --card-bg: rgba(255,255,255,0.03) !important;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", 'Roboto', sans-serif;
  background: linear-gradient(135deg, #1e0533 0%, #3b1b5e 40%, #6b3fa0 100%);
  background-repeat: no-repeat;
  background-attachment: scroll;
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.3;
  overflow-y: auto;
}

/* For mobile devices */
@media (max-width: 767px) {
  body {
    background-size: cover;
    background-attachment: scroll;
  }
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px;
}

.topbar {
  display: flex;
  justify-content: space-between; 
  align-items: center; 
  padding: 5px 20px;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 6px 12px rgba(255,219,77,0.2);
}

.date {
  flex: 1;
  text-align: center; 
}


.left, .right {
  flex: 0 0 auto; /
}

#welcomeSmall {
  font-weight: 600;
  font-size: clamp(12px, 3.8vw, 14px);
  color: #f0e6ff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
  opacity: 0;
  transition: opacity 0.8s ease 0.3s;
}


@media (max-width: 767px) {
  .topbar {
    padding: 5px 10px; /* Slightly smaller padding for mobile */
  }
  .date {
    font-size: 12px; /* Slightly smaller font for mobile */
    flex: 1; /* Ensures .date takes available space */
    text-align: center; /* Reinforces centering */
  }
}

.icon-btn {
 width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 0;
  font-size: 12px;
  font-family: inherit; /* ← KEY FIX */
  line-height: 1;

  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;

  appearance: none !important;
  -webkit-appearance: none !important;

  color-scheme: only light !important; /* ← DISABLES CHROME AUTO-CONTRAST */

  cursor: pointer;
  transition: transform .2s;
}


.icon-btn:hover { transform: scale(1.05); }

.menu-icon {
  width: 20px;
  height: 20px;
  fill: currentColor; /* adopts your icon-btn white color */
  display: block;
  pointer-events: none;
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 60px 0px 0px 0px;
  padding-bottom: 20px;
  border-radius: 17px;
  color:#fff;
}

.title h1 {
  font-size: 1.2rem;
  margin: 0;
  color: #fff !important;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

.title h2 {
  font-size: 1rem;
  margin: 4px 0;
  color: #fff !important;
}

.title p {
  margin: 4px 0 8px;
  font-size: 0.7rem;
  font-weight: 700;
}

.date {
  color: white;
  font-family: 'Roboto', sans-serif;
 
}

nav {
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: 1000px;
}

nav .personalized-btn {
  flex: 0 0 auto;
  min-width: 85px;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  color: #fff !important;
  padding: 0.5rem 0.7rem !important;
  border-radius: 0.4rem !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  margin: 0 2px 4px 2px !important;
  transition: all 0.3s ease !important;
  cursor: pointer;
}

nav .personalized-btn:hover,
nav .personalized-btn:focus {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: #7c3aed !important;
  transform: scale(1.05);
}

nav .personalized-btn:active {
  transform: scale(0.98);
}

main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px 12px;
}

@media (min-width: 980px) {
  main { grid-template-columns: 2fr 320px; }
}

#topWelcomeBar {
position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: 60px !important;
  padding: 12px 16px 0 !important;
  text-align: center !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  transform: none !important; 
  will-change: auto !important; 
  contain: none !important;
}

#welcomeSmall {
  font-weight: 600;
  font-size: clamp(12px, 3.8vw, 14px);
  color: #f0e6ff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
  opacity: 0;
  transition: opacity 0.8s ease 0.3s;
  margin-top: 0px !important;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
}

 .game-container { 
            max-width: 400px; 
            margin: 0 auto; 
            text-align: center; 
            background: linear-gradient(90deg, rgba(124,58, 237, 0.15), rgba(6, 182, 212, 0.25));
            border-radius: 20px; 
            box-shadow: 0 10px 30px rgba(0,0,0,0.1); 
            font-family: 'Inter', sans-serif;
            font-size: 14px;
            color: white;
        }
        .streak { 
            font-size: 1rem; 
            color: #ff6b6b; 
            margin-bottom: 10px; 
            font-weight: bold;
        }
        .stats { 
            display: flex; 
            justify-content: space-around; 
            margin-bottom: 20px; 
            background: #f8fafc; 
            padding: 5px; 
            border-radius: 12px; 
            border: 1px solid #e2e8f0;
            color: #0009;
        }
        .stat { 
            font-size: 0.8rem;
            font-weight: 600;
        }
        .round { 
            margin: 20px 0; 
            padding: 20px; 
            border-radius: 15px; 
            box-shadow: 0 5px 15px rgba(0,0,0,0.08); 
        }
        .round h3 { 
            margin-top: 0; 
            color: #fff; 
            font-size: 14px;
        }
        .round blockquote {
            font-style: italic;
            font-size: 14px;
            margin: 15px 0;
            padding: 15px;
            background: #f1f5f9;
            border-radius: 8px;
            color: #0009;
        }
        .hint { 
            color: #0008; 
            margin-top: 10px; 
            font-size: 12px;
            border-top: 1px solid white;
            padding: 10px;
        }
        button { 
            background: #2563eb; 
            color: white; 
            cursor: pointer; 
            transition: all 0.2s;
            box-sizing: border-box;
        }
        #round1, #round3, #round4, #round5 {
            display: block;
        }
        #round1 > .choices, #round3 > .choices, #round5 > .choices {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
        }
        #round1 > .choices > button, #round3 > .choices > button, #round5 > .choices > button {
            width: calc(50% - 4px);
            margin: 0;
        }
        #round4 > .choices {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
        }
        #round4 > .choices > button {
            width: calc(50% - 4px);
            margin: 0;
        }
        button:hover { 
            transform: translateY(-1px);
        }
        button.correct { 
            background: #10b981 !important; 
            animation: pulse 0.5s !important ; 
        }
        button.incorrect { 
            background: #ef4444 !important;
            animation: pulse 0.5s !important ; 
        }
        input[type="text"] {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            padding: 12px;
            border-radius: 8px;
            font-size: 1.2rem;
            text-align: center;
            width: 80%;
            max-width: 250px;
            margin: 10px auto;
            display: block;
        }
        input.incorrect {
            border-color: #ef4444;
            background: #fee2e2;
            animation: pulse 0.5s;
        }
		.action-btn {
  background: var(--glass) !important;
  color: #fff !important;
  padding: 8px 12px !important;
  border-radius: 1em !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  font-size: 0.7em !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: transform 0.2s !important;
  backdrop-filter: blur(6px) !important; /* From primary code */
  
}

.action-btn:hover {
  transform: scale(1.05);
  border-color: #7c3aed; /* From primary code */
}
        .completion { 
            display: none; 
            margin-top: 20px;
        }
        .completion.show { 
            display: block; 
            animation: fadeIn 0.5s; 
        }
        .completion h2 {
            color: #10b981;
            font-size: 1.8rem;
			padding-top: 20px;
        }
        .completion .hint {
            font-size: 1rem;
            margin: 15px 0;
        }
        .completion button {
            background: #7c3aed;
            margin: 20px;
			border: 1px;
			border-radius: 8px;
			padding: 10px 15px;
        }
        .completion button:hover {
            background: #6d28d9;
        }
        @keyframes pulse { 
            0% { transform: scale(1); } 
            50% { transform: scale(1.05); } 
            100% { transform: scale(1); } 
        }
        @keyframes fadeIn { 
            from { opacity: 0; } 
            to { opacity: 1; } 
        }
        .confetti { 
            position: fixed; 
            top: 0; 
            left: 0; 
            width: 100%; 
            height: 100%; 
            pointer-events: none; 
            z-index: 1000; 
        }
        .unscramble-display {
            font-size: 2rem;
            letter-spacing: 5px;
            font-weight: bold;
            margin: 10px 0;
            color: #2563eb;
        }
        .badge {
            font-size: 12px;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 999px;
            padding: 6px 10px;
            color: #0009;
            display: inline-block;
            margin: 4px;
        }
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(135deg, #1e0533 0%, #3b1b5e 40%, #6b3fa0 100%);
            display: flex;
            justify-content: space-around;
            padding: 0.2rem 0;
            border-top-left-radius: 15px;
            border-top-right-radius: 15px;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
            z-index: 1000;
			align-items: center;   
        }
        .bottom-nav button {
            background: none;
            border: none;
            color: white;
            font-size: 1rem;
            cursor: pointer;
        }


.card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 0 12px rgba(255,219,77,0.9);
  border: 1px solid rgba(2,6,23,0.03);
  background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.01)) !important;
  border: 1px solid rgba(255,255,255,0.03) !important;
  text-align: center !important;
  cursor: pointer !important;
  transition: transform 0.2s !important;
}

.card:hover {
  transform: translateY(-4px) !important;
}

.card h2 {
  color: #fff !important;
}

.card h2 {
  color: #fff !important;
}

.card-icon {
  width: 36px !important;
  height: 36px !important;
  margin-bottom: 6px !important;
}

.card-title {
  font-family: 'Inter', sans-serif !important;
  font-size: 0.95rem !important;
  margin: 6px 0 !important;
  color: #fff !important;
}

.card-teaser {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #fff !important;
}

.card-btn {
  background: #7c3aed !important;
  color: #fff !important;
  border: none !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  margin-top: 6px !important;
  cursor: pointer !important;
  font-family: 'Inter', sans-serif !important;
}

.card-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 12px !important;
  padding: 12px !important;
  margin-bottom: 20px !important;
  align-items: start !important;
  align-content: start !important; /* Prevent vertical stretching */
}

.section-content {
  display: none !important;
  border-radius: 10px !important;
  margin-bottom: 20px !important;
}

.section-content.active {
  display: block !important;
}

.share-btn {
  display: inline-block !important;
  margin-top: 6px !important;
  font-size: 0.75rem !important;
  color: var(--primary) !important;
  text-decoration: none !important;
}

.mood {
  padding: 12px !important;
  border-radius: 10px !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.01)) !important;
  text-align: center !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  border: 1px solid rgba(255,255,255,0.03) !important;
  text-decoration: none !important;
  color: inherit !important;
}

.sheet {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: 0 !important;
  background: linear-gradient(90deg, #7c3aed, #06b6d4) !important;
  color: #dbeafe !important;
  border-top-left-radius: 16px !important;
  border-top-right-radius: 16px !important;
  overflow: hidden !important;
  z-index: 70 !important;
  transition: height 0.32s cubic-bezier(0.2,0.9,0.25,1) !important;
  box-shadow: 0 -20px 60px rgba(2,6,23,0.6) !important;
}

.sheet.open {
  height: 80vh !important;
  padding-bottom: 20px !important;
  position: relative !important;
}

.sheet .handle {
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.handle .bar {
  width: 64px !important;
  height: 6px !important;
  background: rgba(255,255,255,0.08) !important;
  border-radius: 999px !important;
}

.sheet-content {
  padding: 14px !important;
  overflow: auto !important;
  height: calc(80vh - 36px) !important;
}

.verse-card {
  padding: 12px !important;
  border-radius: 10px !important;
  background: var(--card-bg) !important;
  border: 1px solid rgba(255,255,255,0.03) !important;
  margin-bottom: 10px !important;
}

.verse-card p {
  margin: 0 !important;
  font-style: italic !important;
}

.verse-card small {
  font-size: 0.8em !important;
  color: #fff8 !important;
}

.off-canvas {
  position: fixed;
  top: 0;
  left: -260px;
  width: 260px;
  height: 100%;
  background: linear-gradient(90deg, rgba(124,58,237,0.3), rgba(6,182,212,0.3));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* Safari support */ 
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
  transition: left 0.3s ease;
  z-index: 1001;
  padding-top: 60px;
}

.off-canvas ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

.off-canvas li {
  border-bottom: 1px solid #eee !important;
}

.off-canvas a {
  display: block !important;
  padding: 16px 20px !important;
  text-decoration: none !important;
  color: #fff !important;
}

.off-canvas a:hover {
  background-color: #f2f2f2 !important;
  color: #7c3aed !important;
}

.off-canvas .privacy-note {
  margin-top: 50px;
  opacity: 0.8;
}

.privacy-note a {
  padding: 0 !important;
  margin: 0 !important;
  font-size: 0.85em;
  text-decoration: underline;
}

.overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-color: rgba(0,0,0,0.3) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease !important;
  z-index: 1000 !important;
}

.off-canvas.active {
  left: 0 !important;
}

.overlay.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.menu-btn {
  background: none !important;
  border: none !important;
  color: #fff !important;
  font-size: 1.4rem !important;
  cursor: pointer !important;
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
}

.brand {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 8px !important;
}

.logo {
  font-size: 2.2rem !important;
  line-height: 1 !important;
  color: #fff !important;
  flex-shrink: 0 !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 12px !important;
  display: grid !important;
  place-items: center !important;
}

.scripture {
  font-family: 'Merriweather', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: #0b1220;
  line-height: 1.5;
  padding: 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fffbf7);
  box-shadow: 0 5px 16px rgba(0,0,0,0.03);
}

.facts {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.fact {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(2,6,23,0.03);
}

.fact h4 {
  margin: 0 0 5px 0;
  font-size: 0.95rem;
}

.timeline {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 4px;
  -webkit-overflow-scrolling: touch;
}

.timeline .item {
  min-width: 200px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(2,6,23,0.03);
  flex-shrink: 0;
}

section {
  scroll-margin-top: 50px;
}

.accordion {
  border-radius: 8px;
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid rgba(2,6,23,0.04);
}

.accordion-item:last-child {
  border-bottom: none;
}

.acc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  background: inherit;
  width: 100%;
  border: none;
  text-align: left;
}

.acc-title {
  font-weight: 700;
  color: #fff;
}

.acc-sub {
  font-size: 0.75rem;
  color: #0007;
}

.acc-body {
  padding: 10px 12px;
  background: #fff;
  display: none;
  border-radius: 8px;
}

.acc-body.open {
  display: block;
}

.ref {
  font-family: 'Merriweather', serif;
  font-size: 0.9rem;
  color: #0b1220;
  margin-top: 6px;
  background: #fffbea;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(217,160,30,0.08);
}

.verse-wrap {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.verse {
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  color: #fff;
  padding: 12px;
  border-radius: 10px;
  font-family: 'Merriweather', serif;
}

.verse small {
  display: block;
  opacity: 0.95;
  margin-top: 5px;
  font-size: 0.8rem;
}

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

a.btn {
    text-decoration: none !important;
}

.inline { display: inline-block; }
.small { font-size: 0.85rem; color: #fff9; }
.center { text-align: center; }

.pill {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(37,99,235,0.08);
  color: #fff !important;
  font-weight: 400;
}

.disciples-grid {
  display: grid;
  gap: 10px;
  margin-top: 6px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.disciples-grid .fact h4 {
  font-size: 0.95rem;
}

.disciples-grid .fact .small {
  font-size: 0.8rem;
}

.privacy-tooltip {
  position: relative; /* make ::after position relative to this element */
  cursor: pointer;
  font-size: 0.7rem;
  color: #fff9;
  vertical-align: middle;
}

/* Tooltip bubble */
.privacy-tooltip:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 125%; /* place above the text */
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: normal; /* allows wrapping if long */
  width: 200px;
  z-index: 10;
  opacity: 0;
  animation: fadeInTooltip 0.2s forwards;
}

/* optional small arrow below tooltip */
.privacy-tooltip:hover::before {
  content: "";
  position: absolute;
  bottom: 115%; /* just below the tooltip */
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

@keyframes fadeInTooltip {
  from { opacity: 0; transform: translate(-50%, 5px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* WIDGET */
.soul-streak-widget {
  background: var(--glass2);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 7px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  z-index: 9999;
  animation: soulPulse 2.5s infinite alternate;
}

.soul-streak-fire {
  font-size: 1.2rem;
}

.soul-streak-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.soul-streak-text {
  font-size: 12px;
  font-weight: 600;
}

.soul-streak-subtext {
  font-size: 10px;
  color: #eee;
}

@keyframes soulPulse {
  from { box-shadow: 0 0 6px rgba(255,219,77,0.2); }
  to { box-shadow: 0 0 16px rgba(255,219,77,0.8); }
}

/* POPUP (from secondary code) */
.soul-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.soul-popup.show {
  display: flex;
}

.soul-popup-content {
  background: linear-gradient(90deg, rgba(124,58, 237, 0.35), rgba(6, 182, 212, 0.55));
  color: #fff;
  padding: 22px 20px;
  border-radius: var(--radius);
  max-width: 320px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 0 30px rgba(255,219,77,0.3);
}

.btn-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.btn.share-btn {
  background: #fff;
  color: #000;
}

.btn.close-btn {
  background: rgba(124, 58, 237, 0.8);
  border: 0;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  gap: 8px;
  padding: 13px 17px;
  border-radius: 50px;
}

/* GRID (from secondary code) */
.soul-streak-grid {
  display: none;
  position: fixed;
  top: 45px;
  right: 10px;
  background: var(--glass2);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  z-index: 9999;
  padding: 14px;
  font-family: 'Inter', sans-serif;
  color: #fff;
}

.soul-streak-grid-content {
  display: grid;
  gap: 10px;
  text-align: center;
  font-size: 12px;
}

.soul-streak-grid-content h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

/* SIMULATION PANEL (from secondary code) */
.simulation-panel {
  position: fixed;
  top: 200px;
  right: 10px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 16px;
  font-family: 'Inter', sans-serif;
  color: #fff;
  z-index: 9998;
  box-shadow: 0 0 12px rgba(255,219,77,0.2);
}

.simulation-panel input {
  padding: 6px;
  border-radius: 6px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.simulation-panel button {
  padding: 8px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(90deg, var(--accent), #06b6d4);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

/* EMOJI BURST (from secondary code) */
.soul-emoji-burst {
  position: fixed;
  font-size: 2.2rem;
  z-index: 99999;
  pointer-events: none;
  opacity: 0.9;
}

footer {
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

@media (max-width: 768px) {
  .container { padding: 10px; }
  .header-inner { margin: 50px auto 0px auto; }
  .title h1 { font-size: 1.2rem; }
  .title h2 { font-size: 1rem; }
  .title p { font-size: 0.7rem; }
  nav .personalized-btn {
    min-width: 65px;
    font-size: 0.6rem;
    padding: 0.4rem 0.6rem;
  }
  main { padding: 12px 10px; }
  .card { padding: 12px; }
  .card-title { font-size: 0.9rem; }
  .card-teaser { font-size: 10px; }
  .card-btn { padding: 5px 10px; }
  .sheet.open { height: 85vh; }
  .sheet-content { height: calc(85vh - 36px); }
  .off-canvas { width: 260px; padding-top: 40px; }
  .off-canvas a { padding: 10px 16px; }
  .timeline { flex-direction: column; overflow-x: visible; }
  .timeline .item { min-width: auto; }
  .disciples-grid { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .card-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

@media (max-width: 480px) {
  .container { padding: 8px; }
  .icon-btn { width: 32px; height: 32px; font-size: 12px; }
  .header-inner { margin: 40px auto 0px auto; }
  .title h1 { font-size: 1.1rem; }
  .title h2 { font-size: 0.9rem; }
  .title p { font-size: 0.8rem; }
  nav { gap: 4px; }
  nav .personalized-btn { min-width: 55px; font-size: 0.55rem; padding: 0.35rem 0.5rem; }
  .card-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .card { padding: 10px; }
  .card-icon { width: 32px; height: 32px; }
  .card-title { font-size: 0.85rem; }
  .card-teaser { font-size: 9px; }
  .sheet .handle { height: 32px; }
  .sheet-content { padding: 12px; height: calc(85vh - 32px); }
  .verse-card { padding: 10px; }
  .verse-card small { font-size: 0.75em; }
  .off-canvas { width: 260px; }
  .off-canvas a { padding: 8px 14px; font-size: 0.9rem; }
  .menu-btn { font-size: 1.2rem; top: 6px; right: 6px; }
  .brand { gap: 8px; margin: 0 6px; }
  .logo { width: 40px; height: 40px; border-radius: 10px; font-size: 2rem; }
}
/* ===================== MODAL ===================== */
.sharecard-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(12px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0 12px;
  z-index: 99999;
  transition: opacity 0.25s ease;
}

.sharecard-modal.open {
  display: flex;
  opacity: 1;
}

/* ===================== SHEET ===================== */
.sharecard-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--bg1);
  border-radius: 32px 32px 0 0;
  box-shadow: 0 -20px 50px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 20px;
}

/* ===================== HEADER ===================== */
.sharecard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.sharecard-header .icon-button {
  font-size: 16px;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
}

/* ===================== PREVIEW CARD ===================== */
.sharecard-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  background: <?= htmlspecialchars($backgroundStyle); ?>;
  border-radius: 20px;
  overflow: hidden;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ===================== DRAGGABLE TEXT ===================== */
.sharecard-verse,
.sharecard-ref,
.emoji-node {
  position: absolute;
  cursor: grab;
  user-select: none;
  color: #fff;
  white-space: pre-wrap;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
  transition: transform 0.1s ease;
}

.sharecard-verse { font-size: 36px; font-weight: 700; line-height: 1.2; }
.sharecard-ref { font-size: 18px; bottom: 30px; opacity: 0.85;white-space: nowrap; text-align: center; }
.emoji-node { font-size: 40px; }

/* ===================== TOOLBAR ===================== */
.sharecard-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 24px;
  align-items: center;
  justify-content: flex-start;
  background: rgba(255,255,255,0.05);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.tool-btn {
  font-size: 18px;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  color: #fff;
  background: rgba(255,255,255,0.1);
  transition: background 0.2s;
}
.tool-btn.active, .tool-btn:hover {
  background: rgba(255,255,255,0.25);
}

/* ===================== PALETTES ===================== */
.palette {
  display: flex !important;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 10px;
  padding: 12px 24px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-height: 70px;
}
.palette::-webkit-scrollbar { display: none; }
.palette .emoji-btn,
.palette .gradient-swatch {
  flex-shrink: 0;
  min-width: 44px;
}

.emoji-btn {
  font-size: 28px;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
  transition: transform 0.1s ease;
}
.emoji-btn:hover { transform: scale(1.2); }

.gradient-swatch {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid #fff;
}

/* ===================== SHARE BUTTON ===================== */
.sharecard-controls {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.btn.primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.btn.primary:hover { transform: scale(1.05); }

.sharecard-watermark {
  position: absolute;
  bottom: 20px;
  right: 20px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.5;
  color: #fff;
  user-select: none;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  white-space: nowrap;
  line-height: 1;    
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 767px) {
    .sharecard-modal {
        align-items: flex-start; /* Start from top to ensure visibility */
        justify-content: center;
        padding: 16px;
        overflow-y: auto;
    }
    .sharecard-sheet {
        max-width: 95%;
        max-height: calc(100vh - 32px);
        margin-top: 16px; /* Ensure top is visible */
        border-radius: 12px;
        padding: 12px;
        box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
    }
    .sharecard-header {
        font-size: 13px;
		border-radius: 24px 24px 0 0;
    }
    .sharecard-preview {
        margin: 12px 0;
        border-radius: 10px;
    }
    .tool-btn {
        font-size: 13px;
        padding: 6px 12px;
    }
	.off-canvas { width: 260px; padding-top: 40px; }
    .off-canvas a { padding: 8px 14px; font-size: 0.9rem; }
}
@media (min-width: 768px) {
  .sharecard-modal {
    align-items: center; /* already good */
    justify-content: center;
    padding: 24px; /* increased from 0 24px */
    overflow-y: auto; /* CRITICAL: allow scroll if content overflows */
    -webkit-overflow-scrolling: touch;
  }

  /* Ensure modal fills full viewport height */
  .sharecard-modal::before {
    content: '';
    display: block;
    height: 100vh;
    width: 1px;
    margin-left: -1px;
    pointer-events: none;
  }

  .sharecard-sheet {
    border-radius: 24px;
    max-width: 520px;
    padding-bottom: 24px;
    box-shadow: 0 10px 60px rgba(0,0,0,0.4);
    max-height: calc(100vh - 48px); /* prevent overflow beyond viewport */
    overflow-y: auto; /* scroll inside sheet if needed */
    margin: auto; /* ensures centering */
  }

  .sharecard-header {
    border-radius: 24px 24px 0 0;
    font-size: 16px;
  }

  .sharecard-preview {
    aspect-ratio: 16/9;
    margin: 24px 0;
    border-radius: 16px;
  }

  .sharecard-toolbar {
    justify-content: center;
  }

  .tool-btn {
    font-size: 16px;
  }
  
}

@media (min-width: 1024px) {
  .sharecard-sheet {
    max-width: 640px;
    padding: 32px;
    border-radius: 20px;
    max-height: calc(100vh - 64px); /* more padding */
  }

  .sharecard-verse { font-size: 42px; }
  .sharecard-ref { font-size: 20px; }
  .emoji-node { font-size: 48px; }
}
.tap-card::after {
    content: "Tap to Meet Jesus\A Know • Follow • Reflect";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
	border-radius: var(--radius);
    color: #fff8e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    white-space: pre-line;
    text-shadow: 0 0 8px #ffe9a9, 0 0 16px #ffdd75;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    z-index: 3;
    padding: 20px;
    pointer-events: none;
    height: auto;
    animation: pulseLeaf 2s infinite;
}
@keyframes pulseLeaf {
    0%, 100% {
        content: "Tap to Meet Jesus\A Know • Follow • Reflect";
        white-space: pre-line;
    }
    50% {
        content: "Scroll & Tap His Story";
    }
}
.scripture-footer {
    text-align: center;
    font-size: 0.75rem;
    color: #fff;
    padding: 25px 10px;
    margin: 40px auto 20px auto;
}
.scoreboard-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  padding: 5px 20px;
  margin: 15px auto;
  max-width: 380px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  text-align: center;
  font-family: 'Poppins', sans-serif;
}
.scoreboard-card h3 {
  margin: 10px;
  font-weight: 600;
  font-size: 1rem;
}
.scoreboard-stats {
  display: flex;
  justify-content: space-around;
  padding: 10px;
}
.score-item .label {
  display: block;
  font-size: 0.8rem;
  color: #444;
}
.score-item .value {
  font-size: 1rem;
  font-weight: 600;
}
.faith-message {
  font-size: 0.9rem;
  color: #555;
  background: #fff7c2;
  border-radius: 10px;
  padding: 8px 10px;
}
