:root {
  --void: #060a12;
  --sky-deep: #0a1220;
  --sky-mid: #121c32;
  --sky-high: #1a2744;
  --night: #162238;
  --card: rgba(16, 26, 46, 0.72);
  --card-solid: #142036;
  --border: rgba(150, 180, 230, 0.14);
  --border-warm: rgba(232, 168, 74, 0.4);
  --border-soft: rgba(180, 200, 240, 0.08);
  --text: #eef3fb;
  --text-soft: #d5deec;
  --text-muted: #8b9bb4;
  --amber: #e8a84a;
  --amber-soft: #d4923a;
  --amber-deep: #b87828;
  --honey: #f0c070;
  --rose: #e8a090;
  --moon: #c8d6f0;
  --mist: rgba(160, 190, 240, 0.08);
  --flame: #ffb347;
  --flame-mid: #ff8c42;
  --flame-core: #fff6d6;
  --danger: #c45c5c;
  --radius: 22px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-ui: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--void);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  position: relative;
}

/* ═══ Atmosphere: rich blue night sky ═══ */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 110% 70% at 50% -12%, #243668 0%, transparent 52%),
    radial-gradient(ellipse 60% 50% at 12% 28%, rgba(70, 110, 200, 0.22) 0%, transparent 58%),
    radial-gradient(ellipse 55% 45% at 88% 18%, rgba(90, 70, 180, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 80% 40% at 50% 100%, rgba(20, 40, 80, 0.55) 0%, transparent 60%),
    linear-gradient(180deg, #0a1220 0%, #0d1628 28%, #121c32 58%, #0b1322 100%);
  overflow: hidden;
}

.sky-depth {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 45% 35% at 70% 12%, rgba(120, 160, 255, 0.1) 0%, transparent 70%),
    radial-gradient(ellipse 35% 30% at 25% 55%, rgba(60, 90, 170, 0.12) 0%, transparent 65%);
}

.aurora {
  position: absolute;
  top: -8%;
  left: 50%;
  transform: translateX(-50%);
  width: min(140vw, 620px);
  height: 58%;
  background:
    radial-gradient(ellipse 50% 65% at 50% 40%, rgba(100, 150, 255, 0.16) 0%, transparent 72%),
    radial-gradient(ellipse 35% 45% at 42% 30%, rgba(140, 100, 220, 0.1) 0%, transparent 70%),
    radial-gradient(ellipse 30% 40% at 62% 25%, rgba(80, 180, 220, 0.08) 0%, transparent 68%);
  mask-image: radial-gradient(ellipse 55% 70% at 50% 28%, black 15%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 55% 70% at 50% 28%, black 15%, transparent 78%);
  animation: aurora-breathe 18s ease-in-out infinite;
}

@keyframes aurora-breathe {
  0%, 100% { opacity: 0.85; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.04); }
}

.stars {
  position: absolute;
  inset: 0;
}

.stars-far {
  background-image:
    radial-gradient(1px 1px at 5% 8%, rgba(210,230,255,0.55), transparent),
    radial-gradient(1px 1px at 12% 30%, rgba(190,215,255,0.35), transparent),
    radial-gradient(1px 1px at 22% 5%, rgba(230,240,255,0.5), transparent),
    radial-gradient(1px 1px at 34% 22%, rgba(180,210,255,0.28), transparent),
    radial-gradient(1px 1px at 48% 10%, rgba(220,235,255,0.48), transparent),
    radial-gradient(1px 1px at 61% 26%, rgba(190,215,255,0.3), transparent),
    radial-gradient(1px 1px at 74% 7%, rgba(230,240,255,0.42), transparent),
    radial-gradient(1px 1px at 86% 20%, rgba(180,210,255,0.25), transparent),
    radial-gradient(1px 1px at 94% 12%, rgba(210,230,255,0.4), transparent),
    radial-gradient(1px 1px at 8% 48%, rgba(180,210,255,0.22), transparent),
    radial-gradient(1px 1px at 28% 55%, rgba(210,230,255,0.28), transparent),
    radial-gradient(1px 1px at 52% 50%, rgba(180,210,255,0.18), transparent),
    radial-gradient(1px 1px at 70% 58%, rgba(200,220,255,0.2), transparent),
    radial-gradient(1px 1px at 90% 46%, rgba(210,230,255,0.26), transparent),
    radial-gradient(1px 1px at 16% 68%, rgba(170,200,250,0.15), transparent),
    radial-gradient(1px 1px at 42% 72%, rgba(190,215,255,0.12), transparent),
    radial-gradient(1px 1px at 78% 70%, rgba(180,210,255,0.14), transparent);
  animation: twinkle-far 16s ease-in-out infinite;
  opacity: 0.75;
}

