/* ─── Design tokens ─────────────────────────────────────────────────── */
:root {
  color-scheme: dark;
  --bg:          #0d0b18;
  --bg-soft:     #13102a;
  --panel:       rgba(30, 25, 55, 0.88);
  --panel-mid:   rgba(38, 32, 68, 0.92);
  --gold:        #c9a84c;
  --gold-light:  #e8c97a;
  --teal:        #5ddbb8;
  --teal-soft:   rgba(93, 219, 184, 0.18);
  --purple:      #9b6dff;
  --purple-soft: rgba(155, 109, 255, 0.16);
  --accent:      #e05c6a;
  --text:        #ede8fa;
  --muted:       #b3adc8;
  --dim:         #7d7899;
  --line:        rgba(201, 168, 76, 0.2);
  --line-soft:   rgba(255, 255, 255, 0.07);
  --glow-gold:   rgba(201, 168, 76, 0.28);
  --glow-teal:   rgba(93, 219, 184, 0.22);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ─── Reset & base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { background: #07060f; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Inter", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(155, 109, 255, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(93, 219, 184, 0.10) 0%, transparent 50%),
    linear-gradient(180deg, #13102a 0%, #0d0b18 40%, #090714 100%);
}
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin-top: 0; }

/* ─── App shell ─────────────────────────────────────────────────────── */
.app-shell {
  position: relative;
  isolation: isolate;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(155, 109, 255, 0.14) 0%, transparent 55%),
    var(--bg);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.7);
}
.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.55) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(201,168,76,0.4) 0 1px, transparent 1.5px);
  background-size: 180px 200px, 130px 160px;
  background-position: 20% 15%, 70% 55%;
  opacity: 0.15;
}

/* ─── Topbar ────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 20px;
  background: rgba(13, 11, 24, 0.9);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(20px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-light);
  text-decoration: none;
}
.brand__mark {
  font-size: 18px;
  line-height: 1;
}
.brand__mark span { display: block; }
.brand__name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Language switcher ─────────────────────────────────────────────── */
.language-switcher { position: relative; }
.language-switcher__button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 80px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(30, 25, 55, 0.7);
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
}
.language-switcher__chevron { color: var(--muted); font-size: 12px; transition: transform 180ms ease; }
.language-switcher--open .language-switcher__chevron { transform: rotate(180deg); }
.language-switcher__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: none;
  min-width: 130px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(20, 16, 40, 0.97);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  backdrop-filter: blur(16px);
}
.language-switcher--open .language-switcher__menu { display: grid; gap: 3px; }
.language-switcher__menu button {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0 10px;
  font-size: 13px;
}
.language-switcher__menu button:hover,
.language-switcher__menu button[aria-selected="true"] { background: var(--purple-soft); color: var(--text); }

