/* 幻兽变武 · 单屏战斗 H5 */
:root {
  --orange: #FF8A3D;
  --orange-hi: #FFB35C;
  --gold: #FFD37A;
  --ink: #FFF8EE;
  --muted: rgba(255, 248, 238, 0.6);
  --line: rgba(255, 255, 255, 0.14);
  --glass: rgba(11, 18, 30, 0.62);
  --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 {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  overscroll-behavior: none;
  background: #05080e;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}

img {
  display: block;
}

[hidden] {
  display: none !important;
}

.game {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  background: #070b12;
}

/* ---------- 战场画面 ---------- */
.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0a1420;
}

.scene-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% 50%;
  transform-origin: 50% 50%;
  will-change: transform;
  pointer-events: none;
}

.scene.is-shake {
  animation: sceneShake 0.26s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(130% 78% at 50% 42%, transparent 46%, rgba(3, 7, 13, 0.34) 100%),
    linear-gradient(90deg, rgba(3, 7, 13, 0.22), transparent 22%, transparent 78%, rgba(3, 7, 13, 0.22));
}

.shade {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 4;
  pointer-events: none;
}

.shade-top {
  top: 0;
  height: calc(150px + var(--safe-t));
  background: linear-gradient(180deg, rgba(4, 8, 14, 0.95) 0%, rgba(4, 8, 14, 0.62) 46%, transparent 100%);
}

.shade-bottom {
  bottom: 0;
  height: 46%;
  background: linear-gradient(0deg, rgba(3, 6, 11, 0.94) 0%, rgba(3, 6, 11, 0.52) 34%, transparent 100%);
}

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  inset: 0;
  z-index: 20;
  padding: calc(10px + var(--safe-t)) 16px 0;
  pointer-events: none;
}

.hud-inner {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: 100%;
  margin: 0 auto;
}

.player {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100% - 128px);
  padding: 6px 12px 7px 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 23, 38, 0.86), rgba(10, 16, 27, 0.64));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32), inset 0 1px rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.player-avatar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 13px;
  box-shadow: 0 0 0 2px rgba(255, 138, 61, 0.24);
}

.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  white-space: nowrap;
}

.lv {
  padding: 2px 5px;
  border-radius: 5px;
  background: linear-gradient(180deg, #FFD37A, #FFA83D);
  color: #241405;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.5);
}

.pname {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.hp-track {
  width: 124px;
  max-width: 100%;
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.46);
}

.hp-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #4FDD87, #A2F7AE);
  box-shadow: 0 0 10px rgba(80, 230, 130, 0.5);
  transition: width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s;
}

.hp-fill.low {
  background: linear-gradient(90deg, #FF5B4A, #FFB15C);
  box-shadow: 0 0 10px rgba(255, 90, 70, 0.55);
}

.hp-num {
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.top-right {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.score-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(18, 25, 40, 0.86), rgba(10, 16, 27, 0.64));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3), inset 0 1px rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.score-pill .mp-icon {
  width: 15px;
  height: 15px;
  color: var(--gold);
  filter: drop-shadow(0 0 5px rgba(255, 190, 90, 0.55));
}

.score-pill b {
  display: inline-block;
  min-width: 10px;
  color: #FFF4DA;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  transform-origin: 50% 60%;
}

.score-pill.bump b {
  animation: scoreBump 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

.score-pill.is-long b {
  font-size: 12.5px;
  letter-spacing: 0;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(18, 25, 40, 0.86), rgba(10, 16, 27, 0.64));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3), inset 0 1px rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.1s;
}

.icon-btn:active {
  transform: scale(0.91);
}

.icon-btn .mp-icon {
  width: 18px;
  height: 18px;
  color: rgba(255, 248, 238, 0.9);
}

.wave-pill {
  position: absolute;
  top: 74px;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  background: rgba(9, 15, 26, 0.52);
  color: rgba(255, 248, 238, 0.78);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.wave-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
}

