/* 音标塔防 · TV 10 尺 UI 样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; position: fixed; inset: 0; scrollbar-width: none; -ms-overflow-style: none; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: #16222e; color: #f2f6fa; font-size: 22px;
  user-select: none; -webkit-user-select: none;
}
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* 固定 1280×720 设计稿，按屏幕等比缩放：电视机顶盒/不同分辨率下比例一致，绝不会出现内容超出屏幕被裁 */
#app {
  position: absolute; left: 50%; top: 50%; width: 1280px; height: 720px;
  transform: translate(-50%, -50%) scale(var(--ui-scale, 1)); transform-origin: center center;
  overflow: hidden;
}

.screen { display: none; width: 100%; height: 100%; flex-direction: column; overflow: hidden; scrollbar-width: none; }
.screen.active { display: flex; }

/* ---------- 焦点态（电视远距离可见） ---------- */
[data-focus] { outline: none; border-radius: 14px; transition: transform .08s, box-shadow .08s, border-color .08s; }
[data-focus].focused {
  border-color: #ffd34d !important;
  box-shadow: 0 0 0 3px #ffd34d, 0 6px 18px rgba(255, 211, 77, .35);
  transform: scale(1.05);
  z-index: 5;
}

/* ---------- 主菜单 ---------- */
#screen-menu { align-items: center; justify-content: center; gap: 48px; background: radial-gradient(circle at 50% 30%, #2b4257, #16222e); }
.menu-title { text-align: center; }
.game-logo { font-size: 56px; font-weight: 800; color: #ffd34d; letter-spacing: 4px; }
.game-sub { margin-top: 12px; font-size: 24px; color: #b9cbd8; }
.menu-buttons { display: flex; flex-direction: column; gap: 22px; width: 420px; }
.menu-btn {
  font-size: 30px; padding: 22px 30px; border: 2px solid #3a556b;
  background: #243447; text-align: left; border-radius: 18px;
}
.menu-btn:active { background: #31495f; }

/* ---------- 顶栏 ---------- */
.top-bar { position: relative; display: flex; align-items: center; gap: 18px; padding: 16px 24px; }
/* 右上角版本号：遥控器看不到系统信息，方便确认装的是哪一版 */
.hud-version { position: absolute; right: 22px; top: 14px; font-size: 20px; letter-spacing: 1px; color: #8ba3b8; }
.top-bar h2 { font-size: 28px; }
.spacer { flex: 1; }
.back-btn, .icon-btn {
  font-size: 24px; padding: 12px 20px; background: #243447; border: 2px solid #3a556b; border-radius: 14px;
}
.coin-box, .hp-box { font-size: 24px; background: #243447; padding: 10px 18px; border-radius: 12px; }
.hp-box { color: #ff8a8a; }

/* ---------- 卡片网格 ---------- */
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; padding: 24px; overflow-y: auto; scrollbar-width: none; }
.level-card, .dict-card, .book-card {
  background: #243447; border: 2px solid #3a556b; border-radius: 18px; padding: 24px;
  display: flex; flex-direction: column; gap: 10px; min-height: 150px;
}
.level-card .lv-name { font-size: 26px; font-weight: 700; }
.level-card .lv-tip { color: #b9cbd8; font-size: 19px; }
.level-card.locked { opacity: .45; }
.dict-card .ph { font-size: 34px; font-weight: 800; color: #ffd34d; }
.dict-card .cn { color: #b9cbd8; }
.book-card .w { font-size: 28px; font-weight: 700; }
.book-card .ipa { color: #ffd34d; }
.book-card .cn { color: #b9cbd8; }

/* ---------- 战斗布局 ---------- */
.battle-wrap { flex: 1; display: flex; gap: 18px; padding: 0 24px 24px; min-height: 0; }
.field-col { flex: 2; display: flex; flex-direction: column; gap: 12px; min-width: 0; position: relative; }
/* 战场上下边缘的地形装饰带（沙袋/铁丝网），不是网格 */
.field-col::before, .field-col::after {
  content: ""; height: 20px; border-radius: 8px; flex: 0 0 auto;
  background: url("../images/fx/ground-strip.png") left center / 100% 100% no-repeat;
  opacity: .85; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5));
}
.field-col::after { transform: scaleY(-1); opacity: .7; }
#battle-field {
  flex: 1; background: #1d2f3d; border: 2px solid #33506a; border-radius: 18px;
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  background-size: cover; background-position: center;
}
.lane { position: relative; flex: 1; z-index: 1; }
#battle-field::before { content: ""; position: absolute; inset: 0; background: rgba(18, 30, 40, .42); z-index: 0; }
/* 右侧敌军进驻区：战场外的空地（和我方基地对称），整波敌人先在这里排队 */
.staging-col {
  position: relative; flex: 0 0 118px; width: 118px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(64,26,32,.55), rgba(28,18,22,.35));
  border: 2px dashed rgba(255,107,107,.35);
}
.staging-label {
  position: absolute; left: 0; right: 0; top: 8px; text-align: center;
  font-size: 12px; letter-spacing: 3px; color: #ff9a9a; opacity: .9;
}
.staging-col .enemy { top: auto; transform: translateY(-50%); }
.staging-col .enemy.staging { animation: stageBob 1.6s ease-in-out infinite; }
@keyframes stageBob { 0%,100% { margin-left: 0; } 50% { margin-left: -3px; } }
/* 导航炸弹模式：战场上的敌人/干员不拦截点击，任何格子（含被占格）都能选为落点 */
#battle-field.strike-mode .enemy,
#battle-field.strike-mode .operator { pointer-events: none; }
#battle-field.strike-mode { cursor: crosshair; }
/* 战场网格：9 列 × 6 行细线，一眼看清可放格 */
#battle-field::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    repeating-linear-gradient(to right, rgba(255,255,255,.16) 0 1px, transparent 1px calc(100% / 9)),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.16) 0 1px, transparent 1px calc(100% / 6));
}
/* 用交替的淡淡明暗代替网格线，地形更自然 */
.lane:nth-of-type(even) { background: rgba(255, 255, 255, .022); }
.slot-row { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(9, 1fr); }
.slot { border: none; border-radius: 0; background: transparent; }
.slot.can-place { /* 可放置格不再画黄框，只由光标位置提示 */ }
.slot.occupied { background: rgba(58, 85, 107, .18); }

.entity { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.entity .avatar { font-size: 34px; line-height: 1; }
.enemy { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.enemy .hpbar { width: 50px; height: 6px; background: #4a2530; border-radius: 4px; margin-top: 4px; overflow: hidden; }
.enemy .hpbar > i { display: block; height: 100%; background: #ff6b6b; }
.enemy.boss .avatar { font-size: 52px; }
.operator { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; overflow: visible; }
.operator .avatar { font-size: 30px; }
.operator .op-name { font-size: 9px; line-height: 1.05; color: #b9cbd8; white-space: nowrap; }
.operator .hpbar { width: 56%; height: 4px; background: #4a2530; border-radius: 3px; margin: 2px 0; overflow: hidden; }
.operator .hpbar > i { display: block; height: 100%; background: #58d68d; transition: width .15s; }
.operator.hit { filter: brightness(1.9) drop-shadow(0 0 10px #ff6b6b); }
.operator.dying { animation: dieFade .38s forwards; }

/* 立绘图片 */
.portrait { object-fit: contain; display: block; }
.enemy .portrait { width: 54px; height: 54px; }
.enemy.boss .portrait { width: 84px; height: 84px; }
.operator .avatar { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.operator .portrait { height: 100%; width: auto; max-width: 88%; }
.op-card .portrait { width: 46px; height: 46px; }

/* 干员栏：5 张卡片等分铺满，不出现横向滚动条 */
.operator-bar { display: flex; gap: 8px; padding: 6px 2px; overflow: hidden; }
.op-card {
  flex: 1 1 0; min-width: 0; background: #243447; border: 2px solid #3a556b; border-radius: 16px;
  padding: 8px 4px; display: flex; flex-direction: column; gap: 2px; align-items: center;
}
.op-card .icon { font-size: 34px; }
.op-card .name { font-size: 17px; font-weight: 700; white-space: nowrap; }
.op-card .cost { font-size: 15px; color: #ffd34d; }
.op-card.disabled { opacity: .4; }
.op-card.selected { border-color: #6fb7ff; background: #33495e; }

/* ---------- 答题面板 ---------- */
.quiz-panel { width: 400px; background: #243447; border: 2px solid #3a556b; border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.quiz-stem { font-size: 30px; font-weight: 700; line-height: 1.4; }
.quiz-stem.skeleton { font-size: 44px; font-weight: 800; letter-spacing: 2px; color: #ffffff; font-family: "Consolas", "Menlo", monospace; }
.quiz-tip { font-size: 18px; color: #b9cbd8; }
.quiz-ipa { font-size: 30px; font-weight: 800; color: #ff7a59; letter-spacing: 2px; }
/* 单词 + 中文并排：中文紧跟单词右侧，字号大、亮黄色，远距离也看得清 */
.quiz-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.quiz-cn { font-size: 40px; font-weight: 800; color: #ffd34d; line-height: 1.1; text-shadow: 0 2px 8px rgba(255,211,77,.25); }
.quiz-row { display: flex; gap: 12px; align-items: center; }
.audio-btn { font-size: 26px; padding: 10px 16px; background: #31495f; border-radius: 12px; }
.quiz-options { display: flex; flex-direction: column; gap: 14px; margin-top: auto; }
.opt-btn {
  font-size: 28px; padding: 18px; background: #1d2f3d; border: 2px solid #3a556b; border-radius: 14px; text-align: center;
}
.opt-btn.correct { border-color: #58d68d; background: #224536; }
.opt-btn.wrong { border-color: #ff6b6b; background: #4a2530; }
.quiz-hint { min-height: 28px; font-size: 20px; color: #ffd34d; }

/* ---------- 详情 / 设置 ---------- */
.detail-body { padding: 24px; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; gap: 18px; }
.group-row { display: flex; gap: 18px; flex-wrap: wrap; }
.group-card { background: #243447; border: 2px solid #3a556b; border-radius: 16px; padding: 20px; min-width: 220px; }
.group-card .spell { font-size: 30px; font-weight: 800; color: #ffd34d; }
.group-card .word { font-size: 26px; margin-top: 8px; }
.group-card .ipa { color: #b9cbd8; font-size: 19px; }
.group-card .cn { color: #b9cbd8; }
.settings-body { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.setting-row { display: flex; align-items: center; gap: 18px; background: #243447; border-radius: 16px; padding: 20px 24px; }
.setting-row .label { flex: 1; font-size: 24px; }
.setting-row .val { font-size: 24px; color: #ffd34d; }

/* ---------- 弹层 ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal.hidden { display: none; }
.modal-box { background: #243447; border: 2px solid #3a556b; border-radius: 22px; padding: 34px; width: 520px; display: flex; flex-direction: column; gap: 18px; }
.modal-box h3 { font-size: 32px; color: #ffd34d; }
.modal-box #modal-body { font-size: 22px; color: #dce7ee; line-height: 1.6; }
.modal-actions { display: flex; gap: 16px; justify-content: flex-end; }
.modal-actions button { font-size: 24px; padding: 14px 26px; background: #31495f; border: 2px solid #3a556b; border-radius: 14px; }

/* 滚动条 */
/* 电视上不显示任何滚动条：内部列表仍可用方向键滚动，但不画滚动条 */
::-webkit-scrollbar { width: 0; height: 0; display: none; }
::-webkit-scrollbar-thumb { background: transparent; }

/* ---------- 角色介绍浮层 ---------- */
#tip-pop { position: fixed; z-index: 70; width: 300px; background: rgba(28, 44, 58, .97); border: 2px solid #ffd34d; border-radius: 14px; padding: 14px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.tip-title { font-size: 22px; font-weight: 800; color: #ffd34d; }
.tip-stats { font-size: 17px; color: #b9cbd8; margin: 6px 0; }
.tip-lore { font-size: 17px; color: #dce7ee; line-height: 1.5; }

/* ---------- 战斗动态动画 ---------- */
.enemy .avatar { animation: bob 0.6s ease-in-out infinite; }
.enemy.hit .avatar { filter: brightness(1.7) drop-shadow(0 0 8px #ff6b6b); }
.enemy.dying .avatar { animation: dieFade .4s forwards; }
.operator.shooting .avatar { animation: shootKick .18s ease-out; }

.bullet { position: absolute; width: 16px; height: 6px; border-radius: 3px; background: #ffd34d; box-shadow: 0 0 10px #ffd34d; z-index: 3; top: 50%; transform: translateY(-50%); }
.bullet.sniper { width: 26px; height: 8px; background: #7fd4ff; box-shadow: 0 0 12px #7fd4ff; }
.spark { position: absolute; width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle, #ffd34d, transparent 70%); z-index: 3; top: 42%; animation: sparkFade .25s forwards; }

.enemy.attacking .avatar { animation: enemyLunge .2s ease-out; }
.enemy.blocking .avatar { animation: bob .9s ease-in-out infinite; }

/* ---- 我方弹道：按兵种区分 ---- */
.bullet.b-weilong { width: 18px; height: 6px; background: #ffd34d; box-shadow: 0 0 10px #ffd34d; }
.bullet.b-honglang { width: 12px; height: 5px; background: #ff9f43; box-shadow: 0 0 12px #ff7043; }
.bullet.b-fengyi   { width: 14px; height: 14px; border-radius: 50%; background: #58d68d; box-shadow: 0 0 12px #58d68d; }
.bullet.b-haizhua  { width: 22px; height: 4px; background: #a78bfa; box-shadow: 0 0 14px #8b5cf6; }
.bullet.b-luna     { width: 34px; height: 7px; background: #7fd4ff; box-shadow: 0 0 16px #7fd4ff; }

/* 枪口火焰 */
.muzzle { position: absolute; right: 8%; top: 46%; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle, #fff8c4, #ffb020 45%, transparent 70%); animation: muzzlePop .16s forwards; }
.muzzle.m-luna { width: 28px; height: 28px; background: radial-gradient(circle, #eaf8ff, #7fd4ff 45%, transparent 72%); }
.muzzle.m-fengyi { background: radial-gradient(circle, #eaffef, #58d68d 45%, transparent 70%); }
.muzzle.m-haizhua { background: radial-gradient(circle, #f3ecff, #a78bfa 45%, transparent 70%); }

/* 狙击弹道线 */
.tracer { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: linear-gradient(90deg, rgba(127,212,255,.9), rgba(127,212,255,0)); z-index: 3; animation: tracerFade .18s forwards; }

/* 骇爪扫描脉冲 */
.pulse { position: absolute; top: 50%; width: 18px; height: 18px; margin-left: -9px; margin-top: -9px;
  border: 2px solid #a78bfa; border-radius: 50%; z-index: 3; animation: pulseRing .38s forwards; }

/* 警卫盾击冲击波 */
.shockwave { position: absolute; top: 50%; width: 40px; height: 40px; margin-left: -20px; margin-top: -20px;
  border: 3px solid #ffa726; border-radius: 50%; z-index: 3; animation: pulseRing .42s forwards; }

/* 蜂医治疗绿环 */
.heal-ring { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin-left: -15px; margin-top: -15px;
  border: 3px solid #58d68d; border-radius: 50%; z-index: 4; animation: pulseRing .5s forwards; }

/* ---- 敌方弹道：按兵种区分 ---- */
.bullet.enemy-bullet { background: #ff6b6b; box-shadow: 0 0 10px #ff6b6b; }
.bullet.eb-patrol { width: 16px; height: 6px; background: #c9b79c; box-shadow: 0 0 8px #c9b79c; }
.bullet.eb-assault { width: 11px; height: 5px; background: #ff6b6b; box-shadow: 0 0 12px #ff5252; }
.bullet.eb-guard { width: 24px; height: 12px; border-radius: 4px; background: #ffa726; box-shadow: 0 0 14px #ff9800; }
.bullet.eb-boss { width: 32px; height: 14px; border-radius: 4px; background: #ff3b30; box-shadow: 0 0 20px #ff1744; }

#battle-field.shaking { animation: fieldShake .26s ease-in-out; }

.spark.on-slot { left: 50%; top: 50%; margin-left: -12px; margin-top: -12px; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes enemyLunge { 0% { transform: translateX(0); } 45% { transform: translateX(-7px); } 100% { transform: translateX(0); } }
@keyframes muzzlePop { from { opacity: 1; transform: scale(.6); } to { opacity: 0; transform: scale(1.5); } }
@keyframes tracerFade { from { opacity: .95; } to { opacity: 0; } }
@keyframes pulseRing { from { opacity: 1; transform: scale(.4); } to { opacity: 0; transform: scale(1.7); } }
@keyframes fieldShake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-3px, 2px); } 75% { transform: translate(3px, -2px); } }
@keyframes dieFade { to { opacity: 0; transform: scale(.6) rotate(15deg); } }
@keyframes shootKick { 0% { transform: translateX(0); } 40% { transform: translateX(4px); } 100% { transform: translateX(0); } }
@keyframes sparkFade { to { opacity: 0; transform: scale(1.7); } }

/* ===== v0.1.3 威龙 / 红狼 特技表现 ===== */
/* 威龙回身（立绘翻转） */
.operator.turned .portrait { transform: scaleX(-1); }
/* 压气喷雾 */
.spray { position: absolute; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%;
  background: radial-gradient(circle, rgba(210,240,255,.9), rgba(150,205,235,.35) 55%, transparent 70%);
  pointer-events: none; z-index: 5; animation: sprayOut .6s ease-out forwards; }
@keyframes sprayOut { from { opacity: .95; transform: scale(.5); } to { opacity: 0; transform: scale(2.6) translateX(18px); } }
/* 磁吸炸弹：黑色弹体 + 红色引信灯 */
.bomb { position: absolute; top: 56%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #7c828c 0%, #3a3e45 38%, #17191d 68%, #08090b 100%);
  border: 1px solid #05060800;
  box-shadow: 0 0 0 1px #0a0b0d, 0 0 12px rgba(255,70,50,.55), inset -3px -4px 6px rgba(0,0,0,.9);
  pointer-events: none; z-index: 6; }
.bomb::after { content: ""; position: absolute; right: 3px; top: 3px; width: 6px; height: 6px; border-radius: 50%;
  background: #ff5a3c; box-shadow: 0 0 8px #ff5a3c; animation: fuseBlink .32s steps(2, end) infinite; }
@keyframes fuseBlink { 0% { opacity: 1; } 100% { opacity: .25; } }
/* 爆炸：闪白 + 橙色火球 + 冲击环 */
.boom { position: absolute; top: 50%; width: 40px; height: 40px; margin-top: -20px; border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #ffe9a8 22%, #ffab3a 48%, rgba(255,80,40,.45) 72%, transparent 80%);
  pointer-events: none; z-index: 7; animation: boomOut .5s ease-out forwards; }
.boom::before { content: ""; position: absolute; inset: -26px; border-radius: 50%;
  border: 3px solid rgba(255,180,90,.85); animation: boomRing .5s ease-out forwards; }
.boom::after { content: ""; position: absolute; inset: -6px; border-radius: 50%;
  background: radial-gradient(circle, rgba(90,90,95,.55), transparent 68%);
  animation: boomSmoke .55s ease-out forwards; }
@keyframes boomOut { 0% { opacity: 1; transform: scale(.35); } 55% { transform: scale(2.2); } 100% { opacity: 0; transform: scale(3.1); } }
@keyframes boomRing { 0% { opacity: .95; transform: scale(.2); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes boomSmoke { 0% { opacity: .8; transform: scale(.6); } 100% { opacity: 0; transform: scale(2.4); } }
/* 烟云 */
.smoke { position: absolute; top: 50%; width: 150px; height: 110px; margin: -55px 0 0 -75px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,205,215,.92), rgba(150,158,172,.7) 55%, rgba(120,128,142,0) 72%);
  filter: blur(2px); pointer-events: none; z-index: 8; animation: smokePuff .7s ease-out, smokeFade 4.5s linear forwards; }
@keyframes smokePuff { from { opacity: 0; transform: scale(.35); } to { opacity: 1; transform: scale(1); } }
@keyframes smokeFade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
/* 敌人被炸倒（躺平） */
.enemy.knocked { transform: translateY(-50%) rotate(78deg) scale(.92); filter: grayscale(.35) brightness(.9); transition: transform .18s; }
.enemy.knocked .avatar { filter: drop-shadow(0 0 6px #ffd166); }
/* 敌人被烟雾遮蔽 */
.enemy.blinded { opacity: .45; filter: grayscale(.6); }
.enemy.flashed { filter: brightness(2.1) saturate(.4); }
.enemy.flash-hit .avatar { filter: drop-shadow(0 0 14px #ffffff) brightness(2.2); }
.operator.medic-step { animation: medicStep .42s ease-out; }
@keyframes medicStep { 0% { transform: translateY(-10px) scale(.94); filter: drop-shadow(0 0 10px #58d68d); }
  100% { transform: translateY(0) scale(1); filter: none; } }
.heart-loss { position: fixed; right: 26px; top: 104px; pointer-events: none; z-index: 70;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 26px; border-radius: 18px;
  background: rgba(176, 32, 44, .93); color: #fff; box-shadow: 0 0 26px rgba(255, 70, 80, .55);
  border: 2px solid rgba(255, 190, 190, .7); animation: heartLoss 1.8s forwards; }
.heart-loss b { font-size: 34px; letter-spacing: 2px; }
.heart-loss span { font-size: 18px; color: #ffd9d9; }
@keyframes heartLoss { 0% { opacity: 0; transform: translateX(34px); } 14% { opacity: 1; transform: translateX(0); }
  72% { opacity: 1; transform: translateX(0); } 100% { opacity: 0; transform: translateX(0); } }
.flashbang { position: absolute; top: 50%; width: 130px; height: 130px; margin-left: -65px; margin-top: -65px;
  border-radius: 50%; background: radial-gradient(circle, #fff 0%, rgba(255,255,255,.75) 35%, rgba(190,225,255,0) 70%);
  z-index: 8; animation: flashPop .42s forwards; }
.bullet.b-haizhua.crit { background: #fff; box-shadow: 0 0 14px #b59cff, 0 0 22px #fff; }
@keyframes flashPop { from { opacity: 1; transform: scale(.3); } to { opacity: 0; transform: scale(1.5); } }
/* 红狼：自由单位 */
.operator.roamer { position: absolute; transform: translateX(-50%); bottom: 3%; width: 62px; height: 92%; z-index: 7;
  justify-content: flex-start; transition: left .12s linear; }
.operator.roamer .avatar { flex: 0 0 auto; height: 86%; width: 100%; display: flex; align-items: center; justify-content: center; }
.operator.roamer .portrait { height: 100%; width: auto; max-width: 100%; flex: 0 0 auto; }
/* 红狼血条：绝对定位于立绘下方，不参与 flex 排布，保证任何尺寸下都可见 */
.operator.roamer .op-name { display: none; }
.operator.roamer .hpbar { position: absolute; left: 50%; transform: translateX(-50%); bottom: 0; width: 54px; height: 8px; margin: 0;
  border-radius: 5px; background: #57303c; box-shadow: 0 0 0 1px rgba(0,0,0,.7), 0 0 0 2px rgba(120,160,180,.16); }
.operator.roamer .hpbar > i { background: linear-gradient(180deg, #8bf5b2, #3fbf74); box-shadow: 0 0 6px rgba(90,230,150,.55); }
.operator.roamer.sliding { transform: translateX(-50%) rotate(-16deg) scaleX(1.12); transition: transform .16s; }
/* 红狼手炮枪口 */
.operator.roamer.shooting { animation: shootKick .18s ease-out; }

/* 朝向修正：敌兵立绘本身朝左（自右向左推进）无需翻转；盾卫举盾朝右顶住来敌 */
.operator .portrait[src$="shield.png"] { transform: scaleX(-1); }
/* 红狼默认朝右（面向来敌），转身回望时再翻回左侧 */
.operator .portrait[src$="haizhua.png"] { transform: scaleX(-1); }
.enemy .portrait[src$="assault.png"] { transform: scaleX(-1); }
.operator .portrait[src$="honglang.png"] { transform: scaleX(-1); }
.operator.turned .portrait[src$="honglang.png"] { transform: none; }
.operator.turned .portrait[src$="haizhua.png"] { transform: none; }

/* 红狼躲闪：飘字 + 轻微侧身白闪 */
.dodge-tip {
  position: absolute; left: 50%; top: -4px; transform: translate(-50%, -100%);
  font-size: 15px; font-weight: 800; letter-spacing: 1px; color: #7ee0ff;
  text-shadow: 0 0 8px rgba(126,224,255,.85), 0 2px 6px rgba(0,0,0,.6);
  pointer-events: none; z-index: 9; animation: dodgeRise .7s ease-out both;
}
@keyframes dodgeRise {
  0% { opacity: 0; transform: translate(-50%, -70%) scale(.7); }
  25% { opacity: 1; transform: translate(-50%, -105%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -150%) scale(1); }
}
.operator.roamer.dodging .portrait { filter: drop-shadow(0 0 8px rgba(126,224,255,.95)) brightness(1.25); }
/* 反向子弹（威龙向后开火） */
.bullet.rev { transform: scaleX(-1); }

/* ---------- 基地建筑（最左一列） ---------- */
/* 基地：站在最左一列的正中高度，作为地标装饰，不再整条贴边、也不挡住一列上的士兵 */
/* 战场行：左边是基地展示位，右边才是可布防的 9×6 战场 */
.field-row { flex: 1; min-height: 0; display: flex; gap: 10px; }
.base {
  position: relative; flex: 0 0 118px; width: 118px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  pointer-events: none;
}
.base::before {
  content: ""; position: absolute; inset: -10px -6px; border-radius: 18px;
  background: radial-gradient(ellipse at 50% 62%, rgba(70,130,165,.38), rgba(30,60,85,.12) 55%, transparent 72%);
}
.base-art {
  width: 100%; aspect-ratio: 1 / 1; height: auto; flex: 0 0 auto;
  background: url("../images/base/base.png") center center / contain no-repeat;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.55));
  animation: baseBreath 4.5s ease-in-out infinite;
}
@keyframes baseBreath { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.02); } }
.base-hp {
  width: 86%; height: 8px; margin: 0; background: #4a2530; border-radius: 4px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,.6);
}
.base-hp > i { display: block; height: 100%; width: 100%; background: linear-gradient(180deg,#8bf5b2,#3fbf74); transition: width .2s; }
.base.hurt { animation: baseHurt .28s ease-out; }
@keyframes baseHurt {
  0% { filter: brightness(2) drop-shadow(0 0 14px #ff6b6b); }
  100% { filter: none; }
}

/* ---------- 导航炸弹 ---------- */
.missile {
  position: absolute; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  background: url("../images/operators/missile.png") center / contain no-repeat;
  z-index: 9; will-change: transform;
  filter: drop-shadow(0 0 8px rgba(255,170,80,.85));
}
.missile-trail {
  position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,235,180,.95), rgba(255,150,60,.45) 55%, transparent 72%);
  z-index: 8; animation: trailFade .42s linear forwards; pointer-events: none;
}
@keyframes trailFade { from { opacity: .95; transform: scale(1); } to { opacity: 0; transform: scale(2.2); } }

.strike-fx {
  position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 10; pointer-events: none;
}
.strike-fx .flash {
  position: absolute; left: -70px; top: -70px; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffe27a 35%, rgba(255,140,60,.55) 60%, transparent 72%);
  animation: strikeFlash .34s ease-out forwards;
}
.strike-fx .ring {
  position: absolute; left: -45px; top: -45px; width: 90px; height: 90px; border-radius: 50%;
  border: 5px solid rgba(255,190,90,.95);
  animation: strikeRing .72s cubic-bezier(.2,.7,.3,1) forwards;
}
.strike-fx .cloud {
  position: absolute; left: -95px; top: -70px; width: 190px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(120,120,120,.75), rgba(90,90,90,.35) 55%, transparent 72%);
  animation: strikeCloud .9s ease-out forwards;
}
@keyframes strikeFlash { 0% { transform: scale(.25); opacity: 1; } 60% { opacity: .95; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes strikeRing { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(4.4); opacity: 0; } }
@keyframes strikeCloud { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.7) translateY(-10px); opacity: 0; } }

/* ---------- 敌人集结 / 冲锋 ---------- */
.enemy.staging .avatar { animation: bob 1.5s ease-in-out infinite; }
.enemy.staging { filter: brightness(.95) saturate(.9); }
.enemy.staging::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; width: 26px; height: 4px; margin-left: -13px;
  border-radius: 2px; background: rgba(255,211,77,.55);
}
.enemy.charging { animation: chargeIn .3s ease-out; }
@keyframes chargeIn { 0% { transform: translateY(-50%) scale(1.18); } 100% { transform: translateY(-50%) scale(1); } }

/* 盾卫受击：盾面金属闪光 */
.operator.blocking-hit { filter: brightness(1.6) drop-shadow(0 0 12px #9fd8ff); }

/* 红狼扇形弹道（从他身上散出到三路） */
.fan-tracer {
  position: absolute; height: 3px; border-radius: 2px; transform-origin: 0 50%; z-index: 6;
  background: linear-gradient(90deg, rgba(255,196,110,.95), rgba(255,120,40,.55) 45%, rgba(255,90,30,0));
  animation: tracerFade .17s linear forwards; pointer-events: none;
}

/* 盾卫刀刺 */
.stab {
  position: absolute; left: 50%; top: 52%; width: 74%; height: 6px; margin-top: -3px;
  transform-origin: 0 50%; border-radius: 4px;
  background: linear-gradient(90deg, #ffffff, #cfe8ff 40%, rgba(200,230,255,0));
  box-shadow: 0 0 10px rgba(200,230,255,.9);
  animation: stabThrust .26s ease-out forwards; pointer-events: none;
}
.stab.rev { transform-origin: 100% 50%; background: linear-gradient(270deg, #ffffff, #cfe8ff 40%, rgba(200,230,255,0)); }
@keyframes stabThrust {
  0% { transform: scaleX(.15); opacity: 0; }
  35% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* 红狼闪现：白光 + 残影 */
.operator.roamer.blinking { animation: blinkOut .32s ease-out; }
@keyframes blinkOut {
  0% { filter: brightness(2.4) drop-shadow(0 0 18px #9fe8ff); transform: translateX(-50%) scale(1.18); opacity: .3; }
  55% { filter: brightness(1.4) drop-shadow(0 0 10px #9fe8ff); opacity: .85; }
  100% { filter: none; transform: translateX(-50%) scale(1); opacity: 1; }
}
