:root {
  --ink: #f7fbff;
  --muted: #a8b5c7;
  --panel: rgba(12, 18, 28, 0.92);
  --panel-strong: rgba(18, 27, 42, 0.96);
  --line: rgba(255, 255, 255, 0.14);
  --gold: #ffd166;
  --red: #ff5b64;
  --green: #4de28b;
  --blue: #6eb6ff;
  --violet: #b887ff;
  --bg: #0c1119;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--gold);
  color: #221909;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.06);
}

button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

button.ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-width: 320px;
  min-height: 480px;
  background: radial-gradient(circle at 50% 30%, #172235 0, #0c1119 62%);
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  image-rendering: auto;
}

.panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  transform: translate(-50%, -50%);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.menu-panel {
  padding: 24px;
}

.menu-heading {
  display: grid;
  gap: 8px;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 7vw, 68px);
  line-height: 0.95;
}

h2 {
  font-size: 28px;
}

.menu-heading p:last-child {
  max-width: 560px;
  color: var(--muted);
  line-height: 1.7;
}

.account-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 22px 0;
}

.account-row div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.account-row span,
.hud span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.account-row strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.character-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.character-card {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  text-align: left;
}

.character-card.selected {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.55);
}

.character-card.locked {
  cursor: not-allowed;
  opacity: 0.45;
}

.character-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.avatar-dot,
.model-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.avatar-dot {
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.model-icon {
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.14), rgba(5, 9, 15, 0.42) 72%);
}

.model-icon-small {
  width: 34px;
  height: 34px;
}

.character-card h3 {
  margin: 0;
  font-size: 18px;
}

.character-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.character-detail,
.codex-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-title h3 {
  margin: 0;
  font-size: 22px;
}

.role-tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stat-cell,
.codex-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 9, 15, 0.42);
}

.stat-cell {
  padding: 8px;
}

.stat-cell span,
.codex-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat-cell strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.skill-line {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.difficulty-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.difficulty-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.difficulty-card {
  min-height: 104px;
  border-color: var(--line);
  background: rgba(5, 9, 15, 0.42);
  color: var(--ink);
  text-align: left;
}

.difficulty-card.selected {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.55);
}

.difficulty-card.locked {
  cursor: not-allowed;
  opacity: 0.48;
}

.difficulty-card strong {
  display: block;
  margin-bottom: 5px;
}

.difficulty-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.growth-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 14px;
  margin-top: 14px;
}

.growth-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.growth-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.growth-title h2 {
  font-size: 20px;
}

.growth-title span,
.mastery-meta {
  color: var(--muted);
  font-size: 12px;
}

.mastery-bar {
  height: 10px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.mastery-bar i {
  display: block;
  height: 100%;
  background: var(--violet);
}

.talent-list {
  display: grid;
  gap: 8px;
}

.talent-card {
  min-height: 74px;
  border-color: var(--line);
  background: rgba(5, 9, 15, 0.42);
  color: var(--ink);
  text-align: left;
}

.talent-card:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.talent-card strong {
  display: block;
  margin-bottom: 4px;
}

.talent-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.goal-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 14px;
  margin-top: 14px;
}

.goal-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.daily-card {
  display: grid;
  gap: 10px;
}

.daily-card h2 {
  font-size: 20px;
}

.daily-card p,
.achievement-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.modifier-list {
  display: grid;
  gap: 8px;
}

.modifier-pill {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(5, 9, 15, 0.42);
}

.modifier-pill strong {
  display: block;
  color: var(--gold);
  font-size: 13px;
}

.achievement-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.achievement-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(5, 9, 15, 0.42);
}

.achievement-card.claimable {
  border-color: rgba(255, 209, 102, 0.75);
}

.achievement-card.claimed {
  opacity: 0.62;
}

.achievement-card h3 {
  margin: 0 0 5px;
  font-size: 15px;
}

.achievement-card button {
  min-width: 76px;
  min-height: 34px;
  padding: 0 12px;
}

.codex-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.codex-tabs button {
  min-height: 34px;
  padding: 0 13px;
}

.codex-tabs button.active {
  border-color: var(--gold);
  color: var(--gold);
}

.codex-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.codex-card {
  min-height: 118px;
  padding: 12px;
}

.codex-card h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 16px;
}

.codex-mark {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.62);
}

.codex-card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.menu-actions-primary {
  margin: 0 0 14px;
}

.level-panel,
.result-panel {
  width: min(560px, calc(100vw - 28px));
  padding: 22px;
}

.upgrade-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.level-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.level-actions #closeLevelBtn {
  margin-right: auto;
  min-height: 38px;
  padding: 8px 14px;
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(247, 251, 255, 0.66);
}

.level-actions #rerollBtn {
  min-width: 148px;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(124, 227, 213, 0.46);
  background: rgba(22, 47, 58, 0.82);
  color: #c9fff4;
  box-shadow: 0 8px 18px rgba(3, 19, 28, 0.2);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.level-actions #rerollBtn[data-mode="free"] {
  border-color: rgba(124, 227, 213, 0.62);
}

.level-actions #rerollBtn[data-mode="ad"] {
  border-color: rgba(255, 205, 111, 0.72);
  background: rgba(83, 61, 35, 0.9);
  color: #ffe1a0;
}

.level-actions #rerollBtn[data-mode="ad"]::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 11px;
  margin-right: 7px;
  border: 2px solid currentColor;
  border-radius: 4px;
  vertical-align: -1px;
  box-sizing: border-box;
}

.level-actions #rerollBtn[data-mode="ad"]::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: -17px;
  margin-right: 7px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid currentColor;
  vertical-align: -1px;
}

.level-actions #rerollBtn:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.76);
}

.level-actions #rerollBtn.is-loading,
.level-actions #rerollBtn:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

.upgrade-choice {
  min-height: 86px;
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  text-align: left;
}

