/* 古庙逃生 / 七关同一套场景语言。仅作用于关卡台，不覆盖地图、榜单、邀请、结算弹层。 */
#gm-stage{
  --im-gold:#f0d496;--im-ink:#f7ecd5;--im-muted:#cbbfa9;--im-bronze:#9f794b;
  --im-line:#b28a565c;--im-black:#0e1013;--im-panel:#171819ee;
  --im-radius:14px;--im-side:clamp(10px,4vw,20px);
  --im-room:assets/v4/bg.webp;
  --im-glow:#c37c35;
  background:radial-gradient(ellipse at 50% 12%,color-mix(in srgb,var(--im-glow) 23%,transparent),transparent 62%),#101215;
  color:var(--im-ink);
}
#gm-stage[data-temple-room=stroop]{--im-glow:#c29a52}
#gm-stage[data-temple-room=reaction]{--im-glow:#ae552f}
#gm-stage[data-temple-room=schulte]{--im-glow:#397c71}
#gm-stage[data-temple-room=rhythm]{--im-glow:#b45e39}
#gm-stage[data-temple-room=dual]{--im-glow:#657574}
#gm-stage[data-temple-room=lotus]{--im-glow:#587f83}
#gm-stage .gm-stage-bar{
  position:relative;z-index:12;display:grid;grid-template-columns:66px minmax(0,1fr) 88px;
  min-height:calc(52px + env(safe-area-inset-top));
  padding:calc(3px + env(safe-area-inset-top)) 9px 3px;column-gap:5px;
  background:linear-gradient(180deg,#271e17,#151514 88%);
  border-bottom:1px solid #aa804c93;box-shadow:0 6px 16px #0007;
}
#gm-stage .gm-stage-bar::after{
  content:"";position:absolute;inset:auto 0 0;height:1px;pointer-events:none;
  background:linear-gradient(90deg,transparent 5%,#eac58b7a 50%,transparent 95%);
}
#gm-stage #gm-stage-back{
  display:inline-flex;align-items:center;justify-content:center;gap:2px;white-space:nowrap;
  min-height:44px;padding:0 7px;border-radius:8px;
  border-color:#ba906c62;color:var(--im-ink);background:#e2af6c0b;font-size:12px;
}
#gm-stage #gm-stage-back svg{width:13px;height:13px;flex:none}
#gm-stage .im-stage-mark{text-align:center;min-width:0;line-height:1.08}
#gm-stage .im-stage-place{
  display:block;margin-bottom:3px;color:#c39b65;font-size:9px;font-weight:650;letter-spacing:.28em;
}
#gm-stage .gm-stage-title{
  font-size:clamp(13px,3.8vw,17px);font-weight:800;letter-spacing:.045em;
  color:var(--im-gold);white-space:nowrap;text-shadow:0 1px 5px #0009;
}
#gm-stage .gm-stage-flag{
  justify-self:end;border-radius:6px;border:1px solid #c69b623f;
  white-space:nowrap;font-size:9.5px;line-height:1.1;padding:5px 4px;letter-spacing:0;
}
#gm-stage .gm-stage-flag.off{color:#d5c9b0;background:#ffffff09}
#gm-stage .gm-stage-flag.on{color:#211709;background:linear-gradient(#efd59b,#b6864c)}
#gm-stage .gm-stage-body{overscroll-behavior:contain}
#gm-stage :is(button,[role=button]):focus-visible{outline:2px solid #ffe4a0;outline-offset:2px}