.stars-mid {
  background-image:
    radial-gradient(1.2px 1.2px at 18% 14%, rgba(230,240,255,0.65), transparent),
    radial-gradient(1.2px 1.2px at 40% 6%, rgba(200,220,255,0.55), transparent),
    radial-gradient(1.2px 1.2px at 58% 18%, rgba(240,245,255,0.6), transparent),
    radial-gradient(1.2px 1.2px at 80% 11%, rgba(210,230,255,0.5), transparent),
    radial-gradient(1.2px 1.2px at 32% 38%, rgba(200,220,255,0.4), transparent),
    radial-gradient(1.2px 1.2px at 68% 42%, rgba(230,240,255,0.35), transparent),
    radial-gradient(1.2px 1.2px at 10% 40%, rgba(190,215,255,0.38), transparent),
    radial-gradient(1.2px 1.2px at 92% 36%, rgba(210,230,255,0.32), transparent);
  animation: twinkle-mid 11s ease-in-out infinite;
  opacity: 0.8;
}

.stars-near {
  background-image:
    radial-gradient(1.8px 1.8px at 24% 12%, rgba(255,252,255,0.95), transparent),
    radial-gradient(1.6px 1.6px at 46% 5%, rgba(230,240,255,0.85), transparent),
    radial-gradient(2px 2px at 72% 16%, rgba(255,250,255,0.9), transparent),
    radial-gradient(1.5px 1.5px at 55% 34%, rgba(200,225,255,0.7), transparent),
    radial-gradient(1.6px 1.6px at 14% 36%, rgba(220,235,255,0.65), transparent),
    radial-gradient(1.5px 1.5px at 88% 32%, rgba(210,230,255,0.6), transparent),
    radial-gradient(2.2px 2.2px at 63% 8%, rgba(255,255,255,0.75), transparent);
  animation: twinkle-near 7s ease-in-out infinite;
  opacity: 0.95;
}

@keyframes twinkle-far {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.85; }
}
@keyframes twinkle-mid {
  0%, 100% { opacity: 0.65; }
  45% { opacity: 0.9; }
}
@keyframes twinkle-near {
  0%, 100% { opacity: 0.8; }
  35% { opacity: 1; }
  70% { opacity: 0.7; }
}

.clouds {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 18% at 20% 22%, rgba(140, 170, 230, 0.1) 0%, transparent 70%),
    radial-gradient(ellipse 48% 16% at 78% 28%, rgba(120, 150, 210, 0.09) 0%, transparent 68%),
    radial-gradient(ellipse 60% 14% at 50% 16%, rgba(160, 185, 240, 0.07) 0%, transparent 72%);
  filter: blur(18px);
  animation: cloud-drift 40s ease-in-out infinite;
  opacity: 0.9;
}

@keyframes cloud-drift {
  0%, 100% { transform: translateX(0); opacity: 0.85; }
  50% { transform: translateX(2%); opacity: 1; }
}

