/* ============================================================
   烈焰觉醒 · 魔龙之地
   竖屏传奇战斗首页（横屏自动切换为宽屏战场布局）
   ============================================================ */

:root {
  --orange: #FF8A3D;
  --orange-hot: #FF6A1E;
  --gold: #FFD98A;
  --gold-deep: #C98934;
  --gold-line: rgba(255, 196, 112, 0.42);
  --ink: #160a04;
  --paper: #FFE9C4;
  --muted: #C9A98A;
  --panel: rgba(24, 11, 5, 0.82);
  --pad: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
}

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #070302;
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  -webkit-user-select: none;
  background:
    radial-gradient(80% 60% at 50% 8%, #2b0f05 0%, #120604 42%, #070302 100%);
}

button, input { font-family: inherit; }
button {
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}
button:focus-visible, input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
img { display: block; }
i.mp-icon { flex: none; }

[hidden] { display: none !important; }

.game {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  background: #0c0502;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.8);
}

/* ---------------- 场景 ---------------- */
.scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #120703;
}
.scene__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 53% 52%;
  transform: scale(1.045);
  filter: saturate(1.1) contrast(1.045) brightness(0.96);
  animation: sceneBreath 26s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes sceneBreath {
  from { transform: scale(1.045) translate3d(0, 0, 0); }
  to   { transform: scale(1.085) translate3d(0, -1.2%, 0); }
}
.scene__shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 44% at 50% 46%, rgba(255, 122, 40, 0.1) 0%, transparent 60%),
    linear-gradient(180deg,
      rgba(7, 3, 1, 0.94) 0%,
      rgba(9, 4, 1, 0.7) 12%,
      rgba(10, 4, 1, 0.16) 27%,
      rgba(10, 4, 1, 0) 46%,
      rgba(9, 3, 1, 0.18) 62%,
      rgba(8, 3, 1, 0.72) 78%,
      #080301 91%);
}
.scene__glow {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 92%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 130, 40, 0.2) 0%, rgba(255, 80, 10, 0.06) 42%, transparent 68%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.embers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ember {
  position: absolute;
  bottom: -10px;
  width: var(--s, 3px);
  height: var(--s, 3px);
  border-radius: 50%;
  background: radial-gradient(circle, #ffe2a2 0%, #ff9a3c 45%, rgba(255, 90, 20, 0) 72%);
  opacity: 0;
  animation: emberRise var(--d, 9s) linear var(--delay, 0s) infinite;
  filter: blur(0.2px);
}
@keyframes emberRise {
  0%   { transform: translate3d(0, 0, 0) scale(0.5); opacity: 0; }
  10%  { opacity: 0.9; }
  60%  { opacity: 0.55; }
  100% { transform: translate3d(var(--dx, 18px), -92vh, 0) scale(1.15); opacity: 0; }
}

/* 横屏时前景角色（竖屏隐藏，避免与场景主角重复） */
.hero-foreground { display: none; }

/* ---------------- 顶部玩家信息 ---------------- */
.hud {
  position: absolute;
  top: calc(var(--safe-top) + 12px);
  left: var(--pad);
  right: var(--pad);
  z-index: 6;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.hero-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  width: min(68vw, 280px);
  padding: 5px 12px 5px 5px;
  text-align: left;
  border-radius: 40px 14px 40px 40px;
  border: 1px solid rgba(255, 195, 112, 0.38);
  background:
    linear-gradient(120deg, rgba(58, 25, 10, 0.94) 0%, rgba(30, 12, 5, 0.86) 58%, rgba(19, 8, 3, 0.78) 100%);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 220, 160, 0.16),
    inset 0 0 22px rgba(255, 120, 40, 0.08);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.hero-card:active { transform: scale(0.975); filter: brightness(1.12); }

.avatar {
  position: relative;
  flex: none;
  width: 54px;
  height: 54px;
  padding: 2px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #7a3c12, #ffe0a0, #c07a2c, #ffe6b0, #7a3c12);
  box-shadow: 0 0 16px rgba(255, 138, 61, 0.36), 0 3px 10px rgba(0, 0, 0, 0.5);
}
.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 38%;
  border: 1.5px solid #2a1005;
  background: #2a1005;
}
.avatar__lv {
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  min-width: 30px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
  color: #2a1204;
  background: linear-gradient(180deg, #ffe9b4, #e8ab51);
  border: 1px solid #8b4a14;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.hero-card__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.hero-card__row { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.hero-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffe9bf;
  text-shadow: 0 1px 0 #5a2607, 0 0 12px rgba(255, 160, 60, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-realm {
  flex: none;
  font-size: 9px;
  line-height: 1.5;
  padding: 0 5px;
  border-radius: 4px;
  color: #ffd18a;
  border: 1px solid rgba(255, 178, 86, 0.38);
  background: rgba(102, 42, 10, 0.42);
  letter-spacing: 0.05em;
  transform: translateY(-1px);
}
.hero-card__row--sub { gap: 5px; }
.power-label {
  font-size: 9px;
  color: #c99a6c;
  letter-spacing: 0.08em;
}
.power-num {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff4c9 0%, #ffd173 48%, #ff9b32 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 1px rgba(80, 20, 0, 0.8));
}
.power-up {
  font-size: 9px;
  font-weight: 700;
  color: #8ee6a0;
  text-shadow: 0 1px 2px #000;
}

.stage-box {
  flex: none;
  min-width: 76px;
  padding: 6px 8px 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 190, 106, 0.34);
  background: linear-gradient(160deg, rgba(45, 20, 8, 0.9), rgba(17, 7, 3, 0.78));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 220, 170, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: center;
}
.stage-box__name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #ffd89d;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.stage-box__name .mp-icon { width: 12px; height: 12px; color: #ffb45c; }
.stage-box__floor {
  margin-top: 2px;
  font-size: 9px;
  color: #bb8c68;
  letter-spacing: 0.12em;
}
.stage-box__floor b { color: #ffe0ab; font-size: 11px; }

/* 屏幕暗角，让 HUD 与战场分层 */
.game::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  box-shadow:
    inset 0 0 54px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 190, 105, 0.08);
}

