/* 布局：顶部一条工具栏（模式 + 武器），下面要么是可滚动的检查面板，要么是铺满的试玩画布 */
:root { --bg: #14211d; --panel: #1c2d27; --line: #33503f; --fg: #eef4e4; --dim: #a3b8a4; --ember: #ffc94a; --ember-ink: #2a1c05;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif; color-scheme: dark; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
html { padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); background: var(--bg); }
body { background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font); overflow: hidden; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
#app { height: 100%; display: flex; flex-direction: column; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px)); background: #101a17; border-bottom: 1px solid var(--line); flex: none; }
.brand { margin-right: auto; display: flex; gap: 8px; align-items: baseline; font-weight: 700; letter-spacing: .06em; white-space: nowrap; }
.brand em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--dim); }
.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { padding: 4px 12px; border-radius: 7px; color: var(--dim); min-height: 28px; font-size: 13px; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--ember); color: var(--ember-ink); font-weight: 700; }
@media (max-width: 620px) { .brand em { display: none; } }
@media (max-height: 430px) and (orientation: landscape) { .bar { padding-block: 3px; flex-wrap: nowrap; } .brand span { display: none; } .brand em { display: block; } }
.lab { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 14px; align-content: start; max-width: 1180px; width: 100%; margin-inline: auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: grid; gap: 8px; min-width: 0; }
.panel h2 { font-size: 13px; margin: 0; color: var(--dim); font-weight: 600; letter-spacing: .06em; }
.phead { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.ctl { display: flex; gap: 8px; flex-wrap: wrap; }
.cv { width: 100%; display: block; border-radius: 9px; touch-action: pan-y; }
.note { margin: 0; font-size: 12px; color: var(--dim); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.realwrap { display: grid; gap: 6px; justify-items: center; max-width: 150px; text-align: center; }
#real { border-radius: 9px; display: block; }
.stage { flex: 1; position: relative; min-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud > * { position: absolute; }
.joy { left: max(22px, calc(env(safe-area-inset-left, 0px) + 8px)); bottom: 22px; width: 112px; height: 112px; border-radius: 50%; background: rgba(16, 26, 23, .3); border: 1.5px solid rgba(255, 255, 255, .34); pointer-events: auto; }
.joy i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px; border-radius: 50%; background: rgba(255, 255, 255, .82); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.actbtn { border-radius: 50%; display: grid; place-items: center; color: var(--ember-ink); border: 2px solid rgba(255, 255, 255, .7); box-shadow: 0 3px 10px rgba(0, 0, 0, .3); pointer-events: auto; touch-action: none; -webkit-user-select: none; user-select: none; }
.actbtn:active { transform: scale(.94); }
.atkbtn { right: max(22px, calc(env(safe-area-inset-right, 0px) + 10px)); bottom: 26px; width: 84px; height: 84px; background: rgba(255, 201, 74, .88); }
.dodgebtn { right: max(118px, calc(env(safe-area-inset-right, 0px) + 106px)); bottom: 18px; width: 62px; height: 62px; background: rgba(140, 214, 255, .88); color: #0d2b3d; }
.dodgebtn.cd { background: rgba(120, 140, 150, .6); color: rgba(13, 43, 61, .55); }
.hpbox { left: max(14px, env(safe-area-inset-left, 0px)); top: 10px; display: grid; gap: 4px; }
.hp { position: relative; width: 168px; height: 18px; border-radius: 9px; background: rgba(16, 26, 23, .78); border: 2px solid #2b1d3f; overflow: hidden; }
.hp i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(#ff7a6b, #e8433f); transition: width .18s; }
.hp span { position: absolute; inset: 0; font-size: 11px; line-height: 14px; text-align: center; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.wave { font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 99px; background: rgba(16, 26, 23, .7); justify-self: start; }
.resetbtn { right: max(12px, env(safe-area-inset-right, 0px)); top: 10px; pointer-events: auto; font-size: 12px; padding: 4px 12px; border-radius: 99px; background: rgba(16, 26, 23, .7); border: 1px solid rgba(255, 255, 255, .3); min-height: 28px; }
.banner { left: 50%; top: 22%; transform: translateX(-50%); font-size: 22px; font-weight: 800; letter-spacing: .12em; padding: 4px 20px; border-radius: 12px; background: rgba(16, 26, 23, .72); color: var(--ember); white-space: nowrap; transition: opacity .35s; }
.banner.off { opacity: 0; }
.over { left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: auto; text-align: center; padding: 18px 28px; border-radius: 16px; background: rgba(16, 26, 23, .9); border: 1px solid var(--line); min-width: 220px; }
.over h3 { margin: 0 0 4px; font-size: 22px; color: var(--ember); letter-spacing: .1em; }
.over p { margin: 0 0 12px; font-size: 13px; color: var(--dim); }
.over button { background: var(--ember); color: var(--ember-ink); font-weight: 700; padding: 8px 22px; border-radius: 10px; min-height: 40px; }
.vig { position: absolute; inset: 0; pointer-events: none; opacity: 0; box-shadow: inset 0 0 90px 30px rgba(255, 40, 40, .75); }
.hint { left: 50%; top: 44px; transform: translateX(-50%); font-size: 12px; padding: 4px 12px; border-radius: 99px; background: rgba(16, 26, 23, .7); white-space: nowrap; transition: opacity .6s; }
.hint:empty, .hint.off { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .hint { transition: none; } }

.overbtns { display: flex; gap: 10px; justify-content: center; }
.over #againBtn { background: var(--panel); color: var(--fg); border: 1px solid var(--line); }
.pick { min-width: min(560px, 92%); }
.picklist { display: flex; gap: 10px; justify-content: center; }
.picklist button { flex: 1; display: grid; gap: 4px; padding: 12px 10px; min-height: 76px; background: var(--panel); color: var(--fg); border: 2px solid var(--ember); border-radius: 12px; font-weight: 400; }
.picklist button b { font-size: 17px; color: var(--ember); }
.picklist button span { font-size: 12px; color: var(--dim); }
.picklist button:active { background: var(--ember); }
.picklist button i { font-style: normal; font-size: 11px; color: var(--ember); opacity: .8; }
body:not(.lab) .bar { display: none; }
.sndbtn { right: max(74px, calc(env(safe-area-inset-right, 0px) + 62px)); }
.sndbtn[aria-pressed="false"] { opacity: .6; }

.ember { color: var(--ember); }
.homebtn { left: 50%; bottom: 26px; transform: translateX(-50%); pointer-events: auto; background: var(--ember); color: var(--ember-ink); font-weight: 800; padding: 10px 22px; border-radius: 99px; border: 2px solid rgba(255,255,255,.7); box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.homepanel { min-width: min(520px, 94%); max-height: 92%; overflow-y: auto; padding: 14px 18px; }
.homepanel h3 small { font-size: 15px; margin-left: 8px; }
.homelist { display: grid; gap: 8px; margin: 8px 0; text-align: left; }
.hrow { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.hrow div { display: grid; gap: 2px; }
.hrow b { color: var(--fg); font-size: 15px; }
.hrow span { font-size: 12px; color: var(--dim); }
.hrow button { min-width: 74px; min-height: 36px; padding: 0 12px; border-radius: 9px; background: var(--ember); color: var(--ember-ink); font-weight: 800; }
.hrow button:disabled { background: #3a4a42; color: #8aa08c; }
.hnote { font-size: 12px !important; margin: 0 0 8px !important; }
.over button.ghost { background: transparent; color: var(--dim); border: 1px solid var(--line); font-weight: 400; }
.homepanel { z-index: 5; top: 50%; padding: 10px 14px; }
.homepanel h3 { font-size: 18px; margin: 0; }
.homelist { grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 0; }
@media (max-width: 560px) { .homelist { grid-template-columns: 1fr; } }
.hrow { padding: 6px 8px; }
.hrow b { font-size: 14px; }
.hrow span { font-size: 11px; }
.hrow button { min-width: 62px; min-height: 34px; padding: 0 8px; }
.homepanel .overbtns button { min-height: 34px; padding: 6px 14px; }
body.homeopen #banner, body.homeopen #hint { opacity: 0 !important; }
.bankline { margin: 2px 0 0 !important; color: var(--ember) !important; font-weight: 700; font-size: 14px !important; }
.hrow button { white-space: nowrap; font-size: 12px; }
.hrow button { white-space: pre-line; line-height: 1.25; font-size: 12px; min-width: 64px; max-width: 76px; padding: 4px 6px; }
.hrow div { min-width: 0; }
.sprbtn { right: max(150px, calc(env(safe-area-inset-right, 0px) + 138px)); }
