/* ============================================================
 * style.css — 格斗合集页面样式
 * 素材均为 SVG 程序生成，本文件只负责布局与动效
 * ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}
#app { position: fixed; inset: 0; background: #000; }
.screen { position: absolute; inset: 0; }
.hidden { display: none !important; }
/* 背景 SVG 只负责渲染，绝不拦截点击/键盘 */
.bg-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

button {
  font-family: inherit; cursor: pointer; border: none;
}

/* ==================== 主菜单 ==================== */
#screen-menu .menu-content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px;
  text-shadow: 0 2px 8px rgba(0,0,0,.8);
}
#menu-title {
  font-size: clamp(40px, 7vw, 84px);
  font-weight: 900; letter-spacing: .35em; text-indent: .35em;
  color: #ffd76a;
  background: linear-gradient(180deg, #fff3c0 10%, #ffb62e 55%, #e06a00 95%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 #7a2d00) drop-shadow(0 6px 14px rgba(0,0,0,.9));
}
.menu-subtitle { letter-spacing: .4em; color: #cfe6ff; font-size: 14px; opacity: .85; }
/* 🔴 2026-10-19 修【卡片横向溢出屏幕】（截图实证：97 和"死神"两张卡片
   都超出右边界被裁掉，玩家连选都选不到）。
   根因：#menu-cards 用 flex 横向排列，而 .entry-card 固定 380px 宽 ——
   两张卡 + 40px 间距 = 800px，在 390px 手机上必然溢出。
   修法：① 卡片改成自适应宽度（clamp + max-width）
        ② 窄屏（<820px）时改为纵向排列 + 允许滚动
        ③ 容器加 padding，避免卡片贴边 */
#menu-cards {
  display: flex; gap: 40px; margin-top: 10px;
  flex-wrap: wrap; justify-content: center;
  padding: 0 16px; max-width: 100%;
}
.entry-card {
  width: 380px; padding: 22px 20px 16px;
  max-width: 100%; box-sizing: border-box;
  background: linear-gradient(180deg, rgba(20,26,44,.92), rgba(8,10,20,.95));
  border: 2px solid rgba(255,255,255,.22);
  border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  text-align: center;
}
.entry-card:hover, .entry-card.focus {
  border-color: #ffd76a;
  box-shadow: 0 10px 34px rgba(255,180,40,.35), 0 0 0 4px rgba(255,215,106,.12);
}
.entry-card svg { width: 100%; height: auto; }
.entry-sub { color: #9fb6d8; font-size: 13px; letter-spacing: .2em; }
#card-kof:hover .entry-sub, #card-kof.focus .entry-sub { color: #ffcf5e; }
#card-bvn:hover .entry-sub, #card-bvn.focus .entry-sub { color: #6ee7ff; }
.menu-help { font-size: 12px; color: rgba(255,255,255,.55); letter-spacing: .12em; margin-top: 8px; }

/* ==================== 选人界面 ==================== */
#screen-select .select-head {
  position: absolute; top: 12px; left: 0; right: 0;
  display: flex; align-items: center; justify-content: center; gap: 30px;
}
#select-logo { width: 300px; height: auto; filter: drop-shadow(0 3px 6px rgba(0,0,0,.7)); }
.select-opts { display: flex; gap: 10px; }
.select-opts button {
  padding: 8px 14px; border-radius: 8px; font-size: 14px;
  background: rgba(10,14,26,.82); color: #cfe6ff; border: 1px solid rgba(255,255,255,.3);
  transition: all .15s;
}
.select-opts button:hover { background: rgba(40,60,110,.9); border-color: #ffd76a; }
#roster-grid {
  position: absolute; inset: 92px 4% 64px;
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 14px; align-items: stretch;
}
.char-card {
  position: relative; border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, rgba(24,30,52,.9), rgba(10,12,24,.95));
  border: 2px solid rgba(255,255,255,.18);
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 6px 6px; cursor: pointer;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.char-card:hover { border-color: rgba(255,255,255,.55); }
.char-card svg.portrait { width: 86%; height: auto; }
.char-card .c-name { font-size: 15px; font-weight: 700; letter-spacing: .1em; margin-top: 4px; }
.char-card .c-sub { font-size: 11px; color: rgba(255,255,255,.5); }
.char-card.cursor { border-color: #ffd76a; box-shadow: 0 0 0 3px rgba(255,215,106,.3), 0 8px 22px rgba(255,180,40,.25); }
.char-card.pick1 { border-color: #ff6a3d; box-shadow: 0 0 0 3px rgba(255,106,61,.45); background: linear-gradient(180deg, rgba(70,30,16,.92), rgba(20,10,6,.95)); }
.char-card.pick2 { border-color: #3da5ff; box-shadow: 0 0 0 3px rgba(61,165,255,.45); background: linear-gradient(180deg, rgba(16,40,80,.92), rgba(8,14,28,.95)); }
.char-card .pick-tag {
  position: absolute; top: 6px; right: 8px; font-size: 11px; font-weight: 900;
  color: #fff; background: #e8452a; border-radius: 5px; padding: 2px 7px; letter-spacing: .08em;
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.char-card .pick-tag.t2 { background: #2a7ce8; }
#select-status {
  position: absolute; bottom: 14px; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 30px; font-size: 13px; color: rgba(255,255,255,.75);
  text-shadow: 0 1px 4px rgba(0,0,0,.9);
}
.st-p1 { color: #ff9a6a; letter-spacing: .12em; }
.st-p2 { color: #7cc0ff; letter-spacing: .12em; }
#select-info { color: #ffd76a; letter-spacing: .15em; font-weight: 700; }

/* ==================== 战斗 HUD ==================== */
#hud {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 14px 26px 0;
  z-index: 5;
}
.hud-side { display: flex; gap: 10px; align-items: flex-start; flex: 1; }
.hud-side.p2 { flex-direction: row-reverse; text-align: right; }
.portrait-box {
  width: 74px; height: 74px; border-radius: 10px; overflow: hidden;
  background: rgba(0,0,0,.55); border: 2px solid rgba(255,255,255,.5);
  box-shadow: 0 4px 12px rgba(0,0,0,.5);
  flex: none;
}
.portrait-box svg { width: 100%; height: 100%; display: block; }
.bars { width: 340px; display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.pname { font-size: 16px; font-weight: 900; letter-spacing: .2em; text-shadow: 0 2px 4px rgba(0,0,0,.9); }
.hp-bar {
  position: relative; height: 22px; border-radius: 5px; overflow: hidden;
  background: #241a1c; border: 2px solid #f4e3c2; box-shadow: inset 0 2px 6px rgba(0,0,0,.8);
}
.hp-dmg, .hp-fill { position: absolute; top: 0; bottom: 0; transition: width .18s linear; }
.hp-dmg { background: #fff8e0; }
.p1 .hp-dmg { right: 0; } .p1 .hp-fill { right: 0; }
.p2 .hp-dmg { left: 0; }  .p2 .hp-fill { left: 0; }
.hud-kof .p1 .hp-fill { background: linear-gradient(180deg, #ff7a52, #e02814 60%, #a00d00); }
.hud-kof .p2 .hp-fill { background: linear-gradient(180deg, #6fd0ff, #1e6ef0 60%, #0a3aa8); }
.hud-bvn .p1 .hp-fill { background: linear-gradient(180deg, #ffd24a, #f59312 60%, #c05a00); }
.hud-bvn .p2 .hp-fill { background: linear-gradient(180deg, #8afff0, #19c4c4 60%, #067e88); }
.en-bar {
  position: relative; height: 10px; border-radius: 3px; overflow: hidden;
  background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.35);
}
.en-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0%;
  background: linear-gradient(90deg, #ffd76a, #ff9d00); transition: width .2s; }
.p2 .en-fill { left: auto; right: 0;
  background: linear-gradient(270deg, #ffd76a, #ff9d00); }
.en-label { position: absolute; right: 3px; top: -1px; font-size: 8px; color: rgba(255,255,255,.8); letter-spacing: .1em; }
.p2 .en-label { right: auto; left: 3px; }
.round-dots { display: flex; gap: 6px; margin-top: 6px; }
.round-dots i { width: 12px; height: 12px; transform: rotate(45deg);
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.6); }
.round-dots i.on { background: #ffd76a; box-shadow: 0 0 8px rgba(255,215,106,.8); }
.p2 .round-dots { justify-content: flex-end; }
#timer-box {
  margin: 2px 24px 0; width: 64px; height: 64px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); border: 2px solid #f4e3c2; border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
}
#timer { font-size: 34px; font-weight: 900; color: #fff; text-shadow: 0 0 10px rgba(255,215,106,.9); font-variant-numeric: tabular-nums; }
#combo-box {
  position: absolute; top: 30%; left: 0; right: 0; text-align: center;
  font-size: 40px; font-weight: 900; color: #ffd76a;
  text-shadow: 0 0 18px rgba(255,160,0,.9), 0 3px 0 #7a2d00;
  letter-spacing: .1em; pointer-events: none;
}
#combo-box .cpop { animation: cpop .5s ease-out; }
@keyframes cpop {
  0% { transform: scale(2.2); opacity: 0; }
  40% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}
/* 训练模式状态条 */
#train-hud {
  position: absolute; top: 96px; left: 0; right: 0; text-align: center;
  z-index: 5; pointer-events: none;
  font-size: 13px; letter-spacing: .12em; color: #9fe8c8;
  text-shadow: 0 1px 4px rgba(0,0,0,.9);
}
/* 战斗底部操作提示条 */
#fight-hint {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 5; pointer-events: none;
  font-size: 12px; letter-spacing: .1em; color: rgba(255,255,255,.8);
  background: rgba(0,0,0,.45); padding: 6px 18px; border-radius: 20px;
  text-shadow: 0 1px 3px rgba(0,0,0,.9); white-space: nowrap;
}

/* ==================== 公告 / 演出 ==================== */
#announce {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; z-index: 6;
  font-weight: 900; letter-spacing: .14em; text-align: center;
}
#announce .ann {
  font-size: 92px; color: #ffe066;
  text-shadow: 0 4px 0 #7a2d00, 0 0 40px rgba(255,180,40,.8), 0 0 90px rgba(255,120,0,.5);
  animation: annIn .35s cubic-bezier(.2,1.6,.4,1) both, annOut .3s ease-in 1.05s both;
}
#announce.ann-bvn .ann { color: #fff; text-shadow: 0 4px 0 #063, 0 0 40px rgba(120,255,220,.7); }
#announce.ann-small .ann { font-size: 60px; }
#announce .ann-special { font-size: 46px; color: #8ff; text-shadow: 0 3px 0 #06a, 0 0 34px rgba(120,200,255,.9); }
@keyframes annIn { 0% { transform: scale(3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes annOut { 0% { opacity: 1; } 100% { opacity: 0; transform: scale(.8); } }
#flash-layer {
  position: absolute; inset: 0; pointer-events: none; z-index: 7;
  background: #fff; opacity: 0;
}
#flash-layer.flash { animation: flashAnim .45s ease-out; }
@keyframes flashAnim { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ==================== 覆盖层菜单 ==================== */
.overlay-menu {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: rgba(4,6,14,.82); backdrop-filter: blur(4px);
}
.overlay-menu h2 { font-size: 46px; letter-spacing: .3em; color: #ffd76a; text-shadow: 0 3px 0 #7a2d00; margin-bottom: 8px; }
.overlay-menu button {
  min-width: 240px; padding: 13px 26px; border-radius: 10px;
  font-size: 17px; letter-spacing: .2em; font-weight: 700;
  background: linear-gradient(180deg, #2c3a6e, #18244a);
  color: #fff; border: 1px solid rgba(255,255,255,.35);
  transition: all .15s;
}
.overlay-menu button:hover { background: linear-gradient(180deg, #3d5096, #24366e); box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 980px; width: 92%; }
.help-grid h3 { color: #ffd76a; letter-spacing: .2em; margin-bottom: 10px; font-size: 18px; }
.help-grid p { font-size: 14px; line-height: 2.1; color: #cfe6ff; }
#match-result #result-portrait svg { width: 210px; height: auto; filter: drop-shadow(0 8px 24px rgba(255,200,60,.35)); }
#result-title.win1 { color: #ff8a5e; text-shadow: 0 3px 0 #7a1d00; }
#result-title.win2 { color: #6fc0ff; text-shadow: 0 3px 0 #063a7a; }
#result-name { font-size: 26px; font-weight: 900; letter-spacing: .3em; }
.result-btns { display: flex; gap: 18px; }

/* ==================== 超必杀定格 / 演出 ==================== */
#ultra-tint {
  position: absolute; inset: 0; pointer-events: none; z-index: 6;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0) 40%, rgba(10,20,60,.55) 100%);
  opacity: 0; transition: opacity .15s;
}
#ultra-tint.on { opacity: 1; }
.pname.name-pop { animation: namePop .5s cubic-bezier(.2,1.8,.4,1); }
@keyframes namePop { 0% { transform: scale(2.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
/* 街机化 HUD 状态 */
.en-fill.charged { box-shadow: 0 0 10px rgba(255,200,60,.8); }
.en-fill.max { animation: pulse .5s ease-in-out infinite; }
.hp-fill.low { animation: pulse .3s ease-in-out infinite; filter: brightness(1.25) saturate(1.4); }
#timer.low { color: #ff4a3a; animation: pulse .5s ease-in-out infinite; }

/* ==================== 设置面板 ==================== */
#settings-overlay { z-index: 25; }
.set-row { display: flex; align-items: center; gap: 14px; width: min(560px, 90%); }
.set-row label { width: 90px; text-align: right; color: #cfe6ff; letter-spacing: .1em; }
.set-row input[type="range"] { flex: 1; accent-color: #ffd76a; }
#key-grid { display: flex; gap: 30px; max-height: 46vh; overflow: auto; width: min(760px, 92%); }
.key-col { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.key-col-head { font-weight: 900; color: #ffd76a; letter-spacing: .2em; text-align: center; margin-bottom: 4px; }
.key-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: rgba(255,255,255,.06); border-radius: 6px; padding: 4px 10px; }
.key-act { color: #9fb6d8; font-size: 13px; }
.key-btn { min-width: 76px; padding: 5px 10px; font-size: 13px; border-radius: 6px; background: #24304e; color: #ffe066; border: 1px solid rgba(255,255,255,.3); }
.key-btn.waiting { animation: pulse .4s infinite; color: #ff9a3a; border-color: #ff9a3a; }
#menu-settings {
  padding: 10px 26px; border-radius: 10px; font-size: 15px; letter-spacing: .25em;
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.35);
  transition: all .15s;
}
#menu-settings:hover { background: rgba(255,255,255,.2); border-color: #ffd76a; }
.menu-actions { margin-top: 6px; }

/* ==================== 出招表 ==================== */
#movelist-overlay { z-index: 30; }
#movelist-body { width: min(720px, 92%); display: flex; flex-direction: column; gap: 6px; }
.ml-head { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.ml-portrait { width: 120px; height: auto; flex: none; }
.ml-name { font-size: 28px; font-weight: 900; letter-spacing: .25em; color: #ffd76a; text-shadow: 0 2px 0 #7a2d00; }
.ml-row {
  display: grid; grid-template-columns: 80px 170px 90px 1fr; gap: 10px; align-items: center;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px; padding: 8px 14px; font-size: 15px;
}
.ml-cat { color: #9fb6d8; font-weight: 700; letter-spacing: .1em; }
.ml-input { color: #ffe066; letter-spacing: .06em; }
.ml-cost { color: #8ff; font-size: 13px; }
.ml-name2 { color: #fff; text-align: right; }
.ml-tip { margin-top: 10px; font-size: 13px; color: rgba(255,255,255,.6); letter-spacing: .05em; text-align: center; }

/* ==================== 通用小工具 ==================== */
.pulse { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
/* 运行时错误提示条 */
#err-banner {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 999; background: rgba(160, 20, 10, .92); color: #fff;
  padding: 10px 22px; border-radius: 8px; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.5); display: none; letter-spacing: .05em;
}


/* ---------- 窄屏适配（2026-10-19） ----------
   手机上两张卡片改为纵向堆叠，各自占满宽度。
   原来固定 380px + 横排 ⇒ 溢出屏幕、右侧卡片点不到。 */
@media (max-width: 820px) {
  #menu-cards {
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: 100%;
  }
  .entry-card {
    width: min(380px, calc(100vw - 48px));
  }
  .menu-subtitle { letter-spacing: .18em; font-size: 12.5px; padding: 0 16px; text-align: center; }
}