.mist {
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: 0;
  height: 48%;
  background:
    radial-gradient(ellipse 85% 55% at 50% 100%, rgba(40, 70, 130, 0.35) 0%, transparent 68%),
    radial-gradient(ellipse 50% 40% at 22% 88%, rgba(80, 120, 190, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 48% 36% at 80% 92%, rgba(70, 100, 180, 0.14) 0%, transparent 58%);
  filter: blur(2px);
}

.horizon-glow {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100vw, 440px);
  height: 34%;
  background:
    radial-gradient(ellipse 55% 90% at 50% 100%, rgba(232, 168, 74, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 50% 100%, rgba(100, 140, 220, 0.1) 0%, transparent 65%);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  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='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: overlay;
}

@media (prefers-reduced-motion: reduce) {
  .stars-near, .stars-mid, .stars-far, .aurora, .clouds { animation: none; }
  .flame-layers, .glow, .glow-outer, .smoke span, .ember { animation: none !important; }
  .view { transition: none !important; animation: none !important; }
  .candle-wrap.extinguishing .smoke { display: none; }
  .trail-paw { animation: none !important; }
}

#app {
  height: 100%;
  position: relative;
  z-index: 1;
}

.view {
  display: none;
  flex-direction: column;
  height: 100%;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  opacity: 1;
}

.view.active {
  display: flex;
  animation: view-in 0.42s var(--ease-soft) both;
}

.view.fade-out {
  animation: none;
  opacity: 0;
  transition: opacity 0.22s ease;
}

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

/* ═══ Home header ═══ */
.home-header {
  padding: 28px 24px 10px;
  flex-shrink: 0;
  text-align: center;
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.brand-wick {
  width: 10px;
  height: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.brand-wick::after {
  content: "";
  width: 3px;
  height: 8px;
  background: linear-gradient(180deg, #c9b890, #8a7a58);
  border-radius: 1px;
}

.brand-flame {
  width: 7px;
  height: 11px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at center bottom, #ffb347, #ff8c42 70%, transparent);
  margin-bottom: -1px;
  animation: brand-flicker 2.4s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(255, 179, 71, 0.55);
}

@keyframes brand-flicker {
  0%, 100% { transform: scaleY(1) scaleX(1); opacity: 0.9; }
  50% { transform: scaleY(1.08) scaleX(0.92); opacity: 1; }
}

.brand-mark {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--amber);
  opacity: 0.9;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 6.5vw, 2.4rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text);
  font-style: italic;
}

.hero-sub {
  margin-top: 10px;
  font-size: 0.92rem;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  opacity: 0.9;
}

.dedication-block {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.ded-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,168,74,0.45), transparent);
  position: relative;
}

.ded-heart {
  position: absolute;
  width: 11px;
  height: 11px;
  color: var(--rose);
  opacity: 0.7;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 4px rgba(232, 160, 144, 0.35));
}

.dedication {
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.92rem;
  line-height: 1.55;
  font-style: italic;
  letter-spacing: 0.01em;
  opacity: 0.88;
}

.ded-paw {
  width: 18px;
  height: 18px;
  color: var(--amber);
  opacity: 0.4;
  margin-top: 2px;
}

/* ═══ Topbar ═══ */
.topbar {
  padding: 24px 22px 14px;
  flex-shrink: 0;
}

.topbar.row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-soft);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spacer { flex: 1; }

.icon-btn {
  background: rgba(180,200,240,0.04);
  border: 1px solid var(--border);
  color: var(--amber);
  width: 44px;
  height: 44px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.icon-btn:active {
  background: rgba(232,168,74,0.12);
  border-color: var(--border-warm);
}

/* ═══ Memorial cards — fuller premium ═══ */
.list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 110px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}

.card {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  align-items: center;
  gap: 16px;
  background:
    linear-gradient(165deg, rgba(28, 42, 72, 0.55) 0%, rgba(14, 22, 40, 0.78) 100%);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 14px 14px;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.3s, transform 0.2s;
  box-shadow:
    0 10px 36px rgba(4, 10, 24, 0.45),
    inset 0 1px 0 rgba(180, 200, 240, 0.08);
  position: relative;
  overflow: hidden;
  min-height: 108px;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180,210,255,0.28), transparent);
  opacity: 0.7;
}

