/* ===== Chùa LangGoal · Xin Quẻ Phật Tổ ===== */
:root {
  --bg: #3a120b;
  --bg-deep: #140604;
  --gold: #d4a84b;
  --gold-l: #f0d58a;
  --gold-d: #a87b28;
  --cream: #f5e6c8;
  --cream-dim: #d9c6a2;
  --serif: "Playfair Display", "Noto Serif", Georgia, serif;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ph: 340px; /* chiều cao bảng tuỳ chọn tính từ đáy màn hình (JS cập nhật) */
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh; min-height: 100dvh;
  background: var(--bg-deep);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold-l); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Ảnh chánh điện ---------- */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; overflow: clip; background: #1d0805; }
.scene-img {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 40%; /* trước khi JS căn tượng Phật */
  max-width: none; transition: filter 1.2s;
}
@media (min-aspect-ratio: 1/1) { /* laptop: mép dưới ảnh mờ dần vào nền tối sau bảng */
  .scene-img { -webkit-mask-image: linear-gradient(#000 90%, transparent); mask-image: linear-gradient(#000 90%, transparent); }
}
.scene::after { /* tối nhẹ phía trên cho chữ dễ đọc */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(20, 6, 4, .72) 0, rgba(20, 6, 4, 0) 130px),
    radial-gradient(130% 90% at 50% 40%, transparent 55%, rgba(20, 6, 4, .55) 100%);
}
/* Câu đối, hoành phi phủ lên ảnh (js/scene-text.js) */
.scene-text { position: absolute; inset: 0; z-index: 1; }
.hx {
  position: absolute; left: 0; top: 0; transform-origin: 0 0;
  margin: 0; padding: 0; border: 0; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hx-field {
  position: absolute; inset: 0; z-index: 0; display: flex; align-items: center; justify-content: space-evenly;
  font-family: "LXGW WenKai TC", "Kaiti TC", "STKaiti", "KaiTi", "BiauKai", serif; font-weight: 700; line-height: 1;
}
/* Nền dưới chữ: làm nhoè chính vân gỗ/đá của ảnh để xoá chữ cũ, mép mờ dần vào khung gốc */
.hx-field::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 3px;
  backdrop-filter: blur(5px) saturate(.9); -webkit-backdrop-filter: blur(5px) saturate(.9);
  -webkit-mask: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent), linear-gradient(180deg, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-composite: source-in;
  mask: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent), linear-gradient(180deg, transparent, #000 5%, #000 95%, transparent);
  mask-composite: intersect;
}
.hx-h .hx-field::before {
  -webkit-mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent), linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
  -webkit-mask-composite: source-in;
  mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent), linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
  mask-composite: intersect;
}
.hx-stone .hx-field::before { background: rgba(40, 34, 29, .62); }
.hx-wood .hx-field::before { background: rgba(48, 30, 16, .6); }
.hx-red .hx-field::before { background: rgba(92, 22, 13, .58); }
.hx-v .hx-field { flex-direction: column; }
/* Chữ khắc thếp vàng: vàng ngả theo ánh đèn, có rãnh tối cho cảm giác chạm sâu vào gỗ */
.hx-field i {
  font-style: normal; display: block; opacity: .9;
  background: linear-gradient(180deg, #f0d184 0%, #c99a45 55%, #a87830 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 .06em 0 rgba(20, 8, 2, .7)) drop-shadow(0 -.03em 0 rgba(255, 236, 190, .25));
  transition: filter .25s;
}
.hx-clear .hx-field::before { content: none; }
.hx:hover .hx-field i, .hx:focus-visible .hx-field i { filter: brightness(1.25) drop-shadow(0 .06em 0 rgba(20, 8, 2, .7)); }
.hx-clear:hover, .hx-clear:focus-visible { box-shadow: 0 0 16px 2px rgba(255, 210, 120, .22); border-radius: 4px; }

.lit .scene-img { filter: brightness(1.08) saturate(1.05); }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }

/* ---------- Thanh trên ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 0;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;
  padding: 4px 14px 4px 4px; margin-left: -4px; border-radius: 99px;
  background: radial-gradient(closest-side, rgba(20, 6, 4, .55), rgba(20, 6, 4, 0));
}
.logo-mark {
  display: block; height: 56px; width: 53px; flex: none;
  filter: drop-shadow(0 0 3px rgba(255, 214, 130, .75)) drop-shadow(0 0 10px rgba(255, 190, 90, .45));
}
.wordmark { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.wordmark b {
  font: 700 22px/1 "Cinzel", var(--serif); letter-spacing: .04em; text-transform: uppercase;
  color: #fffaf0; text-shadow: 0 0 8px rgba(255, 220, 150, .55), 0 1px 3px rgba(0, 0, 0, .8);
}
.wordmark i { font-style: normal; color: #f8d77e; }
.wordmark small {
  margin-top: 5px; font: 600 10px/1 var(--sans); letter-spacing: .42em; padding-left: .42em; text-transform: uppercase;
  color: #f3cf7a; text-shadow: 0 0 6px rgba(255, 200, 110, .6), 0 1px 2px rgba(0, 0, 0, .8);
}
.icon-btn {
  width: 46px; height: 46px; flex: none; border-radius: 50%;
  border: 1.5px solid rgba(212, 168, 75, .7); background: rgba(20, 6, 4, .6); color: var(--gold-l);
  display: grid; place-items: center; font-size: 20px; line-height: 1;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.icon-btn[aria-pressed="true"] { background: rgba(212, 168, 75, .28); }

/* ---------- Nhang + ống xăm (CSS thuần) ---------- */
.offer {
  position: fixed; left: 50%; bottom: calc(var(--ph) - 6px); z-index: 1;
  width: 0; height: 0;
}
.incense { position: absolute; left: -30px; bottom: 0; width: 60px; height: 70px; }
.incense::after { /* bát hương đồng */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22px;
  border-radius: 6px 6px 50% 50% / 6px 6px 100% 100%;
  background: linear-gradient(90deg, #6b4212, #f0cd7a 45%, #8a5a1e);
  box-shadow: 0 -3px 0 #4a2a0a inset, 0 4px 14px rgba(0, 0, 0, .5);
}
.stick {
  position: absolute; bottom: 14px; width: 3px; height: 50px; border-radius: 2px;
  background: linear-gradient(180deg, #9b2c1c 0 78%, #d9b679 78%);
  transform-origin: 50% 100%; transform: scaleY(0);
  transition: transform .9s cubic-bezier(.3, .8, .3, 1);
}
.stick:nth-child(1) { left: 20px; rotate: -9deg; }
.stick:nth-child(2) { left: 28.5px; height: 56px; }
.stick:nth-child(3) { left: 37px; rotate: 9deg; }
.ember {
  position: absolute; left: 50%; top: -2px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%;
  background: #3b2a24; transition: background .4s;
}
.lit .stick { transform: scaleY(1); animation: burn 300s linear 1s forwards; }
.lit .ember {
  background: #ff7a2a; box-shadow: 0 0 4px #ff9a3a, 0 0 10px #ff5a1a;
  animation: ember 1.6s ease-in-out infinite;
}
@keyframes burn { to { height: 30px; } }
@keyframes ember { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }

.xam {
  position: absolute; left: 40px; bottom: 4px; width: 66px; height: 128px;
  opacity: 0; transform: translateY(60px); transform-origin: 50% 92%;
  transition: opacity .35s, transform .45s cubic-bezier(.3, .8, .3, 1);
}
.xam.show { opacity: 1; transform: none; }
.xam.shake { animation: shake .16s ease-in-out infinite alternate; }
@keyframes shake { from { transform: rotate(-8deg) translateY(-2px); } to { transform: rotate(8deg) translateY(1px); } }
.xam-cup { position: absolute; left: 0; bottom: 0; width: 66px; height: 128px; }
/* thẻ xăm nằm sau ống: trồi lên từ miệng ống rồi rơi ra */
.que-stick {
  position: absolute; left: 50%; top: 4px; width: 12px; height: 92px; margin-left: -6px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55));
  opacity: 0; pointer-events: none;
}
.que-stick.out { animation: queOut 1s cubic-bezier(.3, .7, .4, 1) forwards; }
@keyframes queOut {
  0% { opacity: 1; transform: translateY(46px); }
  50% { opacity: 1; transform: translateY(-70px) rotate(-8deg); }
  100% { opacity: 1; transform: translate(-40px, -30px) rotate(-70deg); }
}