/* ─── Main & pages ──────────────────────────────────────────────────── */
.app-main {
  position: relative;
  z-index: 2;
  padding-bottom: calc(75px + var(--safe-bottom));
}
.tab-page { display: none; animation: pageIn 240ms ease-out; }
.tab-page--active { display: block; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Hero ──────────────────────────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 160px;
  padding: 16px 24px 12px;
}
.hero-emblem {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 12px rgba(201, 168, 76, 0.5));
}
.hero h1 {
  margin-bottom: 2px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero__tagline {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero__copy { margin-bottom: 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.hero__actions { width: 100%; }

/* ─── Buttons ───────────────────────────────────────────────────────── */
.primary-action {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(135deg, #9b6dff 0%, #5ddbb8 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(155, 109, 255, 0.35);
  transition: opacity 160ms;
}
.primary-action:hover { opacity: 0.88; }
.secondary-action {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: rgba(30, 25, 55, 0.6);
  color: var(--gold-light);
}

/* ─── Daily fortune card ──────────────────────────────────────────────── */
.daily-fortune-card {
  margin: 0 16px 0;
  padding: 16px 18px;
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(201,168,76,0.07) 0%, rgba(155,109,255,0.05) 100%), var(--panel);
}
.daily-fortune-card__label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.daily-fortune-content p { 
  margin: 0; 
  color: var(--text); 
  font-size: 15px; 
  line-height: 1.7; 
  font-style: italic; 
}
@keyframes fortuneReveal {
  from { 
    opacity: 0.7; 
    transform: scale(0.98); 
  }
  to { 
    opacity: 1; 
    transform: scale(1); 
  }
}

/* ─── Free banner ───────────────────────────────────────────────────── */
.free-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin: 12px 16px 8px;
  padding: 10px 14px;
  border: 1px solid rgba(93, 219, 184, 0.25);
  border-radius: 12px;
  background: rgba(93, 219, 184, 0.07);
}
.free-banner__icon { flex-shrink: 0; font-size: 22px; line-height: 1; }
.free-banner__text { display: grid; gap: 2px; }
.free-banner__text strong { color: var(--teal); font-size: 13px; }
.free-banner__text span { color: var(--muted); font-size: 11px; }

/* ─── Feature grid ──────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px 16px 0;
}
.feature-grid .feature-card--wide { grid-column: 1 / -1; height: 135px; }

.feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 170px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 140ms, box-shadow 140ms;
}
.feature-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(155,109,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.feature-card--dream  { border-color: rgba(155,109,255,0.28); }
.feature-card--dream::before { background: linear-gradient(135deg, rgba(155,109,255,0.10) 0%, transparent 60%); }
.feature-card--blessing { border-color: rgba(224,160,82,0.34); background-image:linear-gradient(180deg,rgba(18,12,16,.70),rgba(18,12,16,.94)),url('../images/private-prayer-hall-v1.webp');background-size:cover;background-position:center 24%; }
.feature-card--blessing::before { background: linear-gradient(135deg, rgba(232,165,75,0.14) 0%, transparent 60%); }
.feature-card--lottery { border-color: rgba(201,168,76,0.28); }
.feature-card--lottery::before { background: linear-gradient(135deg, rgba(201,168,76,0.08) 0%, transparent 60%); }

.feature-card__icon { 
  font-size: 28px; 
  line-height: 1; 
  filter: drop-shadow(0 2px 6px rgba(155,109,255,0.3)); 
}
.feature-card--blessing .feature-card__icon { filter: drop-shadow(0 2px 6px rgba(224,92,106,0.35)); }
.feature-card--lottery .feature-card__icon  { filter: drop-shadow(0 2px 6px rgba(201,168,76,0.35)); }

.feature-card__meta {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--purple-soft);
  color: var(--purple);
}
.feature-card--blessing .feature-card__meta { background: rgba(224,92,106,0.12); color: #f08090; }
.feature-card--lottery .feature-card__meta  { background: rgba(201,168,76,0.12); color: var(--gold-light); }

.feature-card h3 {
  margin-bottom: 2px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.3;
}

.feature-card p { 
  margin: 0; 
  font-size: 12px; 
  line-height: 1.4; 
  color: var(--muted);
}
.feature-card__arrow { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--dim); font-size: 18px; }

/* ─── Disclaimer ────────────────────────────────────────────────────── */
.page-disclaimer { padding: 8px 20px 4px; text-align: center; }
.page-disclaimer p { margin: 0; color: var(--dim); font-size: 10px; line-height: 1.5; }

/* ─── Quota badge ───────────────────────────────────────────────────── */
.quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 16px;
  padding: 7px 14px;
  border: 1px solid rgba(93,219,184,0.28);
  border-radius: 999px;
  background: rgba(93,219,184,0.07);
  color: var(--teal);
  font-size: 13px;
  font-weight: 600;
}
.quota-badge--empty { border-color: rgba(224,92,106,0.3); background: rgba(224,92,106,0.07); color: #f08090; }

/* ─── Page title ────────────────────────────────────────────────────── */
.page-title { padding: 20px 20px 8px; text-align: center; }
.page-title p { margin-bottom: 4px; color: var(--dim); text-transform: uppercase; font-size: 11px; letter-spacing: 0.2em; }
.page-title h2 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Form card ─────────────────────────────────────────────────────── */
.form-card {
  margin: 0 16px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: var(--panel);
  display: grid;
  gap: 12px;
}
.blessing-form--collapsed { display: none; }
.blessing-add-another { margin: 12px 16px 0; width: calc(100% - 32px); min-height: 48px; font-size: 15px; }

label { display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
input, textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  outline: none;
  font-size: 15px;
  transition: border-color 160ms;
  resize: none;
}
input:focus, textarea:focus { border-color: rgba(155,109,255,0.5); }

/* ─── Blessing ──────────────────────────────────────────────────────── */
.blessing-page { padding: 0 0 24px; }

.blessing-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 16px 12px;
}
.blessing-stats-row span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 46px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  flex-wrap: wrap;
}
.blessing-stats-row strong { color: var(--teal); font-size: 18px; font-weight: 700; }

