/* ==========================================================================
   新宿决战 · 界面样式（camera-ui 写域）
   --------------------------------------------------------------------------
   设计原则（本次重做）：
     1) 一眼看懂：血条 > 领域 > 技能冷却，越紧急的信息越亮、越大、越靠边
     2) 不挡战斗主视野：常驻元素全部贴边，画面中央 60% 只留给角色与招式
     3) 黑底黑条一律修掉：所有数值都带描边/阴影，任何亮度背景下都能读
     4) 层级固定：闪光层 z1 < 信息层 z5 < 按钮层 z6 < 电影黑边 z8 < 全屏界面 z40
   ========================================================================== */

:root {
  --ink: #06060c;
  --ink-2: #0c0d16;
  --crimson: #ff1f3d;
  --crimson-dk: #8c0b1e;
  --azure: #2b86ff;
  --cyan: #5ff0ff;
  --violet: #b04cff;
  --gold: #ffd873;
  --paper: #e8e6df;
  --line: rgba(255, 216, 115, 0.28);
  --glass: rgba(6, 6, 12, 0.72);
  --glass-2: rgba(10, 11, 20, 0.82);

  --f-jp: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Noto Serif JP",
          "Songti SC", "SimSun", "MS Mincho", serif;
  --f-ui: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP",
          "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --f-num: "DIN Alternate", "Bahnschrift", "Impact", "Arial Narrow", system-ui, sans-serif;
  /* 数值统一用等宽数字，计时器/血量跳动时不会左右抖 */
  --num-feat: "tnum" 1, "lnum" 1;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: var(--ink); color: var(--paper);
  font-family: var(--f-ui);
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none;
  overscroll-behavior: none;
}

#gl {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; background: var(--ink); z-index: 0;
}

.hidden { display: none !important; }

/* 全局噪点 / 扫描线，让画面更像动画胶片（保持很淡，不能糊住文字） */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 60;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.11) 0 1px, rgba(0,0,0,0) 1px 3px);
  mix-blend-mode: multiply; opacity: 0.42;
}

/* ============================== HUD ============================== */
#hud {
  position: fixed; inset: 0; z-index: 20;
  pointer-events: none;
  font-family: var(--f-ui);
  font-variant-numeric: tabular-nums;
}

/* --- 打击闪光 / 濒死红边：永远压在 HUD 内容之下，不可能盖住任何读数 --- */
.flash {
  position: absolute; inset: 0; opacity: 0; pointer-events: none; z-index: 1;
  background: #fff; mix-blend-mode: screen;
  transition: opacity .06s linear;
}
.lowhp {
  position: absolute; inset: 0; opacity: 0; pointer-events: none; z-index: 1;
  transition: opacity .3s;
  background: radial-gradient(ellipse at center,
    rgba(255,0,0,0) 46%, rgba(150,0,12,.34) 80%, rgba(255,20,40,.5) 100%);
}
.lowhp.on { opacity: 1; animation: lowBeat 1.1s ease-in-out infinite; }
@keyframes lowBeat { 50% { opacity: .5; } }

/* --- 电影黑边 --- */
.bar {
  position: absolute; left: 0; right: 0; height: 0;
  background: #000; z-index: 8;
  transition: height .45s cubic-bezier(.2,.8,.2,1);
}
.bar-top { top: 0; }
.bar-bottom { bottom: 0; }
#hud.cinema .bar { height: 11vh; }

/* --- 顶部双方状态 --- */
.top-strip {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; padding: 12px 18px 0;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .3s;
}
#hud.cinema .top-strip { transform: translateY(-16px); opacity: 0; }
/* 电影模式下收起常驻信息，但**离屏敌人指示器不收起**：
   它是"对手出画"这一取舍成立的前提，必须保证任何时刻只要对手出画就一定在。 */
#hud.cinema .ability-bar, #hud.cinema .hints { opacity: 0; }

.fighter-panel { width: min(33vw, 430px); }
.fighter-panel.right { text-align: right; }

/* 名字行：编号 / 名字 / 血量数值 */
.fp-head {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 4px; text-shadow: 0 2px 10px #000;
}
.fighter-panel.right .fp-head { flex-direction: row-reverse; }
.fp-name {
  display: flex; align-items: baseline; gap: 8px;
}
.fighter-panel.right .fp-name { flex-direction: row-reverse; }
.fp-name .jp {
  font-family: var(--f-jp); font-size: 20px; letter-spacing: .16em;
  color: #fff; font-weight: 600;
}
.fp-name .en {
  font-size: 9px; letter-spacing: .28em; color: rgba(232,230,223,.45);
}
.fp-side {
  font-size: 9px; letter-spacing: .22em; color: rgba(255,216,115,.65);
  border: 1px solid rgba(255,216,115,.3); padding: 0 4px; border-radius: 2px;
}
.hp-num {
  margin-left: auto; font-family: var(--f-num); font-size: 22px;
  letter-spacing: .02em; color: #fff; line-height: 1;
  text-shadow: 0 2px 4px #000, 0 0 12px rgba(0,0,0,.95);
}
.fighter-panel.right .hp-num { margin-left: 0; margin-right: auto; }

