:root {
    --bg-0: #080c11;
    --bg-1: #0f151d;
    --line: rgba(255, 255, 255, .08);
    --accent: #ff8a2b;
    --accent-2: #ffd166;
    --ok: #4ade80;
    --danger: #ff5a5a;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
    background: var(--bg-0);
    color: #e9eef5;
    overflow: hidden;
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* 整个应用：竖向 flex，保证「头部固定 + 舞台自适应剩余高度」 */
#apps { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }

/* 页面内全屏兜底：原生全屏被浏览器/内嵌窗口拦截时，用 CSS 铺满视口，按钮永远"有反应" */
#apps.pseudo-full {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 9990;
    border-radius: 0;
}

/* ---------------- 顶部 HUD：一行展示全部实时指标与操作入口 ---------------- */
.hud {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 58px;
    padding: 0 14px;
    background: linear-gradient(180deg, #131b25, #0a1017);
    border-bottom: 1px solid rgba(255, 138, 43, .16);
    box-shadow: 0 2px 16px rgba(0, 0, 0, .5);
    z-index: 10;
}
.hud-brand { flex: 0 0 auto; }
.hud-brand h1 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; color: #fff; }
/* 标题即入口：点一下就能回到游戏中心，符合"从任意页面都能一键返回列表"的站点习惯 */
.hud-brand h1 a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; transition: color .2s; }
.hud-brand h1 a:hover, .hud-brand h1 a:focus { color: var(--accent-2); text-decoration: none; outline: none; }
.hud-brand h1 .glyphicon { color: var(--accent); margin-right: 5px; font-size: 15px; }
.hud-brand h1 em { font-style: normal; font-weight: 600; font-size: 11px; letter-spacing: 1px; color: var(--accent); margin-left: 5px; }