/* ---------------- 首领血条 ---------------- */
.boss-panel {
  position: absolute;
  top: calc(var(--safe-top) + 89px);
  left: var(--pad);
  right: var(--pad);
  z-index: 6;
  padding: 6px 10px 5px;
  border-radius: 10px;
  border: 1px solid rgba(255, 186, 98, 0.28);
  background: linear-gradient(180deg, rgba(26, 11, 5, 0.84), rgba(13, 6, 2, 0.76));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 220, 170, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.boss-panel::before,
.boss-panel::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-color: rgba(255, 208, 130, 0.6);
  border-style: solid;
  pointer-events: none;
}
.boss-panel::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
  border-radius: 10px 0 0 0;
}
.boss-panel::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 1px 1px 0;
  border-radius: 0 0 10px 0;
}
.boss-panel__head {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 19px;
  line-height: 1;
}
.boss-emblem {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #2b0f03;
  background: radial-gradient(circle at 34% 30%, #ffe9b0, #e59a37 62%, #8f4712);
  box-shadow: 0 0 8px rgba(255, 140, 40, 0.45);
}
.boss-emblem .mp-icon { width: 12px; height: 12px; }
.boss-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffdca6;
  text-shadow: 0 1px 3px #000;
}
.boss-lv {
  font-size: 8px;
  font-weight: 700;
  color: #d59a62;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid rgba(213, 154, 98, 0.34);
}
.boss-hp {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: #ffb26e;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.boss-bar {
  position: relative;
  height: 11px;
  margin-top: 4px;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(180deg, #240806, #120302);
  border: 1px solid rgba(255, 157, 80, 0.32);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.75);
}
.boss-bar__fill {
  position: absolute;
  inset: 0;
  width: 100%;
  transform-origin: left center;
  border-radius: 5px;
  background:
    linear-gradient(180deg, #ffb066 0%, #ff5d22 35%, #c11d0b 70%, #7d1005 100%);
  box-shadow: 0 0 12px rgba(255, 80, 25, 0.7), inset 0 1px 0 rgba(255, 230, 190, 0.5);
  transition: width 0.2s ease-out;
}
.boss-bar__fill::after {
  content: "";
  position: absolute;
  inset: 1px 0 auto;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 240, 210, 0.62), transparent);
  opacity: 0.7;
}
.boss-bar__shine {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0) 0 17px, rgba(0, 0, 0, 0.24) 17px 18px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16), transparent 35%, transparent 65%, rgba(255, 255, 255, 0.1));
  pointer-events: none;
}
.boss-panel__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  height: 13px;
}
.objective {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: #d4ac83;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.objective .mp-icon { width: 11px; height: 11px; color: #ffb45c; }
.objective em {
  font-style: normal;
  font-weight: 800;
  color: #ffd493;
  font-variant-numeric: tabular-nums;
}
.rage {
  display: none;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #ffdf9a;
  padding: 1px 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, #a51c08, #5e0c03);
  border: 1px solid rgba(255, 158, 64, 0.65);
  animation: ragePulse 0.9s ease-in-out infinite alternate;
}
.boss-panel.is-rage { border-color: rgba(255, 112, 44, 0.6); box-shadow: 0 0 24px rgba(255, 60, 10, 0.28); }
.boss-panel.is-rage .rage { display: inline-block; }
@keyframes ragePulse {
  from { filter: brightness(0.9); }
  to { filter: brightness(1.25); box-shadow: 0 0 10px rgba(255, 100, 25, 0.7); }
}

/* 右侧角色入口 */
.side-entry {
  position: absolute;
  right: var(--pad);
  top: calc(var(--safe-top) + 166px);
  z-index: 6;
  width: 46px;
  height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 12px;
  border: 1px solid rgba(255, 190, 106, 0.34);
  background: linear-gradient(160deg, rgba(45, 20, 8, 0.9), rgba(17, 7, 3, 0.8));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 220, 170, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffca77;
}
.side-entry__face {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 213, 145, 0.7);
  box-shadow: 0 0 8px rgba(255, 140, 40, 0.4);
  background: #2a1005;
}
.side-entry__face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
}
.side-entry span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #ffe0ad;
}
.side-entry:active { transform: scale(0.94); filter: brightness(1.15); }