.upgrade-choice.evolve {
  border-color: rgba(255, 209, 102, 0.8);
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.2), rgba(184, 135, 255, 0.16));
}

.upgrade-choice strong {
  display: block;
  margin-bottom: 5px;
}

.upgrade-choice span {
  color: var(--muted);
  font-size: 13px;
}

.upgrade-choice .upgrade-detail {
  display: block;
  margin-top: 7px;
  color: #c9fff4;
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.upgrade-choice.evolve .upgrade-detail {
  color: #ffe1a0;
}

.upgrade-choice.new-weapon {
  position: relative;
  overflow: hidden;
  border-color: rgba(124, 227, 213, 0.78);
  background: linear-gradient(135deg, rgba(36, 103, 103, 0.3), var(--panel-strong) 52%);
  box-shadow: 0 0 0 1px rgba(124, 227, 213, 0.14), 0 12px 24px rgba(22, 113, 106, 0.16);
}

.upgrade-choice.new-weapon::after {
  content: "";
  position: absolute;
  top: -30px;
  right: 46px;
  width: 88px;
  height: 88px;
  border: 1px solid rgba(199, 255, 244, 0.18);
  border-radius: 50%;
  pointer-events: none;
}

.upgrade-choice.new-weapon strong {
  padding-right: 58px;
}

.upgrade-choice .upgrade-new-badge {
  position: absolute;
  top: 11px;
  right: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(199, 255, 244, 0.62);
  border-radius: 8px 8px 3px 8px;
  background: rgba(79, 195, 177, 0.22);
  color: #c9fff4;
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(79, 195, 177, 0.18);
}

.upgrade-choice[data-rarity] {
  position: relative;
}

.upgrade-choice[data-rarity] strong {
  padding-right: 86px;
}

.upgrade-choice .upgrade-tags {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}

.upgrade-choice .upgrade-tags .upgrade-rarity-badge,
.upgrade-choice .upgrade-tags .upgrade-new-badge {
  position: static;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 7px 7px 3px 7px;
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}

.upgrade-choice .upgrade-tags .upgrade-rarity-badge {
  border: 1px solid rgba(174, 187, 201, 0.56);
  background: rgba(117, 131, 148, 0.18);
  color: #d8e0e8;
}

.upgrade-choice[data-rarity="normal"] {
  border-color: rgba(174, 187, 201, 0.46);
}

.upgrade-choice[data-rarity="fine"] {
  border-color: rgba(108, 168, 255, 0.78);
  background: linear-gradient(135deg, rgba(61, 119, 207, 0.2), var(--panel-strong) 54%);
  box-shadow: 0 0 0 1px rgba(108, 168, 255, 0.12), 0 12px 24px rgba(61, 119, 207, 0.12);
}

.upgrade-choice[data-rarity="epic"] {
  border-color: rgba(183, 140, 255, 0.82);
  background: linear-gradient(135deg, rgba(123, 78, 191, 0.24), var(--panel-strong) 54%);
  box-shadow: 0 0 0 1px rgba(183, 140, 255, 0.14), 0 12px 26px rgba(123, 78, 191, 0.16);
}

.upgrade-choice[data-rarity="ancient"] {
  border-color: rgba(255, 143, 216, 0.86);
  background: linear-gradient(135deg, rgba(194, 72, 157, 0.24), var(--panel-strong) 54%);
  box-shadow: 0 0 0 1px rgba(255, 143, 216, 0.16), 0 12px 28px rgba(194, 72, 157, 0.18);
}

.upgrade-choice[data-rarity="legendary"] {
  border-color: rgba(255, 177, 91, 0.92);
  background: linear-gradient(135deg, rgba(194, 116, 44, 0.28), var(--panel-strong) 54%);
  box-shadow: 0 0 0 1px rgba(255, 177, 91, 0.18), 0 12px 30px rgba(194, 116, 44, 0.2);
}

.upgrade-choice[data-rarity="fine"] .upgrade-rarity-badge {
  border-color: rgba(108, 168, 255, 0.76);
  background: rgba(61, 119, 207, 0.25);
  color: #a9caff;
}

.upgrade-choice[data-rarity="epic"] .upgrade-rarity-badge {
  border-color: rgba(183, 140, 255, 0.78);
  background: rgba(123, 78, 191, 0.28);
  color: #d8c2ff;
}

.upgrade-choice[data-rarity="ancient"] .upgrade-rarity-badge {
  border-color: rgba(255, 143, 216, 0.8);
  background: rgba(194, 72, 157, 0.28);
  color: #ffc2e9;
}

.upgrade-choice[data-rarity="legendary"] .upgrade-rarity-badge {
  border-color: rgba(255, 177, 91, 0.86);
  background: rgba(194, 116, 44, 0.3);
  color: #ffe0a4;
}

.hud {
  position: absolute;
  left: 14px;
  top: 14px;
  width: min(390px, calc(100vw - 28px));
  pointer-events: none;
  z-index: 2;
}

.hud-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hud-row.compact {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  color: var(--ink);
}

.hud-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(9, 13, 20, 0.72);
}

.bar {
  height: 10px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.bar i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--red);
}

.bar.xp i {
  background: var(--blue);
}

.weapon-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.bounty-hud {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.bounty-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(9, 13, 20, 0.72);
  color: var(--ink);
  font-size: 12px;
}

.bounty-line.done {
  border-color: rgba(77, 226, 139, 0.6);
  color: var(--green);
}

.weapon-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(9, 13, 20, 0.72);
  color: var(--ink);
  font-size: 12px;
}

.synergy-pill {
  border-color: rgba(110, 182, 255, 0.55);
  color: var(--blue);
}

.relic-pill {
  border-color: rgba(255, 209, 102, 0.55);
  color: var(--gold);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  max-width: calc(100vw - 28px);
  border: 1px solid rgba(255, 209, 102, 0.7);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(16, 22, 34, 0.95);
  color: var(--gold);
  font-weight: 800;
  pointer-events: none;
}