/* ---------- 敌人名牌 ---------- */
.enemy-plate {
  position: absolute;
  top: 34%;
  left: 0;
  width: 198px;
  max-width: 60%;
  padding: 8px 10px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(24, 18, 34, 0.88), rgba(15, 18, 30, 0.72));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38), inset 0 1px rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  text-align: left;
  transition: transform 0.12s, opacity 0.25s, border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.enemy-plate:focus-visible {
  outline: 2px solid rgba(255, 181, 92, 0.9);
  outline-offset: 2px;
}

.enemy-plate:active {
  transform: scale(0.975);
}

.enemy-plate.is-charging {
  border-color: rgba(255, 90, 70, 0.72);
  box-shadow: 0 0 0 1px rgba(255, 90, 70, 0.32), 0 0 26px rgba(255, 60, 50, 0.34);
  animation: chargePulse 0.46s ease-in-out infinite alternate;
}

.enemy-plate.is-dead {
  opacity: 0.32;
  transform: scale(0.96);
  filter: grayscale(0.4);
}

.enemy-plate.spawn {
  animation: plateSpawn 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

.enemy-head {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
}

.enemy-elem {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(100, 225, 255, 0.38);
  border-radius: 50%;
  background: rgba(80, 200, 255, 0.14);
}

.enemy-elem .mp-icon {
  width: 12px;
  height: 12px;
  color: #7EEBFF;
}

.enemy-name {
  overflow: hidden;
  color: #FFF2E2;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
}

.enemy-lv {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 138, 61, 0.16);
  color: #FFCE8A;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.enemy-hpnum {
  overflow: hidden;
  margin-left: auto;
  color: rgba(255, 248, 238, 0.55);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
}

.enemy-hpnum::before {
  content: "HP ";
  color: rgba(255, 248, 238, 0.32);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.enemy-track {
  height: 7px;
  margin-top: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.5);
}

.enemy-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #FF4848, #FF9A3D);
  box-shadow: 0 0 10px rgba(255, 80, 60, 0.5);
  transition: width 0.18s ease-out;
}

.enemy-hint {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.enemy-hint .mp-icon {
  width: 11px;
  height: 11px;
  color: var(--orange-hi);
}

/* ---------- 连击 ---------- */
.combo {
  position: absolute;
  top: 31%;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  opacity: 0;
  transform: translateX(-8px) scale(0.92);
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.55));
}

.combo.is-on {
  opacity: 1;
  transform: none;
}

.combo-line {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.combo-num {
  color: #FFF4D9;
  font-size: 36px;
  font-style: italic;
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: -0.05em;
  text-shadow: 0 2px 0 rgba(90, 40, 0, 0.7), 0 0 18px rgba(255, 155, 60, 0.65);
  font-variant-numeric: tabular-nums;
}

.combo-word {
  color: #FFC46B;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.combo-mult {
  align-self: flex-start;
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 138, 61, 0.16);
  color: #FFCE8A;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.combo.bump .combo-num {
  animation: comboBump 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

/* ---------- 点敌人攻击的热区 ---------- */
.enemy-zone {
  position: absolute;
  z-index: 18;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

/* ---------- 飘字与打击特效 ---------- */
.fx {
  position: absolute;
  inset: 0;
  z-index: 42;
  overflow: hidden;
  pointer-events: none;
}

.dmg {
  position: absolute;
  color: #FFE0A3;
  font-family: "DIN Alternate", "Arial Black", -apple-system, sans-serif;
  font-size: 28px;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 0 #6E3300, 0 0 16px rgba(255, 170, 60, 0.85);
  animation: floatUp 0.9s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
  white-space: nowrap;
}

.dmg.crit {
  color: #FFF9EA;
  font-size: 38px;
  text-shadow: 0 2px 0 #8E2C00, 0 0 22px rgba(255, 120, 40, 0.95), 0 0 40px rgba(255, 80, 30, 0.55);
}

.dmg.player {
  color: #FF9A8A;
  font-size: 22px;
  text-shadow: 0 2px 0 #4A0900, 0 0 14px rgba(255, 80, 70, 0.8);
}

.spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c, #FFC46B);
  box-shadow: 0 0 10px var(--c, #FFC46B);
  animation: sparkFly 0.52s ease-out forwards;
}

.impact {
  position: absolute;
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 220, 160, 0.6), rgba(255, 140, 60, 0) 66%);
  animation: impactPop 0.4s ease-out forwards;
}

