﻿/* 冲击帧：命中瞬间整屏反色（漫画打击感） */
#app.impact-inv {
  filter: invert(1) contrast(1.6) saturate(0);
}

/* 结构与 HUD —— 竖屏上下分屏，漫画分镜框 */
:root {
  --ink: #141414;
  --paper: #f3ead8;
  --paper-2: #e6d9bf;
  --red: #e63946;
  --yellow: #ffd166;
  --blue: #4cc9f0;
  --pink: #ff4d6d;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0d0c0b;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  overscroll-behavior: none;
}

body {
  display: flex;
  justify-content: center;
}

#app {
  position: relative;
  /* 安卓 Edge 老版本不认 dvh，先给 vh 兜底 */
  width: min(100vw, 56.25vh);
  width: min(100vw, 56.25dvh);
  height: 100vh;
  height: 100dvh;
  background: #000;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}

#stage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 46fr) minmax(0, 8fr) minmax(0, 46fr);
  will-change: transform;
}

.half {
  position: relative;
  overflow: hidden;
}

.half canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 对手半边：纸面 + 网点 */
.half.foe {
  background:
    radial-gradient(120% 80% at 50% 40%, rgba(255, 255, 255, 0.5), transparent 70%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.02) 0 3px, transparent 3px 6px),
    var(--paper);
  border-bottom: 4px solid var(--ink);
}

#selfHalf {
  background: #000;
  border-top: 4px solid var(--ink);
}

#cam {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  background: #111;
}

#app.nocam #cam {
  display: none;
}

#app.nocam #selfHalf {
  background: repeating-linear-gradient(45deg, #17171a 0 14px, #1f1f24 14px 28px);
}

#app.nocam #selfHalf::before {
  content: "无摄像头 · 键盘模拟";
  position: absolute;
  left: 0;
  right: 0;
  top: 46%;
  text-align: center;
  color: #6b6b73;
  font-weight: 900;
  letter-spacing: 0.14em;
  font-size: 12px;
}

/* ---------------- HUD ---------------- */

.hud {
  position: absolute;
  left: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 4;
  pointer-events: none;
}

.foe-hud {
  top: calc(6px + var(--safe-t));
}

.self-hud {
  bottom: calc(12px + var(--safe-b));
  gap: 4px;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.self-hud .name-row {
  justify-content: flex-end;
}

.name-row .name {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.self-hud .name-row .name {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
  color: #fff;
}

.tag {
  font-size: 9px;
  font-weight: 900;
  padding: 1px 5px;
  border: 2px solid var(--ink);
  background: var(--yellow);
  line-height: 1.2;
}

.tag.you {
  background: var(--blue);
}

.pips {
  display: inline-flex;
  gap: 3px;
  margin-left: auto;
}

.self-hud .pips {
  margin-left: 0;
  margin-right: auto;
}

.pip {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: transparent;
  display: inline-block;
}

.pip.on {
  background: var(--red);
}

.self-hud .pip {
  border-color: #fff;
}

.hpbar {
  position: relative;
  height: 22px;
  border: 3px solid var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden;
}

.hpbar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: linear-gradient(90deg, #ffd166, #ff9f1c 55%, #ff5d5d);
}

.hpbar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 10%, rgba(0, 0, 0, 0.09) 10% 10.6%);
}

.hpbar b {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid var(--ink);
  padding: 0 4px;
  line-height: 1.15;
  z-index: 2;
}

.self-hud .hpbar {
  box-shadow: 3px -3px 0 var(--ink);
  border-color: #fff;
}

.stbar {
  position: relative;
  height: 6px;
  margin: 0 3px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid #111;
  border-radius: 3px;
  overflow: hidden;
}

.stbar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #4cc9f0, #90e0ef);
  transition: width 0.1s linear;
}

.stbar.low i {
  background: linear-gradient(90deg, #ff9f1c, #ff4d6d);
}

.self-hud .hpbar b {
  border-color: var(--ink);
}

/* ---------------- 中间信息条 ---------------- */

#midbar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  background: var(--ink);
  color: var(--paper);
  z-index: 5;
}