.joystick {
  position: absolute;
  left: 24px;
  bottom: 24px;
  display: none;
  width: 118px;
  height: 118px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(9, 13, 20, 0.42);
  pointer-events: none;
}

.joystick i {
  position: absolute;
  left: 39px;
  top: 39px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 209, 102, 0.82);
}

.joystick.active {
  display: none;
}

.result-stats {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 560px) {
  .panel {
    top: 10px;
    max-height: calc(100dvh - 20px);
    transform: translateX(-50%);
  }

  .menu-panel {
    padding: 16px;
  }

  .account-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 14px 0;
  }

  .account-row div {
    padding: 8px;
  }

  .account-row strong {
    font-size: 16px;
  }

  .menu-actions-primary {
    position: sticky;
    top: -16px;
    z-index: 3;
    margin: -16px -16px 14px;
    padding: 12px 16px;
    background: rgba(12, 18, 28, 0.98);
    border-bottom: 1px solid var(--line);
  }

  .menu-actions-primary button:first-child {
    flex: 1 1 100%;
  }

  .hud {
    left: 8px;
    top: 8px;
    width: calc(100vw - 16px);
    max-width: none;
  }

  .hud-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .hud-block {
    padding: 4px 5px;
    background: rgba(9, 13, 20, 0.5);
  }

  .hud span {
    font-size: 9px;
  }

  .bar {
    height: 5px;
    margin-top: 2px;
  }

  .hud-row.compact {
    gap: 8px;
    margin-top: 4px;
    font-size: 11px;
  }

  .hud-row.compact strong {
    font-size: 16px;
  }

  .weapon-hud {
    gap: 4px;
    margin-top: 4px;
  }

  .weapon-pill {
    padding: 2px 6px;
    font-size: 10px;
  }

  .bounty-hud {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
  }

  .bounty-line {
    padding: 3px 6px;
    border-radius: 6px;
    background: rgba(9, 13, 20, 0.58);
    font-size: 10px;
  }

  h1 {
    font-size: 42px;
  }

  .detail-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .growth-layout {
    grid-template-columns: 1fr;
  }

  .goal-layout,
  .achievement-card {
    grid-template-columns: 1fr;
  }
}

/* 开发者配置面板只在 ?dev=1 下显示，用于快速组合和移除超武。 */
.dev-loadout {
  position: fixed;
  z-index: 50;
  top: 50%;
  left: 50%;
  width: min(720px, calc(100vw - 24px));
  max-height: min(700px, calc(100dvh - 24px));
  transform: translate(-50%, -50%);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(124, 227, 213, 0.42);
  border-radius: 12px;
  background: rgba(12, 28, 31, 0.97);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.56);
}

.dev-loadout-head,
.dev-loadout-toolbar,
.dev-loadout-selector {
  display: flex;
  align-items: center;
}

.dev-loadout-head,
.dev-loadout-toolbar {
  justify-content: space-between;
  gap: 12px;
}

.dev-loadout-head h2 {
  margin: 3px 0 0;
}

.dev-loadout .icon-button {
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-size: 27px;
  line-height: 1;
}

.dev-loadout-toolbar {
  margin: 18px 0 12px;
  color: rgba(247, 251, 255, 0.68);
}

.dev-loadout-toolbar > div {
  display: flex;
  gap: 8px;
}

.dev-loadout-toolbar button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.dev-loadout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.dev-loadout-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 10px 10px 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  transition: border-color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.dev-loadout-card[data-active="true"] {
  border-color: rgba(124, 227, 213, 0.54);
  background: rgba(35, 92, 88, 0.22);
}

.dev-loadout-card[data-active="false"] {
  opacity: 0.52;
}

.dev-loadout-selector {
  flex: 1;
  min-width: 0;
  gap: 10px;
  cursor: pointer;
}

.dev-loadout-selector input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.dev-loadout-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.dev-loadout-copy strong,
.dev-loadout-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dev-loadout-copy small {
  color: rgba(247, 251, 255, 0.58);
  font-size: 11px;
}

.dev-loadout-remove {
  flex: 0 0 auto;
  width: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 139, 143, 0.38);
  border-radius: 50%;
  background: rgba(255, 91, 100, 0.12);
  color: #ffb0b5;
  font-size: 20px;
  line-height: 1;
}

.dev-start-btn {
  width: 100%;
  margin-top: 14px;
  min-height: 48px;
  border-color: rgba(255, 225, 160, 0.84);
  box-shadow: 0 12px 30px rgba(255, 209, 102, 0.14);
}

.dev-start-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

@media (max-width: 560px) {
  .dev-loadout {
    padding: 16px 12px;
  }

  .dev-loadout-grid {
    grid-template-columns: 1fr;
  }
}

