:root {
  --bg: #0c0a09;
  --bg-soft: #1c1917;
  --ink: #faf7f2;
  --ink-dim: rgba(250, 247, 242, 0.62);
  --gold: #d4a574;
  --gold-soft: rgba(212, 165, 116, 0.18);
  --line: rgba(250, 247, 242, 0.12);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-ui: "Outfit", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--gold); }

/* Splash */
.splash {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(212,165,116,.18), transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(90,60,40,.35), transparent 50%),
    var(--bg);
  transition: opacity .5s ease, visibility .5s;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { text-align: center; padding: 2rem; max-width: 22rem; animation: rise .8s ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.cross {
  font-size: 2.4rem; color: var(--gold);
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 24px rgba(212,165,116,.45));
  animation: glow 3s ease-in-out infinite alternate;
}
@keyframes glow {
  from { filter: drop-shadow(0 0 12px rgba(212,165,116,.3)); }
  to { filter: drop-shadow(0 0 28px rgba(212,165,116,.7)); }
}
.splash h1 {
  font-family: var(--font-display);
  font-weight: 600; font-size: 2.6rem; letter-spacing: -.02em;
  margin-bottom: .75rem;
}
.splash p { color: var(--ink-dim); line-height: 1.55; margin-bottom: 1.75rem; font-weight: 300; }
.splash-credit { margin-top: 1.5rem !important; font-size: .7rem; opacity: .55; margin-bottom: 0 !important; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; max-width: 16rem;
  padding: .95rem 1.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #e8c39a, #c4894a);
  color: #1c1208;
  font-weight: 600; font-size: .95rem;
  letter-spacing: .02em;
  box-shadow: 0 10px 40px rgba(212,165,116,.28);
  transition: transform .15s ease, filter .15s;
}
.btn-primary:active { transform: scale(.97); }
.btn-ghost {
  display: block; width: 100%;
  margin-top: .75rem; padding: .85rem;
  color: var(--ink-dim); font-size: .9rem;
}

/* Topbar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + .65rem) 1rem .65rem;
  background: linear-gradient(to bottom, rgba(12,10,9,.92), rgba(12,10,9,0));
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { text-align: center; }
.brand-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 600;
  letter-spacing: .04em;
}
.streak {
  display: inline-flex; gap: .2rem; align-items: center;
  margin-top: .15rem; font-size: .72rem;
  color: var(--gold); background: var(--gold-soft);
  padding: .15rem .5rem; border-radius: 999px;
}
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(8px);
  color: var(--ink);
  border: 1px solid var(--line);
}

/* Feed */
.feed {
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.card {
  position: relative;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 5.5rem 1.6rem 6.5rem;
  overflow: hidden;
}
.card-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  transition: transform 8s ease-out;
}
.card:nth-child(odd) .card-bg { transform: scale(1.05); }
.card-bg::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(12,10,9,.55) 0%, rgba(12,10,9,.35) 35%, rgba(12,10,9,.72) 100%),
    radial-gradient(ellipse at 30% 20%, rgba(212,165,116,.12), transparent 50%);
}
.card-content {
  position: relative; z-index: 1;
  animation: cardIn .55s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
.card-tema {
  display: inline-block;
  font-size: .68rem; font-weight: 500; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 1.1rem;
  padding: .3rem .7rem;
  border: 1px solid rgba(212,165,116,.35);
  border-radius: 999px;
  background: rgba(212,165,116,.08);
}
.card-texto {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 5.6vw, 2.05rem);
  font-weight: 400; font-style: italic;
  line-height: 1.35;
  letter-spacing: -.01em;
  margin-bottom: 1.4rem;
  text-wrap: balance;
}
.card-ref {
  font-size: .85rem; font-weight: 500;
  letter-spacing: .06em; color: var(--ink-dim);
  text-transform: uppercase;
}
.card-actions {
  position: absolute; z-index: 2;
  right: 1.1rem; bottom: calc(var(--safe-bottom) + 1.6rem);
  display: flex; flex-direction: column; gap: .7rem;
}
.action {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  transition: transform .15s, background .15s;
}
.action:active { transform: scale(.92); }
.action.loved {
  background: rgba(212,165,116,.25);
  color: var(--gold);
  border-color: rgba(212,165,116,.45);
}
.action svg { width: 22px; height: 22px; }