.blessing-field { display: grid; gap: 8px; color: var(--muted); font-size: 14px; }
.blessing-options { display: flex; flex-wrap: wrap; gap: 8px; }
.blessing-options button {
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 6px 13px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 13px;
  transition: all 140ms;
}
.blessing-options button.is-active,
.lamp-card.is-active { border-color: rgba(155,109,255,0.5); background: var(--purple-soft); color: var(--text); }

.lamp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lamp-card {
  min-height: 80px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
  text-align: left;
  transition: all 140ms;
}
.lamp-card strong { display: block; margin-bottom: 4px; font-size: 15px; color: var(--text); }
.lamp-card span   { display: block; font-size: 12px; color: var(--muted); }
.lamp-card--peace   { border-color: rgba(255,209,101,0.2); }
.lamp-card--health  { border-color: rgba(93,219,184,0.2); }
.lamp-card--career  { border-color: rgba(106,166,255,0.2); }
.lamp-card--eternal { border-color: rgba(202,124,255,0.2); }
.lamp-card--peace.is-active   { background: rgba(255,209,101,0.1); border-color: rgba(255,209,101,0.45); }
.lamp-card--health.is-active  { background: rgba(93,219,184,0.1);  border-color: rgba(93,219,184,0.45); }
.lamp-card--career.is-active  { background: rgba(106,166,255,0.1); border-color: rgba(106,166,255,0.45); }
.lamp-card--eternal.is-active { background: rgba(202,124,255,0.1); border-color: rgba(202,124,255,0.45); }

/* ─── Wish wall ticker ──────────────────────────────────────────────── */
.wish-wall {
  margin: 16px 16px 0;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--panel);
}
.wish-wall__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.wish-wall__header h3 { color: var(--text); font-size: 16px; font-weight: 700; margin: 0; }
.wish-wall__stats { display: flex; gap: 14px; flex-shrink: 0; }
.wish-wall__stats span { color: var(--muted); font-size: 12px; }
.wish-wall__stats strong { color: var(--teal); font-weight: 700; margin-left: 3px; }
.wish-wall__hint { 
  margin: 0 0 12px 0; 
  color: var(--dim); 
  font-size: 12px; 
  text-align: center; 
  opacity: 0.8; 
}

.merit-ticker-wrap {
  position: relative;
  overflow: hidden;
  height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line-soft);
}
.merit-ticker-wrap::before,
.merit-ticker-wrap::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 32px;
  z-index: 2;
  pointer-events: none;
}
.merit-ticker-wrap::before { left: 0; background: linear-gradient(90deg, var(--bg-soft), transparent); }
.merit-ticker-wrap::after  { right: 0; background: linear-gradient(-90deg, var(--bg-soft), transparent); }

.merit-ticker { display: flex; align-items: center; white-space: nowrap; height: 100%; will-change: transform; }
.merit-ticker--running { animation: tickerScroll 28s linear infinite; }
.merit-ticker--running:hover { animation-play-state: paused; }

.merit-ticker__item {
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  height: 100%;
  color: var(--muted);
  font-size: 13px;
  border-right: 1px solid var(--line-soft);
  gap: 4px;
}
.merit-ticker__sep { display: inline-block; width: 24px; height: 100%; flex-shrink: 0; }
.merit-ticker__empty { padding: 0 16px; color: var(--dim); font-size: 13px; line-height: 38px; }

@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.merit-ticker__item--new { color: var(--teal) !important; animation: tickerNewItem 3s ease forwards; }
@keyframes tickerNewItem {
  0%   { color: var(--teal); }
  60%  { color: var(--teal); }
  100% { color: var(--muted); }
}