/* ---------------- 战场特效 ---------------- */
.field {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}
.slash {
  position: absolute;
  left: 50%;
  top: 40%;
  width: min(86vw, 390px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(-18deg) scale(0.72);
  border-radius: 50%;
  opacity: 0;
  background:
    conic-gradient(from 195deg,
      rgba(255, 172, 54, 0) 0deg,
      rgba(255, 176, 60, 0.05) 26deg,
      rgba(255, 222, 138, 0.95) 62deg,
      rgba(255, 145, 34, 0.92) 104deg,
      rgba(255, 92, 16, 0.55) 142deg,
      rgba(255, 80, 10, 0) 190deg,
      rgba(255, 80, 10, 0) 360deg);
  -webkit-mask: radial-gradient(circle, transparent 0 35%, #000 41% 51%, transparent 58%);
  mask: radial-gradient(circle, transparent 0 35%, #000 41% 51%, transparent 58%);
  filter: blur(1.5px) drop-shadow(0 0 18px rgba(255, 130, 30, 0.9));
  will-change: transform, opacity;
}
.slash span {
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  background: conic-gradient(from 225deg,
      transparent 0deg,
      rgba(255, 230, 160, 0.7) 40deg,
      rgba(255, 138, 40, 0.55) 90deg,
      transparent 130deg);
  -webkit-mask: radial-gradient(circle, transparent 0 44%, #000 50% 54%, transparent 60%);
  mask: radial-gradient(circle, transparent 0 44%, #000 50% 54%, transparent 60%);
  filter: blur(1px);
}
.slash.is-on { animation: slashArc 0.42s ease-out forwards; }
.slash.is-on span { animation: slashArcInner 0.42s ease-out forwards; }
.slash.is-fire {
  filter: blur(1.5px) drop-shadow(0 0 26px rgba(255, 95, 20, 1));
}
@keyframes slashArc {
  0%   { opacity: 0; transform: translate(-50%, -50%) rotate(-42deg) scale(0.58); }
  28%  { opacity: 1; }
  70%  { opacity: 1; transform: translate(-50%, -50%) rotate(8deg) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(22deg) scale(1.18); }
}
@keyframes slashArcInner {
  0% { opacity: 0; transform: scale(0.75); }
  35% { opacity: 0.95; }
  100% { opacity: 0; transform: scale(1.16); }
}

.storm {
  position: absolute;
  left: 50%;
  top: 41%;
  width: min(88vw, 410px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(0.7) rotate(0deg);
  border-radius: 50%;
  opacity: 0;
  background:
    conic-gradient(from 0deg,
      transparent 0deg,
      rgba(255, 206, 110, 0.55) 30deg,
      transparent 70deg,
      rgba(255, 128, 30, 0.5) 120deg,
      transparent 170deg,
      rgba(255, 220, 140, 0.45) 230deg,
      transparent 290deg);
  -webkit-mask: radial-gradient(circle, transparent 0 40%, #000 48% 53%, transparent 62%);
  mask: radial-gradient(circle, transparent 0 40%, #000 48% 53%, transparent 62%);
  filter: blur(2px) drop-shadow(0 0 20px rgba(255, 130, 40, 0.8));
}
.storm.is-on { animation: stormSpin 0.85s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
@keyframes stormSpin {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6) rotate(0deg); }
  18%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.26) rotate(250deg); }
}

.floats { position: absolute; inset: 0; overflow: hidden; }
.float {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 21px;
  line-height: 1;
  letter-spacing: 0.01em;
  color: #fff0cf;
  white-space: nowrap;
  -webkit-text-stroke: 0.6px rgba(64, 15, 0, 0.75);
  text-shadow:
    0 2px 0 #5c1505,
    0 0 8px rgba(255, 83, 20, 0.9),
    0 0 18px rgba(255, 70, 10, 0.6);
  animation: floatUp 0.92s cubic-bezier(0.18, 0.72, 0.24, 1) forwards;
  pointer-events: none;
}
.float--crit {
  font-size: 29px;
  color: #ffe08a;
  text-shadow:
    0 2px 0 #7a2604,
    0 0 10px rgba(255, 205, 90, 0.95),
    0 0 24px rgba(255, 90, 20, 0.8);
}
.float--crit::after {
  content: "暴击";
  display: block;
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: 0.32em;
  text-align: center;
  color: #ffb44a;
  text-shadow: 0 1px 2px #451003;
}
.float--burn { font-size: 15px; color: #ffb37a; }
.float--heal {
  font-size: 20px;
  color: #a9ffc0;
  text-shadow: 0 2px 0 #0c3a1a, 0 0 12px rgba(90, 255, 140, 0.8);
}
.float--hurt {
  font-size: 16px;
  color: #ff9a8c;
  text-shadow: 0 2px 0 #4a0c06, 0 0 10px rgba(255, 60, 30, 0.8);
}
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, -35%) scale(0.7); }
  18%  { opacity: 1; transform: translate(-50%, -60%) scale(1.12); }
  38%  { transform: translate(-50%, -78%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -190%) scale(0.92); }
}
.spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff3c2, #ff9d34 55%, rgba(255, 90, 10, 0) 75%);
  filter: drop-shadow(0 0 4px rgba(255, 145, 40, 0.9));
  animation: sparkFly 0.55s ease-out forwards;
  pointer-events: none;
}
@keyframes sparkFly {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx, 24px), var(--dy, -30px)) scale(0.2); }
}

.combo {
  position: absolute;
  left: 50%;
  top: 33%;
  transform: translate(-50%, 0) scale(0.6);
  opacity: 0;
  font-size: 20px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  color: #ffe6a7;
  text-shadow: 0 2px 0 #7a2505, 0 0 16px rgba(255, 110, 25, 0.9);
  white-space: nowrap;
  pointer-events: none;
}
.combo.is-on { animation: comboPop 0.3s ease-out; opacity: 1; transform: translate(-50%, 0) scale(1); }
@keyframes comboPop {
  0% { transform: translate(-50%, 0) scale(0.6); opacity: 0.4; }
  60% { transform: translate(-50%, 0) scale(1.18); }
  100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

/* ---------------- 操作提示 ---------------- */
.tip {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 218px);
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 92vw;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 190, 110, 0.22);
  background: rgba(12, 5, 2, 0.58);
  color: #f2d7ac;
  font-size: 11px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}
