:root{
  --bg0:#050208;
  --bg1:#1a1024;
  --bg2:#35203b;
  --ink:#F4F1FF;
  --muted:#B8A9D8;
  --glass: rgba(255,255,255,.06);
  --glass2: rgba(255,255,255,.10);
  --stroke: rgba(255,255,255,.14);
  --accent:#9a6fb3;
  --accent2:#733381;
  --shadow: 0 20px 60px rgba(0,0,0,.55);
  --radius: 22px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(154,111,179,.22), transparent 60%),
    radial-gradient(900px 500px at 80% 30%, rgba(115,51,129,.18), transparent 60%),
    linear-gradient(160deg, var(--bg0), var(--bg1) 45%, var(--bg2));
  overflow-x:hidden;
}

.wrap{min-height:100%; display:flex; align-items:center; justify-content:center; padding:28px; position:relative;}
.bg-sigil{
  position:fixed; inset:0; pointer-events:none; opacity:.10;
  filter: blur(.2px);
  mix-blend-mode: screen;
}
.bg-sigil svg{width:100%; height:100%}

.card.shell{
  width:min(720px, 92vw);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  padding:28px;
  position:relative;
  animation: fadeIn .55s ease-out;
}

.hidden{display:none !important}

.brand .mark{
  font-weight:700;
  letter-spacing:.6px;
  font-size:28px;
}
.brand .tag{color:var(--muted); margin-top:8px; line-height:1.35}
.lead{font-size:18px; line-height:1.5; color:var(--ink); opacity:.95}
.muted{color:var(--muted)}
.tiny{font-size:12px}

.content{margin-top:18px}
.center{text-align:center}
.footer{margin-top:22px; border-top:1px solid rgba(255,255,255,.10); padding-top:14px}

.btn{
  border-radius: 999px;
  border:1px solid var(--stroke);
  padding:12px 18px;
  font-weight:600;
  cursor:pointer;
  background: rgba(255,255,255,.04);
  color:var(--ink);
  transition: transform .14s ease, background .14s ease, border-color .14s ease, opacity .14s ease;
}
.btn:hover{transform: translateY(-1px); background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.22)}
.btn:active{transform: translateY(0px); opacity:.92}
.btn.primary{
  background: linear-gradient(90deg, rgba(154,111,179,.35), rgba(115,51,129,.25));
  border-color: rgba(154,111,179,.55);
}
.btn.ghost{background: rgba(255,255,255,.03)}
.btn.subtle{background: rgba(154,111,179,.12); border-color: rgba(154,111,179,.25)}
.row{display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin-top:14px}

.btn:disabled{
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}
.btn:disabled:hover{
  background: rgba(255,255,255,.04);
  border-color: var(--stroke);
}

.cardstage{
  width:min(360px, 72vw);
  aspect-ratio: 2/3;
  margin: 10px auto 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.18);
  background: radial-gradient(circle at 30% 30%, rgba(154,111,179,.18), transparent 55%),
              linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,.2));
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
  overflow:hidden;
  position:relative;
  transform-style: preserve-3d;
}

.cardstage img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  opacity:0;
  transform: scale(1.02);
  transition: opacity .35s ease, transform .55s ease;
  pointer-events: none;
  user-select: none;
}
.cardstage.ready img{opacity:1; transform: scale(1.0)}

.cardtitle{font-size:18px; font-weight:650; margin-top:6px; color:rgba(244,241,255,.95)}
.story{
  margin-top:10px;
  line-height:1.65;
  color:rgba(244,241,255,.92);
  white-space:pre-wrap;
}

.qtitle{font-size:18px; font-weight:650; margin-bottom:14px}
.qopts{display:grid; gap:10px}
.qopt{
  border:1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  padding:14px 14px;
  background: rgba(255,255,255,.03);
  cursor:pointer;
  transition: transform .14s ease, background .14s ease, border-color .14s ease;
}
.qopt:hover{transform: translateY(-1px); background: rgba(255,255,255,.06); border-color: rgba(154,111,179,.35)}
.qopt .hint{color:var(--muted); font-size:13px; margin-top:6px}

.qbox{
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(10, 6, 18, .35);
  border-radius: 16px;
  padding: 14px;
}

/* Kindred (one-at-a-time) */
.discoverList{
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.discoverCard {
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(10, 6, 18, .55);
  width: min(560px, 100%);
  border-radius: 18px;
  padding: 16px;
}
.dcTop { display:flex; gap: 12px; align-items:center; }
.dcImg { width: 64px; height: 96px; object-fit: cover; border-radius: 10px; }
.dcTitle { font-weight: 700; }
.dcFinger { opacity:.8; font-size: .9rem; margin-top: 2px; }
.dcExcerpt { margin-top: 10px; opacity: .9; line-height: 1.35; }
.dcActions{
  margin-top: 14px;
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap: 10px;
}
.subhead { margin: 18px 0 8px; font-size: 1.05rem; opacity: .95; }
.btnGhost { opacity: .95; }

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

/* --- Softer reading / ND-friendly --- */
:root{
  --read: 1.08rem;
  --readLine: 1.75;
}

.story,
.dcExcerpt{
  font-size: var(--read);
  line-height: var(--readLine);
  letter-spacing: .01em;
}

.card.shell .content{
  margin-top: 14px;
}

/* Signature should feel like "yours" and separated */
.signatureBox{
  margin: 14px auto 0;
  max-width: 52ch;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  text-align: center;
}
.signatureLabel{
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.signatureValue{
  margin-top: 6px;
  font-weight: 650;
  letter-spacing: .04em;
}

/* More breathing room between controls and sections */
.doneActions, .row{
  margin-top: 18px;
  gap: 14px;
}

/* Kindred list: larger padding + simpler hierarchy */
.discoverCard{
  padding: 16px;
  border-radius: 18px;
}
.dcTop{
  gap: 14px;
}
.dcImg{
  width: 72px;
  height: 108px;
  border-radius: 12px;
}
.dcTitle{
  font-size: 1.05rem;
}
.dcFinger{
  margin-top: 6px;
  opacity: .8;
}

/* Buttons: a touch larger for motor / comfort */
.btn{
  padding: 13px 18px;
}

/* Keepsake page: softer / centered feel */
.keepsakeText{
  max-width: 58ch;
  margin: 14px auto 0;
  text-align: center;
  line-height: 1.7;
  font-size: 1.05rem;
  opacity: .92;
}

#lanternInbox { animation: fadeIn .25s ease-out; }

/* --- Consent modal (first-run) --- */
.vaConsent{
  position: fixed;
  inset: 0;
  z-index: 9998;

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 22px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);

  /* critical: allow scrolling when content exceeds viewport */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.vaConsent.hidden{
  display: none !important;
}

/* Modal panel */
.vaConsentPanel{
  width: min(680px, 92vw);
  margin: auto;

  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(12, 8, 20, .90);
  box-shadow: 0 22px 70px rgba(0,0,0,.6);

  padding: 18px 18px 16px;
  color: var(--ink, #F4F1FF);
  animation: fadeIn .35s ease-out;
}

/* Header */
.vaConsentTitle{
  font-weight: 750;
  letter-spacing: .04em;
  font-size: 20px;
}

.vaConsentTag{
  margin-top: 6px;
  opacity: .95;
}

/* Body */
.vaConsentBody{
  margin-top: 12px;
}

/* --- Mobile behavior --- */
@media (max-width: 520px){
  .vaConsent{
    align-items: flex-start; /* top-align so scrolling feels natural */
    padding: 14px;
  }

  .vaConsentPanel{
    width: 100%;
    margin: 14px auto;
  }
}