/* ─── My lamps ──────────────────────────────────────────────────────── */
.my-lamps {
  margin: 12px 16px 0;
  padding: 16px 18px;
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(201,168,76,0.07) 0%, rgba(155,109,255,0.04) 100%), var(--panel);
}
.my-lamps[hidden] { display: none; }
.my-lamps__header { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.my-lamps__icon { font-size: 18px; }
.my-lamps__header h3 { margin: 0; color: var(--text); font-size: 15px; font-weight: 700; }
.my-lamps__list { 
  display: grid; 
  gap: 10px; 
  max-height: 400px; 
  overflow-y: auto; 
  padding-right: 4px; 
}
.my-lamps__list::-webkit-scrollbar {
  width: 4px;
}
.my-lamps__list::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
}
.my-lamps__list::-webkit-scrollbar-thumb {
  background: var(--teal);
  border-radius: 2px;
  opacity: 0.6;
}
.my-lamps__list::-webkit-scrollbar-thumb:hover {
  opacity: 0.8;
}
.my-lamp-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(255,255,255,0.03); }
.my-lamp-item__icon { font-size: 26px; line-height: 1; flex-shrink: 0; filter: drop-shadow(0 0 6px rgba(201,168,76,0.4)); }
.my-lamp-item__body { display: grid; gap: 3px; min-width: 0; }
.my-lamp-item__body strong { color: var(--text); font-size: 14px; font-weight: 600; }
.my-lamp-item__body p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-lamp-item__body span { color: var(--teal); font-size: 12px; font-weight: 600; }

/* ─── Profile ───────────────────────────────────────────────────────── */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 16px 8px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--panel);
}
.avatar {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--purple-soft);
  border: 1px solid rgba(155,109,255,0.3);
  flex-shrink: 0;
  font-size: 28px;
  display: grid;
  place-items: center;
}
.avatar--empty::after { content: "🌸"; font-size: 26px; }
.profile-card h3 { color: var(--text); font-size: 17px; margin-bottom: 4px; }
.profile-card p  { color: var(--muted); font-size: 13px; margin: 0; }

.menu-list { margin: 8px 16px 0; border: 1px solid var(--line-soft); border-radius: 18px; background: var(--panel); overflow: hidden; }
.menu-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--text);
  padding: 0 18px;
  font-size: 15px;
  text-align: left;
}
.menu-list button:last-child { border-bottom: 0; }
.menu-list button span:last-child { color: var(--dim); transition: transform 200ms; }

/* Inline records inside menu-list */
.profile-records-inline {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(155,109,255,0.02);
  max-height: 250px;
  overflow-y: auto;
}
.profile-records-inline[hidden] { display: none; }
.profile-records-inline .my-lamp-item { margin-bottom: 8px; }
.profile-records-inline .my-lamp-item:last-child { margin-bottom: 0; }

.profile-records { margin: 12px 16px 0; padding: 16px 18px; border: 1px solid var(--line-soft); border-radius: 18px; background: var(--panel); }
.profile-records[hidden] { display: none; }
.profile-records h3 { color: var(--teal); font-size: 16px; margin-bottom: 12px; }
.profile-record-item { padding: 10px 0; border-bottom: 1px solid var(--line-soft); color: var(--text); font-size: 14px; line-height: 1.6; }
.profile-record-item:last-child { border-bottom: 0; }
.profile-record-item time { display: block; color: var(--dim); font-size: 12px; margin-bottom: 2px; }

.profile-record-item--clickable {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  text-align: left;
  padding: 12px 0;
  cursor: pointer;
  transition: background 140ms;
}
.profile-record-item--clickable:hover { background: rgba(155,109,255,0.05); }
.profile-record-item--clickable:last-child { border-bottom: 0; }
.profile-record-item--clickable time { flex-shrink: 0; }
.profile-record-body { flex: 1; min-width: 0; }
.profile-record-arrow { flex-shrink: 0; color: var(--dim); font-size: 18px; transition: transform 200ms; }
.record-item--expanded .profile-record-arrow { transform: rotate(180deg); }

/* Blessing detail expanded (inline) */
.blessing-detail-expanded {
  padding: 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(155,109,255,0.03);
  animation: expandDetail 250ms ease;
}
@keyframes expandDetail {
  from { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; }
  to { opacity: 1; max-height: 500px; padding-top: 16px; padding-bottom: 16px; }
}