.card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, transparent, rgba(232,168,74,0.35), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}

.card:active { transform: scale(0.985); }

.card.lit-card {
  border-color: var(--border-warm);
  box-shadow:
    0 10px 36px rgba(4, 10, 24, 0.45),
    0 0 40px rgba(232, 168, 74, 0.16),
    inset 0 1px 0 rgba(232,168,74,0.12);
}

.card.lit-card::after { opacity: 1; }

.card-thumb-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(150,180,230,0.18),
    0 6px 16px rgba(0,0,0,0.3);
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--night);
}

.card-thumb-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  box-shadow: inset 0 0 24px 8px rgba(6, 12, 28, 0.45);
  pointer-events: none;
}

.card-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(155deg, #1e2e4e, #121c32);
  color: rgba(180, 205, 245, 0.42);
}

.card-thumb.placeholder svg {
  width: 36px;
  height: 36px;
}

.card-info { min-width: 0; }

.card-info h3 {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-style: italic;
}

.card-info p {
  color: var(--text-muted);
  font-size: 0.84rem;
  margin-top: 6px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 300;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.card-heart {
  width: 10px;
  height: 10px;
  color: var(--rose);
  opacity: 0.55;
  flex-shrink: 0;
}

.card-tag {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
  opacity: 0.55;
  font-weight: 500;
}

.lit-card .card-tag {
  opacity: 0.85;
}

.lit-card .card-heart {
  opacity: 0.8;
  filter: drop-shadow(0 0 3px rgba(232, 160, 144, 0.45));
}

.card-candle {
  width: 40px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 68px;
  transform: scale(0.62);
  transform-origin: center bottom;
}

/* ═══ Empty state — richer night shrine ═══ */
.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 28px 100px;
  color: var(--text-muted);
  gap: 18px;
  position: relative;
}

.empty.hidden, .hidden { display: none !important; }

.empty-altar {
  position: relative;
  width: 240px;
  height: 250px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 4px;
}

.empty-ring {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 1px solid rgba(160, 190, 240, 0.12);
  box-shadow:
    0 0 40px rgba(100, 140, 220, 0.08),
    inset 0 0 40px rgba(80, 120, 200, 0.06);
  pointer-events: none;
}

.empty-halo {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(232,168,74,0.18) 0%, rgba(100,140,220,0.08) 42%, transparent 72%);
  pointer-events: none;
}

.empty-mist {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 8%;
  height: 40%;
  background: radial-gradient(ellipse 70% 60% at 50% 80%, rgba(120, 160, 230, 0.14) 0%, transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

.paw-trail {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.trail-paw {
  position: absolute;
  color: var(--moon);
  width: 18px;
  height: 18px;
}

.trail-paw.p1 {
  left: 14px;
  bottom: 52px;
  opacity: 0.14;
  transform: rotate(-28deg);
  animation: trail-fade 6s ease-in-out infinite;
}

.trail-paw.p2 {
  left: 32px;
  bottom: 86px;
  opacity: 0.2;
  transform: rotate(-12deg) scale(0.9);
  animation: trail-fade 6s ease-in-out 0.8s infinite;
}

.trail-paw.p3 {
  left: 50px;
  bottom: 118px;
  opacity: 0.12;
  transform: rotate(8deg) scale(0.75);
  animation: trail-fade 6s ease-in-out 1.6s infinite;
}

@keyframes trail-fade {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.28; }
}

.empty-candle {
  height: 185px;
  z-index: 1;
}

.empty-heart {
  position: absolute;
  right: 22px;
  bottom: 40px;
  width: 15px;
  height: 15px;
  color: var(--rose);
  opacity: 0.45;
  filter: drop-shadow(0 0 6px rgba(232, 160, 144, 0.4));
  animation: heart-soft 3.5s ease-in-out infinite;
}

@keyframes heart-soft {
  0%, 100% { opacity: 0.32; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.08); }
}

.empty-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  padding: 18px 20px 8px;
  background: linear-gradient(180deg, rgba(18, 28, 48, 0.35), rgba(10, 16, 30, 0.15));
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(4, 10, 24, 0.25);
}