/* 统一木牌按钮、青铜边框、墨色反馈条。警示颜色留给玩法本身。 */
#gm-stage :is(.gm-btn-gold,.btn-start,.sc-btn-primary){
  min-height:44px;border-radius:10px;border:1px solid #e6be80!important;
  background:linear-gradient(180deg,#f3d9a0 0%,#d1a26a 72%,#b8844d)!important;
  color:#24150c!important;font-weight:800;
  box-shadow:inset 0 1px 0 #fff0c0a3,0 3px 0 #6d4a2d,0 6px 16px #0006;
  text-shadow:none;
}
#gm-stage :is(.gm-btn-ghost,.btn-ghost,.sc-btn-ghost):not(#gm-stage-back):not(#bal-pause){
  color:var(--im-ink)!important;background:#211e1be8!important;
  border:1px solid var(--im-line)!important;border-radius:9px;
}
#gm-stage :is(.gm-btn-gold,.btn-start,.sc-btn-primary,.gm-btn-ghost):active:not(:disabled){filter:brightness(1.09)}
#gm-stage :is(.gm-btn-gold,.btn-start,.sc-btn-primary):disabled{opacity:.82;box-shadow:none}
#gm-stage :is(.sc-hint,.sc-trial-bar,.sc-schulte-head,.sc-feedback,#rescue-status,#lotus-hint){
  color:var(--im-ink);text-shadow:0 1px 2px #0009;
  background:#151716e8;border:1px solid var(--im-line);
  border-radius:9px;
}
#gm-stage :is(.sc-hint,.sc-trial-bar,.sc-feedback,#rescue-status,#lotus-hint){padding:8px 10px;line-height:1.45}
#gm-stage :is(.sc-schulte-time,.sc-rhythm-count,#lotus-steps,#rescue-clock,#rescue-count){font-variant-numeric:tabular-nums}
#gm-stage :is(#bal-intro,#str-intro){
  margin-inline:var(--im-side);background:linear-gradient(155deg,#262019,#141617 65%);
  border:1px solid var(--im-line);border-radius:var(--im-radius);
  box-shadow:inset 0 1px 0 #e7ba6c20,0 12px 30px #0005;
}
#gm-stage :is(#bal-intro,#str-intro) h2{color:var(--im-gold)}
#gm-stage :is(#bal-intro,#str-intro) :is(.v2cover,.passline){border-radius:10px;border-color:var(--im-line)}
#gm-stage :is(#bal-intro,#str-intro) .sub{color:var(--im-ink)}
#gm-stage :is(#bal-intro,#str-intro) .covertext{
  background:linear-gradient(transparent,#120f0ced 76%);color:var(--im-gold)
}
#gm-stage :is(#bal-result,#str-result).show{
  margin:10px var(--im-side);border:1px solid var(--im-line);border-radius:var(--im-radius);
}

/* 1  前庭：保留原画布位置与碰撞尺寸，暖边只沿视窗；危险时不抢血条的注意力。 */
#gm-stage #panel-balance.active #bal-play:not(.hidden){top:calc(52px + env(safe-area-inset-top))}
#gm-stage #bal-track{outline:1px solid #b68b564f;outline-offset:-1px}
#gm-stage #bal-track::after{
  content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  background:radial-gradient(ellipse 75% 72% at 50% 49%,transparent 56%,#080b10a1 100%);
}
#gm-stage #bal-track.danger::after{
  box-shadow:inset 0 0 30px #ed492866;
}
#gm-stage #bal-play .hud .cell{
  background:linear-gradient(#29241ee8,#131618ea)!important;
  border-color:#b78a5a80!important;color:#fff4db!important;
}
#gm-stage #bal-play .hud .k{color:#e0cba6!important}
#gm-stage #bal-play #bal-state{overflow-wrap:anywhere}