.tip.is-hidden { opacity: 0; transform: translate(-50%, 8px); }
.tip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff9a3c;
  box-shadow: 0 0 8px #ff7a1e;
  animation: dotPulse 1.1s ease-in-out infinite alternate;
}
@keyframes dotPulse {
  from { opacity: 0.45; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1.15); }
}

/* ---------------- 底部操作台 ---------------- */
.deck {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  height: 214px;
  padding: 0 var(--pad) calc(var(--safe-bottom) + 10px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  background: linear-gradient(180deg,
    rgba(9, 3, 1, 0) 0%,
    rgba(9, 3, 1, 0.5) 8%,
    rgba(9, 3, 1, 0.9) 17%,
    rgba(9, 3, 1, 0.995) 25%,
    #090301 42%,
    #090301 100%);
}
.deck::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 34%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 177, 92, 0.22), transparent);
  pointer-events: none;
}

.vitals {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding-bottom: 4px;
  flex: none;
}
.orb {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  padding: 3px;
  background:
    conic-gradient(from 220deg, #6b3210, #ffdf9b, #a8621e, #ffe9b8, #6b3210);
  box-shadow:
    0 0 0 1px #2b1004,
    0 0 18px rgba(255, 138, 61, 0.32),
    0 8px 18px rgba(0, 0, 0, 0.55);
}
.orb__halves {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #2a0d03;
  background: #1a0705;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.72);
}
.orb__half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
}
.orb__half--hp {
  left: 0;
  background: linear-gradient(180deg, #4a0f0b, #240503);
  border-right: 1px solid rgba(0, 0, 0, 0.55);
}
.orb__half--mp {
  right: 0;
  background: linear-gradient(180deg, #0a2148, #040c1c);
}
.orb__fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  transition: height 0.25s ease-out;
}
.orb__half--hp .orb__fill {
  background:
    linear-gradient(180deg, rgba(255, 220, 180, 0.5) 0%, transparent 9%),
    linear-gradient(180deg, #ff7456 0%, #f22a12 35%, #a80e06 100%);
  box-shadow: 0 0 14px rgba(255, 45, 20, 0.55);
}
.orb__half--mp .orb__fill {
  background:
    linear-gradient(180deg, rgba(210, 240, 255, 0.5) 0%, transparent 9%),
    linear-gradient(180deg, #6db9ff 0%, #2274e6 38%, #0b3f9e 100%);
  box-shadow: 0 0 14px rgba(40, 120, 255, 0.5);
}
.orb__fill::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -3px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 235, 200, 0.5);
  filter: blur(1px);
}
.orb__glass {
  position: absolute;
  inset: 7px 10px auto 9px;
  height: 38%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
  transform: rotate(-12deg);
  pointer-events: none;
}
.orb__lv {
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 700;
  color: #341504;
  background: linear-gradient(180deg, #ffeec0, #e7a94d);
  border: 1px solid #7e3d0c;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.orb__lv b { font-size: 9px; }
.vitals__nums {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 8px;
}
.vnum {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 9px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
}
.vnum .mp-icon { width: 10px; height: 10px; }
.vnum--hp { color: #ff8b78; }
.vnum--mp { color: #7db5ff; }
.vnum b { font-size: 10px; color: #f7e5c8; font-weight: 800; }

/* 技能轮盘 */
.wheel {
  position: relative;
  width: 218px;
  height: 188px;
  flex: none;
}
.skill {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid rgba(255, 203, 126, 0.5);
  background:
    radial-gradient(circle at 35% 28%, rgba(118, 56, 20, 0.96), rgba(26, 10, 4, 0.98) 68%);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 230, 190, 0.22),
    0 0 0 2px rgba(33, 13, 4, 0.8);
  color: #ffc46e;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, filter 0.12s ease;
  overflow: visible;
}
.skill:active { transform: scale(0.92); filter: brightness(1.25); }
.skill .mp-icon {
  width: 23px;
  height: 23px;
  position: absolute;
  left: 50%;
  top: 11px;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 7px currentColor);
}
.skill__name {
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffe0b1;
  text-shadow: 0 1px 2px #210a02;
  white-space: nowrap;
}
.skill__cost {
  position: absolute;
  top: 3px;
  right: 5px;
  font-size: 8px;
  font-weight: 800;
  color: #8fc4ff;
  text-shadow: 0 1px 2px #000;
}
.skill--fire {
  right: 102px;
  bottom: 4px;
  color: #ff9a3e;
  border-color: rgba(255, 152, 66, 0.68);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 230, 190, 0.25), 0 0 16px rgba(255, 110, 30, 0.32), 0 0 0 2px rgba(33, 13, 4, 0.8);
}
.skill--storm {
  right: 120px;
  bottom: 70px;
  color: #ffd166;
  border-color: rgba(255, 200, 100, 0.62);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 230, 190, 0.25), 0 0 16px rgba(255, 170, 45, 0.28), 0 0 0 2px rgba(33, 13, 4, 0.8);
}
.skill--heal {
  right: 52px;
  bottom: 128px;
  color: #8fe3a1;
  border-color: rgba(143, 227, 161, 0.62);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 230, 190, 0.25), 0 0 16px rgba(90, 220, 130, 0.26), 0 0 0 2px rgba(33, 13, 4, 0.8);
}
.skill__cd {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  color: #ffe4b8;
  text-shadow: 0 1px 3px #000;
  background: conic-gradient(rgba(4, 2, 1, 0.82) calc(var(--p, 0) * 1turn), rgba(4, 2, 1, 0.24) 0);
  border: 1px solid rgba(255, 200, 130, 0.22);
  font-variant-numeric: tabular-nums;
}
.skill.is-cooling .skill__cd { display: flex; }
.skill.is-cooling { filter: saturate(0.45); }
.skill.is-nomp { filter: grayscale(0.35) brightness(0.72); }
.skill.is-nomp .skill__cost { color: #ff8b78; }

.attack {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 98px;
  height: 98px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #4a1a04;
  background:
    radial-gradient(circle at 36% 26%, #fff0bd 0%, #ffcb70 20%, #ff9a3d 48%, #e56514 66%, #8d2c06 100%);
  border: 3px solid #ffdd93;
  box-shadow:
    0 0 0 3px rgba(104, 44, 10, 0.9),
    0 0 0 4px rgba(255, 196, 105, 0.45),
    0 8px 24px rgba(0, 0, 0, 0.62),
    0 0 34px rgba(255, 110, 25, 0.55),
    inset 0 2px 8px rgba(255, 255, 255, 0.5),
    inset 0 -10px 18px rgba(120, 35, 3, 0.45);
  transition: transform 0.1s ease, filter 0.12s ease;
  z-index: 3;
}
.attack:active { transform: scale(0.925); filter: brightness(1.14); }
.attack::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px solid rgba(94, 35, 5, 0.32);
  box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.18);
  pointer-events: none;
}
.attack .mp-icon {
  position: absolute;
  top: 19px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 2px 1px rgba(120, 40, 5, 0.45));
}
.attack__label {
  position: absolute;
  left: 50%;
  bottom: 15px;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #4b1803;
  text-shadow: 0 1px 0 rgba(255, 226, 165, 0.55);
  white-space: nowrap;
}
.attack__ring {
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 214, 145, 0.4);
  animation: ringSpin 16s linear infinite;
  pointer-events: none;
}
.attack__ring::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: #ffe3a4;
  box-shadow: 0 0 8px #ffb44f;
}
@keyframes ringSpin { to { transform: rotate(360deg); } }