.mid-core {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: var(--paper);
  color: var(--ink);
  border-left: 3px solid var(--ink);
  border-right: 3px solid var(--ink);
  position: relative;
  z-index: 2;
}

#roundLabel {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  opacity: 0.7;
  writing-mode: vertical-rl;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}

#timer {
  font-size: clamp(26px, 5.2vh, 38px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1;
  transform: skew(-6deg);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

#timer.urgent {
  color: var(--red);
  animation: urgent 0.8s infinite alternate;
}

.meter {
  position: relative;
  overflow: hidden;
  background: repeating-linear-gradient(90deg, #232323 0 7px, #191919 7px 14px);
}

.meter i {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: 0%;
  background: linear-gradient(90deg, #4cc9f0, #90e0ef);
  box-shadow: 0 0 10px rgba(76, 201, 240, 0.6);
}

.meter.foe i {
  left: auto;
  right: 3px;
  background: linear-gradient(90deg, #ff9e00, #ff4d6d);
  box-shadow: 0 0 10px rgba(255, 77, 109, 0.6);
}

.meter.full i {
  animation: meterPulse 0.5s infinite alternate;
}

.meter::after {
  content: "气";
  position: absolute;
  font-size: 8px;
  font-weight: 900;
  opacity: 0.35;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
}

.meter.foe::after {
  right: auto;
  left: 3px;
}

/* ---------------- 必杀进度 ---------------- */

.super-hint {
  position: absolute;
  left: 50%;
  bottom: calc(104px + var(--safe-b));
  transform: translateX(-50%) translateY(6px);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: rgba(10, 10, 10, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
  z-index: 6;
  white-space: nowrap;
}

.super-hint.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sh-label {
  color: var(--yellow);
  letter-spacing: 0.12em;
}

.sh-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
}

.sh-dot.on {
  background: var(--yellow);
  border-color: var(--yellow);
  box-shadow: 0 0 7px var(--yellow);
}

.sh-ready {
  color: var(--yellow);
  font-size: 9px;
  margin-left: 2px;
  animation: pulse 0.7s infinite alternate;
}

.sh-seq {
  color: #fff;
  font-size: 9px;
  letter-spacing: 0.02em;
  margin-left: 2px;
}

.sh-need {
  color: #ff9f1c;
  font-size: 9px;
  margin-left: 2px;
}

.super-hint.pop {
  animation: superPop 0.36s ease-out;
}

@keyframes superPop {
  0% {
    transform: translateX(-50%) scale(1);
  }
  40% {
    transform: translateX(-50%) scale(1.2);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

@keyframes pulse {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}

/* ---------------- 动作指示灯 ---------------- */.actions {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: calc(64px + var(--safe-b));
  display: flex;
  gap: 3px;
  z-index: 5;
  pointer-events: none;
}

.action-light {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  border-radius: 5px;
  padding: 2px 1px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  overflow: hidden;
  transition: transform 0.08s, background 0.12s;
}

.ai-icon {
  font-size: 12px;
  line-height: 1.05;
  font-weight: 900;
}

.ai-name {
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
  transform: scale(0.92);
  letter-spacing: -0.03em;
}

.ai-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: var(--s, 0%);
  background: var(--blue);
  transition: width 0.06s linear;
}

.action-light.armed {
  background: var(--yellow);
  transform: translateY(-2px);
}

.action-light.fired {
  animation: firePop 0.32s ease-out;
  background: #fff;
}

.action-light.cool {
  opacity: 0.42;
}

/* ---------------- 播报 ---------------- */

.callout {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%) scale(0.7) rotate(-3deg);
  opacity: 0;
  pointer-events: none;
  background: #fff;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 5px 12px;
  font-weight: 900;
  font-size: 14px;
  white-space: nowrap;
  border-radius: 12px;
  transition: opacity 0.12s, transform 0.14s cubic-bezier(0.2, 1.6, 0.4, 1);
  z-index: 6;
}

.callout::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 13px;
  height: 13px;
  background: inherit;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: translateX(-50%) rotate(45deg);
}

.callout.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(-3deg);
}

.callout.combo {
  background: var(--yellow);
  font-size: 16px;
}

.callout.guard {
  background: var(--blue);
}

.callout.warn {
  background: var(--red);
  color: #fff;
}

#comboBadge {
  position: absolute;
  right: 10px;
  top: 24%;
  font-size: clamp(28px, 5vh, 44px);
  font-weight: 900;
  font-style: italic;
  color: var(--yellow);
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  transform: rotate(-7deg) scale(0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 7;
  white-space: nowrap;
}

#comboBadge.show {
  animation: comboPop 0.6s cubic-bezier(0.2, 1.7, 0.4, 1) forwards;
}

