/* 武聖宮・關帝殿：青綠＋朱紅 */
:root { --bg: #0c1714; --panel: rgba(14, 34, 29, .92); --line: rgba(110, 190, 150, .42); --red: #c8322b; --blood: #9c2420; --paper: #f2d9a0; --ink: #f2f4ea; --dim: #a9c4b6; --green: #6fd3a0; --gold: #e8b923; --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: #8fe0b8; }
#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(30, 90, 70, .4), 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(200, 50, 43, .3); }
.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: #e8b923; text-shadow: 0 0 18px rgba(232, 185, 35, .5); 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, #d9443a, #8e1f1a); color: #fff; font-weight: 700; border-radius: 12px; padding: 12px 16px; width: 100%; box-shadow: 0 0 18px rgba(200, 50, 43, .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: #e8b923; 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: #f2d9a0; }
.bar button span { font-size: 11px; color: var(--dim); }
.bar button.gold i { background: var(--red); color: #fff; }
.bar button:active { background: rgba(110, 190, 150, .18); }
.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: #e8b923; 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: #f2d9a0; }
.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: #f2d9a0; }
.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(110, 190, 150, .25); border-radius: 8px; padding: 6px; font-size: 11px; text-align: center; background: rgba(20, 50, 40, .5); }
.lamplist div.flag { border-color: #e8b923; 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(10, 30, 24, .75); 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(10, 30, 24, .7); border-radius: 8px; padding: 4px 8px; font-size: 13px; transition: opacity .6s; }
.chatlog b { color: #f2d9a0; 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(12, 32, 26, .95); 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; }

/* 關帝殿 */
.entry h1 small { display: block; font-size: 18px; letter-spacing: .4em; color: var(--green); text-shadow: none; margin-bottom: 4px; }
.bar button i { color: var(--paper); }
.bar button.gold i { background: linear-gradient(180deg, #f0cf5a, #b8860b); color: #3a1a00; }
textarea { resize: none; height: 70px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); margin: 8px 0 12px; }
.check input { width: auto; margin: 0; }
.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, #d84a3a, #8e1b18); 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: var(--gold); min-height: 1.4em; }
.tipline { text-align: center; color: var(--ink); margin: 6px 0 12px; min-height: 1.4em; }
.oaths { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.oaths div { border: 1px solid rgba(200, 50, 43, .5); border-radius: 6px; padding: 6px 4px; text-align: center; background: linear-gradient(180deg, rgba(150, 30, 26, .55), rgba(90, 16, 14, .55)); font-size: 11px; color: var(--dim); }
.oaths b { display: block; font-family: "Noto Serif TC", serif; font-size: 14px; color: #ffe6a8; }
.oaths div.pin { border-color: var(--gold); box-shadow: 0 0 10px rgba(232, 185, 35, .45); }
.oaths div.done { background: linear-gradient(180deg, rgba(40, 110, 80, .6), rgba(20, 60, 45, .6)); border-color: var(--green); }
.myoath { border: 1px solid var(--gold); border-radius: 12px; padding: 12px; background: rgba(90, 16, 14, .35); margin-bottom: 10px; }
.myoath h4 { margin: 0 0 4px; font-family: "Noto Serif TC", serif; font-size: 22px; color: #ffe6a8; }
.myoath p { margin: 4px 0; font-size: 13px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
/* 每日一刀：蓄力介面 */
.slashui { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + var(--safe-b)); width: min(380px, calc(100vw - 24px)); z-index: 24; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; text-align: center; }
.slashui h3 { margin: 0 0 2px; font-family: "Noto Serif TC", serif; color: var(--gold); font-size: 18px; }
.slashui p { margin: 0 0 8px; font-size: 12px; color: var(--dim); }
.meter { position: relative; height: 16px; border-radius: 99px; background: rgba(0, 0, 0, .5); overflow: hidden; margin: 8px 0 10px; border: 1px solid var(--line); }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #6fd3a0, #e8b923, #c8322b); }
.meter .zone { position: absolute; top: 0; bottom: 0; border-left: 2px solid #fff; border-right: 2px solid #fff; background: rgba(255, 255, 255, .15); }
.meter .ok { position: absolute; top: 0; bottom: 0; border-left: 1px dashed rgba(255, 255, 255, .5); }
.hold { width: 100%; padding: 16px; border-radius: 14px; font-size: 20px; font-weight: 900; letter-spacing: .2em; color: #fff; background: radial-gradient(circle, #d9443a, #7a1a14); box-shadow: 0 0 20px rgba(200, 50, 43, .5); user-select: none; -webkit-user-select: none; touch-action: none; }
.hold.on { background: radial-gradient(circle, #f0cf5a, #b8860b); color: #3a1a00; }
.slashui .x { position: absolute; right: 10px; top: 6px; font-size: 22px; color: var(--dim); }
.amounts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
@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; } }

/* 右上角樂捐按鈕 */
.pill.donate { background: linear-gradient(180deg, #f3d27a, #c99a3a); color: #2a1a06; font-weight: 700; border: 0; cursor: pointer; }

/* 換樓層的淡入淡出 */
.fade { position: fixed; inset: 0; background: #05080a; opacity: 0; pointer-events: none; z-index: 15; }
.fade.on { animation: gdFade .7s ease-out; }
@keyframes gdFade { 0% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 400px) { .bar button { width: 38px; } .bar { gap: 1px; padding: 4px; } .bar button span { white-space: nowrap; font-size: 9.5px; letter-spacing: -.02em; } }
/* 第 95 輪：今日忠義五件事、過關刀門、名片過爐 */
.gdToday { position: fixed; right: max(8px, env(safe-area-inset-right)); top: calc(50% - 116px); z-index: 45; width: 52px; min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: rgba(20, 40, 30, .9); color: #f2ffe8; font: 700 12px/1.25 "Noto Sans TC", system-ui, sans-serif; padding: 4px 2px; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); cursor: pointer; touch-action: manipulation; }
.gdToday b { display: block; font-size: 16px; }
.gdToday.done { border-color: #ffd36a; background: rgba(110, 70, 20, .92); }
body.sheetOpen .gdToday, body.sheetOpen .flbar, body.sheetOpen .tevBtn { display: none; }
.tdRow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 16px; }
.tdRow i { font-style: normal; font-family: "Noto Serif TC", serif; font-weight: 900; width: 30px; text-align: center; color: var(--gold); }
.tdRow span { flex: 1; line-height: 1.4; }
.tdRow button { min-width: 92px; min-height: 46px; border-radius: 12px; font: 700 15px "Noto Sans TC", sans-serif; background: linear-gradient(180deg, #d9443a, #8e1f1a); color: #fff; }
.tdRow em { font-style: normal; color: #bfe8c8; font-weight: 700; min-width: 92px; text-align: center; font-size: 15px; }
.chip.big { min-height: 44px; font-size: 15px; padding: 8px 14px; }
.gd-say { font-size: 15px; color: #ffe6a8; margin: 10px 0; line-height: 1.6; }
#sheet .note { font-size: 14px; }
/* 第 127 輪：錦囊妙計、點將台擂戰鼓 */
.gdJnCard { margin: 8px 0 12px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(180deg, #7a1a14, #4a120e); border: 1px solid #e8b923; color: #fff4dc; }
.gdJnCard small { display: block; color: #ffd36a; font-size: 14px; margin-bottom: 4px; }
.gdJnCard p { margin: 0; font-size: 17px; line-height: 1.6; font-weight: 700; }
.gdJnCard em { display: block; margin-top: 6px; font-style: normal; color: #bfe8c8; font-size: 15px; }
.gdDrUi { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30; width: min(340px, calc(100vw - 24px)); background: rgba(30, 14, 8, .92); border: 1px solid #e8b923; border-radius: 18px; padding: 12px; text-align: center; color: #fff4dc; user-select: none; -webkit-user-select: none; }
.gdDrUi[hidden] { display: none; }
.gdDrTop { font-size: 17px; margin-bottom: 8px; } .gdDrTop b, .gdDrTop span { font-size: 24px; color: #ffd36a; }
#drHit { width: 150px; height: 150px; border-radius: 50%; border: 6px solid #e8b923; background: radial-gradient(circle, #f2e2b8 55%, #b8281f 56%); color: #8e1f1a; font: 900 34px "Noto Serif TC", serif; touch-action: manipulation; cursor: pointer; }
#drHit.hit { animation: gdDrHit .16s ease-out; }
@keyframes gdDrHit { 0% { transform: scale(.9); } 100% { transform: scale(1); } }
.gdDrUi small { display: block; margin-top: 6px; font-size: 14px; color: #e6d6b8; }
/* 第 127 輪：「今日」「今日活動」原本在左側蓋到共用樓層列，改放右側 */
body .tevBtn { left: auto; right: max(8px, env(safe-area-inset-right)); top: calc(50% - 56px); }
#jnGo, #drStart { letter-spacing: .04em; font-size: 18px; }
/* 第 153 輪：同袍打氣板、校場練箭 */
.gdQiH { margin: 14px 0 6px; font-size: 16px; color: #ffd36a; font-weight: 700; }
.gdArInfo { display: flex; justify-content: space-between; font-size: 17px; margin: 4px 0 10px; }
.gdArInfo b { color: #ffd36a; font-size: 22px; }
.gdArGrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; }
.gdArBtn { min-height: 84px; border-radius: 50%; aspect-ratio: 1; font-size: 34px; background: radial-gradient(circle, #3a2a20, #1e140e); color: #8a7a6a; border: 2px solid #5a4a3a; touch-action: manipulation; transition: transform .08s; }
.gdArBtn.lit { background: radial-gradient(circle, #fff3c0 0 18%, #b8281f 19% 38%, #f2e8d0 39% 58%, #1f6a4a 59% 78%, #e8b923 79%); color: transparent; border-color: #ffe08a; box-shadow: 0 0 18px rgba(255, 224, 138, .7); transform: scale(1.04); }
.gdArBtn.miss { background: #5a1a14; border-color: #d9443a; }
.gdArTip { text-align: center; font-size: 16px; margin: 10px 0 0; color: #ffe6a8; min-height: 24px; }