/* 手机横屏时优先展示战斗入口和角色选择，长内容仍可在面板内滚动。 */
@media (max-width: 900px) and (orientation: landscape) {
  .panel {
    top: 8px;
    width: min(920px, calc(100vw - 16px));
    max-height: calc(100dvh - 16px);
    transform: translateX(-50%);
  }

  .menu-panel {
    padding: 12px 16px;
  }

  .menu-heading {
    grid-template-columns: minmax(180px, 0.75fr) minmax(240px, 1.25fr);
    align-items: end;
    gap: 12px;
  }

  h1 {
    font-size: 38px;
  }

  .menu-heading p:last-child {
    line-height: 1.45;
  }

  .account-row {
    gap: 6px;
    margin: 10px 0;
  }

  .account-row div,
  .character-card,
  .character-detail,
  .difficulty-panel,
  .growth-panel,
  .goal-panel,
  .codex-panel {
    padding: 9px;
  }

  .account-row strong {
    font-size: 16px;
  }

  .character-list {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 8px;
  }

  .character-card {
    min-height: 102px;
  }

  .character-card p,
  .skill-line,
  .difficulty-card span {
    font-size: 12px;
    line-height: 1.35;
  }

  .difficulty-list {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 6px;
  }

  .difficulty-card {
    min-height: 76px;
  }

  .growth-layout,
  .goal-layout {
    gap: 8px;
    margin-top: 8px;
  }

  .menu-actions-primary {
    position: sticky;
    top: -12px;
    z-index: 3;
    margin: -12px -16px 10px;
    padding: 8px 16px;
    background: rgba(12, 18, 28, 0.98);
    border-bottom: 1px solid var(--line);
  }

  .menu-actions-primary button:first-child {
    flex: 0 1 auto;
  }

  .hud {
    left: 8px;
    top: 8px;
    width: min(330px, calc(100vw - 16px));
  }

  .hud-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .hud-block {
    padding: 4px 5px;
    background: rgba(9, 13, 20, 0.5);
  }

  .hud span {
    font-size: 9px;
  }

  .bar {
    height: 5px;
    margin-top: 2px;
  }

  .hud-row.compact {
    gap: 8px;
    margin-top: 4px;
    font-size: 11px;
  }

  .hud-row.compact strong {
    font-size: 16px;
  }

  .weapon-hud {
    gap: 4px;
    margin-top: 4px;
  }

  .weapon-pill,
  .bounty-line {
    padding: 2px 6px;
    font-size: 10px;
  }

  .bounty-hud {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
  }

  .hud-block {
    padding: 6px;
  }

  .weapon-hud,
  .bounty-hud,
  .hud-row.compact {
    margin-top: 5px;
  }

  .toast {
    bottom: 12px;
  }
}

/* 游戏大厅首页：战场画面作为背景，首屏只承担进入战斗和当前猎人确认。 */
.home-screen.panel {
  inset: 0;
  left: 0;
  top: 0;
  width: 100%;
  max-height: none;
  transform: none;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: rgba(7, 13, 18, 0.42);
  box-shadow: none;
}

.home-shell {
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  align-items: center;
  gap: 42px;
  min-height: min(680px, calc(100dvh - 32px));
}

.home-copy {
  max-width: 640px;
}

.home-kicker,
.home-section-kicker {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.home-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.home-kicker i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 91, 100, 0.16);
}

.home-heading,
.home-screen .menu-heading {
  display: grid;
  gap: 16px;
}

.home-screen .menu-heading h1 {
  max-width: 560px;
  color: var(--ink);
  font-size: 72px;
  line-height: 0.96;
  letter-spacing: 0;
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
}

.home-screen .menu-heading p:last-child {
  max-width: 420px;
  color: rgba(247, 251, 255, 0.78);
  font-size: 16px;
  line-height: 1.6;
}

.home-account {
  max-width: 420px;
  margin: 28px 0 18px;
}

.home-account div {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(9, 16, 21, 0.5);
}

.home-account strong {
  color: var(--gold);
}

.home-actions {
  align-items: center;
  margin: 0;
}

.home-actions button:first-child {
  min-width: 210px;
  min-height: 56px;
  border-color: #ffe3a0;
  box-shadow: 0 12px 28px rgba(255, 209, 102, 0.18);
  font-size: 18px;
}

.home-actions button.ghost {
  min-height: 44px;
}

.home-actions #resetBtn {
  min-height: 34px;
  padding: 0 10px;
  color: rgba(247, 251, 255, 0.58);
  font-size: 12px;
}

.home-actions #devShowcaseBtn {
  min-height: 34px;
  padding: 0 12px;
  border-color: rgba(255, 177, 91, 0.72);
  background: rgba(194, 116, 44, 0.16);
  color: #ffe0a4;
  font-size: 12px;
}

.home-input-hint {
  margin-top: 14px;
  color: rgba(247, 251, 255, 0.48);
  font-size: 12px;
}

.home-showcase {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(9, 16, 21, 0.72);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.showcase-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 10px;
  color: rgba(247, 251, 255, 0.6);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.showcase-label strong {
  color: var(--green);
  font-size: 10px;
}

.home-character {
  margin-top: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.045);
}

.home-character .model-icon {
  width: 72px;
  height: 72px;
}

.home-character .detail-title h3 {
  font-size: 24px;
}

.home-character .stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-daily {
  margin-top: 12px;
  border-color: rgba(255, 209, 102, 0.34);
  background: rgba(255, 209, 102, 0.08);
}

.home-daily .daily-card {
  gap: 7px;
}

.home-daily .daily-card h2 {
  font-size: 18px;
}

.home-daily .daily-card p,
.home-daily .modifier-pill {
  font-size: 12px;
  line-height: 1.4;
}

.home-daily .modifier-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.home-daily .modifier-pill {
  padding: 6px;
}