.hud-stats { flex: 1 1 auto; display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 9px; border-radius: 6px; line-height: 1;
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(255, 255, 255, .06);
    font-size: 12px; color: #9fb0c4; white-space: nowrap;
    transition: background .2s;
}
.chip .glyphicon { font-size: 12px; color: var(--accent); }
.chip b { font-size: 14px; font-weight: 700; color: #f2f6ff; font-family: Consolas, "Courier New", monospace; }
.chip-hp .glyphicon { color: var(--danger); }
.chip-hp b { color: #ff9090; }
.chip-time b { color: var(--accent-2); }
.chip-combo b { color: var(--ok); }

.hud-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.hud-btn {
    display: inline-flex; align-items: center; gap: 4px;
    height: 32px; padding: 0 10px;
    border-radius: 6px; border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .05); color: #d7e1ee;
    font-size: 12px; cursor: pointer; outline: none;
    transition: all .16s;
}
.hud-btn .glyphicon { font-size: 12px; }
.hud-btn:hover { background: rgba(255, 138, 43, .16); border-color: rgba(255, 138, 43, .5); color: #fff; }
.hud-btn:active { transform: translateY(1px); }

/* ---------------- 游戏舞台 ---------------- */
#stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: #0b0f14; }
#gameCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

/* 准星：中心点 + 四向短线 */
#crosshair { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%); pointer-events: none; opacity: .9; }
#crosshair .ch-dot { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #6cf; box-shadow: 0 0 6px #6cf; }
#crosshair i { position: absolute; background: #6cf; opacity: .85; }
#crosshair i:nth-child(2) { left: 50%; top: 0; width: 2px; height: 8px; margin-left: -1px; }
#crosshair i:nth-child(3) { left: 50%; bottom: 0; width: 2px; height: 8px; margin-left: -1px; }
#crosshair i:nth-child(4) { top: 50%; left: 0; height: 2px; width: 8px; margin-top: -1px; }
#crosshair i:nth-child(5) { top: 50%; right: 0; height: 2px; width: 8px; margin-top: -1px; }
#crosshair.locked .ch-dot { background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); }
#crosshair.locked i { background: var(--accent-2); }

/* 打字命中反馈：#crosshair.hitting 时中心点弹一下，配合清脆的"叮"声，让每次正确输入都有手感 */
#crosshair.hitting .ch-dot { animation: hitPop .20s ease-out; }
#crosshair.hitting i { animation: hitArms .20s ease-out; }
@keyframes hitPop {
    0% { transform: scale(2.1); background: #fff; box-shadow: 0 0 18px #fff; }
    100% { transform: scale(1); }
}
@keyframes hitArms { 0% { opacity: 1; } 100% { opacity: .85; } }

/* 顶部"来袭"警告条：敌方投掷物倒计时，最后一秒高亮闪烁 */
#incomingWarn {
    position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
    display: none; padding: 8px 18px; border-radius: 8px;
    background: rgba(120, 12, 12, .84); border: 1px solid rgba(255, 80, 80, .8);
    color: #ffd9d9; font-size: 13px; font-weight: 700; letter-spacing: .5px;
    pointer-events: none; z-index: 6; white-space: nowrap;
    text-shadow: 0 0 10px rgba(255, 60, 60, .6);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .5);
}
#incomingWarn.hot { animation: incomingBlink .42s infinite alternate; background: rgba(198, 18, 18, .94); }
@keyframes incomingBlink {
    from { transform: translateX(-50%) scale(1); }
    to { transform: translateX(-50%) scale(1.07); }
}

/* 锁定目标词条（打字主面板）
   第八轮时它贴在准星正下方 34px，可这一轮镜头会自动把敌人搬到画面中央，
   面板就会正好压住敌人的头/胸。现在统一上移到屏幕上方 21% 处，
   与 toast（8vh）分层排布，中央战场彻底留给敌人。 */
#lockPanel {
    position: absolute; left: 50%; top: 21%; transform: translateX(-50%);
    display: none; align-items: center; gap: 10px;
    padding: 7px 14px; border-radius: 22px;
    background: rgba(8, 12, 18, .78); border: 1px solid rgba(255, 209, 102, .5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 138, 43, .12) inset;
    font-family: Consolas, "Courier New", monospace; font-size: 18px; letter-spacing: 1.5px;
    pointer-events: none; white-space: nowrap;
}
#lockPanel .lock-tag { font-size: 10px; letter-spacing: 2px; color: var(--accent-2); opacity: .9; }
#lockPanel .tw-ok { color: var(--ok); }
#lockPanel .tw-cur { color: var(--accent-2); text-decoration: underline; }
#lockPanel .tw-rest { color: #fff; }
#lockPanel .lock-meta { font-size: 11px; letter-spacing: 1px; color: #7f8ea1; padding-left: 4px; border-left: 1px solid rgba(255, 255, 255, .12); }

/* 提示条（未锁定鼠标时） */
#hint {
    position: absolute; left: 50%; bottom: 148px; transform: translateX(-50%);
    padding: 6px 14px; border-radius: 16px;
    background: rgba(8, 12, 18, .72); border: 1px solid rgba(255, 255, 255, .12);
    font-size: 12px; color: #b9c6d6; pointer-events: none;
    display: none; animation: softBlink 2s ease-in-out infinite;
}
@keyframes softBlink { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }

/* 治疗读条 */
#channelWrap {
    position: absolute; left: 50%; top: calc(50% + 88px); transform: translateX(-50%);
    width: 180px; display: none; pointer-events: none;
}
#channelWrap .ch-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .14); overflow: hidden; }
#channelWrap .ch-fill { height: 100%; width: 0; background: linear-gradient(90deg, #4ade80, #9df5b5); }
#channelWrap .ch-txt { margin-top: 4px; text-align: center; font-size: 11px; color: #9df5b5; letter-spacing: 1px; }

