:root {
  --paper: #efe4cc;
  --paper2: #e6d7b8;
  --ink: #2b2420;
  --ink2: #6b5a48;
  --red: #b8322a;
  --red2: #8f241e;
  --qing: #2f5d73;
  --lv: #5f8a6a;
  --gold: #b08a3e;
  --kai: "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", "BiauKai", "Songti SC", "STSong", serif;
}
* { box-sizing: border-box; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; }
body {
  background: #1d1915 url(./assets/paper.jpg);
  color: var(--ink);
  font-family: var(--kai);
  display: flex; justify-content: center;
}
#app { position: relative; width: 100%; max-width: 480px; height: 100vh; overflow: hidden; background: var(--paper) url(./assets/paper.jpg); }
.screen { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: none; flex-direction: column; }
.screen.on { display: flex; animation: fadeIn .5s ease; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

button { font-family: var(--kai); }
.btn { border: 0; border-radius: 4px; padding: 13px 10px; font-size: 18px; letter-spacing: 2px; cursor: pointer; flex: 1; text-align: center; display: block; }
.btn.red { background: var(--red); color: #fbeee0; box-shadow: inset 0 0 0 2px #d9574e, 0 3px 0 var(--red2); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink2); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.row2 { display: flex; gap: 12px; padding: 0 18px; }
.hint { font-size: 14px; color: var(--ink2); text-align: center; margin: 8px 18px; }
.paper-card { background: var(--paper) url(./assets/paper.jpg); box-shadow: 0 0 0 1px rgba(43,36,32,.25), 0 0 0 5px var(--paper), 0 0 0 6px rgba(43,36,32,.35), 0 10px 30px rgba(0,0,0,.25); }
.bar { height: 54px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid rgba(43,36,32,.25); flex: none; }
.bar-title { font-size: 19px; letter-spacing: 3px; }

/* 封面 */
#s-cover { background: #2b2420; }
.cover-pan { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; }
.cover-pan img { height: 100%; animation: pan 40s linear infinite alternate; }
@keyframes pan { from { transform: translateX(0) } to { transform: translateX(calc(-100% + 480px)) } }
.cover-mask { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(180deg, rgba(239,228,204,.2) 0%, rgba(239,228,204,.88) 42%, rgba(239,228,204,.97) 100%); }
.cover-body { position: relative; margin-top: auto; padding: 0 28px 40px; display: flex; flex-direction: column; align-items: center; }
.cover-sub { font-size: 14px; letter-spacing: 6px; color: var(--ink2); border-top: 1px solid var(--ink2); border-bottom: 1px solid var(--ink2); padding: 4px 12px; }
.cover-title { margin: 18px 0 8px; font-weight: 400; text-align: center; line-height: 1.15; }
.cover-title span { display: block; }
.cover-title span:nth-child(1), .cover-title span:nth-child(3) { font-size: 26px; letter-spacing: 8px; color: var(--ink2); }
.cover-title span:nth-child(2) { font-size: 50px; letter-spacing: 4px; color: var(--ink); text-shadow: 0 1px 0 rgba(255,255,255,.4); }
.cover-desc { font-size: 16px; line-height: 1.8; text-align: center; color: var(--ink2); margin: 6px 0 22px; }
.seal-btn { width: 96px; height: 96px; border: 0; background: var(--red); color: #fbeee0; font-size: 34px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; border-radius: 6px; box-shadow: inset 0 0 0 4px var(--red), inset 0 0 0 6px #f0c9b8, 0 6px 14px rgba(143,36,30,.4); transform: rotate(-4deg); cursor: pointer; }
.seal-btn:active { transform: rotate(-4deg) scale(.95); }
.cover-tip { font-size: 12px; color: var(--ink2); margin-top: 18px; }

/* 放脸 */
.face-stage { margin: 18px auto 8px; width: 78%; max-width: 330px; border-radius: 2px; }
#face-cv { width: 100%; height: auto; display: block; touch-action: none; }
.face-ctl { display: flex; flex-direction: column; gap: 6px; padding-bottom: 18px; margin-top: auto; }
.face-ctl > .btn { margin: 0 18px; flex: none; }
.zoom-row { display: flex; align-items: center; gap: 10px; padding: 0 30px; font-size: 14px; color: var(--ink2); }
.zoom-row input { flex: 1; accent-color: var(--red); }

/* 抽签 */
.lot-area { position: relative; height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; flex: none; }
.tube { position: relative; width: 110px; height: 200px; cursor: pointer; transform-origin: 50% 100%; }
.tube.shake { animation: shake .5s ease-in-out 2; }
@keyframes shake { 0%,100% { transform: rotate(0) } 25% { transform: rotate(-12deg) } 75% { transform: rotate(12deg) } }
.sticks { position: absolute; left: 14px; right: 14px; top: 0; height: 80px; display: flex; justify-content: space-around; }
.sticks i { width: 9px; height: 100%; background: linear-gradient(90deg, #d8b979, #c29a55); border-radius: 2px 2px 0 0; box-shadow: inset 0 6px 0 var(--red); }
.sticks i:nth-child(2n) { height: 88%; margin-top: 10%; }
.tube-body { position: absolute; left: 0; right: 0; bottom: 0; height: 140px; background: linear-gradient(90deg, #6e3b23, #a8643c 45%, #6e3b23); border-radius: 6px 6px 12px 12px; box-shadow: inset 0 10px 0 rgba(0,0,0,.2), inset 0 -8px 0 rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; }
.tube-body span { width: 52px; height: 52px; background: var(--red); color: #fbeee0; font-size: 30px; display: flex; align-items: center; justify-content: center; border-radius: 4px; box-shadow: inset 0 0 0 2px #f0c9b8; }
.flying-stick { position: absolute; left: 50%; bottom: 150px; width: 12px; height: 110px; margin-left: -6px; background: linear-gradient(90deg, #e2c68a, #c29a55); border-radius: 3px; box-shadow: inset 0 14px 0 var(--red); opacity: 0; }
.flying-stick.go { animation: fly .9s cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes fly { 0% { opacity: 1; transform: translateY(60px) rotate(0) } 60% { opacity: 1; transform: translateY(-120px) rotate(200deg) } 100% { opacity: 0; transform: translateY(-80px) rotate(360deg) scale(.6) } }
.lot-card { margin: 14px 22px; display: none; padding: 12px; gap: 12px; align-items: center; }
.lot-card.on { display: flex; animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.6); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.lot-left img { width: 90px; display: block; }
.lot-luck { display: inline-block; font-size: 13px; color: #fbeee0; background: var(--red); padding: 2px 8px; letter-spacing: 2px; }
.lot-name { font-size: 34px; margin: 4px 0; letter-spacing: 4px; }
.lot-desc { font-size: 14px; line-height: 1.6; color: var(--ink2); }
.lot-btns { display: none; margin-top: auto; padding-bottom: 20px; }
.lot-btns.on { display: flex; }

/* 游戏 */
.hud { height: 64px; display: flex; align-items: center; padding: 0 10px; gap: 8px; border-bottom: 1px solid rgba(43,36,32,.3); flex: none; position: relative; z-index: 3; background: var(--paper) url(./assets/paper.jpg); }
.hours { flex: 1; display: flex; gap: 4px; }
.hours span { flex: 1; height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 20px; color: var(--ink2); border: 1px solid rgba(43,36,32,.25); background: rgba(255,255,255,.18); position: relative; }
.hours span small { font-size: 10px; letter-spacing: 0; }
.hours span.done { color: rgba(43,36,32,.3); background: rgba(43,36,32,.06); }
.hours span.done::after { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; border-top: 1.5px solid rgba(43,36,32,.35); transform: rotate(-12deg); }
.hours span.now { color: #fbeee0; background: var(--red); border-color: var(--red); box-shadow: 0 2px 0 var(--red2); }
.purse { font-size: 15px; display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.purse b { font-size: 22px; font-weight: 400; color: var(--red); min-width: 26px; text-align: right; }
.purse.bump b { animation: bump .4s; }
@keyframes bump { 50% { transform: scale(1.5) } }
.coin { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle, transparent 3px, #c49a45 3.5px, #e3c27a 7px, #9a7330 9px); display: inline-block; }
.view { position: relative; flex: 1; overflow: hidden; touch-action: none; background: #d9c9a6; cursor: grab; }
.strip { position: absolute; left: 0; top: 0; height: 100%; display: flex; will-change: transform; }
.scene { position: relative; height: 100%; flex: none; }
.scene > img { height: 100%; display: block; pointer-events: none; }
.scene + .scene { box-shadow: -10px 0 14px -8px rgba(43,36,32,.6); }
.scene-name { position: absolute; top: 12px; right: 14px; writing-mode: vertical-rl; font-size: 18px; letter-spacing: 6px; padding: 10px 5px; background: rgba(239,228,204,.88); box-shadow: 0 0 0 1px rgba(43,36,32,.35); }
.npc { position: absolute; transform: translate(-50%, -100%); border: 0; background: none; padding: 0; cursor: pointer; z-index: 2; }
.npc .bub { display: flex; align-items: center; gap: 4px; background: #fbf3e4; color: var(--ink); font-size: 15px; padding: 5px 10px 5px 6px; border-radius: 16px; box-shadow: 0 0 0 1.5px var(--ink), 0 4px 10px rgba(0,0,0,.25); white-space: nowrap; animation: float 1.6s ease-in-out infinite; }
.npc .bub b { width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.npc::after { content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -7px; border: 7px solid transparent; border-top-color: var(--ink); }
.npc.used .bub { opacity: .5; animation: none; }
.npc.used .bub b { background: var(--ink2); }
@keyframes float { 50% { transform: translateY(-6px) } }
.tint { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; mix-blend-mode: multiply; transition: background-color 1.5s; }
.me { position: absolute; left: 50%; bottom: 4%; height: 26%; transform: translateX(-50%); pointer-events: none; filter: drop-shadow(0 6px 4px rgba(43,36,32,.35)); z-index: 2; }
.me.walk { animation: walk .32s ease-in-out infinite; }
.me.flip { transform: translateX(-50%) scaleX(-1); }
@keyframes walk { 50% { margin-bottom: 6px; } }
.place { position: absolute; left: 12px; top: 12px; font-size: 15px; background: rgba(239,228,204,.9); padding: 4px 10px; box-shadow: 0 0 0 1px rgba(43,36,32,.35); z-index: 2; }
.foot { flex: none; padding: 8px 0 12px; border-top: 1px solid rgba(43,36,32,.3); position: relative; z-index: 3; background: var(--paper) url(./assets/paper.jpg); }
.mini { height: 6px; margin: 0 18px; background: rgba(43,36,32,.15); border-radius: 3px; position: relative; }
.mini i { position: absolute; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--red); margin-left: -6px; }

/* 事件 */
.evt { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(29,25,21,.55); display: none; align-items: center; justify-content: center; z-index: 20; padding: 14px; }
.evt.on { display: flex; }
.evt-box { width: 100%; padding: 12px; animation: pop .35s ease; }
.evt-head { display: flex; align-items: center; gap: 10px; font-size: 22px; letter-spacing: 3px; margin-bottom: 8px; }
.evt-seal { width: 34px; height: 34px; background: var(--red); color: #fbeee0; display: flex; align-items: center; justify-content: center; font-size: 20px; border-radius: 3px; }
.evt-stage { position: relative; width: 100%; height: 56vh; max-height: 470px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(43,36,32,.35); }
#evt-cv { width: 100%; height: 100%; display: block; touch-action: none; }
.evt-ui { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: none; flex-direction: column; padding: 14px; }
.evt-ui.on { display: flex; }
.evt-res { display: none; flex-direction: column; gap: 10px; margin-top: 8px; }
.evt-res.on { display: flex; }
#evt-res-text { font-size: 17px; line-height: 1.6; text-align: center; }
#evt-res-text b { color: var(--red); font-weight: 400; font-size: 22px; }

/* 砍价 */
.bargain-shop { display: flex; gap: 12px; align-items: flex-start; }
.keeper { width: 64px; height: 64px; flex: none; border-radius: 50%; background: var(--qing); color: #fbeee0; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--qing); display: flex; align-items: center; justify-content: center; font-size: 18px; letter-spacing: 1px; }
.say { position: relative; background: #fbf3e4; padding: 10px 12px; font-size: 16px; line-height: 1.55; box-shadow: 0 0 0 1.5px var(--ink); border-radius: 8px; min-height: 64px; flex: 1; }
.item { margin: 16px auto 8px; text-align: center; }
.item .icon { width: 84px; height: 84px; margin: 0 auto 6px; border-radius: 50%; border: 3px double var(--red); color: var(--red); font-size: 46px; display: flex; align-items: center; justify-content: center; }
.item .nm { font-size: 20px; letter-spacing: 2px; }
.ask { text-align: center; font-size: 15px; color: var(--ink2); }
.ask b { font-size: 30px; color: var(--red); font-weight: 400; }
.mood { display: flex; justify-content: center; gap: 6px; margin: 6px 0; font-size: 18px; }
.offer { margin-top: auto; }
.offer-val { text-align: center; font-size: 16px; }
.offer-val b { font-size: 30px; font-weight: 400; }
.offer input { width: 100%; accent-color: var(--red); margin: 8px 0 10px; }
.offer .row2 { padding: 0; }

/* 小报 */
.paper-wrap { flex: 1; overflow: auto; padding: 14px 18px; }
.paper-wrap img { width: 100%; display: block; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
#s-end .row2 { padding-bottom: 6px; padding-top: 6px; }

/* 事件介绍 */
.intro { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(29,25,21,.4); display: none; align-items: flex-end; z-index: 15; }
.intro.on { display: flex; }
.intro-box { width: 100%; margin: 0 10px 14px; padding: 16px 0 16px; animation: up .3s ease; }
@keyframes up { from { transform: translateY(40px); opacity: 0 } }
.intro-title { font-size: 22px; letter-spacing: 3px; padding: 0 18px; }
.intro-text { font-size: 16px; line-height: 1.7; color: var(--ink2); padding: 6px 18px 14px; }

.evt-stage.auto { height: auto; max-height: none; }
.evt-stage.auto .evt-ui { position: static; }
.evt-res.on ~ * {}
.mood { align-items: center; }
.pt { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--red); margin-left: 4px; }
.pt.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink2); }
.item { margin: 10px auto 4px; }
.item .icon { width: 70px; height: 70px; font-size: 38px; }

/* v2 捏脸 */
.face-top { display: flex; gap: 12px; padding: 12px 16px 4px; align-items: center; flex: none; }
.face-top .face-stage { margin: 0; width: 52%; flex: none; }
.face-side { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.btn.small { font-size: 15px; padding: 9px 6px; letter-spacing: 1px; flex: none; }
.tiny { font-size: 11px; line-height: 1.5; color: var(--ink2); margin: 0; text-align: center; }
.face-opts { flex: 1; overflow: auto; padding: 6px 14px; display: flex; flex-direction: column; gap: 7px; }
.opt-row { display: flex; align-items: center; gap: 8px; }
.opt-lb { font-size: 14px; color: var(--ink2); width: 34px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.chip { border: 0; background: rgba(255,255,255,.3); box-shadow: inset 0 0 0 1px rgba(43,36,32,.35); border-radius: 14px; padding: 5px 11px; font-size: 14px; color: var(--ink); display: flex; align-items: center; gap: 4px; cursor: pointer; }
.chip i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1px rgba(43,36,32,.3); }
.chip.on { background: var(--red); color: #fbeee0; box-shadow: none; }
.face-go { padding-bottom: 16px; padding-top: 6px; flex: none; }
.lot-skill { font-size: 13px; color: var(--red); margin-top: 4px; }

/* v2 行走 */
#world { width: 100%; height: 100%; display: block; }
.joy { position: absolute; left: 18px; bottom: 18px; width: 116px; height: 116px; border-radius: 50%; background: rgba(239,228,204,.55); box-shadow: 0 0 0 1.5px rgba(43,36,32,.45), inset 0 0 18px rgba(43,36,32,.15); z-index: 4; touch-action: none; }
.joy i { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; background: var(--red); box-shadow: inset 0 0 0 3px #d9574e, 0 3px 8px rgba(0,0,0,.3); pointer-events: none; }
.talk { position: absolute; right: 16px; bottom: 34px; z-index: 4; border: 0; background: var(--red); color: #fbeee0; font-size: 17px; letter-spacing: 1px; padding: 14px 16px; border-radius: 6px; box-shadow: inset 0 0 0 2px #f0c9b8, 0 4px 10px rgba(143,36,30,.45); display: none; cursor: pointer; }
.talk.on { display: block; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.hours { gap: 2px; }
.hours span { font-size: 16px; height: 42px; }
.hours span small { font-size: 9px; }

/* v2 新关 */
.gate-guard { width: 70px; flex: none; }
.gate-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.gate-opts .btn { flex: none; font-size: 16px; padding: 11px 8px; }
.opt.ok { background: var(--lv); color: #fff; box-shadow: none; }
.opt.bad { background: var(--red); color: #fff; box-shadow: none; }
.opt.nope { opacity: .45; text-decoration: line-through; }

/* v3 剧情 */
.intro-opts { display: flex; flex-direction: column; gap: 9px; padding: 0 18px 10px; }
.intro-opts .btn { flex: none; font-size: 16px; padding: 12px 10px; letter-spacing: 1px; text-align: left; line-height: 1.4; }
.intro-opts .btn b { font-weight: 400; color: var(--red); margin-right: 6px; }
.intro-opts .btn.red b { color: #fbeee0; }
.intro-opts .btn.skill { box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 0 2px rgba(176,138,62,.25); background: rgba(176,138,62,.12); }
.intro-text { white-space: pre-line; }
.intro-tag { font-size: 13px; color: var(--ink2); padding: 0 18px 4px; letter-spacing: 1px; }
.btn.doubao { color: #2f5d8a; box-shadow: inset 0 0 0 1.5px #5b8fd6; background: rgba(127,176,234,.15); }
.intro-opts .btn.red { text-align: center; }
.btn.doubao.red { background: #5b8fd6; color: #fff; box-shadow: 0 3px 0 #3f6fb0; }