.empty-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--moon);
  opacity: 0.55;
  font-weight: 500;
  margin: 0;
}

.empty h2 {
  font-family: var(--font-display);
  color: var(--text-soft);
  font-weight: 400;
  font-size: 1.7rem;
  font-style: italic;
  letter-spacing: -0.01em;
  margin: 0;
}

.empty-copy > p:not(.empty-kicker) {
  max-width: 280px;
  line-height: 1.7;
  font-size: 0.95rem;
  font-weight: 300;
  opacity: 0.92;
  margin: 0;
}

.btn.ghost-cta {
  margin-top: 8px;
  margin-bottom: 6px;
  background: transparent;
  color: var(--amber);
  border: 1px solid rgba(232,168,74,0.42);
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 24px rgba(232,168,74,0.08);
}

.btn.ghost-cta:active {
  background: rgba(232,168,74,0.12);
  border-color: var(--amber);
  box-shadow: 0 0 28px rgba(232,168,74,0.2);
}

/* ═══ FAB ═══ */
.fab {
  position: fixed;
  right: 22px;
  bottom: calc(26px + var(--safe-bottom));
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(150deg, #f2bc62 0%, #d4923a 55%, #b87828 100%);
  color: #0a1220;
  box-shadow:
    0 10px 36px rgba(232,168,74,0.4),
    0 0 52px rgba(100,140,220,0.12),
    inset 0 1px 0 rgba(255,255,255,0.35);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.fab-icon { width: 26px; height: 26px; }
.fab:active { transform: scale(0.94); }

/* ═══ Form ═══ */
.form-body, .detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  -webkit-overflow-scrolling: touch;
}

.photo-picker { display: block; cursor: pointer; }

.photo-preview {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  background: var(--card-solid);
  border: 1px dashed rgba(150,180,230,0.22);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.photo-paw {
  width: 40px;
  height: 40px;
  opacity: 0.32;
  color: var(--amber);
}

.photo-hint { font-size: 0.92rem; font-weight: 300; }

.photo-preview.has-image {
  border-style: solid;
  border-color: var(--border);
}

.photo-preview.has-image .photo-placeholder { display: none; }

.photo-preview.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 48px 14px rgba(6, 12, 28, 0.5);
  pointer-events: none;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field span {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}

.field input, .field textarea {
  background: rgba(12, 20, 36, 0.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus, .field textarea:focus {
  border-color: rgba(232,168,74,0.5);
  box-shadow: 0 0 0 3px rgba(232,168,74,0.1);
}

.field input::placeholder, .field textarea::placeholder {
  color: rgba(139, 155, 180, 0.5);
}

.light-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(12, 20, 36, 0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.light-row input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.light-row:has(input:checked) {
  border-color: var(--border-warm);
  box-shadow: 0 0 28px rgba(232,168,74,0.12);
}

.light-preview {
  width: 36px;
  height: 56px;
  flex-shrink: 0;
  transform: scale(0.7);
  transform-origin: center bottom;
  pointer-events: none;
}

.light-row input:not(:checked) ~ .light-preview .flame-layers {
  opacity: 0;
  transform: scale(0.3) translateY(6px);
}
.light-row input:checked ~ .light-preview .flame-layers { opacity: 1; }
.light-row input:not(:checked) ~ .light-preview .glow { opacity: 0; }
.light-row input:not(:checked) ~ .light-preview .ember { opacity: 0.7; }
.light-row input:checked ~ .light-preview .ember { opacity: 0; }

.light-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.light-copy strong {
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--text);
}
.light-copy small {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 300;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 15px 18px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.btn.primary {
  background: linear-gradient(150deg, #f2bc62, #c9883a);
  color: #0a1220;
  box-shadow: 0 8px 24px rgba(232,168,74,0.3);
}

.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(196,92,92,0.35);
}

.btn:active { opacity: 0.9; }

/* ═══ Detail — tender shrine ═══ */
.detail-body {
  gap: 8px;
  padding-bottom: 24px;
}

.detail-shrine {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.arch-frame {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  border-radius: 50% 50% 18px 18px / 28% 28% 18px 18px;
  overflow: hidden;
  box-shadow:
    0 12px 40px rgba(4, 10, 28, 0.55),
    0 0 0 1px rgba(150,180,230,0.18),
    0 0 60px rgba(232,168,74,0.1);
}

.detail-photo {
  width: 100%;
  aspect-ratio: 5/6;
  max-height: 42vh;
  background: var(--card-solid) center/cover no-repeat;
  position: relative;
}

.arch-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, transparent 35%, rgba(6, 12, 28, 0.55) 100%),
    linear-gradient(180deg, transparent 55%, rgba(6, 12, 28, 0.62) 100%);
  pointer-events: none;
}

.collar-tag {
  position: absolute;
  bottom: 14px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(145deg, #c9a050, #8a6a30);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  border: 1px solid rgba(255, 220, 160, 0.3);
}

.tag-heart {
  width: 12px;
  height: 12px;
  color: #1a2030;
  opacity: 0.85;
}

.detail-photo.empty-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(165deg, #1e2e4e 0%, #101828 100%);
  color: rgba(180, 205, 245, 0.38);
}

.detail-photo.empty-photo svg {
  width: 60px;
  height: 60px;
  position: relative;
  z-index: 1;
}

.inscription {
  margin-top: -28px;
  position: relative;
  z-index: 2;
  width: calc(100% - 24px);
  max-width: 340px;
  background: linear-gradient(180deg, rgba(20, 32, 56, 0.94), rgba(12, 20, 36, 0.97));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 22px 20px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(4, 10, 28, 0.45);
}

.inscription:has(.detail-message:empty) {
  display: none;
}

.inscribe-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.inscribe-ornament::before,
.inscribe-ornament::after {
  content: "";
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,168,74,0.4), transparent);
}

.inscribe-paw {
  width: 16px;
  height: 16px;
  color: var(--amber);
  opacity: 0.45;
}

.detail-message {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-soft);
  white-space: pre-wrap;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.01em;
}

.detail-message:empty { display: none; }

/* ═══ Candle stage ═══ */
.candle-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 36px;
  gap: 14px;
  position: relative;
  margin-top: auto;
}

.sacred-ring {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(232,168,74,0.14) 0%, rgba(232,168,74,0.04) 40%, transparent 68%);
  pointer-events: none;
}