.home-prep {
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.home-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.home-section-head h2 {
  margin-top: 6px;
  font-size: 30px;
}

.home-section-head p {
  color: rgba(247, 251, 255, 0.58);
  font-size: 13px;
}

.home-prep .character-list {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.home-prep .character-card,
.home-prep .difficulty-panel,
.home-prep .growth-panel,
.home-prep .goal-panel,
.home-prep .codex-panel {
  background: rgba(9, 16, 21, 0.72);
}

@media (max-width: 900px) {
  .home-screen.panel {
    top: 0;
    left: 0;
    width: 100%;
    max-height: none;
    transform: none;
  }

  .home-shell {
    width: min(100% - 28px, 700px);
    padding: 22px 0 42px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    gap: 22px;
    min-height: auto;
    padding-top: 18px;
  }

  .home-screen .menu-heading h1 {
    font-size: 48px;
  }

  .home-screen .menu-heading p:last-child {
    font-size: 14px;
  }

  .home-account {
    margin: 18px 0 14px;
  }

  .home-actions {
    position: static;
    top: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .home-actions button:first-child {
    flex: 1 1 100%;
    width: 100%;
  }

  .home-showcase {
    padding: 12px;
  }

  .home-character .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

@media (max-width: 560px) {
  .home-shell {
    width: calc(100% - 20px);
    padding-top: 14px;
  }

  .home-hero {
    gap: 16px;
    padding-top: 8px;
  }

  .home-screen .menu-heading h1 {
    font-size: 42px;
  }

  .home-kicker {
    margin-bottom: 12px;
  }

  .home-account {
    margin: 14px 0 10px;
  }

  .home-account div {
    padding: 7px;
  }

  .home-account strong {
    font-size: 16px;
  }

  .home-actions button:first-child {
    min-height: 50px;
    font-size: 17px;
  }

  .home-showcase {
    padding: 10px;
  }

  .home-character .detail-head {
    margin-bottom: 8px;
  }

  .home-character .model-icon {
    width: 58px;
    height: 58px;
  }

  .home-character .detail-title h3 {
    font-size: 20px;
  }

  .home-daily .modifier-list {
    grid-template-columns: 1fr;
  }

  .home-prep {
    padding-top: 22px;
  }
}

/* 首屏大厅只保留游戏入口和角色主视觉，系统信息进入下方备战区。 */
.home-screen.panel {
  background: rgba(7, 13, 18, 0.22);
}

.home-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  min-height: calc(100dvh - 20px);
  text-align: center;
}

.home-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 760px;
}

.home-kicker {
  justify-content: center;
  margin-bottom: 12px;
}

.home-screen .menu-heading {
  justify-items: center;
}

.home-screen .menu-heading h1 {
  font-size: 68px;
}

.home-screen .menu-heading p:last-child {
  max-width: 470px;
}

.home-account {
  max-width: 430px;
  width: 100%;
  margin: 18px 0 12px;
}

.home-actions {
  justify-content: center;
}

.home-actions #resetBtn {
  display: none;
}

.home-input-hint {
  display: none;
}

.home-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(430px, 100%);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.showcase-label,
.home-daily {
  display: none;
}

.home-character {
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
}

.home-character .detail-head {
  justify-content: center;
  margin: 0;
}

.home-character .detail-title {
  display: block;
}

.home-character .detail-title > div,
.home-character .role-tag,
.home-character .stat-grid,
.home-character .skill-line {
  display: none;
}

.home-character .model-icon {
  width: 154px;
  height: 154px;
  border: 0;
  background: transparent;
}

.home-prep {
  margin-top: 24px;
}

@media (max-width: 900px) {
  .home-hero {
    gap: 8px;
    min-height: calc(100dvh - 12px);
  }

  .home-screen .menu-heading h1 {
    font-size: 52px;
  }

  .home-account {
    margin: 14px 0 10px;
  }

  .home-actions button:first-child {
    width: min(330px, 86vw);
    min-width: 0;
  }

  .home-showcase {
    width: min(300px, 86vw);
  }

  .home-character .model-icon {
    width: 132px;
    height: 132px;
  }
}

@media (max-width: 560px) {
  .home-shell {
    padding-top: 10px;
  }

  .home-hero {
    gap: 4px;
  }

  .home-screen .menu-heading h1 {
    font-size: 44px;
  }

  .home-screen .menu-heading p:last-child {
    font-size: 13px;
  }

  .home-account {
    max-width: 340px;
    margin: 10px 0 8px;
  }

  .home-account div {
    border: 0;
    padding: 5px;
    background: rgba(9, 16, 21, 0.42);
  }

  .home-account span {
    font-size: 9px;
  }

  .home-account strong {
    font-size: 15px;
  }

  .home-actions button:first-child {
    min-height: 52px;
    font-size: 18px;
  }

  .home-actions button.ghost {
    min-height: 38px;
    padding: 0 14px;
  }

  .home-showcase {
    width: min(250px, 78vw);
  }

  .home-character .model-icon {
    width: 112px;
    height: 112px;
  }

  .home-prep {
    margin-top: 18px;
  }
}

/* 首页只展示游戏入口，成长系统通过备战按钮打开为独立浮层。 */
.home-screen.panel {
  overflow: hidden;
  background: rgba(7, 13, 18, 0.18);
}

.home-shell {
  min-height: 100%;
}

.home-hero {
  min-height: calc(100dvh - 20px);
}

.home-screen .menu-heading h1 {
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.home-screen .menu-heading p:last-child,
.home-account,
.home-kicker {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}

.home-actions {
  align-items: center;
}

.home-actions #startBtn {
  min-width: min(330px, 80vw);
  min-height: 58px;
  font-size: 20px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

.home-actions #prepBtn,
.home-actions #startDailyBtn {
  min-width: 112px;
}

.home-prep {
  display: none;
  position: fixed;
  z-index: 30;
  inset: 14px;
  width: auto;
  max-height: none;
  margin: 0;
  padding: 22px clamp(16px, 3vw, 34px) 34px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 12px;
  background: rgba(8, 14, 22, 0.94);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.58);
}

.home-prep.is-open {
  display: block;
}

