/* Thắp Hương Online — bát hương chung, tông ấm chữa lành trên nền pastel Mèo Béo */
.th-wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; color: var(--text-main, #5c4b47); }

/* ── Hero ── */
.th-hero { text-align: center; margin-bottom: 18px; }
.th-eyebrow {
  display: inline-block; font-weight: 700; font-size: 0.82rem; color: var(--accent, #d67d63);
  background: var(--peach-light, #fff5f2); border: 1px solid var(--border-soft, #ffe6e0);
  padding: 5px 14px; border-radius: 999px; margin: 0 0 10px;
}
.th-title { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 2rem; color: var(--accent-soft, #e59882); margin: 0 0 8px; }
.th-sub { color: var(--text-muted, #8a7772); line-height: 1.6; margin: 0 auto; max-width: 48ch; }
.th-sub strong { color: var(--accent, #d67d63); }

/* ── Bàn thờ ── */
.th-altar-card {
  position: relative;
  background: radial-gradient(120% 90% at 50% 10%, #fff8ee 0%, #fff3f0 60%, #ffeef0 100%);
  border: 1px solid var(--border-soft, #ffe6e0); border-radius: 28px;
  box-shadow: var(--shadow-card, 0 8px 24px -10px rgba(250, 208, 196, 0.6));
  padding: 14px 14px 18px; margin-bottom: 22px; overflow: hidden;
}
.th-scene { position: relative; }
.th-altar { display: block; width: 100%; height: auto; }

.th-sound {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 40px; height: 40px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, 0.85); border: 1px solid var(--border-soft, #ffe6e0);
  box-shadow: 0 4px 12px rgba(250, 208, 196, 0.4); transition: transform 0.2s;
  display: grid; place-items: center; padding: 0;
}
.th-sound-ico { width: 22px; height: 22px; }
.th-sound:hover { transform: scale(1.08); }

/* Icon SVG dùng chung */
.th-ico { width: 1.3em; height: 1.3em; display: inline-block; vertical-align: -0.28em; flex-shrink: 0; }
.th-ico.big { width: 2.3rem; height: 2.3rem; vertical-align: middle; }
.th-chip-face .th-ico { width: 20px; height: 20px; vertical-align: -4px; }
.th-promo-ico { width: 32px; height: 32px; display: block; }

.th-live { text-align: center; margin: 8px 0 0; font-size: 0.9rem; font-weight: 600; color: var(--text-main, #5c4b47); }
.th-live strong { color: var(--accent, #d67d63); font-family: 'Nunito', sans-serif; }
.th-live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #ff5a2f; margin-right: 3px; animation: th-pulse 1.7s ease-in-out infinite; }
@keyframes th-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 47, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(255, 90, 47, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 47, 0); } }
.th-altar-hint { text-align: center; color: var(--text-muted, #8a7772); font-size: 0.86rem; margin: 4px 0 0; min-height: 1.3em; }

/* ── Ngọn nến (luôn lung linh) ── */
.th-flame, .th-flame-core { transform-box: fill-box; transform-origin: 50% 100%; }
.th-candle-l .th-flame { animation: th-flicker 1.9s ease-in-out infinite; }
.th-candle-r .th-flame { animation: th-flicker 2.3s ease-in-out infinite 0.4s; }
.th-candle-l .th-flame-core { animation: th-flicker 1.5s ease-in-out infinite; }
.th-candle-r .th-flame-core { animation: th-flicker 1.7s ease-in-out infinite 0.3s; }
.th-flame-glow { animation: th-glow 2.1s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 70%; }
@keyframes th-flicker { 0%, 100% { transform: scaleY(1) scaleX(1); opacity: 1; } 40% { transform: scaleY(1.14) scaleX(0.94) translateY(-1px); opacity: 0.92; } 70% { transform: scaleY(0.96) scaleX(1.04); opacity: 1; } }
@keyframes th-glow { 0%, 100% { opacity: 0.55; } 50% { opacity: 0.95; } }
.th-lantern { transform-box: fill-box; transform-origin: 50% 0; }
.th-lantern-l { animation: th-sway 4.5s ease-in-out infinite; }
.th-lantern-r { animation: th-sway 5.2s ease-in-out infinite 0.6s; }
@keyframes th-sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }

/* ── Nén hương trong bát (JS đổ vào) ── */
.th-live-stem { stroke: #a86a3f; stroke-width: 2.2; stroke-linecap: round; }
.th-live-ember { fill: #ff5a2f; filter: drop-shadow(0 0 2.5px rgba(255, 120, 60, 0.9)); animation: th-ember 1.8s ease-in-out infinite; }
.th-stk { cursor: pointer; }
.th-stk:nth-child(even) .th-live-ember { animation-delay: 0.6s; }
.th-stk:nth-child(3n) .th-live-ember { animation-delay: 1.1s; }
.th-stk.mine .th-live-ember { fill: #ffb43c; filter: drop-shadow(0 0 4px rgba(255, 180, 60, 0.95)); }
.th-stk.forme .th-live-ember { fill: #ff8ab0; filter: drop-shadow(0 0 4px rgba(255, 138, 176, 0.95)); }
.th-stk .th-mk { font-size: 9px; }
@keyframes th-ember { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }

/* ── Khói chung ── */
.th-smoke { opacity: 0; transition: opacity 0.6s; }
.th-scene.has-sticks .th-smoke { opacity: 1; }
.th-wisp { opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; }
.th-scene.has-sticks .th-wisp { animation: th-rise 5.5s ease-in infinite; }
.th-scene.has-sticks .th-wisp.w2 { animation-duration: 6.4s; animation-delay: 1s; }
.th-scene.has-sticks .th-wisp.w3 { animation-duration: 5.9s; animation-delay: 2.1s; }
@keyframes th-rise {
  0% { opacity: 0; transform: translateY(6px) scaleX(0.5); }
  20% { opacity: 0.45; } 60% { opacity: 0.35; }
  100% { opacity: 0; transform: translateY(-44px) scaleX(1.35); }
}

/* ── Nén trên tay: lấy ra → châm lửa → cắm ── */
.th-hand {
  position: absolute; left: 50%; top: 84%; width: 7px; height: 58px;
  transform: translate(-50%, -50%) rotate(10deg); transform-origin: 50% 50%;
  opacity: 0; pointer-events: none; z-index: 4;
  transition: left 0.85s cubic-bezier(0.45, 0, 0.25, 1), top 0.85s cubic-bezier(0.45, 0, 0.25, 1), transform 0.85s ease, opacity 0.4s ease;
}
.th-hand.show { opacity: 1; }
.th-hand-stick { position: absolute; inset: 0; border-radius: 4px; background: linear-gradient(90deg, #c9905e, #a86a3f); box-shadow: inset -1px 0 rgba(0, 0, 0, 0.18); }
.th-hand-ember { position: absolute; left: 50%; top: -3px; width: 8px; height: 8px; border-radius: 50%; transform: translateX(-50%); background: #c3bab0; transition: background 0.3s, box-shadow 0.3s; }
.th-hand.lit .th-hand-ember { background: #ff5a2f; box-shadow: 0 0 9px 2px rgba(255, 120, 50, 0.9); }

/* ── Popover chi tiết 1 nén ── */
.th-pop {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 6;
  width: min(280px, 88%); background: #fff; border: 1px solid var(--border-soft, #ffe6e0);
  border-radius: 16px; box-shadow: 0 12px 30px rgba(120, 80, 60, 0.22); padding: 12px 14px; text-align: left;
  animation: th-fade 0.25s ease;
}
.th-pop[hidden] { display: none; }
.th-pop-close { position: absolute; top: 6px; right: 8px; border: none; background: none; font-size: 1.2rem; line-height: 1; color: var(--text-muted, #8a7772); cursor: pointer; }
.th-pop-emoji { font-size: 1.4rem; }
.th-pop-title { font-family: 'Nunito', sans-serif; font-weight: 800; color: var(--accent, #d67d63); margin: 2px 0 4px; font-size: 0.98rem; }
.th-pop-meta { font-size: 0.76rem; color: var(--text-muted, #8a7772); margin: 0 0 6px; }
.th-pop-msg { font-style: italic; color: var(--text-main, #5c4b47); background: var(--peach-light, #fff5f2); border: 1px dashed var(--border-soft, #ffe6e0); border-radius: 12px; padding: 8px 10px; margin: 0; line-height: 1.5; font-size: 0.86rem; }
.th-pop-locked { font-size: 0.8rem; color: var(--text-muted, #8a7772); margin: 0; }

/* ── Lời chúc overlay ── */
.th-blessing { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 247, 240, 0.88); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); border-radius: 22px; padding: 18px; text-align: center; animation: th-fade 0.5s ease; z-index: 5; }
.th-blessing[hidden] { display: none; }
@keyframes th-fade { from { opacity: 0; } to { opacity: 1; } }
.th-blessing-inner { max-width: 360px; }
.th-blessing-emoji { font-size: 2.6rem; animation: th-float 3s ease-in-out infinite; }
@keyframes th-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.th-blessing-title { font-family: 'Nunito', sans-serif; font-weight: 800; color: var(--accent, #d67d63); font-size: 1.3rem; margin: 6px 0; }
.th-blessing-text { color: var(--text-main, #5c4b47); line-height: 1.6; margin: 0 0 8px; }
.th-blessing-wish { font-style: italic; color: var(--text-muted, #8a7772); background: #fff; border: 1px dashed var(--border-soft, #ffe6e0); border-radius: 14px; padding: 8px 12px; margin: 0 0 14px; line-height: 1.5; }

/* ── Panel ── */
.th-panel { background: #fff; border: 1px solid var(--border-soft, #ffe6e0); border-radius: 24px; box-shadow: var(--shadow-card, 0 8px 24px -10px rgba(250, 208, 196, 0.6)); padding: 20px 20px 22px; margin-bottom: 18px; }
.th-panel-title { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.05rem; color: var(--accent, #d67d63); margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px dashed var(--border-soft, #ffe6e0); }
.th-panel-title:not(:first-child) { margin-top: 22px; }
.th-optional { font-weight: 600; font-size: 0.8rem; color: var(--text-muted, #8a7772); }

/* ── Chips ── */
.th-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.th-chip { cursor: pointer; }
.th-chip input { position: absolute; opacity: 0; pointer-events: none; }
.th-chip-face { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 0.92rem; background: var(--peach-light, #fff5f2); color: var(--text-main, #5c4b47); border: 2px solid var(--border-soft, #ffe6e0); transition: all 0.2s; }
.th-chip:hover .th-chip-face { border-color: var(--primary-peach-hover, #fbc1b0); transform: translateY(-1px); }
.th-chip input:checked + .th-chip-face { background: linear-gradient(135deg, #fad0c4, #fbc1b0); color: #5c4b47; border-color: #fbc1b0; box-shadow: 0 4px 12px rgba(250, 208, 196, 0.6); }
.th-chip input:focus-visible + .th-chip-face { outline: 2px solid var(--accent, #d67d63); outline-offset: 2px; }
.th-chip-count .th-chip-face { min-width: 62px; justify-content: center; }
.th-count-note { font-size: 0.82rem; color: var(--text-muted, #8a7772); line-height: 1.5; margin: 10px 0 0; }

/* ── Input & textarea ── */
.th-input, .th-textarea {
  width: 100%; box-sizing: border-box; background: var(--input-bg, #fffaf9);
  border: 1.5px solid var(--border-soft, #ffe6e0); border-radius: 16px; padding: 12px 14px;
  font-family: inherit; font-size: 0.95rem; color: var(--text-main, #5c4b47);
}
.th-textarea { margin-top: 4px; resize: vertical; line-height: 1.5; }
.th-input:focus, .th-textarea:focus { outline: none; border-color: var(--primary-peach-hover, #fbc1b0); background: #fff; }
.th-msg-meta { font-size: 0.76rem; color: var(--text-muted, #8a7772); margin-top: 6px; }

/* ── Nút ── */
.th-btn { font-family: 'Nunito', sans-serif; font-weight: 800; cursor: pointer; border-radius: 999px; border: none; display: inline-flex; align-items: center; gap: 8px; transition: transform 0.25s, box-shadow 0.25s; }
.th-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.th-btn-main { width: 100%; justify-content: center; margin-top: 18px; padding: 15px 26px; font-size: 1.05rem; color: #7a4a3a; background: linear-gradient(135deg, #ffd9a0 0%, #ff9e7d 100%); box-shadow: 0 8px 20px rgba(255, 158, 125, 0.5); }
.th-btn-main:hover:not(:disabled) { transform: translateY(-3px) scale(1.01); box-shadow: 0 12px 26px rgba(255, 158, 125, 0.65); }
.th-btn-ico { width: 1.35em; height: 1.35em; }
.th-btn-ghost { background: #fff; color: var(--accent, #d67d63); border: 2px solid var(--border-soft, #ffe6e0); padding: 10px 22px; font-size: 0.95rem; }
.th-btn-ghost:hover { background: var(--peach-light, #fff5f2); border-color: var(--primary-peach-hover, #fbc1b0); }

/* ── Lời cầu nguyện gửi cho bạn / Nén của bạn ── */
.th-forme, .th-mine { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.th-forme-row, .th-mine-row {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px;
  background: var(--peach-light, #fff5f2); border: 1px solid var(--border-soft, #ffe6e0);
  border-left: 4px solid var(--tc, #ffcf5c); border-radius: 14px;
}
.th-forme-row { border-left-color: #ff8ab0; }
.th-row-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.92rem; }
.th-row-head b { color: var(--accent, #d67d63); font-family: 'Nunito', sans-serif; }
.th-row-time { margin-left: auto; font-size: 0.74rem; color: var(--text-muted, #8a7772); font-weight: 500; }
.th-row-msg { color: var(--text-main, #5c4b47); font-style: italic; font-size: 0.9rem; line-height: 1.5; }
.th-mine-row .th-row-msg { color: var(--text-muted, #8a7772); }
.th-empty { color: var(--text-muted, #8a7772); font-size: 0.9rem; margin: 4px 0 0; }
.th-burn { height: 5px; border-radius: 999px; background: #ffe1d6; overflow: hidden; margin-top: 4px; }
.th-burn > span { display: block; height: 100%; background: linear-gradient(90deg, #ff9e7d, #ffcf5c); border-radius: 999px; }

.th-footnote { text-align: center; color: var(--text-muted, #8a7772); font-size: 0.82rem; line-height: 1.6; margin: 6px auto 0; max-width: 46ch; }

/* Bù trừ header cố định khi cuộn tới bàn thờ */
.th-altar-card { scroll-margin-top: 90px; }

/* ── Thống kê dâng hương ── */
.th-stats-today { text-align: center; font-size: 1rem; color: var(--text-main, #5c4b47); margin: 0 0 14px; }
.th-stats-today strong { color: var(--accent, #d67d63); font-family: 'Nunito', sans-serif; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.th-chart { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; padding-top: 6px; }
.th-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; }
.th-bar-val { font-size: 0.72rem; font-weight: 800; font-family: 'Nunito', sans-serif; color: var(--text-muted, #8a7772); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.th-bar { width: 64%; max-width: 34px; min-height: 6px; border-radius: 8px 8px 0 0; background: linear-gradient(#ffcf5c, #ff9e7d); transition: height 0.5s ease; }
.th-bar-col.today .th-bar { background: linear-gradient(#ff9e7d, #e07a5f); box-shadow: 0 4px 10px rgba(224, 122, 95, 0.4); }
.th-bar-col.today .th-bar-val, .th-bar-col.today .th-bar-lbl { color: var(--accent, #d67d63); font-weight: 800; }
.th-bar-lbl { font-size: 0.68rem; color: var(--text-muted, #8a7772); margin-top: 6px; }

/* ── Khám phá thêm ── */
.th-promo-sub { color: var(--text-muted, #8a7772); margin: 0 0 14px; font-size: 0.92rem; }
.th-promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.th-promo-card { display: flex; flex-direction: column; gap: 3px; padding: 14px; border-radius: 16px; text-decoration: none; background: var(--peach-light, #fff5f2); border: 1px solid var(--border-soft, #ffe6e0); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.th-promo-card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px -8px rgba(250, 208, 196, 0.7); border-color: var(--primary-peach-hover, #fbc1b0); }
.th-promo-name { font-family: 'Nunito', sans-serif; font-weight: 800; color: var(--accent, #d67d63); }
.th-promo-desc { font-size: 0.8rem; color: var(--text-muted, #8a7772); line-height: 1.45; }

/* ── Nội dung + FAQ (SEO) ── */
.th-seo-p { color: var(--text-main, #5c4b47); line-height: 1.7; margin: 0 0 12px; font-size: 0.94rem; }
.th-seo-p strong { color: var(--accent, #d67d63); }
.th-faq-title { font-family: 'Nunito', sans-serif; font-weight: 800; color: var(--text-main, #5c4b47); font-size: 1rem; margin: 18px 0 10px; }
.th-faq { border: 1px solid var(--border-soft, #ffe6e0); border-radius: 14px; padding: 2px 14px; margin-bottom: 8px; background: var(--peach-light, #fff5f2); }
.th-faq summary { cursor: pointer; padding: 12px 0; font-weight: 700; font-family: 'Nunito', sans-serif; color: var(--text-main, #5c4b47); list-style: none; position: relative; padding-right: 24px; }
.th-faq summary::-webkit-details-marker { display: none; }
.th-faq summary::after { content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--accent, #d67d63); font-size: 1.2rem; font-weight: 800; }
.th-faq[open] summary::after { content: '−'; }
.th-faq p { margin: 0 0 12px; color: var(--text-muted, #8a7772); line-height: 1.6; font-size: 0.9rem; }

@media (max-width: 520px) { .th-title { font-size: 1.7rem; } .th-panel { padding: 16px 15px 18px; } }
@media (prefers-reduced-motion: reduce) {
  .th-flame, .th-flame-core, .th-flame-glow, .th-lantern-l, .th-lantern-r,
  .th-scene.has-sticks .th-wisp, .th-live-ember, .th-blessing-emoji, .th-live-dot { animation: none !important; }
  .th-blessing, .th-pop { animation: none; }
  .th-hand { transition: opacity 0.3s; }
}