.big-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-4deg) scale(0.5);
  opacity: 0;
  font-size: clamp(46px, 11vh, 92px);
  font-weight: 900;
  font-style: italic;
  color: var(--yellow);
  -webkit-text-stroke: 7px var(--ink);
  paint-order: stroke fill;
  letter-spacing: -0.02em;
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
  transition: opacity 0.14s, transform 0.16s cubic-bezier(0.2, 1.7, 0.4, 1);
  text-shadow: 7px 7px 0 rgba(0, 0, 0, 0.18);
}

.big-text.show {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(-4deg) scale(1);
}

.big-text.count {
  color: #fff;
}

.big-text.fight {
  color: var(--red);
}

.big-text.ko {
  color: var(--red);
  animation: koStamp 0.4s ease-out;
}

.big-text.super {
  color: var(--yellow);
  font-size: clamp(38px, 9vh, 78px);
}

.big-text.combo {
  font-size: clamp(32px, 7vh, 58px);
  color: #fff;
}

.big-text.clash {
  color: var(--blue);
}

#flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 25;
}

#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  opacity: 0;
  box-shadow: inset 0 0 90px 24px rgba(230, 57, 70, 0.85);
}

#vignette.on {
  animation: hurtFlash 0.5s ease-out;
}

.cam-hint {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  font-size: 9.5px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.42);
  padding: 3px 9px;
  border-radius: 10px;
  white-space: nowrap;
  z-index: 3;
  opacity: 0.85;
}

/* ---------------- 弹层 ---------------- */

.screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 18px;
  overflow: auto;
  background: var(--paper);
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.13) 1.2px, transparent 1.4px);
  background-size: 8px 8px;
}

.screen.show {
  display: grid;
}

.card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  padding: 20px 18px;
}

.kicker {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.2em;
  opacity: 0.65;
}

.title {
  margin: 4px 0 8px;
  font-size: clamp(42px, 13vw, 62px);
  line-height: 0.92;
  font-weight: 900;
  letter-spacing: -0.04em;
  transform: skew(-6deg);
  text-shadow: 5px 5px 0 var(--yellow);
}

.title b {
  color: var(--red);
}

.sub {
  font-size: 12.5px;
  line-height: 1.6;
  font-weight: 600;
  margin: 0 0 12px;
}

.rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 700;
}

.rules li {
  border: 2px solid var(--ink);
  padding: 4px 6px;
  background: #fff;
}

.rules b {
  font-size: 16px;
  color: var(--red);
  margin-right: 2px;
}

.btn {
  font-family: inherit;
  font-weight: 900;
  font-size: 16px;
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 11px 16px;
  cursor: pointer;
  transform: rotate(-1deg);
  transition: transform 0.07s, box-shadow 0.07s;
}

.btn:active {
  transform: translate(3px, 3px) rotate(-1deg);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn.big {
  width: 100%;
  font-size: 21px;
  padding: 13px;
  letter-spacing: 0.04em;
}

.btn.ghost {
  background: transparent;
  box-shadow: none;
  border-style: dashed;
  font-size: 12px;
  padding: 8px 12px;
  margin-top: 12px;
}

.privacy,
.tips {
  font-size: 10px;
  line-height: 1.55;
  opacity: 0.62;
  margin: 10px 0 0;
}

.tips code {
  background: rgba(0, 0, 0, 0.08);
  padding: 0 3px;
  border-radius: 3px;
  font-size: 9.5px;
}

.boot-bar {
  height: 14px;
  border: 3px solid var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden;
  margin: 12px 0 8px;
}

.boot-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--red);
  transition: width 0.25s;
}