.ko {
  position: absolute;
  margin: -10px 0 0 -50px;
  color: #FFE7B8;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-shadow: 0 2px 0 #6A2A00, 0 0 22px #FF8A3D, 0 0 54px rgba(255, 138, 61, 0.7);
  animation: koPop 0.95s ease-out forwards;
  white-space: nowrap;
}

.danger {
  position: absolute;
  inset: 0;
  z-index: 41;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 50%, transparent 46%, rgba(255, 40, 30, 0.32) 100%),
    linear-gradient(180deg, rgba(255, 40, 30, 0.3), transparent 30%);
}

.morph {
  position: absolute;
  inset: 0;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 46% at 50% 92%, var(--morph, #FF8A3D) 0%, transparent 72%),
    radial-gradient(46% 26% at 50% 96%, rgba(255, 255, 255, 0.55), transparent 100%);
  mix-blend-mode: screen;
}

.morph.is-on {
  animation: morphWash 0.5s ease-out;
}

.danger.is-on {
  animation: dangerFlash 0.42s ease-out;
}

.toast {
  position: absolute;
  top: 23%;
  left: 50%;
  z-index: 45;
  max-width: 86%;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(10, 15, 25, 0.76);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px rgba(255, 255, 255, 0.12);
  color: #FFF1DA;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -6px);
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 底部变形坞 ---------- */
.dock {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  padding: 0 14px calc(10px + var(--safe-b));
  pointer-events: none;
}

.dock-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 9px 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(24, 31, 46, 0.9), rgba(8, 12, 20, 0.95));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45), inset 0 1px rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: auto;
}

.dock-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 8px;
}

.beast {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.beast-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border: 1.5px solid rgba(126, 235, 255, 0.75);
  border-radius: 50%;
  background: #0b2030;
  box-shadow: 0 0 0 2px rgba(126, 235, 255, 0.12), 0 0 12px rgba(90, 220, 255, 0.35);
}

.beast-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.beast-avatar::after {
  content: "";
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 6px;
  height: 6px;
  border: 1px solid #0a1a22;
  border-radius: 50%;
  background: #71F2C4;
}