/* Blessing record card (inline full display) */
.blessing-record-card {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  margin-bottom: 10px;
}
.blessing-record-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.blessing-record-card__lamp {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(201,168,76,0.4));
}
.blessing-record-card__info {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.blessing-record-card__info strong {
  color: var(--text);
  font-size: 15px;
}
.blessing-record-card__info span {
  color: var(--muted);
  font-size: 13px;
}
.blessing-record-card__header time {
  flex-shrink: 0;
  color: var(--dim);
  font-size: 11px;
}
.blessing-record-card__wish {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 2px solid rgba(93,219,184,0.3);
  border-radius: 0 8px 8px 0;
  background: rgba(93,219,184,0.04);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  font-style: italic;
}

/* ─── Record detail modal ───────────────────────────────────────────── */
.record-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,0.8);
  animation: modalFadeIn 200ms ease;
}
.record-detail-panel {
  position: relative;
  width: min(100%, 400px);
  max-height: calc(100dvh - 100px);
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: var(--bg-soft);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  padding: 24px 20px;
  animation: modalSlideUp 300ms ease;
}
.record-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 140ms;
}
.record-detail-close:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.record-detail-content { padding-right: 24px; }
.record-detail-icon { font-size: 48px; text-align: center; margin-bottom: 12px; filter: drop-shadow(0 0 12px rgba(155,109,255,0.4)); }
.record-detail-content h2 { text-align: center; color: var(--teal); font-size: 22px; margin-bottom: 20px; }

/* Blessing detail card */
.blessing-detail-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255,255,255,0.02);
  margin-bottom: 16px;
}
.blessing-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.blessing-detail-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.blessing-detail-relation {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.blessing-detail-lamp {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(201,168,76,0.05), rgba(155,109,255,0.03));
}
.blessing-detail-lamp-icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(201,168,76,0.4));
}
.blessing-detail-lamp-name {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}
.blessing-detail-duration {
  color: var(--teal);
  font-size: 13px;
  font-weight: 600;
}
.blessing-detail-wish-card {
  padding: 14px;
  border-left: 3px solid rgba(93,219,184,0.4);
  border-radius: 0 10px 10px 0;
  background: rgba(93,219,184,0.04);
}
.blessing-detail-wish-label {
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}
.blessing-detail-wish-text {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
  font-style: italic;
}

.record-detail-field,
.record-detail-wish,
.record-detail-verse,
.record-detail-interpretation {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.record-detail-field:last-of-type,
.record-detail-wish,
.record-detail-interpretation { border-bottom: 0; padding-bottom: 0; }
.record-detail-field span,
.record-detail-wish span,
.record-detail-verse strong,
.record-detail-interpretation strong { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.record-detail-field strong { color: var(--text); font-size: 16px; }
.record-detail-field p,
.record-detail-wish p,
.record-detail-verse p,
.record-detail-interpretation p,
.record-detail-interpretation div { margin: 0; color: var(--text); font-size: 15px; line-height: 1.7; }
.record-detail-number { text-align: center; font-size: 36px; font-weight: 800; background: linear-gradient(135deg, var(--gold-light), var(--teal)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 8px; }
.record-detail-lottery-title { text-align: center; color: var(--text); font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.record-detail-level { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.record-detail-advice { margin-top: 12px; padding: 12px; border-left: 2px solid rgba(93,219,184,0.4); border-radius: 0 8px 8px 0; background: rgba(93,219,184,0.06); color: var(--teal); font-size: 14px; line-height: 1.6; }
.record-detail-dream-body { margin: 12px 0; }
.record-detail-dream-body p { margin-top: 2px; color: var(--text); font-size: 15px; line-height: 1.6; }
.record-detail-dream-body h3 { margin-top: 10px; margin-bottom: 0; color: var(--teal); font-size: 15px; font-weight: 700; }
.record-detail-dream-body h4 { margin-top: 8px; margin-bottom: 0; color: var(--purple); font-size: 15px; font-weight: 700; }
.record-detail-dream-body strong { color: var(--gold-light); }
.record-detail-dream-body ul { margin: 2px 0; padding-left: 1.2em; color: var(--muted); font-size: 14px; line-height: 1.5; }
.record-detail-dream-body hr { margin: 8px 0; border: 0; border-top: 1px solid var(--line-soft); }
.record-detail-time { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-soft); text-align: center; color: var(--dim); font-size: 12px; }

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Bottom nav ────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 430px);
  padding: 6px 6px calc(8px + var(--safe-bottom));
  transform: translateX(-50%);
  border-top: 1px solid var(--line-soft);
  background: rgba(10, 8, 20, 0.95);
  backdrop-filter: blur(20px);
}
.bottom-nav__item {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--dim);
  font-size: 11px;
  text-decoration: none;
  transition: color 140ms;
}
.bottom-nav__icon { font-size: 20px; line-height: 1; }
.bottom-nav__item--active {
  color: var(--gold-light);
  background: radial-gradient(ellipse at 50% 0%, rgba(201,168,76,0.2) 0%, transparent 70%);
}

/* ─── Feedback card ──────────────────────────────────────────────────── */
.feedback-card {
  margin: 12px 16px 0;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--panel);
  display: grid;
  gap: 8px;
}