.loading-card {
  text-align: center;
}

.loading-card h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 900;
}

#bootNote {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.75;
  min-height: 16px;
  margin: 0;
}

.cal-card {
  text-align: center;
}

.cal-card h2 {
  font-size: 20px;
  margin: 6px 0 2px;
  font-weight: 900;
}

.cal-hint {
  font-size: 12.5px;
  font-weight: 700;
  min-height: 36px;
  margin: 4px 0;
}

.cal-count {
  font-size: 54px;
  font-weight: 900;
  color: var(--red);
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  font-style: italic;
  line-height: 1.1;
}

.cal-status {
  font-size: 11px;
  font-weight: 800;
  opacity: 0.75;
  margin: 6px 0 0;
}

.result-card {
  text-align: center;
}

.err-title {
  margin: 6px 0 4px;
  font-size: 22px;
  font-weight: 900;
  color: var(--red);
}

.err-msg {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  margin: 0 0 10px;
}

.help-list {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 11px;
  line-height: 1.7;
  font-weight: 600;
  opacity: 0.8;
}

.help-list b {
  color: var(--red);
}

.diag {
  margin: 0 0 8px;
  padding: 8px;
  max-height: 168px;
  overflow: auto;
  background: #101010;
  color: #9fe870;
  border: 2px solid var(--ink);
  font: 9.5px/1.55 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: text;
  -webkit-user-select: text;
}

.diag-btns {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.btn.small {
  flex: 1;
  font-size: 12px;
  padding: 7px 8px;
  box-shadow: 3px 3px 0 var(--ink);
}

.btn.ghost.small {
  box-shadow: none;
  margin-top: 0;
}

.probe-out {
  margin: 0 0 8px;
  font-size: 10.5px;
  font-weight: 700;
  min-height: 14px;
  color: var(--red);
  word-break: break-all;
}

.result-title {
  font-size: clamp(34px, 10vw, 52px);
  font-weight: 900;
  font-style: italic;
  margin: 6px 0 14px;
  transform: skew(-5deg);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
}

.result-title.win {
  color: var(--yellow);
}

.result-title.lose {
  color: #c9c2b4;
}

.result-title.draw {
  color: var(--blue);
}

#resultStats {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

#resultStats li {
  display: flex;
  justify-content: space-between;
  padding: 6px 2px;
  border-bottom: 2px dashed rgba(0, 0, 0, 0.22);
}

#resultStats b {
  opacity: 0.7;
  font-weight: 700;
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-row .btn.ghost {
  margin-top: 2px;
}

#toast {
  position: absolute;
  left: 50%;
  top: calc(64px + var(--safe-t));
  transform: translateX(-50%) translateY(-8px);
  background: rgba(15, 15, 15, 0.9);
  color: #fff;
  border: 2px solid #fff;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 700;
  max-width: 88%;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 70;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 必杀过场视频：盖住整页，播完自动收起 */
.cut-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 50;
  display: none;
  background: #000;
  pointer-events: none;
}

.cut-video.show {
  display: block;
}

