:root {
  --ink: #14110f;
  --ink-2: #221d19;
  --paper: #efe7da;
  --paper-dim: #c9bfb0;
  --muted: #a49a8c;
  --gold: #d2ad5e;
  --vermilion: #b4513a;
  --glass: rgba(24, 20, 17, 0.58);
  --glass-line: rgba(239, 231, 218, 0.14);
  --serif: "Noto Serif TC", "Noto Serif SC", "Songti TC", "Songti SC", "STSong", "PMingLiU", serif;
  --sans: "Noto Sans TC", "Noto Sans SC", "PingFang TC", "PingFang SC", "Microsoft JhengHei", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper); font-family: var(--sans); overflow: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* ---------- intro ---------- */
.overlay { position: fixed; inset: 0; display: grid; place-items: center; z-index: 30; }
.intro { background: #000; transition: opacity 2.4s ease; }
.intro.fade { opacity: 0; pointer-events: none; }
.intro-inner { text-align: center; padding: 24px; max-width: 520px; }
.intro-line { font-family: var(--serif); font-size: clamp(20px, 4.6vw, 28px); letter-spacing: 0.18em; line-height: 1.9; opacity: 0; animation: rise 2.8s 0.6s ease forwards; }
.intro-status { margin-top: 28px; color: var(--muted); font-size: 13px; min-height: 1.4em; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.btn-ghost { margin-top: 28px; background: transparent; border: 1px solid rgba(239, 231, 218, 0.38); border-radius: 999px; padding: 12px 34px; letter-spacing: 0.3em; min-height: 44px; opacity: 0; animation: rise 1.6s 2.4s ease forwards; }
.btn-ghost:hover { border-color: var(--gold); color: #fff; }
.btn-ghost.small { padding: 8px 20px; letter-spacing: 0.15em; font-size: 14px; animation: none; opacity: 1; margin-top: 12px; }
.moods { margin-top: 26px; animation: rise 1s ease both; }
.moods-q { font-family: var(--serif); letter-spacing: 0.2em; color: var(--paper-dim); }
.mood-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.mood-list button { background: rgba(239, 231, 218, 0.06); border: 1px solid var(--glass-line); border-radius: 999px; padding: 10px 18px; min-height: 44px; }
.mood-list button:hover { border-color: var(--gold); }

/* ---------- HUD ---------- */
.hud { position: fixed; z-index: 10; }
.topbar { top: calc(10px + var(--safe-t)); left: 12px; right: 12px; display: flex; align-items: center; gap: 12px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.temple { display: flex; align-items: center; gap: 8px; }
.temple-name { font-family: var(--serif); font-size: 20px; letter-spacing: 0.2em; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
.badge { font-size: 11px; border: 1px solid var(--gold); color: var(--gold); border-radius: 4px; padding: 1px 6px; }
.presence { flex: 1; text-align: center; font-size: 13px; color: var(--paper-dim); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); }
.presence .sep { margin: 0 8px; opacity: 0.5; }
.me-chip { display: flex; gap: 8px; align-items: center; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; padding: 6px 14px; min-height: 40px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 13px; }
.me-chip .rank { color: var(--gold); }
.me-chip .merit::before { content: "功德 "; color: var(--muted); }

.actions { left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 6px; padding: 8px; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 22px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none; }
.actions button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; min-height: 56px; padding: 6px 4px; background: transparent; border: 0; border-radius: 14px; font-size: 12px; color: var(--paper-dim); }
.actions button .glyph { font-family: var(--serif); font-size: 20px; color: var(--paper); line-height: 1.2; }
.actions button:hover, .actions button.on { background: rgba(239, 231, 218, 0.09); color: var(--paper); }
.actions button.primary .glyph { color: var(--gold); }
.actions button.pulse { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(210, 173, 94, 0); } 50% { box-shadow: 0 0 0 6px rgba(210, 173, 94, 0.22); } }

.hint { left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); background: var(--glass); border: 1px solid var(--glass-line); padding: 8px 16px; border-radius: 999px; font-size: 14px; letter-spacing: 0.06em; backdrop-filter: blur(10px); white-space: nowrap; }

.toasts { position: fixed; top: calc(64px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: var(--glass); border: 1px solid var(--glass-line); padding: 7px 16px; border-radius: 999px; font-size: 13px; backdrop-filter: blur(10px); animation: toast 3.6s ease forwards; }
.toast.gold { border-color: rgba(210, 173, 94, 0.5); color: #f3dfb0; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-6px); } 10%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- panels ---------- */
.panel { position: fixed; z-index: 25; background: rgba(22, 18, 15, 0.86); border: 1px solid var(--glass-line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); color: var(--paper); }
.bottom-panel { left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); border-radius: 22px; padding: 18px 22px; text-align: center; width: min(360px, calc(100vw - 24px)); }
.modal { left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 22px; padding: 22px; width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow-y: auto; text-align: center; }
.panel h2 { font-family: var(--serif); font-weight: 500; letter-spacing: 0.3em; margin: 0 0 12px; font-size: 20px; }
.panel-tip { color: var(--paper-dim); font-size: 14px; letter-spacing: 0.05em; min-height: 1.4em; }
.fineprint { color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 10px; justify-content: center; }
.btn { background: rgba(210, 173, 94, 0.14); border: 1px solid rgba(210, 173, 94, 0.55); color: #f6e7c5; border-radius: 999px; padding: 10px 26px; min-height: 44px; letter-spacing: 0.2em; }
.btn:hover { background: rgba(210, 173, 94, 0.24); }
.btn:disabled { opacity: 0.45; cursor: default; }
.close { display: block; margin: 14px auto 0; }

.hold-btn { position: relative; width: 112px; height: 112px; border-radius: 50%; border: 0; background: radial-gradient(circle at 50% 40%, rgba(255, 190, 110, 0.18), rgba(0, 0, 0, 0)); margin: 8px auto; display: grid; place-items: center; font-family: var(--serif); font-size: 18px; letter-spacing: 0.3em; user-select: none; -webkit-user-select: none; touch-action: none; }
.hold-btn svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.hold-btn .track { fill: none; stroke: rgba(239, 231, 218, 0.16); stroke-width: 3; }
.hold-btn .fill { fill: none; stroke: #ffb860; stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 276.5; stroke-dashoffset: 276.5; }

.count-pad { width: 140px; height: 140px; border-radius: 50%; border: 1px solid var(--glass-line); background: radial-gradient(circle at 40% 35%, #6d4528, #2c1a10 70%); font-family: var(--serif); font-size: 34px; color: #f2dfc0; margin: 6px auto; display: grid; place-items: center; touch-action: manipulation; user-select: none; }
.count-pad:active { transform: scale(0.97); }
.count-pad.beads { background: radial-gradient(circle at 40% 35%, #5c3c2a, #1d130d 72%); }

/* fortune */
.fortune-stage { height: 170px; display: grid; place-items: center; }
.tube { position: relative; width: 70px; height: 150px; transform-origin: 50% 100%; }
.tube.shaking { animation: shake 0.18s ease-in-out infinite alternate; }
@keyframes shake { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
.tube-body { position: absolute; bottom: 0; left: 0; right: 0; height: 100px; border-radius: 10px 10px 14px 14px; background: linear-gradient(90deg, #4a2516, #8a4a2a 45%, #3b1c10); box-shadow: inset 0 0 0 2px rgba(210, 173, 94, 0.4); }
.tube-sticks { position: absolute; bottom: 70px; left: 10px; right: 10px; height: 80px; display: flex; justify-content: space-around; align-items: flex-end; }
.tube-sticks i { width: 5px; height: 70px; background: linear-gradient(#d9b98a, #a77d4a); border-radius: 2px; }
.tube-sticks i:nth-child(2n) { height: 62px; }
.tube.drop .tube-sticks i:nth-child(4) { animation: drop 1.1s ease-in forwards; }
@keyframes drop { 0% { transform: none; } 40% { transform: translateY(-40px) rotate(8deg); } 100% { transform: translate(60px, 60px) rotate(80deg); opacity: 0.9; } }
.jiao { display: flex; gap: 22px; }
.jiao .block { width: 46px; height: 92px; background: radial-gradient(ellipse at 40% 35%, #c3533a, #7a2416 70%); border-radius: 50% 50% 46% 46% / 70% 70% 30% 30%; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5); }
.jiao.flat .block { background: linear-gradient(#e6c9a3, #b38a5c); border-radius: 50% 50% 46% 46% / 70% 70% 30% 30%; }
.jiao.mixed .b { background: linear-gradient(#e6c9a3, #b38a5c); }
.jiao.toss .block { animation: toss 0.9s ease-out; }
@keyframes toss { 0% { transform: translateY(0) rotate(0); } 45% { transform: translateY(-80px) rotate(360deg); } 100% { transform: translateY(0) rotate(720deg); } }

.lot { margin-top: 14px; border: 1px solid rgba(210, 173, 94, 0.4); border-radius: 14px; padding: 16px; background: linear-gradient(#2a201a, #1a1411); }
.lot header { display: flex; justify-content: space-between; color: var(--gold); font-family: var(--serif); letter-spacing: 0.2em; }
.lot-level { border: 1px solid var(--gold); padding: 0 8px; border-radius: 4px; }
.lot-poem { display: flex; flex-direction: row-reverse; justify-content: center; gap: 18px; margin: 18px 0; font-family: var(--serif); font-size: 21px; letter-spacing: 0.2em; }
.lot-poem span { writing-mode: vertical-rl; }
.lot-meaning { line-height: 1.8; }
.lot-advice { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.lot-advice button { background: transparent; border: 1px solid var(--glass-line); border-radius: 999px; padding: 4px 12px; font-size: 13px; min-height: 32px; }
.lot-advice button[aria-selected="true"] { border-color: var(--gold); color: var(--gold); }
.lot-advice-text { color: var(--paper-dim); min-height: 1.6em; }

/* wish */
.wish-form { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.wish-form textarea { background: rgba(239, 231, 218, 0.06); color: var(--paper); border: 1px solid var(--glass-line); border-radius: 10px; padding: 10px; font: inherit; resize: none; }
.check { font-size: 13px; color: var(--paper-dim); }
.support { background: rgba(180, 81, 58, 0.15); border: 1px solid rgba(180, 81, 58, 0.5); padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.7; text-align: left; }
.wish-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; text-align: left; }
.wish-list li { background: linear-gradient(#e9d7b4, #d6bd8f); color: #3a2414; border-radius: 6px; padding: 10px 10px 8px; font-family: var(--serif); font-size: 14px; line-height: 1.5; position: relative; }
.wish-list li .who { display: block; font-size: 11px; color: #7a5a3a; margin-top: 4px; }
.wish-list li button { position: absolute; right: 6px; bottom: 4px; border: 0; background: transparent; color: #8a3b24; font-size: 12px; min-height: 28px; }

.greet-menu { position: fixed; z-index: 26; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 16px; padding: 8px; display: flex; flex-direction: column; gap: 2px; backdrop-filter: blur(14px); min-width: 140px; }
.greet-menu p { margin: 4px 8px 6px; color: var(--gold); font-family: var(--serif); font-size: 14px; }
.greet-menu button { background: transparent; border: 0; text-align: left; padding: 9px 12px; border-radius: 10px; min-height: 40px; }
.greet-menu button:hover { background: rgba(239, 231, 218, 0.08); }

.me-stats { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; text-align: left; margin: 8px auto 12px; width: fit-content; }
.me-stats dt { color: var(--muted); }

/* breath */
.breath { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); z-index: 12; text-align: center; pointer-events: auto; }
.breath-ring { width: 120px; height: 120px; margin: 0 auto; border-radius: 50%; border: 1px solid rgba(239, 231, 218, 0.25); display: grid; place-items: center; }
.breath-core { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 196, 120, 0.7), rgba(255, 196, 120, 0.05) 70%); transition: transform 4s ease-in-out; }
.breath-word { font-family: var(--serif); letter-spacing: 0.4em; margin: 10px 0 2px; }
.breath-time { color: var(--muted); font-size: 13px; margin: 0; }

/* ---------- 點燈 / 燈牆 / 祈福卡 ---------- */
.lamp-form { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.lamp-form input[type=text], .lamp-form input:not([type]) { background: rgba(239, 231, 218, 0.06); color: var(--paper); border: 1px solid var(--glass-line); border-radius: 10px; padding: 10px; font: inherit; min-height: 44px; }
.lamp-form label { font-size: 13px; color: var(--paper-dim); }
.lamp-kinds { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.lamp-kind { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 10px 10px 34px; border: 1px solid var(--glass-line); border-radius: 12px; cursor: pointer; background: rgba(239, 231, 218, 0.04); }
.lamp-kind input { position: absolute; opacity: 0; }
.lamp-kind::before { content: ''; position: absolute; left: 12px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--k, #ffc861); box-shadow: 0 0 10px 3px var(--k, #ffc861); opacity: 0.35; transition: opacity 0.3s; }
.lamp-kind:has(input:checked) { border-color: rgba(210, 173, 94, 0.7); background: rgba(210, 173, 94, 0.1); }
.lamp-kind:has(input:checked)::before { opacity: 1; }
.lamp-kind:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.lamp-kind b { font-family: var(--serif); font-weight: 500; color: var(--paper); letter-spacing: 0.1em; }
.lamp-kind small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.k-guangming { --k: #ffc861; } .k-yaoshi { --k: #7fb4ff; } .k-changming { --k: #ff8a4a; } .k-qifu { --k: #ffd88a; }
.seg { display: flex; border: 1px solid var(--glass-line); border-radius: 999px; padding: 3px; margin: 4px 0; }
.seg label { flex: 1; text-align: center; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 9px 0; border-radius: 999px; color: var(--paper-dim); cursor: pointer; letter-spacing: 0.15em; }
.seg input:checked + span { background: rgba(210, 173, 94, 0.18); color: #f6e7c5; }
.seg input:focus-visible + span { outline: 2px solid var(--gold); }
.hold-bar { --p: 0; position: relative; overflow: hidden; margin-top: 6px; user-select: none; -webkit-user-select: none; touch-action: none; }
.hold-bar::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255, 184, 96, 0.55), rgba(255, 214, 140, 0.35)); transform: scaleX(var(--p)); transform-origin: left; }
.hold-bar span { position: relative; z-index: 1; }
.lamp-done { padding: 6px 0 4px; }
.lamp-done .row { flex-wrap: wrap; align-items: center; }
.lamp-mine-title { font-family: var(--serif); font-weight: 500; font-size: 15px; letter-spacing: 0.25em; color: var(--paper-dim); margin: 18px 0 8px; }
.lamp-mine { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; text-align: left; }
.lamp-mine li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 12px 8px 30px; border: 1px solid var(--glass-line); border-radius: 10px; position: relative; font-size: 14px; }
.lamp-mine li::before { content: ''; position: absolute; left: 12px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--k, #ffc861); box-shadow: 0 0 8px 2px var(--k, #ffc861); }
.lamp-mine li.empty { padding-left: 12px; color: var(--muted); }
.lamp-mine li.empty::before { display: none; }
.lamp-mine small { color: var(--muted); }
.lamp-mine .btn-ghost.small { margin: 0 0 0 auto; padding: 4px 14px; min-height: 32px; }
.card-lamp { width: 120px; height: 120px; margin: 4px auto 8px; position: relative; }
.card-lamp::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(255, 214, 140, 0.75), rgba(255, 160, 70, 0.18) 45%, transparent 70%); animation: glow 3.6s ease-in-out infinite; }
.card-lamp i { position: absolute; left: 50%; top: 30px; width: 18px; height: 40px; margin-left: -9px; border-radius: 50% 50% 45% 45%; background: radial-gradient(circle at 50% 70%, #fff7e2, #ffc56b 60%, #ff8a3a); animation: flicker 2.2s ease-in-out infinite; }
.card-lamp::after { content: ''; position: absolute; left: 50%; bottom: 26px; width: 76px; height: 18px; margin-left: -38px; border-radius: 50%; background: linear-gradient(#e2c27a, #9c7a34); }
.card-view { margin: 0 auto 4px; max-width: 420px; animation: rise 2s 0.3s ease both; }
.card-view.out .card-lamp::before, .card-view.out .card-lamp i { opacity: 0.25; animation: none; }
.card-title { font-family: var(--serif); font-weight: 500; font-size: clamp(20px, 5vw, 26px); letter-spacing: 0.12em; line-height: 1.6; margin: 0 0 10px; }
.card-kind { color: var(--gold); font-family: var(--serif); letter-spacing: 0.15em; margin: 0 0 12px; }
.card-wish { font-family: var(--serif); font-size: 18px; line-height: 1.8; color: var(--paper); margin: 0 0 6px; }
.card-from { color: var(--paper-dim); margin: 0 0 8px; }
@keyframes glow { 0%, 100% { opacity: 0.8; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes flicker { 0%, 100% { transform: scaleY(1) translateY(0); } 40% { transform: scaleY(1.06) translateY(-1px); } 70% { transform: scaleY(0.97) translateY(1px); } }
@media (prefers-reduced-motion: reduce) { .card-lamp::before, .card-lamp i { animation: none; } }

/* ---------- 黃曆 ---------- */
.alm-chip { position: relative; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; padding: 4px 12px; min-height: 32px; font-family: var(--serif); font-size: 13px; letter-spacing: 0.1em; color: var(--paper-dim); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.alm-chip.fresh::after { content: ''; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--vermilion); box-shadow: 0 0 6px rgba(180, 81, 58, 0.8); }
.alm { text-align: left; }
.alm h2, .alm > .fineprint, .alm .close { text-align: center; display: block; margin-left: auto; margin-right: auto; }
.alm h3 { font-family: var(--serif); font-weight: 500; font-size: 14px; letter-spacing: 0.25em; color: var(--paper-dim); margin: 18px 0 8px; }
.alm-head { text-align: center; }
.alm-solar { margin: 0; color: var(--paper-dim); font-size: 14px; }
.alm-lunar { margin: 4px 0; font-family: var(--serif); font-size: 24px; letter-spacing: 0.12em; color: var(--paper); }
.alm-term { margin: 4px 0; color: var(--gold); font-size: 13px; letter-spacing: 0.1em; }
.alm-fest { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.alm-badge { border: 1px solid rgba(180, 81, 58, 0.6); color: #e6a08e; border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.alm-daily { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: linear-gradient(#2a201a, #1a1411); border: 1px solid rgba(210, 173, 94, 0.35); text-align: center; }
.alm-daily h3 { margin-top: 0; }
.alm-line { font-family: var(--serif); font-size: 20px; line-height: 1.8; letter-spacing: 0.08em; margin: 0 0 4px; text-wrap: balance; }
.alm-yiji { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.alm-yiji > div { border: 1px solid var(--glass-line); border-radius: 12px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; }
.alm-yiji b { font-family: var(--serif); font-size: 22px; line-height: 1; padding: 6px 8px; border-radius: 8px; flex: none; }
.alm-yiji .yi b { color: #f6e7c5; background: rgba(95, 138, 90, 0.45); }
.alm-yiji .ji b { color: #f6e7c5; background: rgba(180, 81, 58, 0.45); }
.alm-yiji span span { display: inline-block; margin: 2px 8px 2px 0; font-size: 14px; }
.alm-hours { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.alm-hours li { text-align: center; border-radius: 10px; padding: 6px 0; border: 1px solid transparent; color: var(--muted); background: rgba(239, 231, 218, 0.03); }
.alm-hours li b { display: block; font-family: var(--serif); font-size: 17px; font-weight: 500; }
.alm-hours li small { font-size: 10px; }
.alm-hours li.good { color: #f6e7c5; background: rgba(210, 173, 94, 0.16); }
.alm-hours li.now { border-color: var(--gold); }
.alm-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; }
.alm-facts div { border: 1px solid var(--glass-line); border-radius: 10px; padding: 8px; text-align: center; }
.alm-facts dt { color: var(--muted); font-size: 12px; min-height: 1.2em; }
.alm-facts dd { margin: 2px 0 0; font-family: var(--serif); font-size: 15px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; border: 1px solid rgba(255, 255, 255, 0.3); }
.alm-taisui { margin-top: 14px; }
.alm-taisui p { margin: 2px 0; }
.alm-taisui p:first-child { font-family: var(--serif); letter-spacing: 0.08em; }
.alm-my { font-family: var(--serif); font-size: 18px; letter-spacing: 0.15em; margin: 4px 0 8px; }
.alm-bday { color: var(--gold); font-family: var(--serif); }
.alm-guardian { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(210, 173, 94, 0.45); background: radial-gradient(circle at 15% 30%, rgba(210, 173, 94, 0.18), transparent 60%); margin-bottom: 8px; }
.alm-guardian small { color: var(--muted); letter-spacing: 0.2em; }
.alm-guardian b { font-family: var(--serif); font-weight: 500; font-size: 18px; color: #f6e7c5; letter-spacing: 0.12em; }
.alm-guardian span { color: var(--paper-dim); font-size: 14px; }
.alm-form { display: flex; flex-direction: column; gap: 8px; }
.alm-ymd { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; }
.alm-ymd legend { font-size: 13px; color: var(--paper-dim); margin-bottom: 6px; }
.alm-ymd input, .alm-ymd select { background: rgba(239, 231, 218, 0.06); color: var(--paper); border: 1px solid var(--glass-line); border-radius: 10px; padding: 10px; font: inherit; min-height: 44px; min-width: 0; }
.alm-ymd select option { background: #1d1814; }
@media (max-width: 380px) { .alm-hours { grid-template-columns: repeat(4, 1fr); } .alm-yiji { grid-template-columns: 1fr; } }

/* ---------- 靜坐去處 ---------- */
.sit-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.sit-options button { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 14px 8px; min-height: 76px; background: rgba(239, 231, 218, 0.05); border: 1px solid var(--glass-line); border-radius: 16px; }
.sit-options button:hover { border-color: var(--gold); }
.sit-options b { font-family: var(--serif); font-weight: 500; letter-spacing: 0.2em; font-size: 17px; }
.sit-options small { color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ---------- 禪房 ---------- */
.topbar.quiet .presence, .topbar.quiet .alm-chip { display: none; }
.zen-fade { position: fixed; inset: 0; z-index: 28; background: #050403; opacity: 0; transition: opacity 0.9s ease; display: grid; place-items: center; pointer-events: none; }
.zen-fade.on { opacity: 1; pointer-events: auto; }
.zen-fade p { font-family: var(--serif); letter-spacing: 0.3em; color: var(--paper-dim); }
.zen { position: fixed; inset: 0; z-index: 11; pointer-events: none; transition: opacity 2.5s ease; }
.zen > * { pointer-events: auto; }
.zen-top { position: absolute; top: calc(64px + var(--safe-t)); left: 0; right: 0; text-align: center; pointer-events: none; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8); }
.zen-top h2 { font-family: var(--serif); font-weight: 500; letter-spacing: 0.6em; font-size: 18px; margin: 0; padding-left: 0.6em; color: var(--paper-dim); }
.zen-time { margin: 6px 0 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.zen-left { margin: 2px 0 0; font-size: 13px; color: var(--gold); font-variant-numeric: tabular-nums; min-height: 1.3em; }
.zen-breath { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.zen-bar { position: absolute; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); width: min(460px, calc(100vw - 16px)); display: grid; gap: 8px; padding: 10px; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 22px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: opacity 2s ease; }
.zen-timers, .zen-acts { display: flex; gap: 6px; }
.zen-timers button, .zen-acts button { flex: 1 1 0; min-height: 44px; background: transparent; border: 1px solid transparent; border-radius: 14px; font-size: 14px; color: var(--paper-dim); letter-spacing: 0.1em; }
.zen-timers button { font-size: 13px; min-height: 36px; }
.zen-timers button[aria-pressed="true"], .zen-acts button[aria-pressed="true"] { border-color: rgba(210, 173, 94, 0.55); color: var(--gold); }
.zen-acts button:hover, .zen-timers button:hover { background: rgba(239, 231, 218, 0.07); color: var(--paper); }
#zen-copy { color: var(--gold); }
/* 熄燈: everything fades; a tap anywhere brings it back */
.zen.dim { pointer-events: auto; }
.zen.dim .zen-bar, .zen.dim .zen-top { opacity: 0; pointer-events: none; }
body:has(.zen.dim) .topbar { opacity: 0; transition: opacity 2s ease; }

/* ---------- 抄經 ---------- */
.copy { width: min(480px, calc(100vw - 16px)); background: #ebe2cf; color: #2a221b; border-color: rgba(120, 90, 60, 0.3); padding: 18px 18px 14px; }
.copy .fineprint { color: #7a6a58; }
.copy .btn-ghost.small { border-color: rgba(60, 40, 25, 0.3); color: #3a2e24; }
.copy .btn-ghost.small:hover { border-color: #a3362a; color: #a3362a; }
.copy .btn { background: rgba(163, 54, 42, 0.1); border-color: rgba(163, 54, 42, 0.5); color: #7a2a20; }
.copy .row { flex-wrap: wrap; }
.copy-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; text-align: left; }
.copy-head h2 { margin: 0; color: #2a221b; letter-spacing: 0.2em; font-size: 19px; }
.copy-head select { background: transparent; border: 1px solid rgba(60, 40, 25, 0.3); border-radius: 10px; color: #3a2e24; font: inherit; font-size: 13px; padding: 6px 8px; min-height: 36px; }
.copy-progress { margin: 10px 0 6px; font-size: 13px; color: #6a5a48; font-variant-numeric: tabular-nums; }
.copy-strip { display: flex; justify-content: center; gap: 2px; height: 34px; overflow: hidden; font-family: "BiauKai", "DFKai-SB", "Kaiti TC", "STKaiti", "KaiTi", var(--serif); font-size: 22px; line-height: 34px; }
.copy-strip span { width: 30px; flex: none; text-align: center; }
.copy-strip .done { color: #2a221b; }
.copy-strip .done img { width: 30px; height: 30px; display: block; margin: 2px 0; }
.copy-strip .now { color: #a3362a; border-bottom: 2px solid #a3362a; }
.copy-strip .next { color: rgba(60, 40, 25, 0.35); }
.copy-box { position: relative; width: min(100%, 46vh, 400px); aspect-ratio: 1; margin: 8px auto 6px; background: #f4ecdc; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(120, 90, 60, 0.15), 0 2px 10px rgba(60, 40, 20, 0.12); }
.copy-box canvas { position: absolute; inset: 0; touch-action: none; }
#copy-canvas { cursor: crosshair; transition: opacity 0.22s ease; }
#copy-canvas.settle { opacity: 0; }
.copy-done { padding: 18px 0 6px; }
.copy-dedication { font-family: "BiauKai", "DFKai-SB", "Kaiti TC", "STKaiti", "KaiTi", var(--serif); font-size: 19px; letter-spacing: 0.25em; line-height: 2; color: #3a2e24; text-wrap: balance; }

/* ---- 祖先堂 ---- */
.actions button.dot { position: relative; }
.actions button.dot::after { content: ''; position: absolute; top: 6px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.card-view.invite .card-lamp { display: none; }
.anc { position: fixed; inset: 0; z-index: 11; pointer-events: none; }
.anc > * { pointer-events: auto; }
.anc-hit { position: absolute; inset: 0; }
.anc-top { position: absolute; top: calc(58px + var(--safe-t)); left: 10px; right: 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; pointer-events: none; }
.anc-top > * { pointer-events: auto; }
.anc-head { text-align: center; min-width: 0; pointer-events: none; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9); background: rgba(12, 9, 7, 0.55); border-radius: 16px; padding: 4px 14px 6px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.anc-head h2 { font-family: var(--serif); font-weight: 500; letter-spacing: 0.3em; font-size: 17px; margin: 2px 0 0; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anc-upcoming { margin: 2px 0 0; font-size: 13px; color: var(--gold); letter-spacing: 0.05em; }
.anc-pill { background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; padding: 8px 14px; min-height: 40px; font-size: 13px; letter-spacing: 0.1em; color: var(--paper); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); white-space: nowrap; }
.anc-bar { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); text-align: center; width: min(420px, calc(100vw - 24px)); }
.anc-bar .fineprint { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9); color: var(--paper-dim); margin: 0 0 10px; }
.anc-sheet { position: absolute; left: 50%; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%); width: min(460px, calc(100vw - 16px)); max-height: 54vh; overflow-y: auto; background: rgba(22, 18, 15, 0.88); border: 1px solid var(--glass-line); border-radius: 22px; padding: 16px 18px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-sizing: border-box; }
.anc-who { display: flex; gap: 14px; align-items: flex-start; text-align: left; }
.anc-who > div { flex: 1; min-width: 0; }
.anc-who h3 { margin: 2px 0 2px; font-family: var(--serif); font-weight: 500; font-size: 19px; letter-spacing: 0.15em; }
.anc-who .fineprint { margin: 0; }
#anc-photo { width: 64px; height: 80px; object-fit: cover; border-radius: 6px; border: 2px solid #6b5532; filter: sepia(0.15); }
.anc-epitaph { margin: 6px 0 0; font-family: var(--serif); color: var(--paper-dim); font-size: 14px; line-height: 1.6; }
.anc-x { background: transparent; border: 0; color: var(--paper-dim); font-size: 22px; line-height: 1; padding: 4px 8px; min-width: 40px; min-height: 40px; }
.anc-x.small { font-size: 16px; min-width: 32px; min-height: 32px; margin-left: auto; }
.anc-offers { display: flex; gap: 6px; margin: 14px 0 6px; }
.anc-offer { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; min-height: 58px; background: rgba(239, 231, 218, 0.05); border: 1px solid var(--glass-line); border-radius: 14px; font-size: 12px; color: var(--paper-dim); }
.anc-offer .glyph { font-family: var(--serif); font-size: 20px; color: var(--paper); }
.anc-offer:hover:not(:disabled) { border-color: var(--gold); }
.anc-offer:disabled { opacity: 1; border-color: rgba(210, 173, 94, 0.45); background: rgba(210, 173, 94, 0.1); color: var(--gold); cursor: default; }
.anc-offer:disabled .glyph { color: var(--gold); }
.anc-today { text-align: left; margin: 4px 0 6px; line-height: 1.6; }
.anc-sheet .row { margin-top: 4px; align-items: center; }
.anc-sheet .row .btn-ghost.small { margin-top: 0; }
.anc-notes { text-align: left; margin-top: 12px; border-top: 1px solid var(--glass-line); padding-top: 10px; }
.anc-notes h4 { margin: 0 0 6px; font-weight: 500; font-size: 13px; color: var(--paper-dim); letter-spacing: 0.2em; }
.anc-notes ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; max-height: 160px; overflow-y: auto; }
.anc-notes li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 14px; line-height: 1.6; }
.anc-notes li b { font-weight: 500; color: var(--gold); font-size: 13px; }
.anc-notes li small { color: var(--muted); font-size: 11px; }
.anc-note-form { display: flex; gap: 8px; }
.anc-note-form input, .anc-rename input, .anc-invite input { flex: 1; min-width: 0; background: rgba(239, 231, 218, 0.06); color: var(--paper); border: 1px solid var(--glass-line); border-radius: 10px; padding: 10px; font: inherit; min-height: 44px; }
.anc-note-form .btn { padding: 8px 16px; letter-spacing: 0.1em; }
.anc-burn { position: absolute; left: 50%; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%); width: min(420px, calc(100vw - 16px)); box-sizing: border-box; background: rgba(22, 18, 15, 0.82); border: 1px solid var(--glass-line); border-radius: 22px; padding: 12px 16px; text-align: center; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.anc-burn .panel-tip { margin: 0 0 8px; color: var(--paper); font-family: var(--serif); letter-spacing: 0.15em; }
.anc-burn .btn-ghost.small { margin-top: 6px; }
.anc-papers { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.anc-papers button { background: transparent; border: 1px solid var(--glass-line); border-radius: 999px; padding: 6px 14px; min-height: 36px; font-size: 13px; color: var(--paper-dim); }
.anc-papers button[aria-checked="true"] { border-color: var(--gold); color: var(--gold); background: rgba(210, 173, 94, 0.1); }
.anc-stack-row { display: flex; align-items: center; gap: 14px; text-align: left; }
.anc-stack-row .fineprint { margin: 0; flex: 1; }
.anc-stack { position: relative; width: 72px; height: 72px; flex: none; background: transparent; border: 0; padding: 0; touch-action: none; cursor: grab; }
.anc-stack span, .anc-drag { position: absolute; width: 58px; height: 58px; border-radius: 3px; background: #c9b48a; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.anc-stack span { left: 7px; top: 7px; }
.anc-stack span:nth-child(1) { transform: rotate(-8deg) translate(-3px, 3px); }
.anc-stack span:nth-child(2) { transform: rotate(5deg) translate(2px, 1px); }
.anc-stack span::after, .anc-drag::after { content: ''; position: absolute; inset: 16px; background: linear-gradient(135deg, #eef0f2, #a7aeb4 55%, #dfe3e6); }
.anc-stack[data-kind="ingot"] span, .anc-drag[data-kind="ingot"] { background: linear-gradient(135deg, #f2d27a, #c9962e 55%, #f0cf78); border-radius: 40% 40% 50% 50% / 30% 30% 70% 70%; height: 38px; }
.anc-stack[data-kind="ingot"] span { top: 18px; }
.anc-stack[data-kind="lotus"] span, .anc-drag[data-kind="lotus"] { background: radial-gradient(circle at 50% 70%, #fbe1d6, #f0a896 60%, #d77e6a); border-radius: 50% 50% 45% 45%; }
.anc-stack[data-kind="ingot"] span::after, .anc-stack[data-kind="lotus"] span::after, .anc-drag[data-kind="ingot"]::after, .anc-drag[data-kind="lotus"]::after { display: none; }
.anc-drag { position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; opacity: 0.95; }
.anc-ring { position: absolute; border-radius: 50%; border: 2px dashed rgba(255, 170, 90, 0.45); box-shadow: 0 0 24px rgba(255, 140, 60, 0.18) inset; pointer-events: none; transition: border-color 0.2s, box-shadow 0.2s; }
.anc-ring.over { border-color: rgba(255, 190, 110, 0.95); box-shadow: 0 0 36px rgba(255, 140, 60, 0.45) inset, 0 0 24px rgba(255, 140, 60, 0.3); }
.anc-members { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; text-align: left; }
.anc-members li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid rgba(239, 231, 218, 0.08); }
.anc-members li small { color: var(--gold); font-size: 11px; border: 1px solid rgba(210, 173, 94, 0.5); border-radius: 4px; padding: 0 5px; }
.anc-members li .btn-ghost.small { margin: 0 0 0 auto; padding: 4px 12px; }
.anc-invite input { width: 100%; box-sizing: border-box; font-size: 13px; }
.anc-rename { display: flex; gap: 8px; margin-bottom: 12px; }
.anc-rename .btn-ghost.small { margin-top: 0; }
.anc-halls { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.anc-halls .btn-ghost.small { margin-top: 0; }
#anc-fam h3 { font-weight: 500; font-size: 13px; color: var(--paper-dim); letter-spacing: 0.2em; margin: 16px 0 8px; }
.anc-photo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.anc-photo-row img { width: 56px; height: 70px; object-fit: cover; border-radius: 6px; border: 2px solid #6b5532; }
.anc-photo-row .btn-ghost.small { margin-top: 0; }
.anc-file { position: relative; overflow: hidden; cursor: pointer; display: inline-block; }
.anc-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---- 保存修行 ---- */
.link-btn { margin-top: 18px; background: transparent; border: 0; color: var(--muted); font-size: 13px; letter-spacing: 0.08em; text-decoration: underline; text-underline-offset: 4px; opacity: 0; animation: rise 1.6s 3s ease forwards; min-height: 40px; }
.link-btn:hover { color: var(--paper); }
.acc { border-top: 1px solid var(--glass-line); margin-top: 14px; padding-top: 12px; }
.acc h3 { font-weight: 500; font-size: 14px; color: var(--paper-dim); letter-spacing: 0.2em; margin: 0 0 6px; }
.acc #acc-status { line-height: 1.7; }
.acc #acc-status.ok { color: var(--gold); }
.acc-keys { list-style: none; padding: 0; margin: 4px 0 10px; display: grid; gap: 4px; text-align: left; font-size: 13px; color: var(--paper-dim); }
.acc-keys li { display: flex; align-items: center; gap: 8px; }
.acc-keys li .btn-ghost.small { margin: 0 0 0 auto; padding: 4px 12px; }
.acc .row { flex-wrap: wrap; }
.acc .row .btn-ghost.small { margin-top: 0; }
.acc-code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 22px; letter-spacing: 0.12em; color: var(--gold); background: rgba(210, 173, 94, 0.08); border: 1px dashed rgba(210, 173, 94, 0.5); border-radius: 12px; padding: 14px 10px; user-select: all; word-break: break-all; }
.acc-restore { z-index: 35; }
.acc-restore-form { margin-top: 16px; }
.acc-restore-form input { text-transform: uppercase; letter-spacing: 0.1em; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---- 前往其他寺社 ---- */
button.temple-name { background: transparent; border: 0; padding: 0; color: inherit; cursor: pointer; }
button.temple-name::after { content: ' ▾'; font-size: 0.6em; color: var(--muted); }
.temples-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; text-align: left; }
.temple-row { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 12px; padding: 12px 14px; border: 1px solid var(--glass-line); border-radius: 14px; color: var(--paper); text-decoration: none; }
a.temple-row:hover { border-color: var(--gold); }
.temple-row b { font-family: var(--serif); font-weight: 500; letter-spacing: 0.12em; }
.temple-row small { color: var(--muted); grid-column: 1; }
.temple-row span { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--gold); font-size: 13px; }
div.temple-row span { color: var(--muted); }

/* ---- 提醒 ---- */
.rem-row { display: flex; gap: 8px; align-items: flex-start; text-align: left; margin: 6px 0; line-height: 1.5; }
.rem-row input { margin-top: 3px; accent-color: var(--gold); }
#rem-status.ok { color: var(--gold); }
.anc-remind { margin-top: 0; opacity: 1; animation: none; pointer-events: auto; font-size: 12px; min-height: 28px; color: var(--paper-dim); }

/* ---- 供養 ---- */
.shop-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; text-align: left; }
.shop-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--glass-line); border-radius: 14px; }
.shop-list li > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.shop-list li b { font-family: var(--serif); font-weight: 500; letter-spacing: 0.1em; }
.shop-list li small { color: var(--muted); line-height: 1.5; }
.shop-list li .btn { padding: 8px 14px; letter-spacing: 0.05em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.shop-list li.empty { justify-content: center; color: var(--muted); border-style: dashed; }
.shop-sandbox { border: 1px dashed rgba(210, 173, 94, 0.6); border-radius: 14px; padding: 12px; margin: 0 0 10px; }
.chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 0 0 10px; }
.chips button { background: transparent; border: 1px solid var(--glass-line); border-radius: 999px; padding: 6px 14px; min-height: 36px; font-size: 13px; color: var(--paper-dim); }
.chips button[aria-checked="true"] { border-color: var(--gold); color: var(--gold); background: rgba(210, 173, 94, 0.1); }
.link-btn.inline { opacity: 1; animation: none; margin-top: 4px; font-size: 12px; min-height: 30px; color: var(--paper-dim); }

@media (max-width: 560px) {
  .presence { display: none; }
  /* the top bar must never wrap: temple name and the merit chip each stay on one line */
  .topbar { justify-content: space-between; gap: 8px; }
  .temple { min-width: 0; }
  .temple-name { white-space: nowrap; font-size: 18px; letter-spacing: 0.12em; }
  .me-chip { white-space: nowrap; gap: 6px; padding: 6px 10px; font-size: 12px; }
  /* All 8 rituals must fit without a hidden scroll: stretch the bar and let buttons share the width. */
  .actions { width: calc(100vw - 16px); gap: 2px; padding: 6px; }
  .actions button { flex: 1 1 0; min-width: 0; padding: 6px 0; font-size: 11px; }
  .actions button .glyph { font-size: 18px; }
  .anc-head h2 { font-size: 16px; letter-spacing: 0.2em; }
  .anc-pill { padding: 8px 11px; }
  .anc-sheet { max-height: 50vh; padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
/* landscape: the tablet sheet sits on the right so the tablet stays in view */
@media (orientation: landscape) and (min-width: 640px) {
  .anc-sheet { left: auto; right: 12px; transform: none; top: calc(58px + var(--safe-t)); bottom: calc(12px + var(--safe-b)); max-height: none; width: min(400px, 48vw); }
}

/* 清明雲祭掃（節日活動） */
.fest-chip { position: fixed; z-index: 9; top: calc(60px + var(--safe-t)); left: 50%; transform: translateX(-50%); max-width: calc(100vw - 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(22, 18, 15, 0.72); border: 1px solid rgba(143, 176, 110, 0.6); color: #cfe3b4; border-radius: 999px; padding: 7px 14px; min-height: 36px; font-size: 13px; letter-spacing: 0.08em; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
body:has(.topbar.quiet) .fest-chip, body:has(#intro:not([hidden])) .fest-chip { display: none; }
.anc-sweep-ui .row { justify-content: center; }
.anc-sweep-bar { height: 6px; border-radius: 3px; background: rgba(239, 231, 218, 0.14); overflow: hidden; margin: 4px 0 12px; }
.anc-sweep-bar i { display: block; height: 100%; width: 0; background: #9cc076; border-radius: 3px; transition: width 0.12s linear; }
.anc.sweeping .anc-hit { touch-action: none; cursor: grab; }
.anc-bar .btn-ghost { margin-left: 8px; }
@media (prefers-reduced-motion: reduce) { .anc-sweep-bar i { transition: none; } }

/* 檢舉（祈願牌） */
.wish-list li { padding-bottom: 30px; }
.wish-list li button.report { right: auto; left: 6px; color: #9a8468; font-size: 11px; }
.wish-list li .report-row { position: absolute; left: 4px; right: 4px; bottom: 2px; display: flex; gap: 2px; background: #e3cfa6; border-radius: 4px; }
.wish-list li .report-row button { position: static; flex: 1; font-size: 11px; color: #5a3a22; padding: 0 2px; }
.wish-list li .report-row button { white-space: nowrap; }