.beast-avatar.is-morph {
  animation: morphPop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

.beast-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.beast-name {
  color: #FFF3E3;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.beast-state {
  color: rgba(126, 235, 255, 0.82);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.dock-tip {
  flex: 0 0 auto;
  color: rgba(255, 248, 238, 0.42);
  font-size: 9px;
  line-height: 1.45;
  text-align: right;
  letter-spacing: 0.06em;
}

.dock-main {
  display: flex;
  align-items: center;
  gap: 9px;
}

.weapons {
  display: flex;
  flex: 1;
  gap: 7px;
  min-width: 0;
}

.weapon {
  --w: #FF9A46;
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  transition: transform 0.12s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.weapon:active {
  transform: scale(0.95);
}

.w-glyph {
  color: rgba(255, 248, 238, 0.82);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.w-name {
  overflow: hidden;
  max-width: 100%;
  color: rgba(255, 248, 238, 0.48);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weapon[data-weapon="bow"] {
  --w: #63E4FF;
}

.weapon[data-weapon="staff"] {
  --w: #C49BFF;
}

.weapon.is-on {
  border-color: rgba(255, 170, 90, 0.74);
  background: linear-gradient(180deg, rgba(255, 150, 70, 0.27), rgba(255, 255, 255, 0.03));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 0 16px rgba(255, 150, 70, 0.14);
}

.weapon[data-weapon="bow"].is-on {
  border-color: rgba(99, 228, 255, 0.7);
  background: linear-gradient(180deg, rgba(70, 200, 255, 0.23), rgba(255, 255, 255, 0.03));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 0 16px rgba(70, 200, 255, 0.14);
}

.weapon[data-weapon="staff"].is-on {
  border-color: rgba(196, 155, 255, 0.72);
  background: linear-gradient(180deg, rgba(170, 120, 255, 0.22), rgba(255, 255, 255, 0.03));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 0 16px rgba(170, 120, 255, 0.14);
}

.weapon.is-on .w-glyph {
  color: #FFF9EC;
  text-shadow: 0 0 14px var(--w), 0 2px 4px rgba(0, 0, 0, 0.4);
}

.weapon.is-on .w-name {
  color: #FFE7C6;
}

.weapon.is-on::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--w);
  box-shadow: 0 0 8px var(--w);
  transform: translateX(-50%);
}

.attack {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 2px solid rgba(255, 236, 204, 0.9);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #FFD08A 0%, #FF9A4B 38%, #F2651F 72%, #B83C08 100%);
  box-shadow: 0 10px 26px rgba(255, 95, 25, 0.42), 0 0 0 5px rgba(255, 138, 61, 0.14),
    inset 0 3px 8px rgba(255, 255, 255, 0.5), inset 0 -6px 14px rgba(120, 35, 0, 0.4);
  transition: transform 0.1s, filter 0.1s;
}

.attack::before {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px dashed var(--accent, rgba(255, 196, 120, 0.42));
  border-radius: 50%;
  opacity: 0.55;
  animation: attackRing 12s linear infinite;
  pointer-events: none;
}

.attack:active,
.attack.is-firing {
  filter: brightness(1.08);
  transform: scale(0.92);
}

.attack-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  color: #FFF9EE;
  text-shadow: 0 2px 4px rgba(120, 40, 0, 0.5);
}

.attack-core .mp-icon {
  width: 19px;
  height: 19px;
  filter: drop-shadow(0 1px 2px rgba(90, 30, 0, 0.5));
}

.attack-core b {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.attack-cd {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(rgba(4, 8, 14, 0.5) calc(var(--p, 0) * 1turn), rgba(0, 0, 0, 0) 0);
  pointer-events: none;
}

/* ---------- 弹层 ---------- */
.sheet {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(3, 7, 13, 0.58);
  backdrop-filter: blur(13px) saturate(0.85);
  -webkit-backdrop-filter: blur(13px) saturate(0.85);
}

.sheet-card {
  width: min(88vw, 340px);
  padding: 22px 20px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(31, 37, 53, 0.98), rgba(11, 16, 27, 0.98));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55), inset 0 1px rgba(255, 255, 255, 0.16);
  animation: sheetIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.12) both;
}

.sheet-kicker {
  color: var(--orange-hi);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.32em;
}

.sheet-card h2 {
  margin: 7px 0 0;
  color: #FFF7EA;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.sheet-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.sheet-stats {
  display: flex;
  gap: 8px;
  margin: 16px 0 10px;
}

.stat {
  flex: 1;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
}

.stat span {
  display: block;
  color: rgba(255, 248, 238, 0.48);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.stat b {
  display: block;
  margin-top: 3px;
  color: #FFF1D8;
  font-size: 20px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 46px;
  margin-top: 8px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: transform 0.1s, filter 0.15s;
}

.btn:active {
  transform: scale(0.97);
}

.btn .mp-icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: linear-gradient(180deg, #FFB35C, #FF7A2A);
  color: #2A1502;
  box-shadow: 0 8px 22px rgba(255, 110, 30, 0.35), inset 0 1px rgba(255, 255, 255, 0.5);
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 248, 238, 0.8);
}

.sheet-card--over {
  text-align: center;
}

.sheet-card--over .sheet-kicker {
  color: rgba(255, 196, 120, 0.9);
}