/* 2  符殿：光集中在符纸，而不改变代表题目的实际字色与选项色。 */
#gm-stage #str-play{
  padding:0 var(--im-side) max(6px,env(safe-area-inset-bottom))!important;
  background:radial-gradient(ellipse at 50% 45%,#e4ad4b35,transparent 54%),
    linear-gradient(#0b1014a3,#11100e34 50%,#100e0cdc),url("assets/v4/bg.webp") center 28% / cover no-repeat!important;
}
#gm-stage #str-play .hud .cell:not(.urgent),
#gm-stage #str-play #str-countdown:not(.warn):not(.danger){
  background:linear-gradient(#29241f,#15191a)!important;border-color:var(--im-line)!important;
}
#gm-stage #str-play .stroop-tip{letter-spacing:.09em;border-color:var(--im-line)}
#gm-stage #str-play .stroop-word{-webkit-text-stroke:2px #39230da6}
#gm-stage #str-play .str-talisman{
  height:clamp(126px,32dvh,272px);
  filter:drop-shadow(0 5px 12px #000a) drop-shadow(0 0 12px #eaad4b52);
}
#gm-stage #str-play .color-btns{gap:clamp(4px,2vw,10px)}
#gm-stage #str-play .color-btn{height:clamp(50px,9dvh,76px);min-height:44px;font-size:clamp(26px,8vw,36px)}
#gm-stage #str-play .str-door{inset:auto 16% 2px}

/* 3–5 三个房间沿用独立场景图，衔接用同一套青铜框，背景不影响控件状态。 */
#gm-stage #gm-old-host{
  padding:9px var(--im-side) max(14px,env(safe-area-inset-bottom));
  height:auto;min-height:100%;
}
#gm-stage .sc-page :is(#skillToday,#scTrialGame){
  border-radius:var(--im-radius);border:1px solid var(--im-line);padding:10px;
  box-shadow:inset 0 0 0 2px #130e08a9,0 10px 24px #0005;
}
#gm-stage .sc-page :is(#skillToday,#scTrialGame).sc-theme-reaction{
  background:linear-gradient(#1b100ad9,#1b100a22 30%,#100e0cd9 96%),url("assets/old/bg_reaction.webp") center 33%/cover!important;
}
#gm-stage .sc-page :is(#skillToday,#scTrialGame).sc-theme-schulte{
  background:linear-gradient(#131816d9,#15191724 32%,#0b1718e8 98%),url("assets/old/bg_schulte.webp") center 25%/cover!important;
}
#gm-stage .sc-page :is(#skillToday,#scTrialGame).sc-theme-rhythm{
  background:radial-gradient(ellipse at 55% 36%,#7833112a,transparent 62%),linear-gradient(#17100caa,#22171022 36%,#17100ce0 90%),
    url("assets/old/bg_rhythm.webp") center 48%/cover!important;
}
#gm-stage #gm-old-host .sc-trial-bar{
  display:flex;align-items:center;justify-content:space-between;gap:4px;
  margin-bottom:7px;font-size:11px;
}
#gm-stage #gm-old-host .sc-trial-bar button{min-height:32px;white-space:nowrap}
#gm-stage .sc-page .zy-lane{
  background-color:#101415ce;border:1px solid var(--im-line);
  box-shadow:inset 0 -12px 22px #090a0bd6,0 4px 12px #0004;border-radius:9px;
}
#gm-stage .sc-page .zy-lane-tag{background:#151412e6;color:#ffebba;border-color:#c49b654f}
#gm-stage .sc-page .zy-lane.danger .zy-lane-tag{color:#ffc7a6}
#gm-stage .sc-page :is(#skillToday,#scTrialGame) .sc-result:not(.zy-win){
  background:linear-gradient(#2c2620,#151818);border:1px solid var(--im-line);
  box-shadow:0 6px 18px #0006;color:var(--im-ink);border-radius:10px;
}

