:root {
  --bg: #0d0d0d;
  --bg-card: #161616;
  --bg-elevated: #1c1c1c;
  --gold: #c9a227;
  --gold-soft: #d4af37;
  --gold-dim: rgba(201, 162, 39, 0.15);
  --silver: #c0c0c0;
  --text: #f0ece4;
  --text-muted: #a8a29a;
  --border: rgba(201, 162, 39, 0.25);
  --success: #4ade80;
  --error: #f87171;
  --radius: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* Header */
.header {
  padding: 12px 20px 8px;
  text-align: center;
  background: linear-gradient(to bottom, #111 0%, var(--bg) 100%);
  position: sticky;
  top: 0;
  z-index: 20;
}

.logo {
  max-width: 280px;
  width: 85%;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 0 12px rgba(201, 162, 39, 0.25));
}

/* Main */
.main {
  flex: 1;
  padding: 8px 20px 100px;
  overflow-y: auto;
}

.page {
  display: none;
  animation: fadeIn 0.35s ease;
}

.page.active {
  display: block;
}

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

/* Home */
.welcome-card {
  text-align: center;
  padding: 16px 0 24px;
}

.greeting {
  font-size: 0.9rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.welcome-card h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.verse-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 16px;
  text-align: center;
}

.verse-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 14px;
}

.verse-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-weight: 500;
  font-style: italic;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 12px;
}

.verse-ref {
  display: block;
  font-size: 0.9rem;
  color: var(--gold-soft);
  font-style: normal;
  font-family: 'Inter', sans-serif;
}

.encourage-card {
  background: var(--gold-dim);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 24px;
  text-align: center;
}

.encourage-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Buttons */
.primary-btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #c9a227, #a88b1f);
  color: #0d0d0d;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-align: center;
  text-decoration: none;
}

.primary-btn:active {
  transform: scale(0.98);
}

.primary-btn.small {
  padding: 10px 18px;
  font-size: 0.9rem;
  width: auto;
}

.secondary-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 14px 24px;
  background: transparent;
  color: var(--gold);
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}

.text-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 12px;
}

/* Trivia */
.trivia-header {
  text-align: center;
  margin-bottom: 20px;
}

.trivia-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem;
  margin-bottom: 10px;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stats strong {
  color: var(--gold);
}

.trivia-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
}

.trivia-intro {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.progress-bar {
  height: 4px;
  background: #2a2a2a;
  border-radius: 2px;
  margin-bottom: 12px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.3s ease;
}

.question-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.question {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.4;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  color: var(--text);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.option-btn:active {
  transform: scale(0.99);
}

.option-btn.correct {
  border-color: var(--success);
  background: rgba(74, 222, 128, 0.12);
}

.option-btn.wrong {
  border-color: var(--error);
  background: rgba(248, 113, 113, 0.12);
}

.option-btn:disabled {
  cursor: default;
}

.feedback {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.feedback.correct {
  background: rgba(74, 222, 128, 0.12);
  color: var(--success);
}

.feedback.wrong {
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

.end-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 8px;
}

.end-score {
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.end-score strong {
  color: var(--gold);
}

.end-message {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Connect */
#connect h2,
#faith h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem;
  text-align: center;
  margin-bottom: 8px;
}

.section-intro {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.link-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s;
}

.link-card:active {
  background: var(--bg-elevated);
}

.link-icon {
  font-size: 1.4rem;
}

.prayer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
  margin-bottom: 20px;
}

.prayer-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.prayer-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 18px;
  line-height: 1.5;
}

.contact-info {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

/* Faith */
.faith-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
}

.lead {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 24px;
  color: var(--gold-soft);
}

.faith-point {
  margin-bottom: 22px;
}

.faith-point h3 {
  font-size: 1.05rem;
  color: var(--gold);
  margin-bottom: 6px;
}

.faith-point p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.faith-verse {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-style: italic;
  text-align: center;
  color: var(--text);
}

.faith-verse cite {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  font-style: normal;
  color: var(--gold);
  font-family: 'Inter', sans-serif;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  background: #111;
  border-top: 1px solid #222;
  padding: 8px 0 calc(8px + var(--safe-bottom));
  z-index: 30;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 6px 0;
  cursor: pointer;
  transition: color 0.2s;
}

.nav-btn.active {
  color: var(--gold);
}

.nav-icon {
  font-size: 1.25rem;
}

/* Install Banner */
.install-banner {
  position: fixed;
  bottom: calc(70px + var(--safe-bottom));
  left: 16px;
  right: 16px;
  max-width: 448px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  z-index: 40;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.install-banner p {
  font-size: 0.9rem;
  margin-bottom: 12px;
  color: var(--text);
}

.install-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Utility */
@media (min-width: 480px) {
  .header {
    padding-top: 20px;
  }
}