.altar-shelf {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 8px;
  background: linear-gradient(180deg, rgba(70, 90, 130, 0.5), rgba(30, 42, 70, 0.35));
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  pointer-events: none;
  opacity: 0.65;
}

.candle-label {
  color: var(--text-muted);
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  font-family: var(--font-display);
  font-style: italic;
  opacity: 0.88;
  transition: opacity 0.3s;
}

/* ═══ Candle stack ═══ */
.candle-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.candle-wrap {
  width: 100px;
  height: 200px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding-bottom: 4px;
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
}

.candle-body {
  width: 32px;
  height: 82px;
  background:
    linear-gradient(90deg,
      #c4b48c 0%,
      #ebe0c4 22%,
      #fffaf0 48%,
      #e8dcb8 78%,
      #b8a878 100%);
  border-radius: 6px 6px 3px 3px;
  position: relative;
  z-index: 2;
  box-shadow:
    inset -6px 0 12px rgba(0,0,0,0.16),
    inset 4px 0 8px rgba(255,255,255,0.4),
    0 6px 16px rgba(0,0,0,0.3);
}

.wax-pool {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 5px;
  background: radial-gradient(ellipse, #fff8e8 0%, #e8d9b0 70%, transparent 100%);
  border-radius: 50%;
  opacity: 0.7;
  z-index: 3;
}

.wax-drip {
  position: absolute;
  top: 2px;
  left: 5px;
  width: 7px;
  height: 20px;
  background: linear-gradient(180deg, #fff8e8, #e0d0a8);
  border-radius: 0 0 7px 7px;
  opacity: 0.88;
  z-index: 3;
}

.wax-drip.second {
  left: auto;
  right: 6px;
  height: 13px;
  width: 5px;
  opacity: 0.7;
}

.candle-base {
  width: 44px;
  height: 8px;
  background: linear-gradient(180deg, #4a5a78, #2a3548);
  border-radius: 3px;
  margin-top: -1px;
  z-index: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.pedestal {
  width: 64px;
  height: 14px;
  margin-top: 2px;
  background:
    linear-gradient(180deg, #3e4e6a 0%, #2a3548 40%, #1a2438 100%);
  border-radius: 3px 3px 6px 6px;
  z-index: 0;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

.wick {
  width: 2.5px;
  height: 12px;
  background: linear-gradient(180deg, #121820, #2a3540);
  border-radius: 1px;
  z-index: 3;
  margin-bottom: -1px;
  position: relative;
  display: flex;
  justify-content: center;
}

.ember {
  position: absolute;
  top: -3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff6b35 0%, #c44a20 60%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s;
  box-shadow: 0 0 6px rgba(255, 100, 40, 0.5);
}

.flame-layers {
  position: relative;
  width: 24px;
  height: 42px;
  z-index: 4;
  margin-bottom: -3px;
  opacity: 0;
  transform: scale(0.25) translateY(10px);
  transition: opacity 0.45s var(--ease-soft), transform 0.45s var(--ease-soft);
  transform-origin: center bottom;
}

.flame-layers span {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  pointer-events: none;
}

.flame-outer {
  width: 22px;
  height: 40px;
  background: radial-gradient(ellipse at center bottom, #ff6b35 0%, rgba(255,100,40,0.35) 50%, transparent 75%);
  filter: blur(2.5px);
  opacity: 0.75;
}

.flame-mid {
  width: 15px;
  height: 30px;
  bottom: 2px;
  background: radial-gradient(ellipse at center bottom, var(--flame) 0%, #ff8c42 55%, transparent 100%);
  filter: blur(0.4px);
}

.flame-inner {
  width: 9px;
  height: 20px;
  bottom: 3px;
  background: radial-gradient(ellipse at center, #ffe08a 0%, var(--flame) 65%, transparent 100%);
}

.flame-core {
  width: 5px;
  height: 11px;
  bottom: 4px;
  background: radial-gradient(ellipse, #fffef8 0%, #fff4c8 80%, transparent 100%);
  border-radius: 50%;
  opacity: 0.95;
}

.glow {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,179,71,0.55) 0%, rgba(255,140,40,0.16) 40%, transparent 68%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
  z-index: 0;
}

.glow-outer {
  top: -16px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255,179,71,0.2) 0%, transparent 58%);
}

.smoke {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 50px;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
}

.smoke span {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(180, 180, 190, 0.35);
  filter: blur(3px);
  opacity: 0;
}

.candle-wrap.extinguishing .smoke { opacity: 1; }
.candle-wrap.extinguishing .smoke span {
  animation: smoke-rise 1.1s var(--ease-soft) forwards;
}
.candle-wrap.extinguishing .smoke span:nth-child(1) { animation-delay: 0s; margin-left: -4px; }
.candle-wrap.extinguishing .smoke span:nth-child(2) { animation-delay: 0.12s; margin-left: 2px; width: 8px; height: 8px; }
.candle-wrap.extinguishing .smoke span:nth-child(3) { animation-delay: 0.22s; margin-left: -1px; }

@keyframes smoke-rise {
  0% { opacity: 0.6; transform: translate(-50%, 0) scale(0.6); }
  40% { opacity: 0.4; }
  100% { opacity: 0; transform: translate(-50%, -48px) scale(1.6); }
}

.candle-wrap.lit .flame-layers,
.mini-candle.lit .flame-layers,
.flame-layers.soft {
  opacity: 1;
  transform: scale(1) translateY(0);
  animation: flame-sway 2.2s ease-in-out infinite;
}

.candle-wrap.lit .glow,
.candle-wrap.lit .glow-outer,
.mini-candle.lit .glow,
.empty-candle .glow,
.empty-candle .glow-outer {
  opacity: 1;
  animation: pulse-glow 3s ease-in-out infinite;
}

.candle-wrap.lit .ember { opacity: 0; }
.candle-wrap:not(.lit) .ember { opacity: 0.55; }

.candle-wrap:not(.lit) .flame-layers {
  opacity: 0;
  transform: scale(0.2) translateY(12px);
}

.candle-wrap:not(.lit) .glow,
.candle-wrap:not(.lit) .glow-outer {
  opacity: 0;
}

.flame-layers.soft {
  opacity: 0.75;
  transform: scale(0.92);
  animation: flame-sway 2.6s ease-in-out infinite;
}

.empty-candle .glow { opacity: 0.6; top: 0; }
.empty-candle .glow-outer { opacity: 0.35; }
.empty-candle .ember { opacity: 0; }

@keyframes flame-sway {
  0%, 100% {
    transform: scale(1) rotate(-1.4deg) translateY(0);
    filter: brightness(1);
  }
  25% {
    transform: scale(1.05, 0.95) rotate(2deg) translateY(-1.5px);
    filter: brightness(1.12);
  }
  50% {
    transform: scale(0.96, 1.06) rotate(-1deg) translateY(1px);
    filter: brightness(0.92);
  }
  75% {
    transform: scale(1.03, 0.97) rotate(1.2deg) translateY(-0.5px);
    filter: brightness(1.08);
  }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.65; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.12); }
}

.mini-candle .candle-body { width: 18px; height: 40px; border-radius: 3px; }
.mini-candle .wick { width: 2px; height: 7px; }
.mini-candle .flame-layers { width: 14px; height: 24px; opacity: 0; }
.mini-candle .flame-outer { width: 13px; height: 22px; }
.mini-candle .flame-mid { width: 9px; height: 17px; }
.mini-candle .flame-inner { width: 6px; height: 11px; }
.mini-candle .flame-core { width: 3px; height: 6px; }
.mini-candle.lit .flame-layers {
  opacity: 1;
  transform: scale(1);
  animation: flame-sway 1.8s ease-in-out infinite;
}
.mini-candle .glow { width: 48px; height: 48px; top: 0; }
.mini-candle .glow-outer,
.mini-candle .wax-drip,
.mini-candle .wax-pool,
.mini-candle .pedestal,
.mini-candle .smoke { display: none; }
.mini-candle .candle-base {
  display: block;
  width: 26px;
  height: 5px;
}
.mini-candle .ember { width: 3px; height: 3px; top: -2px; }
.mini-candle.lit .ember { opacity: 0; }
.mini-candle:not(.lit) .ember { opacity: 0.5; }

.light-preview.mini .candle-body { width: 16px; height: 36px; }
.light-preview.mini .flame-layers { width: 14px; height: 24px; }
.light-preview.mini .glow { width: 40px; height: 40px; top: -4px; }
.light-preview.mini .candle-base,
.light-preview.mini .pedestal { display: none; }

@supports (padding: max(0px)) {
  .home-header { padding-top: max(28px, env(safe-area-inset-top)); }
  .topbar.row { padding-top: max(14px, env(safe-area-inset-top)); }
  .fab { bottom: max(26px, calc(18px + env(safe-area-inset-bottom))); }
}