/* Hint */
.scroll-hint {
  position: fixed; z-index: 30;
  left: 0; right: 0; bottom: calc(var(--safe-bottom) + 1.2rem);
  text-align: center;
  color: var(--ink-dim); font-size: .75rem; letter-spacing: .08em;
  text-transform: uppercase;
  animation: bounce 1.6s ease-in-out infinite;
  pointer-events: none;
  transition: opacity .4s;
}
.scroll-hint.hide { opacity: 0; }
.chevron { font-size: 1.1rem; margin-top: .15rem; opacity: .7; transform: rotate(180deg); }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Sheets */
.sheet {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet[hidden] { display: none !important; }
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-panel {
  position: relative;
  width: min(100%, 440px);
  max-height: 82dvh;
  overflow: auto;
  background: linear-gradient(180deg, #1a1614, #120f0d);
  border-radius: 1.4rem 1.4rem 0 0;
  padding: .6rem 1.35rem calc(var(--safe-bottom) + 1.4rem);
  border: 1px solid var(--line);
  border-bottom: 0;
  animation: sheetUp .32s cubic-bezier(.2,.8,.2,1);
}
@keyframes sheetUp {
  from { transform: translateY(40%); opacity: .5; }
  to { transform: none; opacity: 1; }
}
.sheet-tall { max-height: 88dvh; }
.sheet-handle {
  width: 40px; height: 4px; border-radius: 99px;
  background: rgba(255,255,255,.2);
  margin: .35rem auto 1.1rem;
}
.sheet-panel h2 {
  font-family: var(--font-display);
  font-size: 1.7rem; font-weight: 600;
  margin-bottom: .35rem;
}
.sheet-sub { color: var(--ink-dim); font-size: .9rem; margin-bottom: 1.2rem; }

.theme-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .65rem;
}
.theme-chip {
  padding: 1rem .9rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  text-align: left;
  transition: border-color .15s, background .15s;
}
.theme-chip.active, .theme-chip:active {
  border-color: var(--gold);
  background: var(--gold-soft);
}
.theme-chip .emoji { font-size: 1.25rem; display: block; margin-bottom: .35rem; }
.theme-chip .label { font-weight: 500; font-size: .92rem; }
.theme-chip .count { font-size: .72rem; color: var(--ink-dim); margin-top: .2rem; }

.menu-list { display: flex; flex-direction: column; gap: .35rem; margin-top: .8rem; }
.menu-list button {
  text-align: left; padding: 1rem 1rem;
  border-radius: .9rem; background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  font-size: .95rem;
}

.favs-list { margin-top: .8rem; display: flex; flex-direction: column; gap: .6rem; }
.fav-item {
  padding: 1rem; border-radius: 1rem;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
}
.fav-item .t { font-family: var(--font-display); font-style: italic; font-size: 1.05rem; line-height: 1.35; }
.fav-item .r { margin-top: .45rem; font-size: .75rem; color: var(--gold); letter-spacing: .04em; }
.favs-empty { color: var(--ink-dim); padding: 1.5rem 0; text-align: center; }

/* Premium */
.sheet-premium { text-align: center; }
.premium-badge {
  display: inline-block;
  margin: .2rem auto 1rem;
  padding: .3rem .8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(232,195,154,.25), rgba(196,137,74,.2));
  color: var(--gold); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid rgba(212,165,116,.35);
}
.sheet-premium h2 { line-height: 1.15; margin-bottom: 1rem; }
.premium-perks {
  list-style: none; text-align: left;
  margin: 0 auto 1.4rem; max-width: 20rem;
}
.premium-perks li {
  position: relative; padding: .45rem 0 .45rem 1.4rem;
  color: var(--ink-dim); font-size: .9rem; line-height: 1.4;
}
.premium-perks li::before {
  content: "✦"; position: absolute; left: 0; color: var(--gold); font-size: .75rem; top: .55rem;
}
.price-block { margin-bottom: 1.2rem; }
.price-main {
  font-family: var(--font-display);
  font-size: 2.4rem; font-weight: 600; color: var(--ink);
}
.price-main span { font-size: 1rem; color: var(--ink-dim); font-family: var(--font-ui); font-weight: 400; }
.price-alt { font-size: .8rem; color: var(--ink-dim); margin-top: .25rem; }
.fake-note {
  margin-top: 1rem; padding: .9rem 1rem;
  background: var(--gold-soft); border-radius: .8rem;
  color: var(--gold); font-size: .82rem; line-height: 1.45;
}
.about-p { color: var(--ink-dim); font-size: .9rem; line-height: 1.55; margin-bottom: .9rem; }

/* Toast */
.toast {
  position: fixed; z-index: 80;
  left: 50%; bottom: calc(var(--safe-bottom) + 2rem);
  transform: translateX(-50%);
  padding: .7rem 1.1rem;
  background: rgba(28,25,23,.95);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .85rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  animation: rise .3s ease;
}
.toast[hidden] { display: none; }

/* Gradients per theme index */
.bg-0 { background: linear-gradient(160deg, #1a1420 0%, #0c0a09 40%, #1e1810 100%); }
.bg-1 { background: linear-gradient(160deg, #101820 0%, #0c0a09 45%, #1a1410 100%); }
.bg-2 { background: linear-gradient(160deg, #1c1210 0%, #0c0a09 40%, #142018 100%); }
.bg-3 { background: linear-gradient(160deg, #181410 0%, #0c0a09 40%, #201818 100%); }
.bg-4 { background: linear-gradient(160deg, #101418 0%, #0c0a09 45%, #1c1814 100%); }
.bg-5 { background: linear-gradient(160deg, #14101c 0%, #0c0a09 40%, #181410 100%); }

/* Soft grain overlay via SVG noise on body::before */
body::before {
  content: "";
  pointer-events: none;
  position: fixed; inset: 0; z-index: 90; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.card-texto.long { font-size: clamp(1.25rem, 4.6vw, 1.7rem); line-height: 1.4; }
.card-content { max-width: 34rem; margin: 0 auto; }