/* 道具栏（键盘小数字区操作，鼠标点击仅在未锁定时可用） */
#itemBar {
    position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
    display: flex; gap: 8px; pointer-events: auto;
}
.item-slot {
    position: relative; width: 64px; height: 52px;
    border-radius: 8px; border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(8, 12, 18, .66);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; cursor: pointer; transition: all .18s;
}
.item-slot .it-key { position: absolute; left: 4px; top: 2px; font-size: 10px; color: #7f8ea1; font-family: Consolas, monospace; }
.item-slot .glyphicon { font-size: 16px; color: #cfdcea; }
.item-slot .it-name { font-size: 10px; color: #9fb0c4; }
.item-slot .it-count { position: absolute; right: 5px; bottom: 3px; font-size: 11px; font-weight: 700; color: var(--accent-2); font-family: Consolas, monospace; }
.item-slot.selected { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(255, 138, 43, .5), 0 0 14px rgba(255, 138, 43, .35); background: rgba(255, 138, 43, .12); }
.item-slot.empty { opacity: .45; }

/* 非战斗状态（菜单 / 结算）隐藏战斗 HUD，避免一进页面就露出准星、道具栏与键位条 */
#stage.menu #crosshair,
#stage.menu #lockPanel,
#stage.menu #channelWrap,
#stage.menu #keyLegend,
#stage.menu #itemBar,
#stage.menu #effectHud,
#stage.menu #hint { display: none !important; }

/* 底部按键说明 */
#keyLegend {
    position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%);
    font-size: 11px; color: rgba(200, 214, 230, .55); white-space: nowrap; pointer-events: none;
}
#keyLegend kbd { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 3px; padding: 0 4px; font-size: 10px; color: #cfdcea; }

/* 受击红闪 / 画面暗角 */
#hurtOverlay { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 50%, rgba(255, 0, 0, 0) 35%, rgba(255, 0, 0, .55) 100%); }
#hurtOverlay.hit { animation: hurtFlash .42s ease-out; }
@keyframes hurtFlash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* 闪光弹白幕：常驻单层，闪完就淡出到 0，永远不会堆积 DOM 节点 */
#flashVeil {
    position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 6;
    background: radial-gradient(circle at 50% 46%, #fff 0%, rgba(255, 255, 255, .94) 45%, rgba(240, 248, 255, .78) 100%);
    transition: opacity .45s ease-out;
}

#vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .45) 100%); }

/* 锁定对焦：锁定目标时四周浮现一圈柔和的暖色光晕，并轻微压暗外围，
   视觉上像"镜头忽然对上了焦"，让玩家知道该盯着谁敲字；解锁后 0.25s 内淡出。 */
#focusFx {
    position: absolute; inset: 0; pointer-events: none; opacity: 0;
    transition: opacity .25s ease-out;
    background:
            radial-gradient(circle at 50% 50%, rgba(255, 200, 90, 0) 46%, rgba(255, 170, 60, .10) 66%, rgba(255, 140, 40, .16) 100%);
}
#focusFx.on { opacity: 1; }
#stage.menu #focusFx, #stage.over #focusFx { opacity: 0 !important; }

/* 投掷距离读数：手持投掷物时显示"预计落点多少米"，不用靠猜。
   同样放在上方信息区（锁定面板下方），不去挡画面中央的敌人与落点预览。 */
#throwTip {
    position: absolute; left: 50%; top: 26%; transform: translateX(-50%);
    pointer-events: none; white-space: nowrap; display: none;
    font: 600 12px/1.4 Consolas, "Courier New", monospace; letter-spacing: .06em;
    color: #ffd166; text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 10px rgba(255, 190, 70, .45);
    padding: 2px 8px; border-radius: 9px; background: rgba(8, 12, 18, .52);
}
#throwTip.far { color: #8fe9ff; text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 10px rgba(90, 210, 255, .5); }
#throwTip.danger { color: #ff7b6b; text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 12px rgba(255, 90, 70, .6); }

/* ---------------- 页脚（紧凑 SEO 文案区） ---------------- */
.site-foot {
    flex: 0 0 auto; height: 26px; line-height: 26px; padding: 0 14px;
    font-size: 11px; color: rgba(160, 176, 196, .6);
    background: #070b0f; border-top: 1px solid rgba(255, 255, 255, .05);
    white-space: nowrap; overflow: hidden;
}
.site-foot a { color: rgba(255, 138, 43, .8); text-decoration: none; }