/* ---------- Bảng tuỳ chọn (dưới cùng) ---------- */
.panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 4;
  max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(58, 18, 11, .9), rgba(28, 8, 5, .96));
  border-top: 1.5px solid var(--gold);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 230, 170, .15);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; flex-direction: column; justify-content: center;
}
.view { animation: viewIn .35s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.say { margin: 0 0 12px; font-size: 15px; line-height: 1.5; font-weight: 500; }
.tag {
  display: inline-block; margin-right: 4px; padding: 2px 12px; vertical-align: 1px;
  border-radius: 99px; border: 1px solid var(--gold);
  background: linear-gradient(180deg, #c8361f, #8f1d10);
  font: 700 13px/1.5 var(--serif); color: #ffe7c2; letter-spacing: .02em;
}
.say .hint { color: var(--cream-dim); font-weight: 400; font-size: 14px; }

.bands { border: 0; margin: 0 -16px 12px; padding: 0; min-width: 0; }
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 4px;
  scroll-snap-type: x proximity; scroll-padding-inline: 16px; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-width: 58px; height: 42px; padding: 0 12px; border-radius: 99px; scroll-snap-align: start;
  border: 1.5px solid rgba(212, 168, 75, .55);
  background: rgba(20, 6, 4, .55);
  font-weight: 700; font-size: 15px; color: var(--cream);
  transition: transform .15s, background .2s, color .2s, box-shadow .2s;
}
.chip:hover { border-color: var(--gold-l); }
.chip[aria-checked="true"] {
  background: linear-gradient(180deg, var(--gold-l), var(--gold) 60%, var(--gold-d));
  color: var(--bg); border-color: var(--gold-l);
  box-shadow: 0 0 16px rgba(240, 200, 110, .4);
}
.bands.need .chips { animation: nudge .4s; }
.bands.need .chip { border-color: #ffb08a; }
@keyframes nudge { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.field { display: block; min-width: 0; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field em { font-style: normal; font-weight: 400; color: var(--cream-dim); }
.field input {
  display: block; width: 100%; height: 46px; padding: 0 12px; margin: 0;
  border-radius: 12px; border: 1px solid rgba(212, 168, 75, .45);
  background: rgba(20, 6, 4, .6); color: var(--cream);
  font-size: 16px; -webkit-appearance: none; appearance: none;
}
.field input::placeholder { color: rgba(245, 230, 200, .4); }
.field input:focus { outline: none; border-color: var(--gold-l); box-shadow: 0 0 0 3px rgba(212, 168, 75, .22); }
.field input[type="date"] { color-scheme: dark; min-width: 0; }
.field input[type="date"]::-webkit-date-and-time-value { text-align: left; }

.prayer {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid rgba(212, 168, 75, .35);
  background: rgba(20, 6, 4, .4);
  font-family: var(--serif); font-style: italic; font-size: 16px; line-height: 1.55; color: #fff3da;
}
.row-btns { display: flex; gap: 8px; }
.row-btns .btn-primary { flex: 1.4; }
.row-btns .btn-ghost { flex: 1; padding: 0 10px; }

/* ---------- Nút ---------- */
.btn-primary {
  height: 46px; padding: 0 18px; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #fff0bd, var(--gold) 55%, var(--gold-d));
  color: #3a120b; font-weight: 700; font-size: 16px;
  box-shadow: 0 6px 22px rgba(212, 168, 75, .35), inset 0 -2px 0 rgba(0, 0, 0, .15);
  transition: transform .15s, filter .2s;
}
.btn-primary:active { transform: scale(.98); }
.btn-primary[disabled] { filter: grayscale(.6) brightness(.7); cursor: progress; }
.btn-ghost {
  height: 46px; border-radius: 999px; border: 1px solid var(--gold);
  background: rgba(20, 6, 4, .6); color: var(--gold-l); font-weight: 600; font-size: 15px;
}

/* ---------- Hộp thoại ---------- */
.dlg {
  width: min(480px, calc(100% - 20px)); max-height: calc(100dvh - 20px);
  padding: 0; border: 0; background: transparent; color: var(--cream);
  overflow: auto; overscroll-behavior: contain;
}
.dlg::backdrop { background: rgba(10, 3, 2, .82); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.dlg[open] { animation: unfold .55s cubic-bezier(.2, .8, .2, 1); }
@keyframes unfold { from { opacity: 0; transform: translateY(24px) scale(.94); } to { opacity: 1; transform: none; } }
.dlg-close {
  position: sticky; top: 8px; float: right; margin: 8px 8px -44px 0; z-index: 3;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(212, 168, 75, .6);
  background: rgba(20, 6, 4, .75); color: var(--gold-l); font-size: 22px; line-height: 1;
}

/* Thẻ quẻ = lá sớ đỏ viền vàng */
.so {
  position: relative; margin: 10px 0 0; padding: 34px clamp(18px, 5vw, 28px) 62px;
  background:
    radial-gradient(circle at 25% 15%, rgba(255, 255, 255, .07), transparent 45%),
    repeating-linear-gradient(115deg, rgba(0, 0, 0, .035) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #a6291a, #7a160d);
  border: 3px solid var(--gold);
  box-shadow: inset 0 0 0 6px #7a160d, inset 0 0 0 7.5px var(--gold-l), 0 20px 50px rgba(0, 0, 0, .6);
  border-radius: 6px; text-align: center;
}
.corner { position: absolute; width: 38px; height: 38px; border: 2px solid var(--gold-l); pointer-events: none; }
.corner::after { content: ""; position: absolute; inset: 5px; border: inherit; border-radius: inherit; }
.corner.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.corner.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.corner.bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }
.corner.br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
.corner.tl::after { inset: 5px auto auto 5px; width: 100%; height: 100%; }
.corner.tr::after { inset: 5px 5px auto auto; width: 100%; height: 100%; }
.corner.bl::after { inset: auto auto 5px 5px; width: 100%; height: 100%; }
.corner.br::after { inset: auto 5px 5px auto; width: 100%; height: 100%; }
.so-top { margin: 0; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-l); }
.so-top b { font-size: 14px; }
.so-type {
  margin: 8px 0 0; font-family: var(--serif); font-weight: 800; font-size: clamp(30px, 9vw, 50px); line-height: 1.1; white-space: nowrap;
  background: linear-gradient(180deg, #fff3c8, #e9bf62 60%, #c2902f); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-transform: uppercase; letter-spacing: .02em;
}
.so[data-type="Trung Cát"] .so-type { background-image: linear-gradient(180deg, #fff8e2, #f0d58a 60%, #d8b46a); }
.so[data-type="Hạ Cát"] .so-type { background-image: linear-gradient(180deg, #ffffff, #f5e6c8 60%, #e3cfa6); }
.so-title { margin: 4px 0 14px; font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--cream); }
.so-poem p { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(15px, 4.2vw, 17.5px); line-height: 1.6; color: #fff3da; }
.so-poem p:nth-child(even) { margin-bottom: 4px; }
.so-div { display: flex; align-items: center; gap: 10px; margin: 16px 0; }
.so-div::before, .so-div::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.so-div span { width: 9px; height: 9px; background: var(--gold); transform: rotate(45deg); }
.so-adv { margin: 0; text-align: left; display: grid; gap: 10px; }
.so-adv div { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.so-adv dt {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(240, 213, 138, .14); border: 1px solid rgba(240, 213, 138, .55);
  font-family: var(--serif); font-weight: 800; color: var(--gold-l); font-size: 15px;
}
.so-adv dd { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--cream); }
.so-adv dd b { display: block; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-l); font-weight: 600; }
.so-note {
  margin: 18px 0 0; padding: 12px 14px; border-radius: 10px;
  background: rgba(20, 6, 4, .28); border: 1px dashed rgba(240, 213, 138, .45);
  font-family: var(--serif); font-style: italic; font-size: 16px; line-height: 1.55; color: #fff3da;
}
.so-meta { margin: 14px 0 0; font-size: 13px; color: var(--gold-l); }
.seal {
  position: absolute; right: 18px; bottom: -16px; transform: rotate(-8deg);
  width: 58px; height: 58px; display: grid; place-items: center; text-align: center;
  background: #c0291a; border: 2px solid #ffdcc4; border-radius: 6px;
  font: 800 11px/1.05 var(--serif); color: #ffe9d6; letter-spacing: .04em; text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35); opacity: .92;
}
.dlg-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 26px 2px 0; }
.dlg-actions .btn-primary { grid-column: 1 / -1; width: 100%; }
.dlg-foot { margin: 14px 4px 6px; font-size: 12.5px; text-align: center; color: rgba(245, 230, 200, .6); }

.dlg.small { width: min(400px, calc(100% - 24px)); }
.sheet {
  margin-top: 10px; padding: 26px 20px 22px; border-radius: 16px; text-align: center;
  background: linear-gradient(180deg, #4a160c, #2a0b06); border: 1px solid rgba(212, 168, 75, .5);
}
.sheet h3 { margin: 0 0 16px; font-family: var(--serif); color: var(--gold-l); font-size: 21px; }
.sheet-btn {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 50px; margin-bottom: 10px;
  border-radius: 12px; border: 1px solid var(--gold); background: rgba(20, 6, 4, .5);
  color: var(--cream); text-decoration: none; font-weight: 600;
}
.sheet-note { margin: 6px 0 0; font-size: 13px; color: var(--cream-dim); }
#imgPreview { width: 100%; height: auto; border-radius: 6px; display: block; }
/* Bản Artifact: không cho bôi đen chữ (ô nhập và ảnh thẻ quẻ vẫn dùng bình thường) */
.no-copy body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.no-copy input { -webkit-user-select: text; user-select: text; }
.no-copy #imgPreview { -webkit-touch-callout: default; }

.toast {
  position: fixed; left: 50%; top: calc(76px + env(safe-area-inset-top)); z-index: 30;
  transform: translate(-50%, -16px); opacity: 0; pointer-events: none;
  width: max-content; max-width: calc(100% - 32px); padding: 9px 18px; border-radius: 99px;
  background: #f5e6c8; color: #3a120b; font-weight: 600; font-size: 14.5px; text-align: center;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .45); transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Laptop / tablet ngang ---------- */
@media (min-width: 760px) {
  .topbar { padding: calc(20px + env(safe-area-inset-top)) 28px 0; }
  .logo-mark { height: 76px; width: 72px; }
  .wordmark b { font-size: 30px; }
  .wordmark small { font-size: 12px; margin-top: 7px; }
  .panel {
    left: 50%; right: auto; bottom: 20px; transform: translateX(-50%);
    width: min(960px, calc(100% - 48px)); padding: 18px 22px 20px;
    border: 1.5px solid var(--gold); border-radius: 22px;
  }
  .offer { bottom: calc(var(--ph) - 6px); }
  .xam { scale: 1.25; transform-origin: 50% 100%; }
  .bands { margin: 0 0 14px; }
  .chips { display: grid; grid-template-columns: repeat(9, 1fr); padding: 2px 0 0; overflow: visible; }
  .chip { min-width: 0; }
  .grid { grid-template-columns: 1fr 1fr 1fr 210px; gap: 12px; }
  .say { font-size: 16px; }
  .prayer { font-size: 17px; }
  #viewPray { display: grid; grid-template-columns: 1fr 230px; column-gap: 16px; align-items: center; }
  #viewPray .say { grid-column: 1 / -1; }
  #viewPray .prayer { margin: 0; }
  .row-btns { display: grid; grid-template-columns: 1fr 1fr; }
  .row-btns .btn-primary { grid-column: 1 / -1; order: -1; }
  .row-btns .btn-ghost { font-size: 14px; padding: 0 6px; }
  .row-btns:has(#reopenBtn[hidden]) #editBtn { grid-column: 1 / -1; }
  .toast { top: calc(110px + env(safe-area-inset-top)); }
}
@media (max-height: 520px) {
  .logo-mark { height: 44px; width: 42px; }
  .wordmark b { font-size: 18px; }
}

/* ---------- Giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .lit .stick, .lit .ember { animation: none !important; }
  .que-stick.out { opacity: 1; transform: translate(-40px, -30px) rotate(-70deg); }
}