/* 3 山门：火光沿门框，判定按钮的黄／绿／红保留，圆台不再像漂浮的网页按钮。 */
#gm-stage #gm-old-host .rx-zone{height:clamp(136px,24dvh,210px);margin-top:0}
#gm-stage .rx-door{
  width:clamp(112px,35vw,160px);height:89%;bottom:2px;z-index:0;
  background:radial-gradient(ellipse at 50% 76%,#eec37c8c,transparent 68%),#332218;
  border-color:#b58350;box-shadow:0 0 30px #c46d375e,inset 0 0 10px #0f0905;
}
#gm-stage .rx-door i{background:repeating-linear-gradient(90deg,#4b2620 0 12px,#73452d 13px 15px)}
#gm-stage .rx-z{z-index:1}
#gm-stage #scPad{
  width:clamp(155px,49vw,235px);height:clamp(155px,49vw,235px);margin:0 auto 13px;
  box-shadow:0 0 0 4px var(--ring),0 0 0 7px #75502d,0 8px 0 7px #352819,
    0 16px 27px 8px #0009,inset 0 -12px 20px #0008,inset 0 5px 10px #ffdfb842;
}
#gm-stage #scPad .sc-pad-main{font-size:clamp(19px,6.1vw,28px)}
#gm-stage #scPad[data-st=go] .sc-pad-main{font-size:clamp(32px,11vw,56px)}
#gm-stage #scPad .sc-pad-sub{font-size:11px}
#gm-stage .rx-practice-row{margin:8px auto 4px}

/* 4 藏玉阁：石格压暗但把数字提亮；已点击格的视觉与未点保持一致。 */
#gm-stage .sc-page .sc-schulte-grid:not(:empty){
  background:linear-gradient(155deg,#26362d,#132522);border:1px solid #a68d616c;
  box-shadow:inset 0 4px 18px #070d0ce8,0 5px 18px #0008;border-radius:11px;
  padding:7px;gap:clamp(4px,1.8vw,8px);
}
#gm-stage .sc-page .sc-cell:not(.wrong),#gm-stage .sc-page .sc-cell.done:not(.wrong){
  min-width:0;height:clamp(38px,7dvh,58px);border-radius:8px;background:
    radial-gradient(ellipse at 24% 14%,#b1d6ad49,transparent 62%),linear-gradient(150deg,#477a64,#1a4a40 74%,#153d35)!important;
  color:#fff1ca;text-shadow:0 2px 2px #071a17,0 0 1px #000;font-size:clamp(18px,5.4vw,25px);
  box-shadow:inset 0 1px 0 #b0d7b26e,inset 0 -3px 0 #08181781,0 3px 0 #0b1c19;
}
#gm-stage .sc-page .sc-cell.hit{filter:brightness(1.3)}
#gm-stage .stone-path i{background:#526359}
#gm-stage .stone-path i.lit{background:#f3d28d}

/* 5 鼓楼：鼓面为主光，正确的闪光留给节拍，不加额外的伪节奏动画。 */
#gm-stage .sc-rhythm-dot{
  width:clamp(100px,32vw,150px);height:clamp(100px,32vw,150px);
  margin:8px auto;background-color:#723920!important;
  box-shadow:0 5px 0 #4f2318,0 0 0 3px #8f633d,0 14px 26px #000a;
}
#gm-stage .sc-rhythm-count{
  background:#241c16e8;border:1px solid var(--im-line);color:#fff1cc!important;
  font-size:clamp(13px,4.1vw,18px);
}
#gm-stage .sc-rhythm-tap{min-height:50px;padding:13px 12px!important;font-size:18px!important}
#gm-stage .sc-rhythm-tap.beat-now{outline:3px solid #fff3cc}
#gm-stage .sc-feedback:empty{display:none}

