/* Top HUD: unit bars, phase banner, attack pattern, centre prompt */
/* ---------- HUD 上方 ---------- */
.hud-top { position: absolute; left: 0; right: 0; top: 0; padding: 22px 28px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 24px; }
.unit { display: flex; flex-direction: column; gap: 8px; width: 420px; }
.unit.enemy { justify-self: end; align-items: flex-end; }
.unit .name { display: flex; align-items: baseline; gap: 10px; }
.unit .name b { font-size: 22px; font-weight: 900; letter-spacing: .06em; }
.unit .name span { color: var(--muted); font-size: 12px; letter-spacing: .1em; }
.bar { position: relative; height: 16px; width: 100%; background: rgba(0,0,0,.5); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; transition: width .5s; }
.bar.hp i { background: linear-gradient(180deg, #7FE7A8, #3DBF74); }
.unit.enemy .bar.hp i { background: linear-gradient(180deg, #FF7B7F, var(--crimson)); margin-left: auto; }
.bar.poise { height: 10px; }
.bar.poise i { background: linear-gradient(180deg, #C9B6FF, var(--violet)); margin-left: auto; }
.stat { display: flex; justify-content: space-between; width: 100%; font-family: var(--hud); font-size: 15px; font-weight: 600; letter-spacing: .08em; color: var(--muted); font-variant-numeric: tabular-nums; }
.stat b { color: var(--text); }
.unit.enemy .stat { flex-direction: row-reverse; }
.countdown { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.countdown .num { font-family: var(--hud); font-size: 30px; font-weight: 700; color: var(--crimson); line-height: 1; }
.countdown .lbl { font-size: 12px; color: var(--muted); letter-spacing: .1em; }

.phase { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 360px; }
.phase .who { font-family: var(--hud); font-size: 13px; font-weight: 700; letter-spacing: .3em; color: var(--muted); }
.phase .main { font-size: 34px; font-weight: 900; letter-spacing: .18em; line-height: 1; padding-left: .18em; }
.phase .pill { font-size: 12px; letter-spacing: .14em; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.stage.is-timestop .phase .pill { color: var(--cyan); border-color: var(--cyan); background: var(--cyan-dim); }
.stage.is-timestop .phase .main { color: var(--cyan); text-shadow: 0 0 22px rgba(95,227,255,.45); }
.stage.is-slowmo .phase .pill { color: var(--violet); border-color: var(--violet); background: var(--violet-dim); }
.stage.is-slowmo .phase .main { color: var(--violet); }
.stage.is-knockback .phase .main { color: var(--brass); }

/* 攻擊 pattern 時間軸 */
.pattern { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: 8px; }
.stage.show-pattern .pattern { display: flex; }
.pattern .lbl { font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.pattern .row { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.pattern .hit { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--crimson); background: transparent; }
.pattern .hit.done { background: var(--crimson); opacity: .45; }
.pattern .hit.now { background: var(--crimson); box-shadow: 0 0 14px var(--crimson); animation: blink .5s steps(2) infinite; }
.stage.is-slowmo .pattern .hit.now { animation: none; }
.pattern .gap { width: 42px; height: 18px; border: 2px dashed var(--violet); border-radius: 3px; margin: 0 6px; position: relative; }
.pattern .gap.now { background: var(--violet-dim); box-shadow: 0 0 14px var(--violet); }
.pattern .gap::after { content: "空窗"; white-space: nowrap; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 5px; font-size: 10px; color: var(--violet); letter-spacing: .1em; }
.pattern .sep { width: 10px; }
.pattern .ms { font-family: var(--hud); font-size: 12px; color: var(--muted); letter-spacing: .1em; margin-left: 8px; }
@keyframes blink { 50% { opacity: .35 } }

/* 中央提示 */
.prompt { position: absolute; left: 50%; top: 300px; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.prompt.show { display: flex; }
.prompt .big { font-size: 30px; font-weight: 900; letter-spacing: .14em; }
.prompt .key { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px; border: 2px solid var(--text); border-radius: 6px; font-family: var(--hud); font-weight: 700; font-size: 18px; letter-spacing: .12em; background: rgba(0,0,0,.45); }
.prompt .key .space { display: inline-block; width: 120px; height: 12px; border: 2px solid currentColor; border-top: 0; border-radius: 0 0 4px 4px; }
.prompt .note { font-size: 13px; color: var(--muted); letter-spacing: .06em; }
.prompt .ring { width: 92px; height: 92px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); position: relative; display: grid; place-items: center; font-family: var(--hud); font-weight: 700; font-size: 16px; }
.prompt .ring::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid var(--text); border-color: var(--text) transparent transparent transparent; animation: spin 1s linear infinite; }
.prompt .ring b { color: var(--green); }
@keyframes spin { to { transform: rotate(360deg) } }
.prompt .timer { width: 420px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.prompt .timer i { display: block; height: 100%; background: var(--violet); animation: drain 3s linear infinite; }
@keyframes drain { from { width: 100% } to { width: 0 } }
.prompt.gapmode .big { color: var(--violet); }
.prompt.kb .big { color: var(--brass); font-size: 44px; text-shadow: 0 0 24px rgba(230,176,75,.5); }