/* 秘技面板：达成条件后出现在底部 */
.combo-pad {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(12px);
  z-index: 30;
  width: min(344px, 90vw);
  padding: 10px 12px 12px;
  background: #14110f;
  border: 4px solid var(--ink, #111);
  box-shadow: 0 0 0 3px #f5c445, 0 10px 24px rgba(0, 0, 0, 0.45);
  color: #f5c445;
  font-family: "Arial Black", system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.combo-pad.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.cp-title {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-align: center;
  color: #ffd400;
  margin-bottom: 6px;
}

.cp-seq {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 10px;
}

.cp-seq i {
  font-style: normal;
  font-size: 12px;
  line-height: 1;
  padding: 3px 3px;
  min-width: 13px;
  text-align: center;
  color: #6b5a2a;
  border-bottom: 2px solid #3a3222;
}

.cp-seq i.on {
  color: #111;
  background: #ffd400;
  border-bottom-color: #fff;
}

.cp-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cp-dpad {
  position: relative;
  width: 108px;
  height: 108px;
  flex: 0 0 auto;
}

.cp-key {
  position: absolute;
  width: 36px;
  height: 36px;
  font-size: 14px;
  line-height: 1;
  color: #f5c445;
  background: #241d18;
  border: 2px solid #6b5a2a;
  border-radius: 4px;
  padding: 0;
}

.cp-key:active,
.cp-key.hit {
  background: #ffd400;
  color: #111;
}

.cp-up { left: 36px; top: 0; }
.cp-down { left: 36px; top: 72px; }
.cp-left { left: 0; top: 36px; }
.cp-right { left: 72px; top: 36px; }

.cp-ab {
  display: flex;
  gap: 10px;
}

.cp-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 16px;
  font-family: inherit;
  color: #111;
  border: 3px solid #111;
  padding: 0;
}

.cp-a { background: #ff4d6d; }
.cp-b { background: #4cc9f0; }

.cp-btn:active,
.cp-btn.hit {
  filter: brightness(1.4);
}

.cp-hint {
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  color: #c9b98a;
}

.cp-hint.armed {
  color: #ff4d6d;
  animation: cpBlink 0.4s steps(2) infinite;
}

@keyframes cpBlink {
  50% { opacity: 0.35; }
}

/* 美漫分镜外框：整页像一页漫画 */
#frame {
  position: absolute;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  border: 8px solid var(--ink);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22);
}

/* 打击层：盖在画框之上，胳膊能压着边框飞进来 */
#strikeTop {
  position: absolute;
  inset: 0;
  z-index: 46;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 横屏提示（手机横过来时挡住，避免分屏被压扁） */
#rotate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  background: var(--paper);
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.13) 1.2px, transparent 1.4px);
  background-size: 8px 8px;
  text-align: center;
  padding: 24px;
}

body.landscape-mobile #rotate {
  display: grid;
}

#rotate .rot-icon {
  font-size: 46px;
  transform: rotate(-90deg);
  animation: rotateHint 2.4s ease-in-out infinite;
}

#rotate h3 {
  margin: 8px 0 4px;
  font-size: 20px;
  font-weight: 900;
}

#rotate p {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.65;
}

@keyframes rotateHint {
  0%,
  100% {
    transform: rotate(-90deg);
  }
  50% {
    transform: rotate(0deg);
  }
}

/* ---------------- 调试 ---------------- */

#debugPanel {
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: 250px;
  background: rgba(8, 8, 8, 0.88);
  color: #9fe870;
  font: 10px/1.4 Consolas, "Courier New", monospace;
  padding: 6px 8px;
  border-radius: 4px;
  z-index: 60;
  display: none;
  pointer-events: none;
}

#debugPanel.visible {
  display: block;
}

.dbg-row {
  display: flex;
  gap: 5px;
  margin-bottom: 4px;
  flex-wrap: wrap;
  color: #cfcfcf;
}

.dbg-row b {
  color: #6fd3ff;
  font-weight: 600;
}

.dbg-row span {
  min-width: 34px;
}

.dbg-score {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dbg-score span {
  width: 56px;
  color: #bbb;
  white-space: nowrap;
  overflow: hidden;
}

.dbg-score i {
  flex: 1;
  height: 5px;
  background: #222;
  display: block;
}

.dbg-score i b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #4cc9f0, #ffd166);
}

.dbg-score em {
  width: 28px;
  text-align: right;
  font-style: normal;
  color: #7bd88f;
}

.dbg-log {
  margin-top: 4px;
  color: #888;
  font-size: 9px;
  border-top: 1px solid #333;
  padding-top: 3px;
}

@media (max-height: 640px) {
  .actions {
    bottom: calc(40px + var(--safe-b));
  }
  .action-light {
    padding: 1px 1px 3px;
  }
  .ai-name {
    font-size: 7px;
  }
}