/* 6 后院：边沿有冷夜色，安全方向以暖灯强调；三个救援节点与现有击倒数同步。 */
#gm-stage #rescue-section,#gm-stage #gm-lotus{
  max-width:470px;padding-inline:var(--im-side);
}
#gm-stage #rescue-section .rescue-hud{
  color:#f8e9c8;background:linear-gradient(#28251e,#161918);
  border-color:var(--im-line);font-size:clamp(10.5px,3.2vw,13px);padding:5px 7px;gap:4px;
}
#gm-stage #rescue-section .rescue-mute{width:36px;height:36px;min-height:36px;margin:0;border-color:var(--im-line)}
#gm-stage #rescue-section .rescue-hp-bar{width:clamp(26px,9vw,45px);border-color:#b68d59}
#gm-stage .im-rescue-field{position:relative}
#gm-stage .im-rescue-field::after{
  content:"";position:absolute;inset:0;border-radius:0 0 12px 12px;pointer-events:none;
  background:radial-gradient(ellipse 45% 28% at 81% 75%,#f6c37120,transparent 100%),
    radial-gradient(ellipse 75% 71% at 52% 48%,transparent 65%,#07101987);
}
#gm-stage #rescue-arena{border-color:var(--im-line)}
#gm-stage .im-rescue-milestones{
  position:absolute;z-index:1;top:8px;right:9px;display:flex;gap:9px;pointer-events:none;
  color:#f0e2c6;background:#171611dc;border:1px solid var(--im-line);border-radius:6px;
  padding:4px 7px;font-size:9px;font-variant-numeric:tabular-nums;
}
#gm-stage .im-rescue-milestones span{display:inline-flex;align-items:center;gap:3px}
#gm-stage .im-rescue-milestones i{width:6px;height:6px;border-radius:999px;background:#645645;outline:1px solid #ae926a}
#gm-stage [data-rescue-lamps="1"] .im-rescue-milestones span:nth-child(1) i,
#gm-stage [data-rescue-lamps="2"] .im-rescue-milestones span:nth-child(-n+2) i,
#gm-stage [data-rescue-lamps="3"] .im-rescue-milestones i{background:#ffe5a0;box-shadow:0 0 7px #e8ab57}

/* 7 莲桥：看灯暖光、作答冷静、通关天光。背景/网格坐标与点击区域不变。 */
#gm-stage #gm-lotus .scene{border-color:var(--im-line);background:#131b1c;border-radius:var(--im-radius)}
#gm-stage #gm-lotus .field::after{
  content:"";position:absolute;z-index:1;inset:0;pointer-events:none;
  background:linear-gradient(90deg,#14222852,transparent 17%,transparent 83%,#15242c54);
}
#gm-stage #gm-lotus .scene[data-lotus-phase=watch] .lotus-exit-glow{opacity:.38}
#gm-stage #gm-lotus .scene[data-lotus-phase=complete] .lotus-exit-glow{opacity:1}
#gm-stage #gm-lotus .scene[data-lotus-phase=input] .stage{box-shadow:inset 3px 0 #a9d8bd}
#gm-stage #gm-lotus .scene[data-lotus-phase=wrong] .stage{box-shadow:inset 3px 0 #f19377}
#gm-stage #gm-lotus .scene[data-lotus-phase=complete] .stage{box-shadow:inset 3px 0 #f2d394}
#gm-stage #gm-lotus .stage{background:linear-gradient(#22231e,#151918);border-color:var(--im-line)}
#gm-stage #gm-lotus #lotus-status{color:var(--im-ink)}
#gm-stage #gm-lotus #lotus-steps{color:var(--im-gold)}
#gm-stage #gm-lotus .tile.lit{
  background:radial-gradient(ellipse,#ffe2a0d9,#e8993978 65%,#8c542550)
}
#gm-stage #gm-lotus .tile.trail{background:radial-gradient(ellipse,#f8d37a78,#bd881c32)}
#gm-stage #gm-lotus .tile.wrong{background:#ac473caa}
#gm-stage #gm-lotus #lotus-hint{margin-bottom:8px}
#gm-stage #gm-lotus .lotus-story-actions button{margin-bottom:2px}

@media(max-width:360px){
  #gm-stage .gm-stage-bar{grid-template-columns:54px minmax(0,1fr) 78px;padding-inline:6px;column-gap:3px}
  #gm-stage .gm-stage-flag{font-size:9px;padding-inline:3px}
}
@media(max-height:700px){
  #gm-stage #str-play .str-talisman{height:clamp(100px,27dvh,178px)}
  #gm-stage #str-play .stroop-word{font-size:clamp(42px,8.5dvh,66px)}
  #gm-stage #str-play .color-btn{padding:0!important}
  #gm-stage #gm-old-host .rx-zone{height:125px}
}
@media(prefers-reduced-motion:reduce){
  #gm-stage :is(.im-rescue-milestones i,.lotus-exit-glow,.rx-door i){transition:none!important}
  #gm-stage #scPad::after{animation:none!important}
}