/* 血条：亮色渐变 + 高光边，彻底告别"黑底黑条" */
.hp-wrap { position: relative; }
.hp-bar {
  /* z-index 1：血条本体必须压在"幽灵条"之上，否则满血时白色幽灵条会把角色色盖掉
     （基线里血条看起来是灰白条，就是这个层序问题） */
  position: relative; z-index: 1; height: 15px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.62) 55%, rgba(0,0,0,.72));
  border: 1px solid rgba(255,255,255,.3);
  transform: skewX(-20deg); overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.65), inset 0 0 10px rgba(0,0,0,.55);
}
.hp-bar.ghost {
  position: absolute; inset: 0; z-index: 0;
  border-color: transparent; box-shadow: none;
}
.hp-fill, .hp-ghost, .tech-fill, .dom-fill {
  display: block; height: 100%; width: 100%;
  transform-origin: left center;
  transition: transform .09s linear;
}
.fighter-panel.right .hp-fill,
.fighter-panel.right .hp-ghost,
.fighter-panel.right .tech-fill,
.fighter-panel.right .dom-fill { transform-origin: right center; }

.hp-fill.gojo {
  background: linear-gradient(180deg, #9de5ff 0%, var(--azure) 35%, #0a3f92 100%);
  box-shadow: 0 0 16px rgba(43,134,255,.9), inset 0 1px 0 rgba(255,255,255,.6);
}
.hp-fill.sukuna {
  background: linear-gradient(180deg, #ffd0c4 0%, var(--crimson) 38%, #78091a 100%);
  box-shadow: 0 0 16px rgba(255,31,61,.9), inset 0 1px 0 rgba(255,255,255,.55);
}
.hp-fill.low { animation: hpLow .7s ease-in-out infinite; }
@keyframes hpLow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.7) saturate(1.4); }
}
.hp-ghost { background: rgba(255,255,255,.5); transition: transform .5s ease-out .12s; }

/* 受击反馈：被打的一方整块面板闪一下红光（不需要盯血条也知道挨打了） */
#hud.hurt-gojo .fighter-panel.left,
#hud.hurt-sukuna .fighter-panel.right { animation: hudHurt .45s ease-out; }
@keyframes hudHurt {
  0% { filter: drop-shadow(0 0 16px rgba(255,31,61,.95)) brightness(1.6); }
  100% { filter: none; }
}