/* ---------------- 弹层：水平 + 垂直居中 ---------------- */
.modal { text-align: center; overflow-y: auto; }
.modal::before { content: ''; display: inline-block; vertical-align: middle; height: 100%; width: 0; }
.modal-dialog { display: inline-block; text-align: left; vertical-align: middle; margin: 12px auto !important; max-width: 94vw; }
.modal-content {
    background: linear-gradient(180deg, #16202b, #0d141c);
    border: 1px solid rgba(255, 138, 43, .3);
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .05);
    color: #e9eef5;
    overflow: hidden;
}
.modal-header { border-bottom: 1px solid var(--line); padding: 14px 18px; }
.modal-title { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: .5px; }
.modal-title .glyphicon { color: var(--accent); margin-right: 6px; }
.modal-body { padding: 16px 18px; max-height: 74vh; overflow-y: auto; }
/* 自定义细滚动条：深色弹层里原生滚动条几乎看不见，明确提示"还有内容可滚动" */
.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-track { background: rgba(255, 255, 255, .04); border-radius: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(255, 138, 43, .55); border-radius: 4px; }
.modal-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 138, 43, .8); }
.modal-footer { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.modal-title .close { color: #9fb0c4; opacity: .8; text-shadow: none; }
.modal-title .close:hover { color: #fff; }

/* 通用按钮（覆盖 bootstrap 默认的浅色） */
.btn { border-radius: 6px; font-size: 13px; padding: 7px 16px; border-width: 1px; transition: all .16s; }
.btn .glyphicon { margin-right: 4px; }
.btn-primary { background: linear-gradient(180deg, #ff9d4a, #f2761a); border-color: #f2761a; color: #1a1005; font-weight: 700; }
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(180deg, #ffb066, #ff8a2b); border-color: #ff8a2b; color: #1a1005; }
.btn-warning { background: rgba(255, 209, 102, .16); border-color: rgba(255, 209, 102, .55); color: #ffd166; }
.btn-warning:hover { background: rgba(255, 209, 102, .28); color: #fff; }
.btn-default { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); color: #d7e1ee; }
.btn-default:hover { background: rgba(255, 255, 255, .13); color: #fff; }

/* 开始弹层 */
.start-intro {
    font-size: 13px; line-height: 1.9; color: #c3d1e0;
    background: rgba(255, 138, 43, .08); border-left: 3px solid var(--accent);
    padding: 10px 12px; border-radius: 4px; margin-bottom: 14px;
}
/* 开始页内嵌的常用设置：整体做成一块浅底卡片，和上面的介绍句分层 */
.start-set {
    background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 8px; padding: 12px 14px 10px;
}
.start-set .set-row { margin-bottom: 10px; }
.start-set-hint { margin: 8px 0 0; font-size: 11px; color: #9fb0c4; letter-spacing: .3px; }
.start-tip { margin: 14px 0 0; font-size: 11px; color: #8fa0b4; text-align: center; }
.start-tip kbd { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 3px; padding: 0 4px; }

/* 规则表格 */
.rules-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.rules-table th, .rules-table td { padding: 7px 8px; border-bottom: 1px solid rgba(255, 255, 255, .07); color: #c3d1e0; vertical-align: middle; background-color: transparent !important; }
.rules-table th { color: #ffd166; font-weight: 700; background: rgba(255, 255, 255, .04); }
.rules-table td.k { font-family: Consolas, monospace; color: #fff; white-space: nowrap; }
.rules-h { font-size: 13px; font-weight: 700; color: #ffd166; margin: 14px 0 6px; }

/* 设置弹层 */
.set-row { margin-bottom: 14px; }
.set-row label { display: block; font-size: 12px; color: #9fb0c4; margin-bottom: 6px; }
.set-row .val { float: right; color: var(--accent-2); font-family: Consolas, monospace; }
.set-row input[type=range] { width: 100%; accent-color: #ff8a2b; }   /* 滑块跟随主题橙色 */
.seg-group { display: flex; gap: 6px; }
.seg { flex: 1; text-align: center; padding: 7px 4px; border-radius: 6px; font-size: 12px; cursor: pointer; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05); color: #c3d1e0; transition: all .16s; }
.seg.on { border-color: var(--accent); color: #fff; background: rgba(255, 138, 43, .16); }

/* ---------------- 结算弹层 ---------------- */
.result-head { text-align: center; padding: 4px 0 10px; }
.result-title { font-size: 40px; font-weight: 900; letter-spacing: 10px; margin: 0; line-height: 1.2; }
.result-title.win {
    background: linear-gradient(90deg, #ffd166, #ff8a2b, #ffd166);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: winGlow 1.6s ease-in-out infinite, winDrop .55s cubic-bezier(.2, 1.4, .5, 1) both;
}
.result-title.lose {
    color: #ff5a5a; text-shadow: 0 0 22px rgba(255, 60, 60, .65);
    animation: loseDrop .5s cubic-bezier(.2, 1.4, .5, 1) both, loseShake .5s ease-in-out .5s 3;
}
@keyframes winDrop { from { transform: translateY(-26px) scale(.86); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes winGlow { 0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 138, 43, .5)); } 50% { filter: drop-shadow(0 0 22px rgba(255, 209, 102, .9)); } }
@keyframes loseDrop { from { transform: scale(1.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes loseShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.result-reason { text-align: center; font-size: 12px; color: #8fa0b4; margin-top: 2px; }
.result-score { text-align: center; font-size: 30px; font-weight: 800; color: #fff; font-family: Consolas, monospace; margin: 8px 0 2px; letter-spacing: 1px; }
.result-score span { font-size: 12px; color: var(--accent-2); letter-spacing: 2px; margin-left: 6px; }
.result-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 4px; }
.rm { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; padding: 9px 6px; text-align: center; }
.rm .glyphicon { display: block; font-size: 15px; color: var(--accent); margin-bottom: 4px; }
.rm b { display: block; font-size: 15px; color: #fff; font-family: Consolas, monospace; }
.rm span { font-size: 11px; color: #93a5b9; }
.result-tip { text-align: center; font-size: 12px; color: #ffd166; margin-top: 10px; min-height: 18px; }

/* ---------------- 特效层：撒花 / 失败碎片（叠在弹层之上） ---------------- */
#fxLayer { position: fixed; inset: 0; pointer-events: none; z-index: 1250; overflow: hidden; display: none; }
#fxLayer.on { display: block; }
.confetti {
    position: absolute; top: -14vh; width: 9px; height: 14px; border-radius: 2px;
    animation-name: confettiFall; animation-timing-function: cubic-bezier(.35, .1, .6, 1); animation-fill-mode: forwards;
}
@keyframes confettiFall {
    0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate3d(var(--dx), 128vh, 0) rotate(var(--rot)); opacity: .9; }
}
.victory-ring {
    position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px;
    border-radius: 50%; border: 5px solid rgba(255, 209, 102, .85);
    animation: ringExpand .95s ease-out forwards;
}
@keyframes ringExpand { 0% { transform: scale(.2); opacity: .95; } 100% { transform: scale(26); opacity: 0; } }
.shard {
    position: absolute; top: -12vh; width: 12px; height: 22px;
    background: rgba(255, 70, 70, .55); border-radius: 2px;
    animation-name: shardFall; animation-timing-function: ease-in; animation-fill-mode: forwards;
}
@keyframes shardFall { 100% { transform: translate3d(var(--dx), 126vh, 0) rotate(var(--rot)); opacity: .25; } }
#loseFlash { position: fixed; inset: 0; z-index: 1240; pointer-events: none; background: radial-gradient(circle, rgba(255, 0, 0, .28), rgba(120, 0, 0, .85)); opacity: 0; }
#loseFlash.on { animation: loseFlashAnim .9s ease-out forwards; }
@keyframes loseFlashAnim { 0% { opacity: .95; } 100% { opacity: 0; } }

/* ---------------- Toast：屏幕上方 11% 处横向居中 ----------------
   以前 toast 是「垂直居中」，任何一句"打错了 / 该敲 X"都会正好压在敌人身上，
   而打字游戏里玩家的视线始终盯着屏幕中央的敌人 —— 这等于每次提示都在挡视线。
   现在整层移到上方 8vh，从上往下堆叠，中央战场完全空出来。 */
#toastLayer { position: fixed; left: 0; right: 0; top: 8vh; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; z-index: 1300; }
.toast {
    padding: 8px 20px; border-radius: 24px;
    background: rgba(8, 12, 18, .82); border: 1px solid rgba(255, 209, 102, .5);
    color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 1px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, .55);
    animation: toastIn .26s cubic-bezier(.2, 1.4, .5, 1) both, toastOut .38s ease-in .9s both;
    white-space: nowrap;
}
.toast.good { border-color: rgba(74, 222, 128, .6); color: #9df5b5; }
.toast.bad { border-color: rgba(255, 90, 90, .65); color: #ff9a9a; }
.toast.info { border-color: rgba(108, 204, 255, .5); color: #a9dcff; font-size: 13px; font-weight: 600; }
@keyframes toastIn { from { transform: scale(.82); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-10px) scale(.96); opacity: 0; } }

/* ---------------- 生效中的道具（烟雾 / 闪光）倒计时面板 ----------------
   位置：屏幕底部正中（道具栏与键位条上方），横排居中排列。
   两条要点（都是本轮按反馈修的）：
   1) 必须"水平居中"：整块 left:50% + translateX(-50%)，多条时向右并排，
      视觉重心与准星在同一条中轴上，不会像以前那样偏在左上角。
   2) 不能闪：以前每 0.12s 重建整块 innerHTML，等于每帧重播一次入场动画，
      看起来像在"抖"。现在 DOM 只创建一次（新增/结束时才增删），
      之后仅原地改数字与进度条宽度，永远不会有重播闪烁。 */
#effectHud {
    position: absolute; left: 50%; bottom: 104px; transform: translateX(-50%);
    display: flex; flex-direction: row; align-items: flex-end; justify-content: center; gap: 8px;
    pointer-events: none; z-index: 7;
}
#effectHud .fx-chip {
    width: 148px; padding: 5px 10px 7px; border-radius: 7px;
    background: rgba(8, 12, 18, .74); border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 3px 14px rgba(0, 0, 0, .45);
    animation: fxChipIn .22s ease-out both;
}
#effectHud .fx-chip.smoke { border-color: rgba(120, 190, 150, .55); }
#effectHud .fx-chip.flash { border-color: rgba(150, 200, 255, .6); }
/* 标题 + 剩余秒数作为一整组水平居中：图标、名称、秒数紧挨着排，
   视觉重量压在中轴上，不会出现"左边一个词、右边一个数字"的割裂感 */
#effectHud .fx-top { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .5px; }
#effectHud .fx-chip.smoke .fx-top { color: #9fe0b8; }
#effectHud .fx-chip.flash .fx-top { color: #a9d6ff; }
#effectHud .fx-top b { margin-left: 2px; font-family: Consolas, monospace; font-size: 12px; font-variant-numeric: tabular-nums; }
#effectHud .fx-bar {
    margin-top: 5px; height: 5px; border-radius: 3px; overflow: hidden;
    background: rgba(255, 255, 255, .10);
}
#effectHud .fx-bar i { display: block; height: 100%; border-radius: 3px; }
#effectHud .fx-chip.smoke .fx-bar i { background: linear-gradient(90deg, #4ade80, #b9f2c8); }
#effectHud .fx-chip.flash .fx-bar i { background: linear-gradient(90deg, #6cc4ff, #e6f4ff); }
@keyframes fxChipIn { from { transform: translateX(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- 自适应 ----------------
   窄屏优先压缩内边距与字号，而不是隐藏指标，保证 8 项核心数据始终同行可见 */
@media (max-width: 1440px) {
    .hud { gap: 8px; padding: 0 10px; }
    .chip { padding: 4px 7px; }
    .chip b { font-size: 13px; }
    .hud-brand h1 em { display: none; }
}
@media (max-width: 1180px) {
    .chip { padding: 3px 6px; font-size: 11px; }
    .chip .glyphicon { font-size: 11px; }
    .hud-btn { padding: 0 8px; }
    .hud-btn span { display: none; }
}
@media (max-width: 960px) {
    .hud-brand h1 { font-size: 13px; }
    .chip .glyphicon { display: none; }
    .chip { padding: 4px 6px; }
    .result-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .item-slot { width: 56px; height: 46px; }
    #keyLegend { display: none; }
}
@media (min-width: 768px) {
    .modal-dialog {
        min-width: 35%;
        width: auto;
    }
}