/* 舞台只有一个关卡标题；旧头卡保留玩法提示和声音开关，不再重复标题。 */
#gm-stage .zy-head{
  margin:0 0 7px!important;min-height:0!important;padding:4px 6px 4px 9px!important;
  border:1px solid var(--im-line)!important;border-radius:8px;
  background:linear-gradient(90deg,#241e17eb,#141615de)!important;color:var(--im-ink);
  gap:6px;box-shadow:none;
}
#gm-stage .zy-head .zy-badge,#gm-stage .zy-head .zy-head-t b{display:none}
#gm-stage .zy-head .zy-head-t small{
  display:block;color:#e7d6b3;font-size:11px;line-height:1.28;margin:0;
}
#gm-stage .zy-head .zy-mute{width:36px;height:36px;min-height:36px;margin:0}
#gm-stage #gm-rescue .zy-head{display:none}
#gm-stage #gm-lotus .intro-line{min-height:0;margin-bottom:5px}
#gm-stage #gm-lotus .intro-line p{display:none}
#gm-stage #gm-lotus .intro-line:has(#lotus-reset[hidden]){display:none}
#gm-stage #gm-lotus #lotus-reset{min-height:36px}
#gm-stage .sc-page .sc-trial-bar{
  padding:4px 8px;min-height:0;font-size:10px;justify-content:center!important;
}
#gm-stage .sc-page .sc-trial-bar [data-gm-back]{display:none}
#gm-stage .sc-page .sc-hint{
  font-size:12px;line-height:1.48;padding:7px 9px;
}
#gm-stage #bal-track::after{z-index:6}
#gm-stage .rx-open .rx-door{background:radial-gradient(ellipse at 50% 70%,#ffe8ae,#7b4d2a 76%)}
#gm-stage #soundToast{top:auto;bottom:max(15px,env(safe-area-inset-bottom));pointer-events:none}
#gm-stage #soundToast .spk{font-size:14px}
@media(min-width:500px){
  #gm-stage #panel-balance.active #bal-play:not(.hidden){
    left:max(0px,calc((100vw - 410px)/2));right:max(0px,calc((100vw - 410px)/2));
  }
}
@media(max-height:700px){
  #gm-stage #gm-old-host .zy-lane{height:66px;flex-shrink:0;margin-block:4px}
  #gm-stage .sc-page .sc-schulte-head{margin:4px 0;padding:3px 7px}
  #gm-stage .sc-page .sc-cell:not(.wrong),#gm-stage .sc-page .sc-cell.done:not(.wrong){height:clamp(35px,6.6dvh,46px)}
  /* 满宽：短屏也不再按高度收窄桥图，两侧不留黑边；超出时舞台可滚动。 */
  #gm-stage #gm-lotus .field{width:100%}
}
#gm-stage #gm-lotus #lotus-practice:disabled{display:none}
#gm-stage #gm-lotus .lotus-story-actions:has(#lotus-practice:not([hidden]):not(:disabled)) #lotus-action{width:auto;flex:1}
#gm-stage #gm-lotus #lotus-practice{padding-inline:10px;font-size:13px}
@media(max-height:700px){
  #gm-stage[data-temple-room=schulte] #gm-old-host .sc-schulte-grid:not(:empty){
    flex:0 0 auto;grid-auto-rows:minmax(34px,6.1dvh);gap:4px;padding:5px;margin-top:3px;
  }
  #gm-stage[data-temple-room=schulte] #gm-old-host .sc-cell{
    height:100%;width:100%;aspect-ratio:auto;font-size:20px;
  }
  #gm-stage[data-temple-room=schulte] #gm-old-host .sc-cell:not(.wrong){height:100%}
}