.home-modal-head {
  position: sticky;
  top: -22px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -22px 0 22px;
  padding: 18px 0 14px;
  background: rgba(8, 14, 22, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.home-modal-head h2 {
  margin-top: 4px;
  font-size: 30px;
}

.home-prep .home-section-head {
  padding-top: 0;
}

@media (max-width: 560px) {
  .home-hero {
    min-height: calc(100dvh - 12px);
  }

  .home-actions #startBtn {
    min-height: 54px;
  }

  .home-prep {
    inset: 8px;
    padding: 16px 12px 24px;
  }

  .home-modal-head {
    top: -16px;
    margin: -16px 0 16px;
    padding: 14px 0 12px;
  }
}

/* 战斗状态条保持轻量，让场景和角色成为画面主体。 */
.hud {
  top: 12px;
  left: 50%;
  width: min(560px, calc(100vw - 24px));
  transform: translateX(-50%);
}

.hud > .hud-row:first-child {
  gap: 8px;
}

.hud-block {
  min-width: 0;
  padding: 7px 9px 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: rgba(13, 24, 28, 0.62);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.hud-block > span {
  display: flex;
  align-items: center;
  color: rgba(244, 249, 242, 0.82);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
}

.hud-block > span::before {
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: #f06a6f;
  box-shadow: 0 0 8px rgba(240, 106, 111, 0.72);
  content: "";
}

.hud-block:nth-child(2) > span::before {
  background: #77c8c4;
  box-shadow: 0 0 8px rgba(119, 200, 196, 0.72);
}

.bar {
  height: 7px;
  margin-top: 6px;
  border: 1px solid rgba(0, 0, 0, 0.24);
  border-radius: 999px;
  background: rgba(7, 15, 17, 0.62);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.28);
}

.bar i {
  border-radius: inherit;
  transition: width 120ms linear;
}

.bar:not(.xp) i {
  background: linear-gradient(90deg, #e45561, #ff9a72);
  box-shadow: 0 0 8px rgba(240, 91, 102, 0.52);
}

.bar.xp i {
  background: linear-gradient(90deg, #4fa9b4, #9be0c3);
  box-shadow: 0 0 8px rgba(104, 203, 190, 0.48);
}

.hud-row.compact {
  width: max-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 4px 8px;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(10, 20, 23, 0.44);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.12);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.hud-row.compact strong {
  color: #fff1c3;
}

@media (max-width: 560px) {
  .hud {
    top: 8px;
    left: 10px;
    width: calc(100vw - 20px);
    transform: none;
  }

  .hud > .hud-row:first-child {
    gap: 5px;
  }

  .hud-block {
    padding: 5px 7px 6px;
    border-radius: 8px;
  }

  .hud-block > span {
    font-size: 9px;
  }

  .bar {
    height: 6px;
    margin-top: 4px;
  }

  .hud-row.compact {
    margin-top: 4px;
    padding: 3px 7px;
    gap: 8px;
    font-size: 11px;
  }

  .hud-row.compact strong {
    font-size: 16px;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .hud {
    top: 8px;
    width: min(620px, calc(100vw - 24px));
  }
}

/* 备战内容收进右侧抽屉，首页只保留游戏入口和当前猎人。 */
.home-prep {
  display: block;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  inset: 0 0 0 auto;
  width: min(438px, calc(100vw - 12px));
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 18px 16px 28px;
  overflow-x: hidden;
  border-width: 1px 0 1px 1px;
  border-radius: 18px 0 0 18px;
  transform: translateX(105%);
  visibility: hidden;
  pointer-events: none;
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.38);
  transition: transform 220ms ease, visibility 220ms ease;
}

.home-prep.is-open {
  display: block;
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.home-prep > .home-modal-head {
  top: -18px;
  margin: -18px -16px 14px;
  padding: 14px 16px 12px;
  background: rgba(8, 14, 22, 0.98);
}

.home-prep > .home-modal-head h2 {
  font-size: 24px;
}

.home-prep > .home-section-head {
  display: none;
}

.prep-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  scrollbar-width: none;
}

.prep-tabs::-webkit-scrollbar {
  display: none;
}

.prep-tab {
  min-width: 62px;
  min-height: 34px;
  flex: 1 0 62px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: rgba(247, 251, 255, 0.62);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.prep-tab:hover,
.prep-tab.active {
  border-color: rgba(255, 209, 102, 0.4);
  background: rgba(255, 209, 102, 0.14);
  color: #fff1c3;
}

.prep-view {
  display: none !important;
}

.prep-view.is-active {
  display: block !important;
}

.prep-view-character.is-active,
.prep-view-growth.is-active,
.prep-view-goals.is-active {
  display: grid !important;
}

.home-prep .prep-view-character.is-active {
  grid-template-columns: 1fr;
  gap: 8px;
}

.home-prep .growth-layout,
.home-prep .goal-layout {
  gap: 10px;
}

.result-revive-note {
  color: #fff1c3;
}

.result-panel .revive-btn {
  width: 100%;
  margin-bottom: 10px;
  border-color: rgba(119, 224, 192, 0.68);
  background: linear-gradient(90deg, rgba(56, 156, 150, 0.92), rgba(112, 203, 175, 0.92));
  color: #061517;
  box-shadow: 0 8px 22px rgba(62, 195, 168, 0.2);
}

.result-panel .revive-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

@media (max-width: 560px) {
  .home-prep {
    width: calc(100vw - 12px);
    padding: 16px 12px 24px;
  }

  .home-prep > .home-modal-head {
    top: -16px;
    margin: -16px -12px 12px;
    padding: 13px 12px 11px;
  }

  .prep-tab {
    min-width: 58px;
    flex-basis: 58px;
    padding: 0 8px;
    font-size: 11px;
  }
}

/* 战斗 HUD 使用状态标签组织信息，减少文档式的层层面板。 */
.hud {
  width: min(430px, calc(100vw - 24px));
}

.hud > .hud-row:first-child {
  gap: 6px;
}

.hud-block {
  padding: 5px 8px 6px;
  border: 1px solid rgba(235, 255, 245, 0.2);
  border-radius: 999px;
  background: rgba(8, 24, 26, 0.48);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hud-block > span {
  color: rgba(239, 255, 246, 0.72);
  font-size: 9px;
  font-weight: 800;
}

.hud-block > span::before {
  width: 5px;
  height: 5px;
  margin-right: 4px;
}

.bar {
  height: 5px;
  margin-top: 4px;
  background: rgba(1, 12, 14, 0.5);
}

.hud-row.compact {
  width: auto;
  max-width: 100%;
  margin-top: 5px;
  padding: 0;
  gap: 5px;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.hud-row.compact strong {
  padding: 0 3px;
  color: #fff0bd;
  font-size: 21px;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.hud-row.compact span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid rgba(235, 255, 245, 0.16);
  border-radius: 999px;
  background: rgba(8, 24, 26, 0.36);
  color: rgba(246, 255, 249, 0.78);
  font-size: 10px;
}

.hud-row.compact span::before {
  width: 4px;
  height: 4px;
  margin-right: 4px;
  border-radius: 50%;
  background: rgba(184, 239, 201, 0.82);
  content: "";
}

.weapon-hud,
.bounty-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.weapon-pill,
.bounty-line {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 2px 7px;
  border: 1px solid rgba(235, 255, 245, 0.15);
  border-radius: 7px;
  background: rgba(8, 24, 26, 0.34);
  color: rgba(246, 255, 249, 0.78);
  font-size: 10px;
  line-height: 1.2;
}

.weapon-pill::before,
.bounty-line::before {
  width: 4px;
  height: 4px;
  margin-right: 5px;
  border-radius: 50%;
  background: rgba(255, 219, 133, 0.82);
  content: "";
}

.bounty-line {
  border-color: rgba(235, 255, 245, 0.12);
  color: rgba(246, 255, 249, 0.68);
}

.bounty-line::before {
  background: rgba(211, 231, 207, 0.62);
}

.bounty-line.done {
  border-color: rgba(77, 226, 139, 0.42);
  color: #8af0ae;
}

.bounty-line.done::before {
  background: #72e79d;
  box-shadow: 0 0 7px rgba(77, 226, 139, 0.7);
}

.synergy-pill {
  border-color: rgba(136, 213, 255, 0.38);
  color: #a4ddff;
}

.synergy-pill::before {
  background: #82cfff;
}

.relic-pill {
  border-color: rgba(255, 209, 102, 0.38);
  color: #ffe19a;
}

.relic-pill::before {
  background: #ffd166;
}

/* 死亡时压低战场色彩，把注意力集中到复活与结算动作。 */
.game-shell.death-mode::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: rgba(20, 12, 18, 0.28);
  box-shadow: inset 0 0 110px rgba(10, 5, 12, 0.62);
  content: "";
  animation: death-vignette 2.4s ease-in-out infinite;
}

.game-shell.death-mode #game {
  filter: saturate(0.56) brightness(0.72) contrast(1.05);
}

.result-emblem {
  display: none;
}

.result-panel.death-result {
  width: min(390px, calc(100vw - 28px));
  padding: 24px 22px 20px;
  overflow: hidden;
  border-color: rgba(255, 125, 132, 0.38);
  background: rgba(12, 14, 22, 0.94);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.62), 0 0 36px rgba(210, 67, 84, 0.12);
  text-align: center;
}

.result-panel.death-result .result-emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border: 1px solid rgba(255, 125, 132, 0.6);
  border-radius: 50%;
  background: rgba(126, 35, 50, 0.22);
  box-shadow: 0 0 0 8px rgba(255, 125, 132, 0.04), 0 0 28px rgba(255, 91, 100, 0.18);
  animation: death-emblem 1.8s ease-in-out infinite;
}

.result-panel.death-result .result-emblem::before {
  width: 34px;
  height: 27px;
  border: 2px solid #ff9ca0;
  border-radius: 48% 48% 42% 42%;
  content: "";
}

.result-panel.death-result .result-emblem span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff7d84;
  box-shadow: 17px 0 0 #ff7d84;
  transform: translateX(-8px) translateY(-4px);
}

.result-panel.death-result .result-emblem span::after {
  position: absolute;
  top: 17px;
  left: 1px;
  width: 20px;
  height: 4px;
  border-bottom: 2px solid #ff9ca0;
  content: "";
}

.result-panel.death-result .eyebrow {
  color: #ff8b91;
  letter-spacing: 0.14em;
}

.result-panel.death-result h2 {
  margin-top: 7px;
  font-size: clamp(30px, 8vw, 42px);
  text-shadow: 0 4px 20px rgba(255, 91, 100, 0.22);
}

.death-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 12px;
}

