/* 开运阁 / Tang Fortune Temple。两套皮共用结构:
   .skin-cn   = 麻邻国现有风格(浅底、主色绿、圆润 3D 按钮)+ 唐风细节(缓坡檐、鸱尾、联珠、瓦当、朱砂点睛)
   .skin-tang = 唐风寺院本体(黄昏大殿、朱柱白壁灰瓦、石青石绿泥金) */
:root {
  --brand: #58CC02; --brand-dark: #46A302; --brand-bg: #E8F8DB; --on-brand: #fff;
  --bg: #F7F7F7; --card: #fff; --ink: #3C3C3C; --soft: #777; --line: #EAEAEA; --line-dark: #D6D6D6;
  --red: #C8422B; --red-dark: #9E3220; --gold: #C9A24B; --gold-soft: #EFE3C2; --tile: #4A4F57; --tile-dark: #33373D;
  --qing: #2F5D8A; --lv: #3E8E7E; --lv-soft: #BFE3CF; --qing-soft: #A9C6E0;
  --r: 16px; --font: "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", "PingFang SC", "Microsoft YaHei", serif;
  --plaque-ink: #FFF6E0;
}
.skin-tang {
  --brand: #C8422B; --brand-dark: #8E2B1B; --brand-bg: #F6DFD3; --on-brand: #FFF3DC;
  --bg: #15121A; --card: #F3EBDD; --ink: #2B2622; --soft: #6E6359; --line: #DCCFB6; --line-dark: #C4B594;
  --red: #B5402A; --red-dark: #7E2A1A; --gold: #C9A24B; --gold-soft: #E4D4A8; --tile: #3F434A; --tile-dark: #2A2D32;
  --font: "Cormorant Garamond", Georgia, "Times New Roman", serif; --plaque-ink: #F6E9C8;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
.skin-tang { font-size: 19px; font-weight: 600; line-height: 1.45; }
body.lock { overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
[hidden] { display: none !important; }
html, body { max-width: 100%; overflow-x: hidden; }
#app { overflow-x: clip; min-height: 100vh; display: flex; flex-direction: column; position: relative; }
main { flex: 1; position: relative; z-index: 1; }
.col { width: 100%; max-width: 520px; margin: 0 auto; padding: 0 16px 28px; position: relative; text-align: center; }

/* 背景(海外皮:整屏寺院) */
.bg { display: none; }
.skin-tang .bg { display: block; position: fixed; inset: 0; z-index: 0; background: #15121A url(img/tang_bg_m.webp) center top / cover no-repeat; }
.skin-tang .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(21,18,26,.5) 0, rgba(21,18,26,0) 18%, rgba(21,18,26,0) 38%, rgba(21,18,26,.78) 70%, rgba(21,18,26,.94) 100%); }
.skin-tang[data-scene]:not([data-scene="home"]) .bg::after { background: linear-gradient(180deg, rgba(21,18,26,.62) 0, rgba(21,18,26,.5) 30%, rgba(21,18,26,.86) 100%); }
@media (min-width: 760px) { .skin-tang .bg { background-image: url(img/tang_bg_d.webp); background-position: center 30%; } }

/* 顶栏 */
.top { position: relative; z-index: 3; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; background: var(--card); border-bottom: 2px solid var(--line); }
.top .grow { flex: 1; }
.logo { display: flex; align-items: center; gap: 8px; white-space: nowrap; flex-shrink: 0; color: var(--ink); text-decoration: none; font-size: 19px; }
.logo img { border-radius: 8px; display: block; }
.logo b { font-weight: 700; }
.tbtn { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--soft); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.skin-tang .top { background: transparent; border-bottom: 0; }
.skin-tang .logo { color: #F6E9C8; font-size: 24px; letter-spacing: .02em; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.skin-tang .tbtn { background: rgba(21,18,26,.5); border: 1px solid rgba(233,204,120,.55); color: #F6E9C8; font-size: 16px; border-radius: 4px; backdrop-filter: blur(4px); }
.wd.lg { width: 28px; height: 28px; }

/* 场景 */
.scene { display: none; }
.scene.on { display: block; animation: sceneIn .42s ease both; }
@keyframes sceneIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 首页:主视觉 + 匾 */
.hero { position: relative; height: 300px; overflow: hidden; background: #EEF3EA; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 46%; display: block; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70px; background: linear-gradient(180deg, rgba(247,247,247,0), var(--bg)); }
.skin-tang .hero { height: 46vh; min-height: 280px; max-height: 420px; background: none; }
.skin-tang .hero img, .skin-tang .hero::after { display: none; }
@media (min-width: 760px) { .hero { height: 400px; } .hero img { object-position: 50% 62%; } }
[data-s="home"] .col { margin-top: -46px; }
.plaque { position: relative; display: inline-block; margin: 0 0 10px; padding: 7px; border-radius: 14px; background: var(--red); box-shadow: 0 4px 0 var(--red-dark), 0 10px 22px rgba(120,40,20,.18); }
.plaque span { display: block; padding: 4px 26px 5px; border: 2px solid var(--gold); border-radius: 8px; color: var(--plaque-ink); font-size: 34px; font-weight: 700; letter-spacing: .18em; text-indent: .18em; line-height: 1.3; }
.plaque::before, .plaque::after { content: ""; position: absolute; top: -18px; width: 3px; height: 18px; background: var(--gold); }
.plaque::before { left: 26px; } .plaque::after { right: 26px; }
.skin-tang .plaque { border-radius: 3px; box-shadow: 0 3px 0 var(--red-dark), 0 12px 30px rgba(0,0,0,.5); }
.skin-tang .plaque span { border-radius: 1px; border-width: 1px; white-space: nowrap; font-size: min(30px, 7vw); letter-spacing: .06em; text-indent: 0; padding: 4px 20px 6px; }
.tagline { margin: 4px 0 2px; font-size: 22px; font-weight: 700; }
.intro { margin: 0 auto 12px; max-width: 22em; color: var(--soft); font-size: 15px; }
.skin-tang .tagline { color: #F6E9C8; font-size: 28px; font-style: italic; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.skin-tang .intro { color: #E6D9BD; font-size: 18px; max-width: 24em; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.stats { display: flex; justify-content: center; gap: 8px; margin: 0 0 14px; }
.stats span { padding: 3px 12px; border-radius: 999px; background: var(--brand-bg); color: var(--brand-dark); font-size: 14px; font-weight: 700; }
.skin-tang .stats span { background: rgba(21,18,26,.55); color: #E9CC78; border: 1px solid rgba(233,204,120,.4); border-radius: 3px; font-size: 16px; }

/* 面板 */
.panel { position: relative; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 18px 16px 20px; }
.skin-tang .panel { border: 0; border-radius: 3px; border-top: 6px solid var(--red); box-shadow: 0 18px 50px rgba(0,0,0,.5); padding: 18px 18px 22px; }
.panel.pav { margin-top: 52px; padding-top: 30px; }
.skin-tang .panel.pav { border-top: 0; }
.eave { position: absolute; left: -3%; width: 106%; bottom: calc(100% - 8px); height: auto; display: block; pointer-events: none; }
.e-roof { fill: var(--tile); } .e-ridge, .e-edge { fill: var(--tile-dark); } .e-chi { fill: var(--tile-dark); } .e-beam { fill: var(--red); }
.e-lines path { stroke: rgba(255,255,255,.1); stroke-width: .7; fill: none; }
.skin-tang .e-chi { fill: var(--gold); }
.h { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 14px; font-size: 19px; font-weight: 700; }
.h2 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.h2.solo { margin: 22px 0 12px; }
.skin-tang .h { font-size: 23px; } .skin-tang .h2 { font-size: 27px; } .skin-tang .h2.solo { color: #F6E9C8; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.hint { margin: 0 0 16px; color: var(--soft); font-size: 15px; }
.skin-tang .hint { font-size: 18px; }
.wd { width: 20px; height: 20px; flex: none; }
.wd-o { fill: #fff; stroke: var(--gold); stroke-width: 1.6; } .wd-p { fill: var(--gold); } .wd-c { fill: var(--gold); }
.skin-tang .wd-o { fill: var(--card); }

/* 玩法 */
.modes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 18px; }
.chip { min-height: 40px; padding: 5px 13px; border-radius: 12px; border: 2px solid var(--line); border-bottom-width: 4px; background: var(--card); font-size: 15px; font-weight: 700; color: var(--ink); transition: transform .08s; }
.chip.on { border-color: var(--brand); background: var(--brand-bg); color: var(--brand-dark); }
.chip:disabled { opacity: .55; cursor: default; } .chip.on:disabled { opacity: 1; }
.chip:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; margin-bottom: 2px; }
.skin-tang .chip { border-radius: 3px; border: 1px solid var(--line-dark); border-bottom-width: 3px; background: #FBF6EA; font-size: 17px; font-weight: 600; }
.skin-tang .chip.on { border-color: var(--qing); background: #E3ECF4; color: var(--qing); }

/* 按钮(沿用站内 3D 按压) */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 22px; border-radius: 16px; font-size: 18px; font-weight: 700; letter-spacing: .04em; transition: transform .08s, box-shadow .08s; user-select: none; }
.btn.primary { width: 100%; background: var(--brand); color: var(--on-brand); box-shadow: 0 4px 0 var(--brand-dark); }
.btn.ghost { background: var(--card); color: var(--ink); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 transparent; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.wide { width: 100%; margin-top: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.skin-tang .btn { border-radius: 3px; font-size: 21px; letter-spacing: .03em; }
.skin-tang .btn.ghost { border: 1px solid var(--line-dark); box-shadow: 0 4px 0 var(--line-dark); background: #FBF6EA; }
.again { margin: 12px 0 0; color: var(--soft); font-size: 14px; }
.skin-tang .again { font-size: 17px; }
.link { margin: 14px auto 0; display: block; color: var(--brand-dark); font-size: 15px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.link:disabled { color: var(--soft); text-decoration: none; cursor: default; }
.skin-tang .link { color: #E9CC78; font-size: 18px; } .skin-tang .link:disabled { color: #B9AC92; }

/* 牌 */
.tile { position: relative; display: inline-block; vertical-align: top; }
.tile canvas { position: absolute; display: block; pointer-events: none; }
.fan { display: flex; justify-content: center; gap: 10px; padding: 18px 0 30px; }
.pick { position: relative; animation: fanIn .5s cubic-bezier(.2,.9,.3,1.2) both; animation-delay: calc(var(--i) * 70ms); transition: transform .15s; }
.pick:hover, .pick:focus-visible { transform: translateY(-8px); outline: none; }
.pick:active { transform: translateY(-2px) scale(.97); }
@keyframes fanIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.reveal { padding: 14px 0 6px; }
.flip { perspective: 900px; display: inline-block; }
.flip .in { position: relative; transform-style: preserve-3d; transition: transform .75s cubic-bezier(.2,.8,.2,1.08); }
.flip.on .in { transform: rotateY(180deg); }
.flip .tile { position: absolute; left: 0; top: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip .tile.f { transform: rotateY(180deg); }
.got { margin: 22px 0 16px; font-size: 20px; font-weight: 700; color: var(--brand-dark); }
.skin-tang .got { color: var(--red); font-size: 24px; font-style: italic; }

/* 钟 */
.bellbtn { display: block; width: 220px; max-width: 70%; margin: 0 auto; }
.bell { width: 100%; height: auto; display: block; overflow: visible; }
.b-beam { fill: var(--red); } .b-cap { fill: var(--tile-dark); } .b-dou { fill: #9C6B3F; } .b-rope { fill: #6B4A2A; } .b-crown { fill: #94702E; }
.b-shade { fill: rgba(80,50,0,.16); } .b-pearl circle { fill: #F4E3A6; } .b-band { fill: rgba(110,80,20,.5); }
.b-seat { fill: #F0D78A; stroke: #8A6A2A; stroke-width: 1.5; } .b-petal path { fill: #B88E3A; } .b-seatc { fill: #8A6A2A; }
.b-lip { fill: #A9853A; } .b-clap { fill: #7A5A26; }
.swing { transform-origin: 120px 44px; }
.bellbtn.hit .swing { animation: swing 1.5s cubic-bezier(.3,.6,.4,1) both; }
@keyframes swing { 0% { transform: rotate(0); } 12% { transform: rotate(9deg); } 34% { transform: rotate(-7deg); } 54% { transform: rotate(4.5deg); } 72% { transform: rotate(-2.5deg); } 88% { transform: rotate(1deg); } 100% { transform: rotate(0); } }
.rings circle { fill: none; stroke: var(--gold); stroke-width: 2; opacity: 0; transform-origin: 120px 160px; }
.bellbtn.hit .rings circle { animation: ring 1.5s ease-out both; }
.bellbtn.hit .rings circle:nth-child(2) { animation-delay: .18s; } .bellbtn.hit .rings circle:nth-child(3) { animation-delay: .36s; }
@keyframes ring { 0% { opacity: .7; transform: scale(.8); } 100% { opacity: 0; transform: scale(1.7); } }
.dots { display: flex; justify-content: center; gap: 14px; margin: 10px 0 6px; }
.dots .wd { width: 26px; height: 26px; opacity: .35; transition: opacity .2s, transform .3s cubic-bezier(.2,.9,.3,1.6); }
.dots .wd.on { opacity: 1; transform: scale(1.15); }
.left { margin: 0; font-size: 17px; font-weight: 700; color: var(--soft); min-height: 1.6em; }

/* 静坐 */
.breath { position: relative; width: 230px; height: 230px; max-width: 72vw; max-height: 72vw; margin: 6px auto 10px; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.rg-b { fill: none; stroke: var(--line); stroke-width: 2.4; }
.rg-f { fill: none; stroke: var(--brand); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .25s linear; }
.skin-tang .rg-f { stroke: var(--gold); }
.rosette { position: absolute; inset: 9%; width: 82%; height: 82%; transform: scale(.66); transition: transform 6s ease-in-out; }
.breath[data-ph="in"] .rosette { transform: scale(1); transition-duration: 4s; }
.breath[data-ph="done"] .rosette { transform: scale(.9); transition-duration: .6s; }
.r-o path { fill: #D9F2C4; stroke: var(--brand); stroke-width: 1.6; } .r-i path { fill: #FBE9E4; stroke: var(--red); stroke-width: 1.3; }
.r-c { fill: var(--gold); } .r-d circle { fill: var(--gold); }
.skin-tang .r-o path { fill: var(--lv-soft); stroke: var(--lv); } .skin-tang .r-i path { fill: var(--qing-soft); stroke: var(--qing); }
.phase { margin: 0; font-size: 24px; font-weight: 700; }
.secs { margin: 0 0 14px; color: var(--soft); font-size: 16px; font-variant-numeric: tabular-nums; }
.note { margin: 12px 0 0; color: var(--soft); font-size: 14px; }
.skin-tang .phase { font-size: 30px; font-style: italic; } .skin-tang .note, .skin-tang .secs { font-size: 17px; }
[data-s="sit"] .btn { min-width: 200px; }

/* 开运卡 */
.cardwrap { margin: 0 auto 14px; max-width: 360px; border-radius: 18px; overflow: hidden; background: var(--card); box-shadow: 0 6px 0 var(--line), 0 16px 34px rgba(0,0,0,.08); aspect-ratio: 2 / 3; }
.skin-tang .cardwrap { border-radius: 4px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.cardwrap img { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .4s; }
.cardwrap img.ready { opacity: 1; }
.nick { display: block; width: 100%; max-width: 360px; margin: 0 auto; height: 46px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); text-align: center; font-size: 16px; outline: none; }
.nick:focus { border-color: var(--brand); }
.skin-tang .nick { border-radius: 3px; border: 1px solid var(--line-dark); font-size: 19px; }
.play { display: flex; flex-direction: column; align-items: center; margin-top: 22px; padding: 14px 16px; border-radius: var(--r); border: 2px dashed var(--brand); background: var(--brand-bg); color: var(--brand-dark); text-decoration: none; }
.play b { font-size: 19px; } .play span { font-size: 14px; color: var(--soft); }
.skin-tang .play { border-radius: 3px; border: 1px solid rgba(233,204,120,.6); background: rgba(21,18,26,.6); color: #E9CC78; }
.skin-tang .play b { font-size: 23px; } .skin-tang .play span { color: #D5C7A8; font-size: 17px; }

/* 页脚 */
.ft { position: relative; z-index: 1; padding: 18px 20px 30px; text-align: center; }
.ft p { margin: 0 auto; max-width: 34em; color: #9A9A9A; font-size: 12.5px; line-height: 1.7; }
.skin-tang .ft p { color: #A99F8C; font-size: 15px; font-weight: 500; }

/* 抽屉:福牌墙 / 卡册 */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.42); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-in { width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column; background: var(--bg); border-radius: 22px 22px 0 0; animation: up .32s cubic-bezier(.2,.9,.3,1) both; }
.skin-tang .sheet-in { background: var(--card); border-radius: 4px 4px 0 0; }
@keyframes up { from { transform: translateY(40px); } to { transform: none; } }
@media (min-width: 760px) { .sheet { align-items: center; } .sheet-in { border-radius: 22px; } .skin-tang .sheet-in { border-radius: 4px; } }
.sheet-hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; }
.sheet-hd h2 { margin: 0; font-size: 21px; }
.skin-tang .sheet-hd h2 { font-size: 26px; } .skin-tang .sheet-hd .tbtn { background: #FBF6EA; color: var(--ink); border-color: var(--line-dark); backdrop-filter: none; }
.sheet-bd { overflow: auto; padding: 4px 16px 26px; -webkit-overflow-scrolling: touch; }
.rack { position: relative; margin-top: 44px; padding: 12px 10px 14px; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); text-align: center; }
.skin-tang .rack { background: #FBF6EA; border: 1px solid var(--line-dark); border-radius: 3px; }
.rack h3 { margin: 10px 0 8px; font-size: 16px; color: var(--soft); font-weight: 700; }
.plqs { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 12px; padding-top: 12px; }
.plq { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 84px; padding: 14px 10px 8px; border-radius: 10px 10px 14px 14px; background: #FFF8E8; border: 2px solid #D9B978; box-shadow: 0 3px 0 #D9B978; }
.plq .str { position: absolute; top: -14px; left: 50%; width: 3px; height: 16px; margin-left: -1.5px; background: var(--red); border-radius: 2px; }
.plq .str::after { content: ""; position: absolute; top: 12px; left: -3.5px; width: 10px; height: 10px; border-radius: 50%; background: #FFF8E8; border: 2px solid #D9B978; }
.plq-t { display: flex; flex-direction: row-reverse; gap: 4px; writing-mode: vertical-rl; font-size: 17px; font-weight: 700; line-height: 1.35; letter-spacing: .08em; min-height: 120px; color: #5A4326; }
.plq-t span { display: block; }
.plq em { margin-top: 8px; font-style: normal; font-size: 11.5px; color: #A68A55; white-space: nowrap; }
.skin-tang .plq { max-width: 210px; border-radius: 2px; padding: 16px 12px 8px; }
.skin-tang .plq-t { writing-mode: horizontal-tb; flex-direction: column; min-height: 0; font-size: 17px; font-style: italic; letter-spacing: 0; line-height: 1.25; }
.skin-tang .plq em { font-size: 14px; }
.empty { margin: 4px 0 8px; color: var(--soft); font-size: 14px; }
.albsub { margin: 0 0 14px; text-align: center; color: var(--soft); font-weight: 700; }
.alb { display: grid; grid-template-columns: repeat(7, max-content); justify-content: center; gap: 12px 8px; padding-bottom: 6px; }
.alb .tile.no { opacity: .28; }

/* 提示 */
.toast { position: fixed; left: 50%; bottom: 13vh; z-index: 30; transform: translate(-50%, 12px); padding: 9px 18px; border-radius: 999px; background: rgba(40,40,40,.92); color: #fff; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .scene.on, .pick, .bellbtn.hit .swing, .bellbtn.hit .rings circle { animation: none; } .rosette { transition-duration: .01s !important; } }

/* ---------- 3D 大殿模式 ---------- */
#hall { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; touch-action: none; outline: none; -webkit-user-select: none; user-select: none; }
#hallSplash { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: var(--bg); text-align: center; }
#hallSplash b { display: block; font-size: 34px; color: var(--red); letter-spacing: .12em; }
#hallSplash span { display: block; margin-top: 10px; color: var(--soft); font-size: 15px; }
.skin-tang #hallSplash b { color: #F6E9C8; letter-spacing: .04em; } .skin-tang #hallSplash span { color: #B9AC92; font-size: 18px; }
body.hall-on[data-scene="home"] { overflow: hidden; height: 100%; position: fixed; inset: 0; }
body.hall-on[data-scene="home"] #app { min-height: 0; height: 0; overflow: visible; }
body.hall-on[data-scene="home"] main, body.hall-on[data-scene="home"] .ft, body.hall-on[data-scene="home"] .bg { display: none; }
body.hall-on[data-scene="home"] .top { position: fixed; left: 0; right: 0; top: 0; background: transparent; border-bottom: 0; pointer-events: none; padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
body.hall-on[data-scene="home"] .top > * { pointer-events: auto; }
body.hall-on.skin-cn[data-scene="home"] .logo { background: rgba(255,255,255,.92); padding: 4px 12px 4px 6px; border-radius: 14px; box-shadow: 0 2px 0 rgba(0,0,0,.08); }
body.hall-on.skin-cn[data-scene="home"] .tbtn { background: rgba(255,255,255,.92); }
body.hall-on:not([data-scene="home"]) #hall, body.hall-on:not([data-scene="home"]) #hud { display: none; }
#hud { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
#hud > * { pointer-events: auto; }
.h-guide { position: absolute; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); padding: 7px 16px; border-radius: 999px; background: rgba(255,255,255,.94); border: 2px solid var(--line); color: var(--ink); font-size: 15px; font-weight: 700; line-height: 1.35; text-align: center; pointer-events: none !important; }
.h-guide:empty { display: none; }
.skin-tang .h-guide { background: rgba(21,18,26,.72); border: 1px solid rgba(233,204,120,.55); color: #F6E9C8; font-size: 18px; border-radius: 4px; }
.h-help { position: absolute; left: 50%; top: calc(132px + env(safe-area-inset-top)); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); padding: 4px 12px; border-radius: 10px; background: rgba(40,40,40,.62); color: #fff; font-size: 12.5px; line-height: 1.4; text-align: center; transition: opacity .8s; pointer-events: none !important; }
.skin-tang .h-help { font-size: 15px; font-weight: 500; }
.h-help.off { opacity: 0; }
.h-act { position: absolute !important; left: 50%; bottom: calc(34px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: auto !important; min-width: 190px; max-width: calc(100vw - 32px); }
.h-act:active:not(:disabled) { transform: translate(-50%, 4px) !important; }
.h-touch .h-act { left: auto; right: 16px; transform: none; min-width: 0; max-width: calc(100vw - 178px); padding: 0 18px; }
.h-touch .h-act:active:not(:disabled) { transform: translateY(4px) !important; }
.h-joy { display: none; position: absolute; left: 18px; bottom: calc(26px + env(safe-area-inset-bottom)); width: 124px; height: 124px; border-radius: 50%; background: rgba(255,255,255,.28); border: 2px solid rgba(255,255,255,.7); touch-action: none; }
.h-joy i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.h-touch .h-joy { display: block; }
#hud:not([data-mode="walk"]) .h-joy, #hud:not([data-mode="walk"]) .h-act, #hud:not([data-mode="walk"]) .h-guide, #hud:not([data-mode="walk"]) .h-help { display: none; }
.h-mask { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.38); }
.h-panel { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto; text-align: center; }
.h-panel .modes { margin-top: 12px; }
.h-tip { position: absolute; left: 50%; bottom: calc(30px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.h-tip span { padding: 8px 18px; border-radius: 999px; background: rgba(255,255,255,.94); border: 2px solid var(--line); font-size: 17px; font-weight: 700; color: var(--ink); text-align: center; }
.skin-tang .h-tip span { background: rgba(21,18,26,.72); border: 1px solid rgba(233,204,120,.55); color: #F6E9C8; border-radius: 4px; font-size: 21px; }
.h-tip .btn { width: auto; min-width: 200px; }
.h-sit { position: absolute; left: 50%; bottom: calc(30px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: 220px; display: grid; grid-template-columns: 1fr; justify-items: center; text-align: center; }
.h-sit svg { grid-area: 1 / 1; width: 132px; height: 132px; transform: rotate(-90deg); background: rgba(255,255,255,.9); border-radius: 50%; }
.skin-tang .h-sit svg { background: rgba(21,18,26,.7); }
.h-sit b, .h-sit em { position: relative; z-index: 1; }
.h-sit b { grid-area: 1 / 1; align-self: center; margin-top: -22px; font-size: 22px; color: var(--ink); }
.h-sit em { grid-area: 1 / 1; align-self: center; margin-top: 34px; font-style: normal; font-size: 18px; color: var(--soft); }
.skin-tang .h-sit b { color: #F6E9C8; } .skin-tang .h-sit em { color: #D9C9A0; }
.h-sit .btn { margin-top: 12px; min-width: 190px; width: auto; }

@media (max-width: 430px) { .top { gap: 6px; padding-left: 10px; padding-right: 10px; } .tbtn { padding: 0 8px; font-size: 13px; } .skin-tang .tbtn { font-size: 13px; padding: 0 7px; } .skin-tang .logo { font-size: 20px; } .logo { font-size: 17px; gap: 6px; } }