.ritual-intro { margin: 6px auto 0; max-width: 320px; color: var(--muted); font-size: 13px; line-height: 1.6; text-transform: none !important; letter-spacing: 0 !important; }
.profile-library-heading { margin: 18px 20px 8px; }
.profile-library-heading h3 { margin: 0 0 4px; font-size: 16px; }
.profile-library-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.profile-quick-actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 12px 16px 0; }
.profile-quick-actions a { display: grid; place-items: center; gap: 4px; min-height: 66px; padding: 8px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(255,255,255,.035); color: var(--muted); font-size: 11px; text-align: center; text-decoration: none; }
.feedback-card h3 { color: var(--text); font-size: 16px; font-weight: 700; margin: 0; }
.feedback-card p { color: var(--muted); font-size: 13px; margin: 0; }
.feedback-card textarea { min-height: 70px; font-size: 14px; resize: none; }
.feedback-card .primary-action { min-height: 44px; font-size: 15px; }
.feedback-success { color: var(--teal); font-size: 13px; font-weight: 600; text-align: center; }

/* ─── Desktop frame ─────────────────────────────────────────────────── */
@media (min-width: 700px) {
  body { padding: 24px 0; }
  .app-shell { min-height: calc(100vh - 48px); border: 1px solid rgba(155,109,255,0.15); border-radius: 28px; }
  .topbar { border-radius: 28px 28px 0 0; }
}

/* 底部导航图标样式 */
.bottom-nav__icon img {
  display: inline-block;
  vertical-align: middle;
}

/* Hero区域logo样式 */
.hero-emblem img {
  display: block;
  margin: 0 auto;
}

/* Stable cross-platform SVG icon system */
.brand__mark img { display: block; width: 24px; height: 24px; }
.hero-emblem img { width: 46px; height: 46px; }
.feature-card__icon img { display: block; width: 32px; height: 32px; }
.free-banner__icon img { display: block; width: 24px; height: 24px; }
.bottom-nav__icon img { display: block; width: 23px; height: 23px; }
.ui-icon--small { width: 16px; height: 16px; }
.primary-action:has(img) { display: flex; align-items: center; justify-content: center; gap: 8px; }
.primary-action img { width: 22px; height: 22px; flex: 0 0 auto; }
.profile-quick-actions img { width: 24px; height: 24px; }
.blessing-options button img { width: 19px; height: 19px; margin-right: 5px; vertical-align: middle; }
.my-lamps__icon img { width: 28px; height: 28px; }
.record-svg-icon { width: 42px; height: 42px; }
.inline-svg-icon { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }
.my-lamp-item__icon img, .blessing-detail-lamp-icon img { width: 30px; height: 30px; }


/* ─── Profile v2: content-first layout ──────────────────────────────── */
.profile-section { margin: 12px 16px; padding: 16px 18px; border: 1px solid var(--line-soft); border-radius: 18px; background: var(--panel); }
.profile-section__header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.profile-section__header h3 { margin: 0; font-size: 15px; color: var(--teal); }
.profile-section__header img { width: 18px; height: 18px; }
.profile-section__content { font-size: 14px; line-height: 1.6; color: var(--text); }