.over-score {
  margin: 10px 0 0;
  color: #FFE9B8;
  font-size: clamp(38px, 13vw, 52px);
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow: 0 3px 0 rgba(105, 45, 0, 0.55), 0 0 30px rgba(255, 160, 60, 0.35);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.over-label {
  margin-top: 2px;
  color: rgba(255, 248, 238, 0.45);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.over-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 10px;
  color: rgba(255, 248, 238, 0.62);
  font-size: 10.5px;
}

.over-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.over-meta b {
  color: #FFE0A6;
  font-weight: 800;
}

.over-meta .mp-icon {
  width: 13px;
  height: 13px;
  color: var(--gold);
}

.over-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.over-tip {
  margin: 12px 0 0;
  color: rgba(255, 248, 238, 0.35);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

/* ---------- 动画 ---------- */
@keyframes sceneShake {
  0%, 100% { transform: translate(0, 0); }
  18% { transform: translate(-3px, 2px); }
  36% { transform: translate(3px, -2px); }
  54% { transform: translate(-2px, -1px); }
  72% { transform: translate(2px, 1px); }
  88% { transform: translate(-1px, 0); }
}

@keyframes chargePulse {
  from { opacity: 0.78; }
  to { opacity: 1; }
}

@keyframes comboBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

@keyframes scoreBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.2); color: #FFE7B0; }
  100% { transform: scale(1); }
}

@keyframes plateSpawn {
  0% { opacity: 0.35; transform: scale(0.9); }
  60% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.6); }
  16% { opacity: 1; transform: translate(-50%, 0) scale(1.14); }
  34% { transform: translate(-50%, -12px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, var(--rise, -72px)) scale(0.9); }
}

@keyframes sparkFly {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(0.2); }
}

@keyframes impactPop {
  0% { opacity: 0; transform: scale(0.3); }
  30% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.5); }
}

@keyframes koPop {
  0% { opacity: 0; transform: scale(0.6); }
  20% { opacity: 1; transform: scale(1.08); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: translateY(-16px) scale(1.02); }
}

@keyframes dangerFlash {
  0% { opacity: 0; }
  22% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes morphWash {
  0% { opacity: 0; }
  18% { opacity: 0.5; }
  100% { opacity: 0; }
}

@keyframes morphPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.22) rotate(-4deg); }
  100% { transform: scale(1); }
}

@keyframes attackRing {
  to { transform: rotate(360deg); }
}

@keyframes sheetIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* ---------- 适配 ---------- */
@media (max-height: 720px) {
  .player-avatar { width: 40px; height: 40px; border-radius: 12px; }
  .hp-track { width: 112px; }
  .wave-pill { top: 68px; }
  .dock-card { padding: 8px 8px 9px; }
  .weapon { height: 52px; }
  .attack { width: 68px; height: 68px; }
  .combo-num { font-size: 32px; }
}

@media (max-width: 370px) {
  .hud { padding-right: 12px; padding-left: 12px; }
  .player { gap: 7px; padding-right: 9px; }
  .hp-track { width: 96px; }
  .pname { font-size: 12px; }
  .score-pill { padding: 0 9px; }
  .score-pill b { font-size: 14px; }
  .dock { padding-right: 11px; padding-left: 11px; }
  .dock-tip { display: none; }
  .dock-main { gap: 7px; }
  .weapons { gap: 6px; }
  .w-name { font-size: 8.5px; }
  .attack { width: 68px; height: 68px; }
  .enemy-plate { width: 186px; padding-right: 8px; padding-left: 8px; }
}

@media (max-height: 580px) {
  .hud { padding-top: calc(7px + var(--safe-t)); }
  .player-avatar { width: 36px; height: 36px; }
  .player { padding: 4px 10px 5px 4px; }
  .hp-track { height: 7px; }
  .hp-num { display: none; }
  .wave-pill { top: 62px; height: 22px; }
  .dock-tip { display: none; }
  .dock-top { padding-bottom: 6px; }
  .beast-avatar { width: 26px; height: 26px; }
  .weapon { height: 48px; }
  .attack { width: 62px; height: 62px; }
  .attack::before { inset: -5px; }
  .attack-core b { font-size: 11px; }
  .combo { top: 32%; }
}

@media (orientation: landscape) {
  .dock { padding-right: 18px; padding-bottom: calc(9px + var(--safe-b)); padding-left: 18px; }
  .dock-card { max-width: 620px; }
  .hud { padding-right: 20px; padding-left: 20px; }
  .hud-inner { max-width: 680px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
