:root { --bg: #1e0e14; --panel: rgba(46, 18, 28, .9); --line: rgba(240, 120, 150, .45); --red: #e0577a; --blood: #b8325a; --paper: #ffd9a8; --ink: #fff1f3; --dim: #d9aab4; --green: #ffb3c8; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: "Noto Sans TC", system-ui, sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: #ffa8bd; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.loading { position: fixed; inset: 0; display: grid; place-items: center; font-family: "Noto Serif TC", serif; font-size: 20px; color: var(--dim); background: var(--bg); z-index: 50; }
.entry { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(120, 30, 60, .35), rgba(0, 0, 0, .85)); z-index: 40; padding: 16px; }
.entry-card { width: min(400px, 100%); text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px 20px; box-shadow: 0 0 60px rgba(224, 87, 122, .25); }
.eyebrow { margin: 0; letter-spacing: .3em; color: var(--dim); font-size: 13px; }
.entry h1 { font-family: "Noto Serif TC", serif; font-weight: 900; font-size: 52px; margin: 6px 0; color: #ff7a9a; text-shadow: 0 0 18px rgba(255, 122, 154, .6); letter-spacing: .1em; }
.slogan { color: var(--ink); line-height: 1.7; margin: 0 0 16px; }
.field { display: block; text-align: left; font-size: 13px; color: var(--dim); margin-bottom: 12px; }
input, select, textarea { width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, .45); color: var(--ink); font: inherit; font-size: 16px; }
.primary { background: linear-gradient(180deg, #ef6f8f, #b8325a); color: #fff; font-weight: 700; border-radius: 12px; padding: 12px 16px; width: 100%; box-shadow: 0 0 18px rgba(240, 120, 150, .45); }
.primary.big { font-size: 20px; letter-spacing: .2em; }
.primary:disabled { opacity: .5; }
.ghost { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; width: 100%; background: rgba(0, 0, 0, .3); }
.note { font-size: 12px; color: var(--dim); line-height: 1.6; margin: 10px 0 0; }
.hud { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 12px 10px; z-index: 20; pointer-events: none; }
.hud > * { pointer-events: auto; }
.brand { font-family: "Noto Serif TC", serif; font-weight: 900; font-size: 20px; color: #ff7a9a; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; }
.brand small { font-family: "Noto Sans TC"; font-weight: 400; font-size: 11px; color: var(--dim); margin-left: 6px; }
.stats { display: flex; gap: 6px; margin: 0 auto; }
.stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; text-align: center; min-width: 58px; }
.stats b { display: block; font-size: 15px; } .stats span { font-size: 10px; color: var(--dim); }
.right { display: flex; gap: 6px; }
.pill { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; min-height: 34px; display: inline-flex; align-items: center; gap: 6px; }
.online i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }
.online i.off { background: #666; box-shadow: none; }
.bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 6px; z-index: 20; }
.bar button { display: grid; justify-items: center; gap: 2px; width: 52px; padding: 4px 0; border-radius: 12px; }
.bar button i { font-style: normal; font-family: "Noto Serif TC", serif; font-weight: 900; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: rgba(0, 0, 0, .4); color: #ffc2d1; }
.bar button span { font-size: 11px; color: var(--dim); }
.bar button.gold i { background: var(--red); color: #fff; }
.bar button:active { background: rgba(224, 87, 122, .2); }
.sheet { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe-b)); width: min(480px, calc(100vw - 24px)); max-height: min(calc(100vh - 170px), 700px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; z-index: 25; backdrop-filter: blur(8px); }
.sheet h2 { font-family: "Noto Serif TC", serif; margin: 0 0 4px; color: #ff8fab; font-size: 20px; }
.sheet .sub { color: var(--dim); font-size: 13px; margin: 0 0 12px; }
.sheet .x { position: absolute; right: 10px; top: 8px; font-size: 22px; color: var(--dim); }
.sheet h3 { font-size: 14px; margin: 16px 0 8px; color: #ffc2d1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; background: rgba(0, 0, 0, .35); }
.chip.on { background: var(--red); color: #fff; border-color: var(--red); }
.buys { display: grid; gap: 8px; }
.buy { display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 2px 8px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: rgba(0, 0, 0, .35); }
.buy b { font-size: 15px; } .buy span { grid-column: 1; font-size: 12px; color: var(--dim); } .buy em { grid-row: 1 / 3; grid-column: 2; align-self: center; font-style: normal; font-weight: 700; color: #ffd0dc; }
.buy.own { opacity: .7; } .buy.on { border-color: var(--green); }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: rgba(0, 0, 0, .3); margin-top: 10px; }
.card p { margin: 4px 0; font-size: 14px; }
.lamplist { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.lamplist div { border: 1px solid rgba(255, 179, 200, .25); border-radius: 8px; padding: 6px; font-size: 11px; text-align: center; background: rgba(60, 20, 32, .4); }
.lamplist div.flag { border-color: #ff7a9a; background: rgba(90, 60, 10, .5); }
.lamplist b { display: block; font-size: 12px; color: var(--green); }
.feed { position: fixed; left: 12px; top: calc(70px + var(--safe-t)); display: grid; gap: 4px; z-index: 15; max-width: min(320px, 70vw); pointer-events: none; }
.feed div { background: rgba(36, 12, 20, .7); border-left: 3px solid var(--red); border-radius: 6px; padding: 4px 8px; font-size: 12px; animation: in .3s ease; transition: opacity .6s; }
.chatlog { position: fixed; left: 12px; bottom: calc(92px + var(--safe-b)); display: grid; gap: 3px; z-index: 15; max-width: min(320px, 70vw); pointer-events: none; }
.chatlog div { background: rgba(36, 12, 20, .65); border-radius: 8px; padding: 4px 8px; font-size: 13px; transition: opacity .6s; }
.chatlog b { color: #ffc2d1; margin-right: 4px; }
.chatbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe-b)); width: min(420px, calc(100vw - 24px)); display: flex; gap: 6px; z-index: 26; }
.chatbar input { margin: 0; } .chatbar button { background: var(--red); border-radius: 10px; padding: 0 14px; color: #fff; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); top: calc(70px + var(--safe-t)); display: grid; gap: 6px; z-index: 60; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: rgba(40, 14, 22, .94); border: 1px solid var(--red); border-radius: 12px; padding: 10px 14px; font-size: 14px; text-align: center; animation: in .25s ease; transition: opacity .4s; }
.toast.out { opacity: 0; }
@keyframes in { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 520px) {
  .brand small { display: none; } .brand { font-size: 17px; }
  .bar button { width: 46px; } .bar button i { width: 30px; height: 30px; }
  .stats div { min-width: 48px; padding: 3px 6px; }
}

.row-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); margin: 4px 0; }
.row-check input { width: auto; margin: 0; }
/* 月老殿 */
.lamplist div.gold { border-color: #f0c040; background: rgba(90, 60, 10, .5); }
.lamplist b { color: #ffb3c8; }
.lv { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.lv b { font-family: "Noto Serif TC", serif; font-size: 20px; color: #ff8fab; }
.bar-wrap { height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .4); overflow: hidden; flex: 1; }
.bar-wrap i { display: block; height: 100%; background: linear-gradient(90deg, #ff7a9a, #ffd0dc); }
textarea { resize: none; height: 78px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); margin: 8px 0 12px; }
.check input { width: auto; margin: 0; }
.diary { display: grid; gap: 6px; }
.diary div { font-size: 13px; border-left: 3px solid #ff7a9a; padding: 4px 8px; background: rgba(0, 0, 0, .25); border-radius: 6px; }
.diary small { color: var(--dim); margin-right: 6px; }
.jiao { display: flex; justify-content: center; gap: 22px; margin: 16px 0 8px; min-height: 70px; }
.jiao span { width: 34px; height: 64px; border-radius: 34px 34px 6px 6px; background: linear-gradient(180deg, #d84a4a, #8e1b22); box-shadow: inset -6px 0 0 rgba(0, 0, 0, .25); transition: transform .5s; }
.jiao span.flat { background: linear-gradient(180deg, #f2d2a0, #c8945a); border-radius: 6px; }
.jiao.toss span { animation: toss .7s ease; }
@keyframes toss { 0% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-60px) rotate(360deg); } 100% { transform: translateY(0) rotate(720deg); } }
.res { text-align: center; font-family: "Noto Serif TC", serif; font-size: 22px; color: #ffd0dc; min-height: 1.4em; }
.dots { display: flex; justify-content: center; gap: 8px; margin: 6px 0 12px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #ff7a9a; }
.dots i.on { background: #ff7a9a; box-shadow: 0 0 8px #ff7a9a; }
.poem { text-align: center; font-family: "Noto Serif TC", serif; font-size: 19px; line-height: 1.9; color: #fff1f3; margin: 10px 0; }
.poem h4 { margin: 0; color: #ff8fab; font-size: 15px; letter-spacing: .3em; }
.cards { display: grid; gap: 8px; }
.cardx { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: rgba(255, 180, 200, .07); }
.cardx p { margin: 0 0 8px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }
.cardx .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cardx .stk { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12px; background: rgba(0, 0, 0, .3); }
.cardx .stk.on { background: var(--red); color: #fff; }
.cardx .rep { margin-left: auto; font-size: 11px; color: var(--dim); }
.cardx small { color: var(--dim); font-size: 11px; }
.story { display: flex; gap: 10px; align-items: flex-start; }
.story .who { flex: none; background: var(--red); color: #fff; border-radius: 8px; padding: 2px 8px; font-size: 13px; }
.story p { margin: 0; font-size: 15px; line-height: 1.7; }
.care p { font-size: 15px; line-height: 1.8; }
.care a { display: block; text-align: center; margin: 8px 0; padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); color: #fff; text-decoration: none; font-size: 16px; }
.amounts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.amounts .chip.big { flex: 1 1 calc(50% - 6px); min-height: 44px; font-size: 15px; font-weight: 700; }  /* 第 110 輪：手機好按 */
@media (max-width: 520px) { .bar { gap: 2px; padding: 5px; } .bar button { width: 40px; } .bar button i { width: 28px; height: 28px; font-size: 14px; } .bar button span { font-size: 10px; } .stats div { min-width: 44px; } #hudLv { font-size: 12px; } }

/* 紅線宮：結緣牆、免責 */
.lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.ln { position: relative; border: 1px solid rgba(255, 120, 150, .4); border-left: 4px solid #e0283a; border-radius: 8px; padding: 6px 8px; background: rgba(90, 20, 40, .45); display: grid; gap: 2px; }
.ln b { font-size: 14px; color: #ffc2d1; } .ln span { font-size: 12px; } .ln small { font-size: 10px; color: var(--dim); }
.ln.gold { border-color: #f0c040; border-left-color: #ffd36a; background: rgba(110, 80, 10, .45); } .ln.gold b { color: #ffe08a; }
.ln.pin { box-shadow: 0 0 10px rgba(255, 211, 106, .4); } .ln em { font-style: normal; font-size: 10px; color: #ffe08a; }
.disc { text-align: center; opacity: .85; }
.foot-disc { position: fixed; right: 10px; bottom: calc(80px + var(--safe-b)); margin: 0; font-size: 10px; color: var(--dim); z-index: 14; pointer-events: none; opacity: .8; }
@media (max-width: 520px) { .bar button { width: 37px; } .bar button span { font-size: 9px; white-space: nowrap; } .foot-disc { bottom: calc(76px + var(--safe-b)); } }
.brand, .pill, .stats b { white-space: nowrap; }
@media (max-width: 400px) { .hud { gap: 6px; padding-left: 8px; padding-right: 8px; } .brand { padding: 6px 8px; } .pill { padding: 6px 8px; font-size: 12px; } }

/* 右上角樂捐按鈕 */
.pill.donate { background: linear-gradient(180deg, #f3d27a, #c99a3a); color: #2a1a06; font-weight: 700; border: 0; cursor: pointer; }
/* 手機：右上按鈕（換宮廟、人數、樓層、音量、樂捐）放到第二排靠右，樂捐一定看得到 */
@media (max-width: 520px) {
  .hud { flex-wrap: wrap; row-gap: 6px; }
  .hud .right { width: 100%; justify-content: flex-end; flex-wrap: nowrap; }
  .stats { margin: 0 0 0 auto; }
  .feed, .toasts { top: calc(114px + var(--safe-t)); }
}

/* 第 145 輪：長輩友善（面板說明與選項字放大、選項按鈕 ≥44px）＋祝福紅繩架、相思豆小園 */
.sheet .sub { font-size: 15px; line-height: 1.55; }
.sheet h3 { font-size: 16px; }
.note { font-size: 14px; }
.chip { font-size: 15px; min-height: 44px; padding: 8px 14px; }
.card p, .diary div, .toast { font-size: 15px; }
.check, .field { font-size: 15px; }
.buy span { font-size: 14px; }
.sheet .x { min-width: 44px; min-height: 44px; font-size: 26px; right: 4px; top: 2px; }
.knWho { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 12px; }
.knWho button { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .35); color: var(--ink); font: 700 15px "Noto Sans TC", sans-serif; text-align: left; padding: 6px 10px; touch-action: manipulation; }
.knWho button.on { background: var(--red); color: #fff; border-color: var(--red); }
.knGo { position: sticky; bottom: 0; min-height: 52px; box-shadow: 0 -6px 14px rgba(30, 8, 18, .6); }
.knRes { margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 143, 171, .16); border: 1px solid rgba(255, 143, 171, .5); font: 700 16px/1.5 "Noto Sans TC", sans-serif; color: #ffe0e8; }
.knRes span { font-weight: 500; font-size: 15px; color: #ffd0dc; }
.hdGrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px auto 4px; max-width: 246px; }
.hdGrid button { aspect-ratio: 1; min-height: 64px; border-radius: 18px; border: 1px solid rgba(255, 179, 200, .35); background: rgba(90, 120, 70, .45); touch-action: manipulation; transition: transform .12s; position: relative; }
.hdGrid button.on::after { content: ''; position: absolute; inset: 22%; border-radius: 50% 50% 46% 46%; background: radial-gradient(circle at 35% 30%, #ff8a9a 0 12%, #e0203a 35%, #8a0a1a 80%); box-shadow: 0 0 14px rgba(255, 60, 90, .8); }
.hdGrid button.pop { transform: scale(.85); background: rgba(255, 179, 200, .55); }
.hdInfo { text-align: center; font: 700 16px "Noto Sans TC", sans-serif; color: #ffd0dc; margin: 6px 0 10px; }

/* 2026-11-27 假設 ⑭：隨喜金額換算主機費天數 */
.tpHelp { margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 215, 120, .12); font-size: 15px; line-height: 1.55; text-align: center; }
.tpHelp small { font-size: 13px; opacity: .85; }