.profile-empty-state { text-align: center; padding: 12px 0; }
.profile-empty-state p { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.profile-empty-state__cta { display: inline-block; padding: 8px 18px; border-radius: 20px; background: var(--purple-soft); color: var(--purple); font-size: 13px; text-decoration: none; transition: background 140ms; }
.profile-empty-state__cta:hover { background: rgba(155,109,255,0.24); }

.profile-record-card { padding: 8px 0; }
.profile-record-card__dream { color: var(--muted); font-size: 13px; font-style: italic; margin: 0 0 8px; }
.profile-record-card__result { font-size: 13px; line-height: 1.6; max-height: 140px; overflow: hidden; position: relative; }
.profile-record-card__result::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 40px; background: linear-gradient(transparent, var(--panel)); pointer-events: none; }
.profile-record-card__time { display: block; color: var(--dim); font-size: 11px; margin-top: 6px; }

.profile-record-card--lottery .profile-record-card__header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.profile-record-card--lottery .profile-record-card__header strong { font-size: 15px; }
.profile-record-card--lottery .profile-record-card__header span { color: var(--gold); font-size: 12px; }
.profile-record-card--lottery .profile-record-card__title { color: var(--text); font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.profile-record-card--lottery .profile-record-card__verse { color: var(--muted); font-size: 13px; font-style: italic; margin: 0 0 6px; }
.profile-record-card--lottery .profile-record-card__interpretation { color: var(--text); font-size: 13px; margin: 0; }

.profile-blessing-card { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.profile-blessing-card:last-child { border-bottom: 0; }
.profile-blessing-card__icon { font-size: 18px; flex-shrink: 0; line-height: 1.4; }
.profile-blessing-card__body { flex: 1; min-width: 0; }
.profile-blessing-card__body strong { display: block; font-size: 13px; margin-bottom: 1px; }
.profile-blessing-card__body p { margin: 0 0 1px; font-size: 12px; color: var(--muted); }
.profile-blessing-card__body time { font-size: 11px; color: var(--dim); }

.profile-history-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); align-items: center; }
.profile-history-item:last-child { border-bottom: 0; }
.profile-history-item__icon { font-size: 18px; flex-shrink: 0; }
.profile-history-item__body { flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.profile-history-item__body span { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-history-item__body time { font-size: 11px; color: var(--dim); flex-shrink: 0; }

.profile-empty-hint { color: var(--muted); font-size: 13px; text-align: center; padding: 8px 0; margin: 0; }

.profile-footer { display: flex; justify-content: center; gap: 16px; padding: 20px 16px 8px; flex-wrap: wrap; }
.profile-footer a { color: var(--dim); font-size: 12px; text-decoration: none; }
.profile-footer a:hover { color: var(--muted); }


/* ─── Blessing success state ───────────────────────────────────────── */
.blessing-success { text-align: center; padding: 32px 20px; margin: 16px 16px 0; border: 1px solid var(--line-soft); border-radius: 18px; background: var(--panel); }
.blessing-success__icon { font-size: 40px; margin-bottom: 12px; }
.blessing-success h3 { color: var(--teal); font-size: 17px; margin: 0 0 8px; }
.blessing-success p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 16px; max-width: 280px; margin-left: auto; margin-right: auto; }
.blessing-success__actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.blessing-success__new { background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 6px 12px; }
.blessing-success__new:hover { color: var(--text); }
.blessing-form--collapsed { display: none; }


/* ─── Footer links ─────────────────────────────────────────────────── */
.page-footer-links { display: flex; justify-content: center; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.page-footer-links a { color: var(--dim); font-size: 11px; text-decoration: none; }
.page-footer-links a:hover { color: var(--muted); }


/* ─── Profile dream items (expandable) ─────────────────────────────── */
.profile-dream-item { border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.profile-dream-item:last-child { border-bottom: 0; }
.profile-dream-item__summary { display: flex; align-items: center; gap: 8px; padding: 10px 0; }
.profile-dream-item__text { flex: 1; min-width: 0; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-dream-item__summary time { flex-shrink: 0; font-size: 11px; color: var(--dim); }
.profile-dream-item__arrow { flex-shrink: 0; color: var(--dim); font-size: 16px; transition: transform 200ms; }
.profile-dream-item.is-expanded .profile-dream-item__arrow { transform: rotate(90deg); }
.profile-dream-item__detail { padding: 0 0 14px; }
.profile-dream-item__detail[hidden] { display: none; }
.profile-dream-item__original { margin-bottom: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.03); }
.profile-dream-item__original strong { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.profile-dream-item__original p { margin: 0; font-size: 13px; color: var(--text); line-height: 1.6; }
.profile-dream-item__result { font-size: 13px; line-height: 1.7; }
.profile-dream-item__result h3, .profile-dream-item__result h4 { font-size: 14px; color: var(--teal); margin: 10px 0 4px; }

.profile-more-hint { text-align: center; color: var(--dim); font-size: 11px; margin: 8px 0 0; }

/* ─── Profile lottery past items ───────────────────────────────────── */
.profile-lottery-past { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.profile-lottery-past__item { border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.profile-lottery-past__item:last-child { border-bottom: 0; }
.profile-lottery-past__summary { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 13px; }
.profile-lottery-past__summary strong { flex-shrink: 0; color: var(--text); }
.profile-lottery-past__summary span { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-lottery-past__summary time { flex-shrink: 0; font-size: 11px; color: var(--dim); }
.profile-lottery-past__detail { padding: 4px 0 12px; font-size: 13px; line-height: 1.6; }
.profile-lottery-past__detail[hidden] { display: none; }
.profile-lottery-past__item.is-expanded .profile-dream-item__arrow { transform: rotate(90deg); }

.profile-record-card--today { position: relative; border: 1px solid rgba(93,219,184,.3); border-radius: 12px; padding: 12px; }
.profile-record-card__badge { position: absolute; top: 8px; right: 10px; font-size: 10px; color: var(--teal); font-weight: 700; letter-spacing: .05em; }

.profile-blessing-card--today { border-left: none; padding-left: 0; }

.profile-overview{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:0 16px 12px}.profile-overview>div{padding:13px 8px;text-align:center;border:1px solid var(--line-soft);border-radius:14px;background:var(--panel)}.profile-overview strong{display:block;color:var(--teal);font-size:20px}.profile-overview span{display:block;color:var(--dim);font-size:10px;margin-top:2px}.profile-local-note{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 16px 14px;padding:12px 14px;border:1px solid rgba(201,168,76,.22);border-radius:14px;background:rgba(201,168,76,.05)}.profile-local-note div{display:flex;flex-direction:column;gap:2px}.profile-local-note strong{font-size:12px;color:var(--gold)}.profile-local-note span{font-size:10px;color:var(--dim)}.profile-local-note button,.profile-delete{border:0;background:transparent;color:var(--dim);font-size:10px;padding:5px;white-space:nowrap}.profile-delete{display:block;margin:8px 0 0 auto;color:#d78f8f}.profile-blessing-card .profile-delete{display:inline;margin-left:8px}


/* ─── Profile collapse button ──────────────────────────────────────── */
.profile-collapse { display: block; width: 100%; border: none; background: rgba(93,219,184,.08); color: var(--teal); font-size: 12px; padding: 8px; border-radius: 8px; cursor: pointer; margin-bottom: 10px; }
.profile-collapse:hover { background: rgba(93,219,184,.15); }
.profile-delete { display: inline-block; margin-top: 12px; border: 1px solid rgba(224,92,106,.25); background: rgba(224,92,106,.06); color: var(--accent); font-size: 11px; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.profile-delete:hover { background: rgba(224,92,106,.15); }


/* ─── Profile blessing collapsed & show more ───────────────────────── */
.profile-blessing-card--collapsed { display: none; }
.profile-show-more { display: block; width: 100%; border: 1px solid var(--line-soft); background: rgba(255,255,255,.03); color: var(--muted); font-size: 12px; padding: 10px; border-radius: 10px; cursor: pointer; margin-top: 8px; text-align: center; }
.profile-show-more:hover { background: rgba(255,255,255,.06); color: var(--text); }


/* ─── SPA loading state ─────────────────────────────────────────────── */
.spa-loading {
  display: grid;
  place-items: center;
  min-height: 60vh;
  padding: 40px;
}

/* Fix: blessing.css sets display:flex on these, which overrides [hidden] attribute */
.prayer-sound[hidden] { display: none !important; }
.prayer-hall__empty[hidden] { display: none !important; }