/* ---------------- 受击 / 提示 ---------------- */
.hit-vignette {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(120% 90% at 50% 50%, transparent 48%, rgba(180, 15, 0, 0.5) 100%);
  transition: opacity 0.16s ease;
}
.hit-vignette.is-on { opacity: 1; }

.toast {
  position: absolute;
  left: 50%;
  top: 31%;
  transform: translate(-50%, -6px);
  z-index: 30;
  max-width: 80vw;
  padding: 8px 15px;
  border-radius: 999px;
  background: rgba(18, 7, 2, 0.9);
  border: 1px solid rgba(255, 187, 100, 0.42);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5), 0 0 18px rgba(255, 120, 30, 0.12);
  color: #ffe3b7;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.game.is-shaking { animation: shake 0.18s linear; }
@keyframes shake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-4px, 2px, 0); }
  50% { transform: translate3d(4px, -1px, 0); }
  75% { transform: translate3d(-2px, 1px, 0); }
}

/* ---------------- 结果弹层 ---------------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(70% 60% at 50% 42%, rgba(80, 24, 6, 0.35), transparent 70%),
    rgba(4, 2, 1, 0.74);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fadeIn 0.22s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.result-card {
  position: relative;
  width: min(88vw, 366px);
  max-height: 88dvh;
  overflow: auto;
  padding: 30px 20px 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 194, 112, 0.5);
  background:
    linear-gradient(180deg, rgba(48, 20, 8, 0.98) 0%, rgba(26, 11, 5, 0.99) 45%, rgba(14, 6, 2, 0.99) 100%);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.78),
    0 0 0 1px rgba(255, 220, 165, 0.08),
    inset 0 1px 0 rgba(255, 230, 185, 0.2),
    0 0 46px rgba(255, 100, 25, 0.16);
  text-align: center;
  animation: cardIn 0.32s cubic-bezier(0.18, 0.85, 0.3, 1.08);
  scrollbar-width: none;
}
.result-card::-webkit-scrollbar { display: none; }
@keyframes cardIn {
  0% { opacity: 0; transform: translateY(16px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.result-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 17px;
  border: 1px solid rgba(255, 199, 122, 0.13);
  pointer-events: none;
}
.result-card__flare {
  position: absolute;
  left: 50%;
  top: -20px;
  width: 190px;
  height: 150px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(255, 126, 35, 0.34), transparent 68%);
  pointer-events: none;
}
.result-badge {
  position: relative;
  width: 62px;
  height: 62px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #3a1403;
  background: radial-gradient(circle at 35% 28%, #fff0c0, #ffc468 42%, #e0781f 72%, #8f3b07);
  border: 2px solid #ffe2a7;
  box-shadow: 0 0 0 4px rgba(255, 177, 82, 0.16), 0 0 28px rgba(255, 122, 25, 0.45);
}
.result-badge .mp-icon { width: 32px; height: 32px; }
.result-kicker {
  position: relative;
  margin: 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.42em;
  color: #d09a62;
  text-indent: 0.42em;
}
.result-title {
  position: relative;
  margin: 5px 0 0;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #fff8d6 0%, #ffdc8e 42%, #ff9e34 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 #6c2504) drop-shadow(0 0 14px rgba(255, 130, 30, 0.38));
}
.result-desc {
  position: relative;
  margin: 7px 0 0;
  font-size: 11px;
  color: #c7a180;
  letter-spacing: 0.06em;
}
.result-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 16px;
}
.result-stats div {
  padding: 9px 4px 8px;
  border-radius: 10px;
  background: rgba(9, 4, 1, 0.55);
  border: 1px solid rgba(255, 190, 108, 0.14);
}
.result-stats span {
  display: block;
  font-size: 9px;
  color: #b78a63;
  letter-spacing: 0.08em;
}
.result-stats b {
  display: block;
  margin-top: 4px;
  font-size: 17px;
  font-weight: 900;
  color: #ffe3b2;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(255, 150, 50, 0.25);
}
.result-record {
  position: relative;
  display: inline-block;
  margin-top: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: #ffd797;
  background: rgba(105, 41, 8, 0.45);
  border: 1px solid rgba(255, 184, 92, 0.26);
  letter-spacing: 0.04em;
}
.result-record.is-record { color: #a8ffc1; border-color: rgba(120, 255, 160, 0.35); background: rgba(20, 80, 35, 0.3); }

.btn {
  position: relative;
  width: 100%;
  height: 48px;
  margin-top: 12px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.1s ease, filter 0.12s ease;
}
.btn:active { transform: scale(0.975); filter: brightness(1.08); }
.btn .mp-icon { width: 17px; height: 17px; }
.btn--primary {
  color: #3d1402;
  background: linear-gradient(180deg, #ffe4a2 0%, #ffb552 34%, #ff8529 72%, #e26514 100%);
  border: 1px solid #ffe6ae;
  box-shadow: 0 6px 18px rgba(255, 100, 20, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -4px 8px rgba(150, 50, 5, 0.3);
}
.btn--ghost {
  margin-top: 8px;
  height: 40px;
  font-size: 12px;
  color: #e7c7a0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 190, 110, 0.24);
  letter-spacing: 0.1em;
}

/* ---------------- 角色面板 ---------------- */
.overlay--sheet {
  align-items: flex-end;
  padding: 0;
  background: rgba(4, 2, 1, 0.66);
}
.sheet {
  position: relative;
  width: min(100%, 560px);
  max-height: 88dvh;
  margin: 0 auto;
  border-radius: 24px 24px 0 0;
  border: 1px solid rgba(255, 193, 110, 0.36);
  border-bottom: 0;
  background: linear-gradient(180deg, #251009 0%, #150804 42%, #0d0502 100%);
  box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 226, 175, 0.18);
  overflow: hidden auto;
  scrollbar-width: none;
  animation: sheetUp 0.3s cubic-bezier(0.18, 0.8, 0.25, 1);
}
.sheet::-webkit-scrollbar { display: none; }
@keyframes sheetUp {
  from { transform: translateY(40px); opacity: 0.4; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f7d7aa;
  background: rgba(12, 5, 2, 0.62);
  border: 1px solid rgba(255, 195, 115, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.sheet__close .mp-icon { width: 19px; height: 19px; }
.sheet__close:active { transform: scale(0.92); }
.sheet__art {
  position: relative;
  height: 41dvh;
  min-height: 250px;
  overflow: hidden;
  background: #1a0a04;
}
.sheet__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 14%;
  filter: saturate(1.06) contrast(1.03);
}
.sheet__art-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(21, 8, 4, 0.78) 0%, transparent 42%),
    linear-gradient(180deg, transparent 42%, rgba(21, 9, 4, 0.7) 72%, #150804 100%);
}
.sheet__badge {
  position: absolute;
  left: 16px;
  bottom: 18px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #3a1403;
  background: linear-gradient(180deg, #ffe8ae, #e7a84d);
  border: 1px solid #ffe8b0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}
.sheet__body {
  position: relative;
  margin-top: -26px;
  padding: 0 18px calc(var(--safe-bottom) + 18px);
}
.sheet__kicker {
  margin: 0;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.36em;
  color: #c38a55;
}
.sheet__name {
  margin: 3px 0 0;
  font-size: 27px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff6d2, #ffd48a 52%, #ff9c35);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 #5c2104);
}
.sheet__sub {
  margin: 4px 0 0;
  font-size: 11px;
  color: #c8a27d;
  letter-spacing: 0.06em;
}
.sheet__sub b { color: #ffe1ae; font-variant-numeric: tabular-nums; }
.sheet__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 13px;
}
.sheet__stats div {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 11px;
  background: rgba(9, 4, 1, 0.5);
  border: 1px solid rgba(255, 188, 102, 0.14);
}
.sheet__stats .mp-icon { width: 15px; height: 15px; color: #e2a760; }
.sheet__stats span { font-size: 9px; color: #a9825e; letter-spacing: 0.06em; }
.sheet__stats b {
  margin-left: auto;
  font-size: 13px;
  font-weight: 900;
  color: #ffe4b6;
  font-variant-numeric: tabular-nums;
}

.nick-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  padding: 6px 6px 6px 12px;
  border-radius: 12px;
  background: rgba(9, 4, 1, 0.5);
  border: 1px solid rgba(255, 188, 102, 0.16);
}
.nick-row label {
  flex: none;
  font-size: 9px;
  color: #b08a64;
  letter-spacing: 0.08em;
}
.nick-row input {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 190, 110, 0.18);
  background: rgba(30, 13, 6, 0.72);
  color: #ffe3b8;
  font-size: 13px;
  font-weight: 700;
  outline: none;
}
.nick-row input::placeholder { color: #7e5c41; }
.nick-row button {
  flex: none;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 800;
  color: #381302;
  background: linear-gradient(180deg, #ffe3a1, #eda94e);
  border: 1px solid #ffe9b6;
}
.nick-row button .mp-icon { width: 14px; height: 14px; }
.nick-row button:active { transform: scale(0.94); }
.sheet__hint {
  margin: 8px 2px 0;
  font-size: 9px;
  color: #7f6148;
  letter-spacing: 0.04em;
}

/* ---------------- 小屏适配 ---------------- */
@media (max-height: 720px) {
  :root { --pad: 12px; }
  .hud { top: calc(var(--safe-top) + 8px); }
  .hero-card { width: min(66vw, 262px); }
  .avatar { width: 48px; height: 48px; }
  .hero-name { font-size: 14px; }
  .boss-panel { top: calc(var(--safe-top) + 80px); }
  .side-entry { top: calc(var(--safe-top) + 150px); }
  .deck { height: 198px; }
  .orb { width: 70px; height: 70px; }
  .wheel { width: 202px; height: 174px; }
  .skill { width: 54px; height: 54px; }
  .skill--fire { right: 94px; bottom: 2px; }
  .skill--storm { right: 110px; bottom: 66px; }
  .skill--heal { right: 46px; bottom: 118px; }
  .attack { width: 90px; height: 90px; }
  .attack .mp-icon { top: 16px; width: 31px; height: 31px; }
  .attack__label { bottom: 13px; font-size: 11px; }
  .tip { bottom: calc(var(--safe-bottom) + 200px); }
  .combo { top: 31%; }
}
@media (max-width: 370px) {
  .hero-card { width: 66vw; }
  .hero-realm { display: none; }
  .vitals__nums { display: none; }
  .wheel { width: 204px; }
  .attack { width: 92px; height: 92px; }
  .skill { width: 54px; height: 54px; }
  .skill--fire { right: 94px; }
  .skill--storm { right: 108px; }
  .skill--heal { right: 46px; }
  .result-title { font-size: 26px; }
}

/* ---------------- 横屏宽屏战场 ---------------- */
@media (min-aspect-ratio: 4/3) and (min-width: 720px) {
  .game { max-width: none; }

  .hero-foreground {
    display: block;
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 1;
    height: 88%;
    width: auto;
    pointer-events: none;
  }
  .hero-foreground img {
    height: 100%;
    width: auto;
    max-width: none;
    object-fit: contain;
    object-position: left bottom;
    filter: saturate(1.08) contrast(1.035) brightness(0.98);
    opacity: 0.92;
    -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 82%, transparent 100%);
  }
  .hero-foreground__fade {
    position: absolute;
    inset: 0;
    background:
      linear-gradient(0deg, #090301 0%, rgba(9, 3, 1, 0.62) 8%, transparent 24%),
      linear-gradient(180deg, rgba(8, 3, 1, 0.75) 0%, transparent 18%);
    pointer-events: none;
  }

  .scene__img { object-position: 61% 50%; transform: scale(1.03); animation: none; }
  .scene__shade {
    background:
      radial-gradient(70% 62% at 54% 46%, rgba(255, 122, 40, 0.08) 0%, transparent 64%),
      linear-gradient(180deg,
        rgba(6, 2, 1, 0.84) 0%,
        rgba(8, 3, 1, 0.3) 15%,
        rgba(8, 3, 1, 0) 36%,
        rgba(7, 2, 1, 0.12) 60%,
        rgba(7, 2, 1, 0.6) 80%,
        #080301 94%);
  }

  .hud {
    top: calc(var(--safe-top) + 16px);
    left: 22px;
    right: 22px;
    gap: 14px;
  }
  .hero-card { width: 342px; padding: 6px 16px 6px 6px; }
  .avatar { width: 66px; height: 66px; }
  .hero-name { font-size: 19px; }
  .hero-realm { font-size: 10px; }
  .power-label { font-size: 10px; }
  .power-num { font-size: 19px; }
  .power-up { font-size: 10px; }
  .stage-box { min-width: 112px; padding: 8px 12px 7px; }
  .stage-box__name { font-size: 12px; }
  .stage-box__floor { font-size: 10px; }

  .boss-panel {
    top: calc(var(--safe-top) + 100px);
    left: 22px;
    right: 22px;
    width: auto;
    padding: 8px 14px 7px;
  }
  .boss-panel__head { height: 24px; }
  .boss-emblem { width: 22px; height: 22px; }
  .boss-emblem .mp-icon { width: 14px; height: 14px; }
  .boss-title { font-size: 16px; }
  .boss-lv { font-size: 9px; }
  .boss-hp { font-size: 12px; }
  .boss-bar { height: 14px; margin-top: 5px; }
  .boss-panel__foot { height: 15px; }
  .objective { font-size: 10px; }
  .objective .mp-icon { width: 12px; height: 12px; }

  .side-entry {
    top: calc(var(--safe-top) + 110px);
    right: 30px;
    width: 58px;
    height: 66px;
    border-radius: 14px;
  }
  .side-entry__face { width: 29px; height: 29px; }
  .side-entry span { font-size: 10px; }
  .slash { top: 55%; width: min(42vw, 520px); }
  .storm { top: 55%; width: min(44vw, 560px); }
  .combo { top: 29%; font-size: 26px; }
  .tip { bottom: calc(var(--safe-bottom) + 202px); font-size: 12px; padding: 7px 15px; }

  .deck {
    height: 212px;
    padding: 0 30px calc(var(--safe-bottom) + 14px);
    background: linear-gradient(180deg,
      rgba(9, 3, 1, 0) 0%,
      rgba(9, 3, 1, 0.45) 22%,
      rgba(9, 3, 1, 0.88) 52%,
      #090301 78%);
  }
  .deck::before { top: 26%; }
  .orb { width: 94px; height: 94px; }
  .orb__lv { font-size: 9px; padding: 2px 9px; }
  .orb__lv b { font-size: 10px; }
  .vnum { font-size: 11px; }
  .vnum b { font-size: 12px; }
  .vnum .mp-icon { width: 12px; height: 12px; }
  .vitals { padding-bottom: 6px; }

  .wheel { width: 252px; height: 200px; }
  .skill { width: 66px; height: 66px; }
  .skill .mp-icon { width: 26px; height: 26px; top: 12px; }
  .skill__name { font-size: 9px; bottom: 6px; }
  .skill--fire { right: 116px; bottom: 2px; }
  .skill--storm { right: 138px; bottom: 76px; }
  .skill--heal { right: 58px; bottom: 138px; }
  .attack { width: 112px; height: 112px; }
  .attack .mp-icon { width: 40px; height: 40px; top: 20px; }
  .attack__label { font-size: 13px; bottom: 17px; }

  .result-card { width: min(35vw, 420px); }
  .sheet { max-width: 620px; }
  .sheet__art { height: 34dvh; min-height: 200px; }
}


/* 宽屏（16:9 及更宽）把首领血条放回顶部中央，更接近端游 HUD */
@media (min-aspect-ratio: 4/3) and (min-width: 1200px) {
  .boss-panel {
    top: calc(var(--safe-top) + 16px);
    left: 50%;
    right: auto;
    width: min(42vw, 620px);
    transform: translateX(-50%);
  }
  .boss-panel__head { height: 24px; }
  .boss-bar { height: 14px; margin-top: 5px; }
}

/* 手机横屏（例如 844×390）的紧凑布局：不挡画面，全部入口可见 */
@media (min-aspect-ratio: 4/3) and (min-width: 720px) and (max-height: 520px) {
  .hud { top: 8px; left: 14px; right: 14px; }
  .hero-card { width: 236px; padding: 3px 10px 3px 3px; }
  .avatar { width: 40px; height: 40px; }
  .avatar__lv { font-size: 8px; bottom: -4px; }
  .hero-name { font-size: 13px; }
  .hero-realm { display: none; }
  .power-label { font-size: 8px; }
  .power-num { font-size: 12px; }
  .power-up { font-size: 8px; }
  .stage-box { min-width: 76px; padding: 4px 7px; }
  .stage-box__name { font-size: 9px; }
  .stage-box__floor { font-size: 8px; }

  .boss-panel {
    top: 8px;
    left: 260px;
    right: 100px;
    width: auto;
    transform: none;
    padding: 4px 8px;
  }
  .boss-panel__head { height: 16px; }
  .boss-emblem { width: 15px; height: 15px; }
  .boss-emblem .mp-icon { width: 10px; height: 10px; }
  .boss-title { font-size: 11px; }
  .boss-lv { font-size: 7px; }
  .boss-hp { font-size: 9px; }
  .boss-bar { height: 8px; margin-top: 3px; }
  .boss-panel__foot { height: 10px; margin-top: 2px; }
  .objective { font-size: 8px; }
  .objective .mp-icon { width: 9px; height: 9px; }

  .side-entry { top: 72px; right: 14px; width: 40px; height: 48px; }
  .side-entry__face { width: 20px; height: 20px; }
  .side-entry span { font-size: 8px; }

  .hero-foreground { height: 90%; }
  .scene__img { object-position: 60% 50%; }
  .slash { top: 52%; width: 260px; }
  .storm { top: 52%; width: 280px; }
  .combo { top: 34%; font-size: 16px; }
  .tip { bottom: 132px; font-size: 9px; padding: 4px 9px; }
  .float { font-size: 16px; }
  .float--crit { font-size: 22px; }

  .deck { height: 128px; padding: 0 18px 8px; }
  .orb { width: 58px; height: 58px; }
  .orb__lv { font-size: 7px; padding: 1px 5px; }
  .orb__lv b { font-size: 8px; }
  .vitals__nums { display: none; }
  .wheel { width: 172px; height: 122px; }
  .skill { width: 42px; height: 42px; border-width: 1px; }
  .skill .mp-icon { width: 16px; height: 16px; top: 8px; }
  .skill__name { font-size: 7px; bottom: 3px; }
  .skill__cost { font-size: 7px; top: 2px; right: 4px; }
  .skill--fire { right: 78px; bottom: 2px; }
  .skill--storm { right: 92px; bottom: 50px; }
  .skill--heal { right: 38px; bottom: 82px; }
  .attack { width: 74px; height: 74px; border-width: 2px; }
  .attack .mp-icon { width: 24px; height: 24px; top: 14px; }
  .attack__label { font-size: 9px; bottom: 10px; }
  .attack__ring { inset: -6px; }

  .result-card { width: 320px; padding: 20px 16px 14px; }
  .result-title { font-size: 24px; }
  .result-badge { width: 46px; height: 46px; margin-bottom: 6px; }
  .result-badge .mp-icon { width: 24px; height: 24px; }
  .result-stats { margin-top: 10px; }
  .btn { height: 40px; margin-top: 8px; }
  .sheet__art { height: 38dvh; min-height: 160px; }
}
