@font-face {
  font-family: 'CameraPlainVariable';
  src: url('../fonts/CameraPlainVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.25);
  --bg: #050505;
  --bg-card: #0f0f0f;
  --ink: #f5f0e6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.font-display {
  font-family: 'Playfair Display', 'CameraPlainVariable', serif;
}

a { color: inherit; }

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255,255,255,0.05);
  border-right: 1px solid rgba(255,255,255,0.05);
  background: linear-gradient(to bottom, #0a0a0a, #050505);
  overflow: hidden;
}

#app::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.7;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(212,175,55,0.10), transparent 60%),
    radial-gradient(600px 400px at 50% 110%, rgba(212,175,55,0.06), transparent 60%);
}

main {
  flex: 1;
  padding-bottom: 7rem;
  position: relative;
  z-index: 1;
}

.screen { padding: 2.5rem 1.5rem 1.5rem; animation: fadein .5s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: rgba(212,175,55,0.7);
  margin: 0;
}

h1.title {
  margin: 0.5rem 0 0;
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.2;
}
h1.title .shimmer { color: var(--gold); }
h1.title .sub { display:block; color: rgba(255,255,255,0.9); font-family: 'Playfair Display', serif; }

.top-row { display: flex; align-items: flex-start; justify-content: space-between; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(212,175,55,0.3);
  background: rgba(255,255,255,0.03);
  color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn svg { width: 18px; height: 18px; }

.card {
  border-radius: 24px;
  border: 1px solid rgba(212,175,55,0.25);
  background: linear-gradient(to bottom right, #171310, #111111, #0b0b0b);
  padding: 1.5rem;
  margin-top: 2rem;
}
.card.plain {
  border: 1px solid rgba(255,255,255,0.1);
  background: #0f0f0f;
}

.card-row { display: flex; align-items: center; justify-content: space-between; }
.card-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--gold);
}
.card-label.dim { color: rgba(255,255,255,0.5); }

.verse-text {
  margin-top: 1rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  line-height: 1.5;
  color: rgba(245,240,230,0.95);
}
.verse-src {
  margin-top: 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: rgba(212,175,55,0.8);
}

.streak-flame {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #f5d97a, #d4af37 55%, #8a6a1b);
  box-shadow: 0 0 40px rgba(212,175,55,0.5);
}
.streak-flame svg { width: 26px; height: 26px; color: #1a1a1a; }
.streak-count { margin-top: 0.5rem; font-size: 2.4rem; color: var(--gold); font-family: 'Playfair Display', serif; }
.streak-note { margin-top: 0.25rem; font-size: 0.75rem; color: rgba(255,255,255,0.5); }

.footer-line {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

nav.tabbar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  border-top: 1px solid rgba(212,175,55,0.15);
  background: rgba(5,5,5,0.9);
  backdrop-filter: blur(20px);
  z-index: 30;
}
.tab-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom));
}
.tab-btn {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  padding: 0.5rem 0;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.4);
}
.tab-btn svg { width: 18px; height: 18px; }
.tab-btn.active { color: var(--gold); }
.tab-btn.active::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 2rem; height: 2px; border-radius: 999px;
  background: var(--gold);
}

/* Panic / emergency screen */
.panic-hero {
  min-height: calc(100dvh - 7rem);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 1.5rem;
}
.panic-circle {
  width: 220px; height: 220px;
  border-radius: 999px;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, #fff2c0, #f5d97a 30%, #d4af37 60%, #8a6a1b 100%);
  box-shadow: 0 0 60px rgba(212,175,55,0.5);
  cursor: pointer;
  color: #1a1a1a;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
}
.prayer-text {
  margin-top: 2.5rem;
  max-width: 20rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.9);
}
.breathe-word {
  font-size: 1.6rem;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
}