/* 咒力 / 领域行：细条 + 百分比 */
.stat-row {
  display: flex; align-items: center; gap: 7px; margin-top: 4px;
}
.fighter-panel.right .stat-row { flex-direction: row-reverse; }
.stat-label {
  font-size: 9px; letter-spacing: .18em; color: rgba(232,230,223,.5);
  white-space: nowrap;
}
.stat-num {
  font-family: var(--f-num); font-size: 11.5px; color: rgba(255,255,255,.92);
  min-width: 34px; text-align: right; text-shadow: 0 1px 3px #000;
}
.fighter-panel.right .stat-num { text-align: left; }
.tech-bar {
  flex: 1; height: 6px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(0,0,0,.6));
  border: 1px solid rgba(255,255,255,.22);
  transform: skewX(-20deg); overflow: hidden;
}
.tech-fill.gojo {
  background: linear-gradient(90deg, #15589c, var(--cyan));
  box-shadow: 0 0 10px rgba(95,240,255,.85);
}
.tech-fill.sukuna {
  background: linear-gradient(90deg, #5c0a16, #ff6a4d);
  box-shadow: 0 0 10px rgba(255,106,77,.85);
}
.dom-bar {
  flex: 1; height: 5px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(0,0,0,.6));
  border: 1px solid rgba(255,255,255,.18);
  overflow: hidden; transform: skewX(-20deg);
}
.dom-fill.gojo { background: linear-gradient(90deg, #4a2b8f, var(--violet)); box-shadow: 0 0 12px var(--violet); }
.dom-fill.sukuna { background: linear-gradient(90deg, #7a1020, #ff5a3c); box-shadow: 0 0 12px #ff5a3c; }
.dom-bar.ready { animation: domPulse 1.1s ease-in-out infinite; }
@keyframes domPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255,216,115,0); }
  50% { box-shadow: 0 0 16px var(--gold); }
}

.burnout {
  margin-top: 5px; font-size: 10px; letter-spacing: .26em;
  color: var(--gold); text-shadow: 0 0 10px rgba(255,216,115,.9);
  animation: flick .35s steps(2) infinite;
}
@keyframes flick { 50% { opacity: .35; } }

/* 摩虚罗之轮 */
.wheel { margin-top: 5px; font-size: 9px; letter-spacing: .2em; color: rgba(255,216,115,.75); }
.wheel-dots { display: flex; gap: 4px; justify-content: flex-end; margin-top: 3px; }
.wheel-dots i {
  width: 8px; height: 8px; transform: rotate(45deg);
  border: 1px solid rgba(255,216,115,.5); background: rgba(0,0,0,.5);
}
.wheel-dots i.on { background: var(--gold); box-shadow: 0 0 10px var(--gold); }

/* --- 中央读数：计时 / 阶段 / 距离 / 连击 --- */
.center-readout {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%);
  text-align: center; min-width: 170px;
}
.timer {
  font-family: var(--f-num); font-size: 34px; line-height: 1;
  letter-spacing: .06em; color: #fff;
  text-shadow: 0 2px 6px #000, 0 0 20px rgba(0,0,0,.9);
  transition: color .3s, opacity .3s;
}
.timer.on { color: #fff; }
.timer.off { color: rgba(255,255,255,.32); text-shadow: 0 2px 6px #000; }
.timer.paused { color: var(--gold); animation: flick .9s steps(2) infinite; }
.center-sub {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 3px;
}
.phase-tag, .focus-dist {
  font-size: 10px; letter-spacing: .16em; padding: 2px 8px; border-radius: 2px;
  background: rgba(6,6,12,.6); text-shadow: 0 1px 3px #000;
}
.phase-tag { color: rgba(255,150,150,.92); border: 1px solid rgba(255,31,61,.35); }
.phase-tag.ph2 { color: #ffb27a; border-color: rgba(255,140,60,.5); }
.phase-tag.ph3 { color: #ff8ad0; border-color: rgba(255,80,200,.55); box-shadow: 0 0 12px rgba(255,80,200,.25); }
.focus-dist { font-family: var(--f-num); color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.18); }
.focus-dist.melee { color: var(--gold); border-color: rgba(255,216,115,.55); box-shadow: 0 0 12px rgba(255,216,115,.22); }
.focus-dist.mid { color: rgba(255,255,255,.85); }
.focus-dist.far { color: rgba(255,255,255,.42); }

.combo {
  position: absolute; left: 50%; top: 74px; transform: translateX(-50%) scale(.6);
  opacity: 0; transition: opacity .12s, transform .12s;
  white-space: nowrap; pointer-events: none;
}
.combo.show { opacity: 1; transform: translateX(-50%) scale(1); }
.combo b {
  font-family: var(--f-num); font-size: 44px; color: var(--gold);
  text-shadow: 0 0 22px rgba(255,216,115,.9), 0 3px 0 #7a4a00;
}
.combo span { font-size: 12px; letter-spacing: .3em; margin-left: 6px; color: #fff; }

/* --- 离屏敌人指示：人在画面外也知道他在哪、有多远 --- */
.enemy-compass {
  position: absolute; left: 0; top: 0; z-index: 5;
  width: 0; height: 0; opacity: 0;
  transition: opacity .18s linear;
}
.enemy-compass.show { opacity: 1; }
.ec-arrow {
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; margin: -15px 0 0 -15px;
  display: grid; place-items: center;
  font-size: 19px; color: var(--crimson);
  text-shadow: 0 0 12px rgba(255,31,61,.9), 0 0 3px #000;
  transform-origin: 50% 50%;
  transition: transform .08s linear;
}
.enemy-compass::before {
  content: ""; position: absolute; left: 0; top: 0;
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border: 1px solid rgba(255,31,61,.45); border-radius: 50%;
  box-shadow: 0 0 18px rgba(255,31,61,.35), inset 0 0 14px rgba(255,31,61,.2);
}
.enemy-compass.behind::before { border-style: dashed; border-color: rgba(255,216,115,.6); }
.enemy-compass.behind .ec-arrow { color: var(--gold); text-shadow: 0 0 12px rgba(255,216,115,.9); }
.ec-dist {
  position: absolute; left: 50%; top: 26px; transform: translateX(-50%);
  font-family: var(--f-num); font-size: 12px; color: #fff;
  background: rgba(6,6,12,.72); border: 1px solid rgba(255,255,255,.25);
  padding: 1px 6px; border-radius: 2px; white-space: nowrap;
}

/* --- 技能栏：大字术式名 + 冷却环 + 就绪反馈 --- */
.ability-bar {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: 5;
  display: flex; gap: 10px; align-items: flex-end;
  transition: opacity .3s;
}
.ab {
  position: relative; width: 76px; height: 76px;
  background: linear-gradient(180deg, rgba(24,26,40,.92), rgba(6,6,12,.94));
  border: 1px solid rgba(255,255,255,.22);
  clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%, 0 11px);
  overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .12s;
  box-shadow: 0 3px 14px rgba(0,0,0,.6);
}
/* 冷却环：--cd 由 hud.js 写入（0=就绪 1=刚放完） */
.ab::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: conic-gradient(from -90deg,
    rgba(2,2,8,.78) calc(var(--cd, 0) * 360deg), rgba(0,0,0,0) 0);
  mix-blend-mode: normal;
}
.ab .ab-key {
  position: absolute; top: 0; left: 0; z-index: 3;
  min-width: 19px; padding: 2px 4px;
  font-family: var(--f-num); font-size: 12px; line-height: 1; color: #06121c;
  background: linear-gradient(180deg, #ffe9a8, var(--gold));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 6px 100%);
  text-align: center;
}
.ab .ab-cost {
  position: absolute; top: 3px; right: 6px; z-index: 3;
  font-family: var(--f-num); font-size: 12px; color: var(--cyan);
  text-shadow: 0 1px 4px #000;
}
.ab .ab-glyph {
  position: absolute; inset: 12px 8px 18px; z-index: 2;
  display: grid; place-items: center;
  font-family: var(--f-jp); font-size: 27px; color: #fff;
  text-shadow: 0 0 16px currentColor, 0 2px 6px #000;
}
.ab .ab-name {
  position: absolute; bottom: 3px; left: 0; right: 0; z-index: 3;
  font-size: 9.5px; text-align: center; letter-spacing: .05em;
  font-family: var(--f-ui); color: rgba(255,255,255,.82); text-shadow: 0 0 8px #000;
}
.ab .ab-cd { position: absolute; inset: 0; z-index: 1; background: rgba(0,0,0,.66); transform-origin: bottom; transform: scaleY(0); transition: transform .1s linear; }
.ab .ab-cd-num {
  position: absolute; inset: 0; z-index: 4; display: grid; place-items: center;
  font-family: var(--f-num); font-size: 22px; color: #fff;
  text-shadow: 0 0 10px #000, 0 0 3px #000; opacity: 0;
}
.ab.cooling .ab-cd-num { opacity: 1; }
/* 冷却时把术式字压暗，让剩余秒数成为该格子唯一的主角 */
.ab.cooling .ab-glyph { opacity: .22; }
.ab.ready { border-color: rgba(95,240,255,.6); box-shadow: 0 0 18px rgba(95,240,255,.3) inset, 0 3px 14px rgba(0,0,0,.6); }
.ab.ready.sr { border-color: rgba(176,76,255,.6); box-shadow: 0 0 18px rgba(176,76,255,.34) inset, 0 3px 14px rgba(0,0,0,.6); }
.ab.disabled { filter: grayscale(.8) brightness(.55); }
.ab.charged { animation: abCharged .6s ease-in-out infinite; }
@keyframes abCharged {
  0%, 100% { box-shadow: 0 0 10px rgba(255,216,115,.5); }
  50% { box-shadow: 0 0 26px rgba(255,216,115,.95); }
}
/* 就绪瞬间弹一下：不用盯着技能栏也知道能放了 */
.ab.hud-ready { border-color: rgba(255,255,255,.55); }
.ab.hud-pop { animation: abPop .42s cubic-bezier(.2,1.6,.3,1); }
@keyframes abPop {
  0% { transform: translateY(-4px) scale(1.09); }
  100% { transform: none; }
}
/* 每个术式一个专属色，扫一眼就能认出来 */
.ab[data-skill="blue"] .ab-glyph { color: #7fd2ff; }
.ab[data-skill="red"] .ab-glyph { color: #ff8a7a; }
.ab[data-skill="purple"] .ab-glyph { color: #c48cff; }
.ab[data-skill="reverse"] .ab-glyph { color: #a8ffd0; }
.ab[data-skill="void"] .ab-glyph { color: #ffffff; }
.ab[data-skill="purple200"] .ab-glyph { color: var(--gold); }

/* --- 教学提示：左下角，20 秒后自己消失 --- */
.hints {
  position: absolute; left: 18px; bottom: 108px; z-index: 5;
  display: flex; flex-direction: column; gap: 5px; align-items: flex-start;
  opacity: 0; transition: opacity .5s;
}
.hints.show { opacity: 1; }
.hint {
  font-size: 11.5px; letter-spacing: .1em;
  padding: 4px 10px; color: rgba(255,255,255,.92);
  background: rgba(6,6,12,.62);
  border-left: 2px solid var(--gold);
  text-shadow: 0 0 10px #000;
}
.hint b { color: var(--gold); font-family: var(--f-num); font-size: 13px; }

/* --- 领域拉锯 ---------------------------------------------------------
   放到画面下部（电影黑边之上）：拉锯时要一边连点 J/K 一边看两个人，
   压在中上部的横条会把角色糊掉。整块加半透明底板，保证在任何领域背景上都读得清。
   -------------------------------------------------------------------- */
.clash {
  position: absolute; left: 50%; bottom: 12.5vh; transform: translateX(-50%);
  width: min(72vw, 800px); text-align: center; z-index: 5;
  padding: 12px 20px 11px;
  background: linear-gradient(180deg, rgba(6,6,12,.85), rgba(6,6,12,.6));
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 12px 46px rgba(0,0,0,.7);
  backdrop-filter: blur(3px);
}
.clash-title {
  font-family: var(--f-jp); font-size: 20px; letter-spacing: .42em;
  color: #fff; margin-bottom: 8px;
  text-shadow: 0 0 24px var(--violet), 0 0 48px var(--crimson), 0 3px 0 #000;
  animation: clashPulse .5s ease-in-out infinite alternate;
}
@keyframes clashPulse {
  from { transform: scale(1); filter: brightness(1); }
  to { transform: scale(1.03); filter: brightness(1.34); }
}
.clash-track {
  position: relative; height: 20px;
  background: rgba(0,0,0,.75);
  border: 1px solid rgba(255,255,255,.28);
  transform: skewX(-20deg); overflow: hidden;
  box-shadow: 0 0 30px rgba(0,0,0,.9);
}
.clash-side { position: absolute; top: 0; bottom: 0; }
.clash-side.gojo {
  left: 0; width: 50%; transform-origin: left;
  background: linear-gradient(90deg, rgba(43,134,255,.25), var(--cyan));
  box-shadow: 0 0 22px var(--cyan);
}
.clash-side.sukuna {
  right: 0; width: 50%; transform-origin: right;
  background: linear-gradient(90deg, #ff5a3c, rgba(140,11,30,.25));
  box-shadow: 0 0 22px var(--crimson);
}
.clash-pin {
  position: absolute; top: -6px; bottom: -6px; width: 5px; left: 50%;
  background: #fff; box-shadow: 0 0 20px #fff, 0 0 40px var(--gold);
  transform: translateX(-50%);
}
.clash-hint {
  margin-top: 9px; font-size: 13.5px; letter-spacing: .16em;
  color: #fff; text-shadow: 0 1px 4px #000, 0 0 12px #000;
}
.clash-hint b {
  color: var(--ink); font-family: var(--f-num); font-size: 15px;
  background: var(--gold); padding: 1px 7px; margin: 0 2px; border-radius: 2px;
  box-shadow: 0 0 14px rgba(255,216,115,.8);
}

/* --- Banner：两套排面 ---------------------------------------------------
   长句（提示/播报）走顶部信息条，短句（「黑闪！」「宿傩 讨伐」）走戏剧大字，
   戏剧大字放在画面上部 16%，人物在画面中下部，不会糊脸。
   ---------------------------------------------------------------------- */
.banner {
  position: absolute; left: 50%; top: 74px; transform: translateX(-50%);
  z-index: 5; pointer-events: none; opacity: 0;
  white-space: pre-line; text-align: center;
  font-family: var(--f-ui); font-size: 15px; letter-spacing: .14em;
  color: #fff; padding: 5px 30px;
  background: linear-gradient(90deg,
    rgba(6,6,12,0) 0%, rgba(6,6,12,.78) 14%, rgba(6,6,12,.78) 86%, rgba(6,6,12,0) 100%);
  text-shadow: 0 2px 8px #000;
  transition: opacity .18s;
}
.banner.show { opacity: 1; animation: bannerIn .28s cubic-bezier(.2,1.3,.3,1); }
@keyframes bannerIn {
  from { transform: translateX(-50%) translateY(8px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.banner.drama {
  top: 15%;
  font-family: var(--f-jp); font-size: clamp(34px, 4.6vw, 62px);
  letter-spacing: .2em; line-height: 1.2; padding: 6px 40px;
  background: none;
  text-shadow:
    0 0 18px rgba(0,0,0,1), 0 0 52px rgba(255,31,61,.85),
    0 0 90px rgba(255,216,115,.5), 0 4px 0 #000;
}
.banner.drama::after {
  content: ""; display: block; margin: 10px auto 0;
  width: 62%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  box-shadow: 0 0 12px var(--gold);
}
.banner.drama.show { animation: dramaIn .34s cubic-bezier(.2,1.4,.3,1); }
@keyframes dramaIn {
  from { transform: translateX(-50%) scale(.9); opacity: 0; filter: blur(6px); }
  to { transform: translateX(-50%) scale(1); opacity: 1; filter: none; }
}

/* --- 播片字幕 --- */
.caption {
  position: absolute; left: 6vw; bottom: 15vh; z-index: 6;
  max-width: 60vw;
}
.cap-main {
  font-family: var(--f-jp); font-size: clamp(19px, 2.6vw, 34px);
  letter-spacing: .16em; color: #fff;
  text-shadow: 0 0 20px rgba(0,0,0,1), 0 2px 0 #000, 0 0 46px rgba(176,76,255,.65);
  animation: capIn .5s cubic-bezier(.2,1,.3,1);
}
.cap-sub {
  margin-top: 5px; font-size: clamp(10px, 1vw, 13px);
  letter-spacing: .42em; color: rgba(255,216,115,.9);
  text-shadow: 0 0 14px rgba(0,0,0,1);
  animation: capIn .6s .08s backwards cubic-bezier(.2,1,.3,1);
}
@keyframes capIn { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }

/* --- 播片 UI --- */
.cine-ui {
  position: absolute; left: 22px; right: 22px; bottom: 2.4vh; z-index: 6;
  display: flex; align-items: center; gap: 16px;
}
.cine-progress { flex: 1; height: 2px; background: rgba(255,255,255,.16); overflow: hidden; }
.cine-progress i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  box-shadow: 0 0 12px var(--violet);
}
.cine-skip { font-size: 11px; letter-spacing: .24em; color: rgba(255,255,255,.6); }
.cine-skip b { color: var(--gold); font-family: var(--f-num); }

/* --- 音量：收在右下角一枚按钮里 --- */
.audio-dock {
  position: absolute; right: 16px; bottom: 18px; z-index: 6;
  pointer-events: auto;
}
.audio-toggle {
  width: 34px; height: 34px; padding: 0;
  display: grid; place-items: center;
  font-size: 15px; color: rgba(255,216,115,.9); cursor: pointer;
  background: rgba(6,6,12,.62);
  border: 1px solid rgba(255,255,255,.22);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  transition: color .2s, border-color .2s, background .2s;
}
.audio-toggle:hover { color: #fff; border-color: rgba(255,216,115,.7); }
.audio-dock.open .audio-toggle { color: var(--ink); background: var(--gold); border-color: var(--gold); }
.audio-panel {
  position: absolute; right: 0; bottom: 42px;
  display: none; flex-direction: column; gap: 4px;
  padding: 9px 11px;
  background: var(--glass-2);
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 8px 26px rgba(0,0,0,.6);
}
.audio-dock.open .audio-panel { display: flex; }
.audio-panel label {
  display: flex; align-items: center; gap: 7px;
  font-size: 10px; letter-spacing: .18em; color: rgba(255,255,255,.82);
}
.audio-panel input { width: 84px; height: 3px; accent-color: var(--crimson); }
.audio-panel i { font-family: var(--f-num); font-style: normal; width: 22px; text-align: right; }

/* ============================== 全屏界面 ============================== */
.screen {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(30,10,40,.72), rgba(6,6,12,.95) 70%),
    linear-gradient(160deg, #06060c, #12040c 60%, #06060c);
  animation: screenIn .35s ease-out;
}
.screen.compact { z-index: 55; background: rgba(4,4,9,.82); backdrop-filter: blur(6px); }
@keyframes screenIn { from { opacity: 0; } }

/* 标题 */
.title-bg-grid {
  position: absolute; inset: 0; opacity: .12; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,31,61,.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43,134,255,.5) 1px, transparent 1px);
  background-size: 62px 62px;
  transform: perspective(420px) rotateX(62deg) translateY(14%);
  mask-image: linear-gradient(to bottom, transparent, #000 40%, transparent 96%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40%, transparent 96%);
}
.title-inner {
  position: relative; width: min(94vw, 1120px);
  text-align: center; padding: 22px;
}
.title-kicker {
  font-size: 11px; letter-spacing: .72em; color: var(--crimson);
  margin-bottom: 10px; text-shadow: 0 0 20px rgba(255,31,61,.7);
}
.title-main { margin: 0; line-height: .94; }
.t-jp {
  display: block; font-family: var(--f-jp); font-weight: 700;
  font-size: clamp(46px, 8.4vw, 116px); letter-spacing: .1em; color: #fff;
  text-shadow:
    0 0 26px rgba(255,255,255,.34),
    0 0 64px rgba(176,76,255,.6),
    0 6px 0 rgba(0,0,0,.9);
}
.t-en {
  display: block; margin-top: 8px;
  font-size: clamp(9px, 1.15vw, 14px); letter-spacing: .66em;
  color: rgba(255,216,115,.85);
}
.title-vs {
  margin: 20px auto 4px; display: flex; align-items: center;
  justify-content: center; gap: clamp(12px, 3vw, 40px);
  font-family: var(--f-jp);
}
.vs-left, .vs-right {
  font-size: clamp(17px, 2.4vw, 27px); letter-spacing: .2em; color: #fff;
}
.vs-left { color: var(--cyan); text-shadow: 0 0 22px rgba(95,240,255,.8); }
.vs-right { color: var(--crimson); text-shadow: 0 0 22px rgba(255,31,61,.8); }
.vs-mark {
  font-family: var(--f-num); font-size: clamp(20px, 3vw, 34px);
  color: var(--gold); transform: skewX(-12deg);
  text-shadow: 0 0 26px rgba(255,216,115,.9);
}

.title-actions {
  margin: 26px 0 22px; display: flex; gap: 14px;
  justify-content: center; flex-wrap: wrap;
}
.btn {
  position: relative; cursor: pointer;
  padding: 13px 30px; min-width: 190px;
  font-family: var(--f-jp); font-size: 17px; letter-spacing: .22em;
  color: #fff; background: rgba(10,10,18,.86);
  border: 1px solid rgba(255,255,255,.24);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: transform .14s, box-shadow .14s, border-color .14s, background .14s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.btn .btn-sub {
  font-family: var(--f-ui); font-size: 10px; letter-spacing: .1em;
  color: rgba(255,255,255,.5);
}
.btn:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 0 26px rgba(255,216,115,.35);
}
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, rgba(120,14,32,.95), rgba(30,6,60,.95));
  border-color: rgba(255,31,61,.7);
  box-shadow: 0 0 28px rgba(255,31,61,.35);
}
.btn.primary:hover {
  border-color: var(--gold);
  box-shadow: 0 0 40px rgba(255,80,60,.5);
}

.controls-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px; text-align: left;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 16px 2px;
}
.cg-col h4 {
  margin: 0 0 6px; font-family: var(--f-jp); font-size: 12px;
  letter-spacing: .34em; color: var(--gold);
}
.cg-col p {
  margin: 2px 0; font-size: 11.5px; line-height: 1.65;
  color: rgba(232,230,223,.72);
}
.cg-col b { color: #fff; font-family: var(--f-num); font-size: 12.5px; letter-spacing: .06em; }
.cg-col em { color: var(--gold); font-style: normal; }

.title-foot {
  margin-top: 12px; font-size: 10px; letter-spacing: .24em;
  color: rgba(232,230,223,.34);
}

/* 暂停 / 结算 */
.pause-inner, .result-inner, .loading-inner, .crash-inner {
  text-align: center; padding: 30px; width: min(92vw, 620px);
}
.pause-inner h2, .result-inner h2 {
  font-family: var(--f-jp); font-size: 32px; letter-spacing: .4em;
  margin: 0 0 16px; color: #fff;
  text-shadow: 0 0 30px rgba(255,31,61,.7);
}
.pause-inner { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.pause-note { margin-top: 6px; font-size: 11px; letter-spacing: .2em; color: rgba(255,255,255,.45); }
.pause-note b, .loading-step { color: var(--gold); }

.result-mark {
  font-family: var(--f-jp); font-size: clamp(72px, 14vw, 150px); line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(255,216,115,.8), 0 0 100px rgba(255,31,61,.5);
  animation: markIn .7s cubic-bezier(.2,1.5,.3,1);
}
.result-mark.lose { color: var(--crimson); text-shadow: 0 0 40px rgba(255,31,61,.9); }
@keyframes markIn { from { transform: scale(.3) rotate(-14deg); opacity: 0; } }
.result-inner p { color: rgba(232,230,223,.72); letter-spacing: .16em; font-size: 13px; }
.result-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px;
  margin: 20px auto; max-width: 430px; font-size: 12.5px;
}
.result-stats div {
  display: flex; justify-content: space-between;
  border-bottom: 1px dashed rgba(255,255,255,.16); padding: 4px 2px;
}
.result-stats span { color: rgba(232,230,223,.6); letter-spacing: .14em; }
.result-stats b { color: #fff; font-family: var(--f-num); font-size: 15px; }
.result-actions { display: flex; gap: 12px; justify-content: center; margin-top: 8px; }

/* 载入 */
.spin {
  width: 46px; height: 46px; margin: 0 auto 18px;
  border: 2px solid rgba(255,255,255,.14);
  border-top-color: var(--crimson); border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-family: var(--f-jp); font-size: 17px; letter-spacing: .4em;
  color: #fff; margin-bottom: 8px;
}
.loading-step { font-size: 11px; letter-spacing: .24em; }

/* 引导诊断面板：把「永远转圈」变成能看懂的原因 */
.boot-diag {
  margin-top: 22px; max-width: 640px; text-align: left;
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 31, 61, .45);
  border-left: 3px solid var(--crimson);
  padding: 16px 18px; animation: screenIn .3s ease-out;
}
.boot-diag.hidden { display: none; }
.bd-title {
  font-family: var(--f-jp); font-size: 17px; letter-spacing: .18em;
  color: var(--crimson); margin-bottom: 10px;
  text-shadow: 0 0 16px rgba(255, 31, 61, .55);
}
.bd-body { font-size: 12.5px; line-height: 1.95; color: rgba(232, 230, 223, .85); }
.bd-body code {
  font-family: Consolas, "Courier New", monospace; font-size: 12px;
  background: rgba(255, 255, 255, .09); padding: 1px 6px;
  color: var(--gold); border-radius: 2px; word-break: break-all;
}
.bd-body b { color: #fff; }
.bd-body a { color: var(--cyan); }

/* 崩溃 */
.crash-inner h2 { color: var(--crimson); font-family: var(--f-jp); letter-spacing: .3em; }
#crash-msg {
  text-align: left; max-height: 42vh; overflow: auto;
  background: rgba(0,0,0,.65); border: 1px solid rgba(255,31,61,.4);
  padding: 12px; font-size: 11.5px; line-height: 1.55;
  color: #ffb3b3; white-space: pre-wrap; word-break: break-word;
}

/* ============================== 小屏 / 低分辨率适配 ============================== */
@media (max-width: 1024px) {
  .fighter-panel { width: min(38vw, 360px); }
  .ab { width: 68px; height: 68px; }
  .ab .ab-glyph { font-size: 23px; }
}

@media (max-width: 860px) {
  .top-strip { padding: 8px 10px 0; gap: 6px; }
  .fighter-panel { width: 44vw; }
  .fp-name .jp { font-size: 15px; letter-spacing: .08em; }
  .fp-name .en, .fp-side { display: none; }
  .hp-num { font-size: 17px; }
  .hp-bar { height: 12px; }
  .stat-label { display: none; }
  .timer { font-size: 24px; }
  .phase-tag, .focus-dist { font-size: 9px; padding: 1px 6px; }
  .combo b { font-size: 32px; }
  .combo { top: 60px; }
  .ability-bar { gap: 6px; bottom: 12px; }
  .ab { width: 54px; height: 54px; }
  .ab .ab-glyph { font-size: 19px; inset: 9px 5px 14px; }
  .ab .ab-name { font-size: 8px; }
  .ab .ab-key { font-size: 10px; min-width: 16px; }
  .ab .ab-cost { font-size: 10px; }
  .banner { font-size: 13px; padding: 4px 18px; }
  .banner.drama { font-size: clamp(26px, 8vw, 44px); }
  .hints { bottom: 84px; left: 10px; }
  .hint { font-size: 10px; padding: 3px 7px; }
  .audio-dock { right: 10px; bottom: 12px; }
  .clash { bottom: 13vh; width: 90vw; padding: 9px 12px 8px; }
  .clash-title { font-size: 15px; letter-spacing: .26em; }
  .clash-hint { font-size: 11.5px; letter-spacing: .1em; }
  .title-actions .btn { min-width: 150px; padding: 11px 18px; font-size: 15px; }
}

@media (max-height: 620px) {
  .controls-grid { display: none; }
  .title-vs { margin: 10px auto 0; }
  .hints { display: none; }
  .banner { top: 60px; }
}

/* --- 触屏小字的可读性补丁 -------------------------------------------------
   src/mobile.css（触屏层）给 .ab-cost 定的字号是 clamp(9px, 2.2vmin, 13px)，
   在 390x844 竖屏下 2.2vmin≈8.6px → 取 9px → 渲染高度只有 11px，
   验收口径（<12px 且含文字）会判 fail。这里把触屏档的下限抬到 13px：
   咒力消耗是"能不能放"的判断依据，不该为了省一点空间把它压到读不清。
   注：本规则只覆盖字号，其余触屏布局仍由 mobile.css 说了算。
   ------------------------------------------------------------------------ */
html.is-touch #hud #ability-bar .ab .ab-cost { font-size: clamp(13px, 2.6vmin, 15px); }
html.is-touch #hud .stat-num { font-size: 12.5px; }

/* 手机竖屏：技能栏缩小、面板更紧凑（mobile.css 会再叠一层触屏控件样式） */
@media (orientation: portrait) and (max-width: 860px) {
  .fighter-panel { width: 47vw; }
  .ab { width: 48px; height: 48px; }
  .ab .ab-glyph { font-size: 17px; }
  .enemy-compass::before { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
}