.death-metrics > div {
  display: grid;
  gap: 3px;
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
}

.death-metrics strong {
  color: #fff1c3;
  font-size: 22px;
}

.death-metrics span {
  color: rgba(247, 251, 255, 0.58);
  font-size: 11px;
}

.death-result .result-revive-note {
  margin: 0 0 16px;
  color: rgba(247, 251, 255, 0.64);
  font-size: 12px;
}

.death-result .revive-btn {
  min-height: 50px;
  margin-bottom: 8px;
  border-color: rgba(119, 224, 192, 0.72);
  background: #72d5b4;
  box-shadow: 0 10px 26px rgba(62, 195, 168, 0.2);
}

.death-result #backMenuBtn {
  width: 100%;
  min-height: 38px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(247, 251, 255, 0.78);
}

@keyframes death-vignette {
  0%,
  100% {
    opacity: 0.86;
  }
  50% {
    opacity: 1;
  }
}

@keyframes death-emblem {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}

@media (max-width: 560px) {
  .hud {
    width: calc(100vw - 16px);
  }

  .hud-block {
    padding: 4px 6px 5px;
  }

  .hud-row.compact strong {
    font-size: 18px;
  }

  .hud-row.compact span,
  .weapon-pill,
  .bounty-line {
    min-height: 19px;
    padding: 2px 6px;
    font-size: 9px;
  }

  .result-panel.death-result {
    padding: 20px 16px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-shell.death-mode::before,
  .result-panel.death-result .result-emblem {
    animation: none;
  }
}

/* 首页开始战斗附近的难度拨片，默认显示最低已解锁难度。 */
.difficulty-picker {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 14px;
  padding: 6px;
  border: 1px solid rgba(222, 243, 218, 0.2);
  border-radius: 16px;
  background: rgba(23, 48, 43, 0.54);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.difficulty-current {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  padding: 4px 8px;
  text-align: center;
}

.difficulty-current span {
  color: rgba(239, 255, 246, 0.58);
  font-size: 10px;
}

.difficulty-current strong {
  color: #fff0bd;
  font-size: 18px;
  line-height: 1.1;
}

.difficulty-current small {
  max-width: 100%;
  overflow: hidden;
  color: rgba(239, 255, 246, 0.66);
  font-size: 10px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.difficulty-current em {
  color: #8ee6b6;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.difficulty-arrow {
  min-height: 52px;
  padding: 0;
  border: 1px solid rgba(222, 243, 218, 0.18);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff0bd;
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
}

.difficulty-arrow:disabled {
  opacity: 0.32;
  cursor: default;
}

.difficulty-arrow:not(:disabled):hover {
  border-color: rgba(255, 209, 102, 0.56);
  background: rgba(255, 209, 102, 0.14);
}

/* 备战抽屉改为森林青灰底，避免与战斗场景割裂成纯黑面板。 */
.home-prep {
  border-color: rgba(205, 237, 211, 0.26);
  background: rgba(25, 46, 43, 0.96);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.34), inset 1px 0 0 rgba(255, 255, 255, 0.04);
}

.home-prep > .home-modal-head {
  background: rgba(25, 46, 43, 0.98);
  border-bottom-color: rgba(205, 237, 211, 0.16);
}

.home-prep .prep-tabs {
  border-color: rgba(205, 237, 211, 0.16);
  background: rgba(9, 26, 25, 0.3);
}

.home-prep .character-card,
.home-prep .growth-panel,
.home-prep .goal-panel,
.home-prep .codex-panel {
  border-color: rgba(205, 237, 211, 0.18);
  background: rgba(43, 69, 60, 0.72);
}

.home-prep .character-card:hover,
.home-prep .character-card.selected {
  border-color: rgba(255, 209, 102, 0.62);
  background: rgba(68, 87, 67, 0.84);
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.result-actions.is-single {
  grid-template-columns: 1fr;
}

.result-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 0 10px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 900;
  transition: transform 160ms ease, filter 160ms ease;
}

.result-actions > button:hover {
  transform: translateY(-2px);
}

.death-result .result-actions .revive-btn {
  border-color: rgba(137, 255, 211, 0.7);
  background: #75d8b8;
  color: #06211d;
  box-shadow: 0 8px 20px rgba(82, 207, 170, 0.22);
}

.death-result .result-actions #backMenuBtn {
  width: 100%;
  border-color: rgba(212, 220, 255, 0.26);
  background: rgba(113, 124, 170, 0.3);
  color: #f2f3ff;
}

.video-icon {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.video-icon::after {
  position: absolute;
  top: 3px;
  left: 7px;
  width: 0;
  height: 0;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-left: 5px solid currentColor;
  content: "";
}

.back-icon {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.82;
}

.back-icon::before {
  position: absolute;
  top: 3px;
  left: 1px;
  width: 7px;
  height: 7px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.revive-btn.is-loading .video-icon {
  animation: video-loading 700ms linear infinite;
}

@keyframes video-loading {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 560px) {
  .difficulty-picker {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 6px;
    padding: 5px;
    border-radius: 14px;
  }

  .difficulty-arrow {
    min-height: 48px;
    font-size: 26px;
  }

  .difficulty-current strong {
    font-size: 16px;
  }

  .result-actions > button {
    min-height: 48px;
    border-radius: 14px;
    font-size: 15px;
  }
}

/* 统一文字气质：展示字负责情绪，幼圆负责阅读，数据字负责战斗反馈。 */
:root {
  --font-body: "SIMYOU", "YouYuan", "STXihei", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "STXinwei", "ZCOOL KuaiLe", "Kaiti SC", "STKaiti", "KaiTi", var(--font-body);
  --font-data: "Trebuchet MS", "Avenir Next", "SIMYOU", "YouYuan", sans-serif;
}

html,
body {
  font-family: var(--font-body);
  font-weight: 600;
  text-rendering: optimizeLegibility;
}

button {
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: 0.02em;
}

h1,
h2,
h3,
h4,
.menu-heading,
.home-modal-head h2,
.difficulty-current strong,
.result-panel h2 {
  font-family: var(--font-display);
  font-weight: 900;
}

h1,
.menu-heading h1 {
  letter-spacing: 0.035em;
  text-shadow: 3px 3px 0 rgba(14, 29, 28, 0.28), 0 8px 24px rgba(0, 0, 0, 0.34);
}

h2,
h3,
h4 {
  letter-spacing: 0.015em;
}

.eyebrow,
.home-kicker,
.home-section-kicker,
.showcase-label,
.account-row span,
.difficulty-current span,
.difficulty-current small,
.difficulty-current em {
  font-family: var(--font-data);
  font-weight: 800;
}

.home-kicker,
.home-section-kicker,
.eyebrow {
  letter-spacing: 0.08em;
}

.home-actions button,
.prep-tab,
.difficulty-arrow,
.result-actions button {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.12);
}

.account-row strong,
.stat-cell strong,
.difficulty-current strong,
.difficulty-current em,
.hud,
.result-stats,
.death-metrics strong,
.home-account strong {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
}

.hud-block > span,
.hud-row.compact span,
.weapon-pill,
.bounty-line,
.skill-line,
.home-input-hint,
.result-revive-note {
  font-family: var(--font-body);
}

.hud-row.compact strong,
.death-metrics strong,
.home-account strong,
.account-row strong {
  letter-spacing: 0.025em;
}

.character-card h3,
.difficulty-card strong,
.talent-card strong,
.achievement-card h3,
.codex-card h4,
.growth-title h2 {
  font-family: var(--font-display);
}

@media (max-width: 560px) {
  h1,
  .menu-heading h1 {
    letter-spacing: 0.02em;
  }

  .home-input-hint,
  .result-stats,
  .result-revive-note {
    font-weight: 600;
  }
}