/* Chants / audio list */
.category-pills { display: flex; gap: 0.5rem; margin-top: 1.5rem; }
.pill {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(212,175,55,0.3);
  background: rgba(255,255,255,0.03);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
}
.pill.active { background: var(--gold); color: #111; border-color: var(--gold); }

.track-row {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.9rem 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
}
.track-row:hover { background: rgba(255,255,255,0.02); }
.track-art {
  width: 3rem; height: 3rem; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(212,175,55,0.4), rgba(212,175,55,0.1));
  color: var(--gold);
}
.track-art svg { width: 18px; height: 18px; }
.track-meta { min-width: 0; flex: 1; }
.track-title { font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-sub { font-size: 0.75rem; color: rgba(255,255,255,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.player-bar {
  position: fixed; bottom: 4.6rem; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  padding: 0.75rem 1rem;
  background: rgba(15,15,15,0.95);
  border-top: 1px solid rgba(212,175,55,0.15);
  backdrop-filter: blur(20px);
  z-index: 25;
  display: none;
  align-items: center;
  gap: 0.75rem;
}
.player-bar.show { display: flex; }
.player-bar .track-meta { flex: 1; }
.play-toggle {
  width: 40px; height: 40px; border-radius: 999px;
  background: var(--gold); color: #111; border: none;
  display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
}
.play-toggle svg { width: 18px; height: 18px; }

/* Numbers / decoder */
.digit-input {
  margin-top: 1.5rem;
  width: 100%;
  padding: 1rem;
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.2em;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 16px;
  color: var(--ink);
  font-family: 'Playfair Display', serif;
}
.digit-input::placeholder { color: rgba(255,255,255,0.25); }
.decode-btn {
  margin-top: 1rem; width: 100%;
  padding: 0.9rem;
  border-radius: 999px;
  border: none;
  background: var(--gold);
  color: #111;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.decode-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.result-card { margin-top: 1.5rem; }
.result-title { font-size: 1.6rem; color: var(--gold); font-family: 'Playfair Display', serif; }
.result-meaning { margin-top: 0.75rem; font-size: 1rem; line-height: 1.6; color: rgba(255,255,255,0.9); }
.result-block { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.08); }
.result-block .label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.2em; color: rgba(212,175,55,0.8); }
.result-block .value { margin-top: 0.35rem; font-size: 0.95rem; color: rgba(255,255,255,0.85); }

.most-seen { margin-top: 2rem; }
.most-seen h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.15em; color: rgba(255,255,255,0.5); font-weight: 500; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.chip {
  padding: 0.5rem 0.9rem; border-radius: 999px;
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.25);
  color: var(--gold); font-size: 0.85rem; cursor: pointer;
}

/* settings */
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.settings-row .label { font-size: 0.95rem; }
.settings-row .desc { font-size: 0.75rem; color: rgba(255,255,255,0.45); margin-top: 0.15rem; }
.switch {
  width: 44px; height: 26px; border-radius: 999px;
  background: rgba(255,255,255,0.1);
  position: relative; cursor: pointer; border: none; flex-shrink: 0;
}
.switch.on { background: var(--gold); }
.switch .knob {
  position: absolute; top: 2px; left: 2px;
  width: 22px; height: 22px; border-radius: 999px; background: #fff;
  transition: transform .2s ease;
}
.switch.on .knob { transform: translateX(18px); }

.back-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: rgba(212,175,55,0.8);
  font-size: 0.85rem;
  background: none; border: none; cursor: pointer;
  padding: 0; margin-bottom: 1rem;
}

.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: none;
  align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.overlay.show { display: flex; }
.sheet {
  width: 100%; max-width: 480px;
  background: #0f0f0f;
  border-top: 1px solid rgba(212,175,55,0.2);
  border-radius: 24px 24px 0 0;
  padding: 1.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom));
  max-height: 80dvh; overflow-y: auto;
}
.sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: rgba(255,255,255,0.15); margin: 0 auto 1rem; }

@media (min-width: 480px) {
  #app { border-radius: 20px; margin: 1rem auto; min-height: calc(100dvh - 2rem); box-shadow: 0 40px 80px rgba(0,0,0,0.5); }
}
