:root {
  color-scheme: dark;
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  background: #090a08;
  color: #ddd2b8;
  font-synthesis: none;
}

body.is-battle-view-open {
  overflow: hidden;
}

.battle-view {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  overflow: hidden;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background:
    radial-gradient(circle at 50% 42%, rgba(113, 88, 47, 0.22), transparent 32%),
    linear-gradient(180deg, rgba(7, 9, 8, 0.98), rgba(14, 12, 9, 0.99));
  place-items: center;
}

.battle-view.is-visible {
  animation: battle-view-enter 220ms ease-out both;
}

.battle-view__stage {
  position: relative;
  display: grid;
  width: min(100%, 480px);
  height: 100%;
  min-height: 100dvh;
  max-height: 100dvh;
  grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: 7px;
  padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
  border-inline: 1px solid rgba(169, 137, 75, 0.2);
  background:
    linear-gradient(rgba(13, 15, 12, 0.8), rgba(13, 12, 10, 0.88)),
    repeating-linear-gradient(135deg, transparent 0 22px, rgba(186, 146, 73, 0.025) 23px 24px);
  box-shadow: 0 0 48px rgba(0, 0, 0, 0.68);
}

.battle-view__header {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(189, 151, 80, 0.28);
  color: #a99b7d;
  font-size: 11px;
}

.battle-view__header strong {
  color: #dec486;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.battle-combatant {
  position: relative;
  display: grid;
  min-height: 0;
  align-items: center;
  gap: 7px 11px;
  padding: 10px 12px;
  border: 1px solid rgba(154, 129, 78, 0.3);
  border-radius: 10px;
  background: rgba(22, 23, 18, 0.76);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.battle-combatant--enemy {
  grid-template-columns: minmax(0, 1fr) minmax(78px, 26%);
}

.battle-combatant--player {
  grid-template-columns: minmax(78px, 26%) minmax(0, 1fr);
}

.battle-combatant--enemy .battle-combatant__identity,
.battle-combatant--enemy .battle-gauges {
  grid-column: 1;
}

.battle-combatant--enemy .battle-combatant__art {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.battle-combatant--player .battle-combatant__identity,
.battle-combatant--player .battle-gauges {
  grid-column: 2;
}

.battle-combatant--player .battle-combatant__art {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.battle-combatant__identity {
  align-self: end;
}

.battle-combatant__identity span,
.battle-combatant__identity strong {
  display: block;
}

.battle-combatant__identity span {
  color: #887e68;
  font-size: 10px;
}

.battle-combatant__identity strong {
  overflow: hidden;
  margin-top: 2px;
  color: #e2cf9f;
  font-size: clamp(15px, 4.5vw, 19px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-combatant__art {
  position: relative;
  display: grid;
  width: 100%;
  max-width: 104px;
  aspect-ratio: 3 / 4;
  align-self: center;
  border: 1px solid rgba(190, 153, 82, 0.38);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 36%, rgba(187, 149, 75, 0.2), transparent 40%),
    #181914;
  color: #ae9668;
  font-size: 24px;
  place-items: center;
  transition: transform 140ms ease-out;
}

.battle-combatant__art img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.battle-combatant--enemy.is-attacking .battle-combatant__art {
  transform: translateY(12px) scale(1.02);
}

.battle-combatant--player.is-attacking .battle-combatant__art {
  transform: translateY(-12px) scale(1.02);
}

.battle-combatant.is-hit {
  border-color: rgba(190, 92, 73, 0.72);
  background: rgba(65, 29, 23, 0.74);
  animation: battle-hit-shake 260ms ease-in-out;
}

.battle-gauges {
  display: grid;
  align-self: start;
  gap: 8px;
}

.battle-gauge__track {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(157, 139, 103, 0.24);
  border-radius: 999px;
  background: #10110e;
}

.battle-gauge__track i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transition: width 240ms ease-out;
}

.battle-gauge--hp .battle-gauge__track i {
  background: linear-gradient(90deg, #782f2a, #bd5b45);
}

.battle-gauge--spirit .battle-gauge__track i {
  background: linear-gradient(90deg, #31557e, #5e91b9);
}

.battle-damage-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.battle-damage-number {
  position: absolute;
  top: 34%;
  left: 50%;
  color: #ff856c;
  font-family: system-ui, sans-serif;
  font-size: 19px;
  font-weight: 800;
  text-shadow: 0 2px 5px #000;
  transform: translateX(-50%);
  animation: battle-damage-float 520ms ease-out both;
}

.battle-view__versus {
  color: #c8a65e;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 4px;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 14px rgba(190, 140, 51, 0.36);
}

.battle-view__result {
  position: absolute;
  z-index: 5;
  inset: 50% auto auto 50%;
  display: grid;
  width: min(270px, calc(100% - 44px));
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(204, 164, 79, 0.62);
  border-radius: 10px;
  background: rgba(17, 18, 14, 0.97);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.7);
  text-align: center;
  transform: translate(-50%, -50%);
  animation: battle-result-enter 180ms ease-out both;
}

.battle-view__result strong {
  color: #e6c875;
  font-size: 22px;
}

.battle-view__result.is-fail strong {
  color: #d98e7e;
}

.battle-view__result span {
  color: #aaa18e;
  font-size: 12px;
}

.battle-view__result button {
  min-height: 38px;
  margin-top: 4px;
}

@keyframes battle-view-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes battle-hit-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  55% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

@keyframes battle-damage-float {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.85); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(1); }
}

@keyframes battle-result-enter {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (max-height: 680px) {
  .battle-view__stage {
    gap: 4px;
    padding-block: 6px;
  }

  .battle-combatant {
    padding: 7px 10px;
  }

  .battle-combatant__art {
    max-width: 76px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .battle-view *,
  .battle-view *::before,
  .battle-view *::after {
    scroll-behavior: auto !important;
    animation-duration: 20ms !important;
    transition-duration: 20ms !important;
  }
}

/* V1.6.1：上下对战表现层。战斗单位数据仍由 battleServer 提供。 */
.battle-view__stage {
  isolation: isolate;
  width: min(100vw, 480px, 56.25dvh);
  height: auto;
  min-height: 0;
  max-height: none;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom));
  background-color: #0d0e0b;
  background-image:
    linear-gradient(180deg, rgba(5, 7, 7, 0.42), rgba(9, 10, 8, 0.2) 45%, rgba(5, 6, 5, 0.5)),
    var(--battle-background-image, none),
    radial-gradient(circle at 50% 48%, rgba(128, 99, 48, 0.18), transparent 46%);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.battle-team {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 0;
  place-items: center;
}

.battle-team--opponent {
  grid-row: 1 / span 2;
}

.battle-team--player {
  grid-row: 4 / span 2;
}

.battle-formation {
  display: grid;
  width: min(100%, 410px);
  height: 100%;
  min-height: 0;
  align-items: center;
  justify-items: center;
  transition: width 180ms ease;
}

.battle-formation[data-unit-count="0"] {
  visibility: hidden;
}

.battle-formation[data-unit-count="1"] {
  width: min(34%, 140px);
  grid-template-columns: minmax(0, 1fr);
}

.battle-formation[data-unit-count="2"] {
  width: min(68%, 280px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.battle-formation[data-unit-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.battle-combatant {
  display: grid;
  width: 100%;
  max-width: 136px;
  min-height: 0;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.battle-combatant .battle-gauges {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  gap: 3px;
  align-self: end;
}

.battle-combatant .battle-combatant__art {
  grid-column: 1;
  width: 58%;
  max-width: 78px;
  justify-self: center;
  border-color: rgba(190, 153, 82, 0.5);
  background: rgba(17, 19, 16, 0.76);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
  transition: transform var(--battle-attack-duration, 140ms) ease-out;
}

.battle-combatant--opponent-side .battle-combatant__art {
  grid-row: 3;
}

.battle-combatant--player-side .battle-combatant__art {
  grid-row: 2;
  margin-top: 30px;
}

.battle-combatant__art img {
  transform: none;
}

.battle-combatant__art.is-empty {
  background:
    linear-gradient(180deg, rgba(148, 118, 63, 0.06), rgba(9, 11, 9, 0.38)),
    rgba(17, 19, 16, 0.7);
}

.battle-combatant__name {
  grid-column: 1;
  overflow: hidden;
  color: #ead7a5;
  font-size: clamp(11px, 3.4vw, 14px);
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 2px 5px #000;
  white-space: nowrap;
}

.battle-combatant--opponent-side .battle-combatant__name {
  grid-row: 2;
}

.battle-combatant--player-side .battle-combatant__name {
  grid-row: 3;
}

.battle-gauge__track {
  height: 6px;
  border-color: rgba(224, 208, 173, 0.3);
  background: rgba(5, 7, 6, 0.84);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.48);
}

.battle-view__controls {
  position: absolute;
  z-index: 6;
  top: max(10px, env(safe-area-inset-top));
  right: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.battle-round-control,
.battle-speed-control {
  display: inline-grid;
  min-height: 30px;
  place-items: center;
  padding: 4px 10px;
  border: 1px solid rgba(198, 159, 80, 0.26);
  border-radius: 999px;
  background: rgba(8, 10, 8, 0.68);
  color: #d7bd7d;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 4px #000;
}

.battle-speed-control {
  min-width: 42px;
  border-color: rgba(203, 168, 92, 0.4);
  color: #dec684;
}

.battle-speed-control:disabled {
  cursor: default;
  opacity: 0.76;
}

.battle-damage-layer {
  position: absolute;
  z-index: 3;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.battle-view__action {
  position: absolute;
  z-index: 4;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.battle-action-label {
  position: absolute;
  top: var(--battle-action-y, 50%);
  left: var(--battle-action-x, 50%);
  min-width: max-content;
  padding: 3px 9px;
  border: 1px solid rgba(229, 192, 105, 0.52);
  border-radius: 999px;
  background: rgba(18, 16, 11, 0.82);
  color: #f0d78d;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 4px #000;
  animation: battle-action-pop 420ms ease-out both;
}

.battle-combatant.is-hit {
  border-color: transparent;
  background: transparent;
  animation: none;
}

.battle-combatant.is-hit .battle-combatant__art {
  filter: brightness(1.35) saturate(1.2);
  animation: battle-hit-shake var(--battle-hit-duration, 260ms) ease-in-out;
}

.battle-combatant--opponent-side.is-attacking .battle-combatant__art {
  transform: translateY(10px) scale(1.02);
}

.battle-combatant--player-side.is-attacking .battle-combatant__art {
  transform: translateY(-10px) scale(1.02);
}

.battle-damage-number {
  top: 32%;
  font-size: clamp(18px, 5vw, 23px);
}

@keyframes battle-action-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) translateY(0) scale(0.88); }
  22% { opacity: 1; transform: translate(-50%, -50%) translateY(calc(var(--battle-action-travel-y) * 0.2)) scale(1.04); }
  72% { opacity: 1; transform: translate(-50%, -50%) translateY(calc(var(--battle-action-travel-y) * 0.7)) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) translateY(var(--battle-action-travel-y)) scale(0.96); }
}

@media (max-height: 680px) {
  .battle-view__stage {
    padding-block: 5px;
  }

  .battle-combatant {
    gap: 3px;
    padding: 0;
  }

}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(114, 86, 36, 0.18), transparent 36%),
    linear-gradient(180deg, #12130f, #080907);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.notice-layer {
  position: fixed;
  z-index: 100;
  top: 46%;
  left: 50%;
  display: grid;
  width: min(calc(100% - 40px), 400px);
  pointer-events: none;
  transform: translate(-50%, -50%);
  place-items: center;
}

.game-notice {
  min-width: min(260px, 100%);
  max-width: 100%;
  padding: 16px 22px;
  border: 1px solid rgba(216, 181, 107, 0.58);
  border-radius: 9px;
  background: rgba(19, 20, 16, 0.96);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.52);
  color: #e6cf99;
  font-size: 17px;
  line-height: 1.7;
  text-align: center;
  white-space: pre-line;
  animation: notice-fade-in 280ms ease-out both;
}

.game-notice--success {
  border-color: rgba(207, 164, 72, 0.72);
  color: #f0cd78;
  box-shadow: 0 12px 38px rgba(140, 96, 24, 0.3);
}

.game-notice--fail {
  border-color: rgba(183, 91, 73, 0.7);
  color: #e3a092;
}

.game-notice--system {
  border-color: rgba(151, 139, 105, 0.58);
  color: #d8ccb0;
}

.game-notice--reward {
  border-color: rgba(112, 159, 94, 0.68);
  color: #b7d69d;
}

.game-notice--battle {
  border-color: rgba(143, 124, 178, 0.64);
  color: #cbbce2;
}

.game-notice.is-leaving {
  animation: notice-fade-out 280ms ease-in both;
}

@keyframes notice-fade-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes notice-fade-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.98);
  }
}

.reward-notice-layer {
  position: fixed;
  z-index: 99;
  top: calc(82px + env(safe-area-inset-top));
  left: 50%;
  display: flex;
  width: min(100%, 480px);
  padding: 0 12px;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
  transform: translateX(-50%);
}

.reward-notice {
  width: fit-content;
  max-width: min(78%, 280px);
  padding: 8px 11px;
  border: 1px solid rgba(112, 159, 94, 0.46);
  border-radius: 7px;
  background: rgba(17, 23, 16, 0.94);
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.34);
  color: #b7d69d;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-line;
  animation: reward-notice-in 220ms ease-out both;
}

.reward-notice.is-leaving {
  animation: reward-notice-out 280ms ease-in both;
}

@keyframes reward-notice-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reward-notice-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-notice,
  .game-notice.is-leaving,
  .reward-notice,
  .reward-notice.is-leaving {
    animation-duration: 1ms;
  }
}

.game-shell {
  position: relative;
  width: min(100%, 480px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(74px + env(safe-area-inset-bottom));
  overflow: hidden;
  background: rgba(12, 14, 11, 0.94);
  border-inline: 1px solid rgba(194, 151, 70, 0.16);
  box-shadow: 0 0 48px rgba(0, 0, 0, 0.45);
}

.game-header {
  padding: 13px 18px 11px;
  border-bottom: 1px solid rgba(194, 151, 70, 0.22);
  background: linear-gradient(145deg, rgba(50, 45, 29, 0.72), rgba(17, 20, 15, 0.92));
}

.label {
  margin: 0 0 6px;
  color: #9c8e70;
  font-size: 12px;
  letter-spacing: 0.2em;
}

.game-header h1 {
  margin: 0;
  color: #d9b66f;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.game-header__subtitle {
  margin: 3px 0 0;
  color: #8f856f;
  font-size: 11px;
  letter-spacing: 0.2em;
}

.build-badge {
  display: inline-block;
  padding: 2px 7px;
  margin-top: 5px;
  border: 1px solid rgba(194, 151, 70, 0.28);
  border-radius: 999px;
  color: #9e9277;
  font-size: 10px;
  line-height: 1.35;
}

.status {
  margin: 0;
  color: #aaa086;
  font-size: 14px;
}

.status:empty {
  display: none;
}

.status[data-state="success"] {
  color: #9fbd85;
}

.status[data-state="error"] {
  color: #d88672;
}

.game-content {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.player-interface {
  display: grid;
  gap: 10px;
}

.role-card,
.page-panel {
  padding: 18px;
  border: 1px solid rgba(194, 151, 70, 0.22);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(35, 34, 26, 0.9), rgba(19, 22, 17, 0.94));
}

.role-card h2,
.page-panel h2 {
  margin: 0 0 10px;
  color: #d3ad62;
  font-size: 20px;
}

.role-card p,
.page-panel p {
  margin: 0;
  color: #aaa38f;
  line-height: 1.7;
}

.role-card--compact {
  padding: 10px 12px;
}

.cultivate-panel {
  padding: 12px;
}

.cultivate-character-stage {
  display: grid;
  width: 100%;
  height: clamp(260px, 56vh, 340px);
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(194, 151, 70, 0.2);
  border-radius: 9px;
  background:
    radial-gradient(circle at 50% 34%, rgba(183, 143, 66, 0.12), transparent 44%),
    rgba(8, 11, 8, 0.42);
  color: #706852;
  font-size: 14px;
  letter-spacing: 0.18em;
}

.cultivate-character-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cultivate-character-stage > span {
  pointer-events: none;
}

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

.breakthrough-action-button {
  display: grid;
  min-height: 64px;
  padding: 9px 10px;
  place-content: center;
  text-align: center;
}

.breakthrough-action-button strong,
.breakthrough-action-button small {
  display: block;
}

.breakthrough-action-button strong {
  font-size: 16px;
  font-weight: 600;
}

.breakthrough-action-button small {
  margin-top: 4px;
  color: rgba(255, 245, 219, 0.72);
  font-size: 11px;
}

.breakthrough-action-button small b {
  font-weight: 500;
}

.cultivate-info-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(194, 151, 70, 0.18);
  border-radius: 9px;
  background: rgba(10, 13, 10, 0.38);
}

.cultivate-info-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cultivate-info-heading h2 {
  margin: 0;
  font-size: 17px;
}

.cultivation-progress-block {
  margin-top: 16px;
}

.cultivation-progress-block .progress-label strong {
  color: #c6ad73;
  font-size: 13px;
  font-weight: 500;
}

.cultivation-progress-block progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #0d100c;
}

.cultivation-progress-block progress::-webkit-progress-bar {
  background: #0d100c;
}

.cultivation-progress-block progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, #7e5c24, #d0a653);
}

.cultivation-progress-block progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, #7e5c24, #d0a653);
}

.qi-sea-progress-block progress::-webkit-progress-value {
  background: linear-gradient(90deg, #485f50, #8fae82);
}

.qi-sea-progress-block progress::-moz-progress-bar {
  background: linear-gradient(90deg, #485f50, #8fae82);
}

.cultivate-support-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 15px;
}

.cultivate-support-stats > div {
  padding: 10px;
  border: 1px solid rgba(194, 151, 70, 0.13);
  border-radius: 7px;
  background: rgba(15, 17, 13, 0.52);
}

.cultivate-support-stats span,
.cultivate-support-stats strong {
  display: block;
}

.cultivate-support-stats span {
  color: #857d69;
  font-size: 11px;
}

.cultivate-support-stats strong {
  margin-top: 5px;
  color: #cbb47e;
  font-size: 14px;
  font-weight: 500;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-heading .label {
  display: block;
}

.section-heading h2 {
  margin-bottom: 0;
}

.cultivate-state {
  max-width: 9.5rem;
  padding: 5px 8px;
  border: 1px solid #4f4a34;
  border-radius: 999px;
  color: #9fab88;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.cultivate-state[data-state="full"] {
  border-color: #936b36;
  color: #e1b666;
}

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

.cultivate-metrics > div {
  padding: 12px;
  border: 1px solid rgba(194, 151, 70, 0.16);
  border-radius: 7px;
  background: rgba(12, 15, 11, 0.48);
}

.cultivate-metrics span,
.progress-label,
.pill-panel span {
  color: #857d69;
  font-size: 12px;
}

.cultivate-metrics strong {
  display: block;
  margin-top: 6px;
  color: #dbc388;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.cultivate-progress-block {
  margin-top: 18px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-label b {
  color: #b9a575;
  font-weight: 500;
}

.cultivate-progress-block progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #0d100c;
}

.cultivate-progress-block progress::-webkit-progress-bar {
  background: #0d100c;
}

.cultivate-progress-block progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, #7e5c24, #d0a653);
}

.cultivate-progress-block progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, #7e5c24, #d0a653);
}

.offline-message {
  min-height: 1.5em;
  margin-top: 12px !important;
  color: #9fbd85 !important;
  font-size: 13px;
}

.breakthrough-card {
  margin-top: 12px;
}

.breakthrough-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #a99f86;
}

.breakthrough-row strong {
  color: #deb866;
  font-size: 20px;
}

.pill-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.pill-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
}

.pill-status b {
  color: #c9aa68;
  font-weight: 500;
}

.barrier-pill-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(201, 170, 104, 0.28);
  border-radius: 8px;
  background: rgba(20, 22, 20, 0.72);
}

.barrier-pill-status {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-width: 0;
  color: #a99f86;
  font-size: 11px;
}

.barrier-pill-status strong,
.barrier-pill-status b {
  color: #c9aa68;
  font-weight: 500;
}

.use-barrier-pill-button {
  min-height: 36px;
  padding: 6px 10px;
  white-space: nowrap;
}

.use-pill-button,
.heart-demon-button {
  width: 100%;
}

.heart-demon-button {
  width: 100%;
  margin-top: 14px;
}

.breakthrough-button {
  width: 100%;
}

.use-pill-button:disabled,
.use-barrier-pill-button:disabled,
.heart-demon-button:disabled,
.breakthrough-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.breakthrough-result {
  min-height: 1.5em;
  margin-top: 10px !important;
  font-size: 13px;
}

.breakthrough-result[data-state="success"] {
  color: #9fbd85;
}

.breakthrough-result[data-state="error"] {
  color: #d88672;
}

.heart-demon-report {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(150, 76, 66, 0.4);
  border-radius: 7px;
  background: rgba(55, 24, 24, 0.3);
}

.heart-demon-report summary {
  color: #d0a673;
  cursor: pointer;
}

.heart-demon-report > p {
  margin-top: 10px;
  color: #aebd91;
  font-size: 12px;
}

.heart-demon-report ol {
  max-height: 220px;
  padding-left: 24px;
  margin: 12px 0 0;
  overflow-y: auto;
  color: #a99f8d;
  font-size: 12px;
  line-height: 1.7;
}

.attribute-status {
  min-height: 1.5em;
  margin-top: 8px !important;
  color: #817965 !important;
  font-size: 12px;
}

.attribute-status:empty {
  display: none;
}

.attribute-status[data-state="error"] {
  color: #d88672 !important;
}

.attribute-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.attribute-panel .attribute-panel-heading h2 {
  margin: 0;
  font-size: 18px;
}

.attribute-detail-button {
  padding: 7px 12px;
  border: 1px solid rgba(194, 151, 70, 0.38);
  border-radius: 999px;
  background: rgba(70, 57, 30, 0.5);
  color: #c6ad73;
  font-size: 12px;
}

.attribute-detail-button:hover,
.attribute-detail-button:focus-visible {
  border-color: #bd9446;
  color: #ebca82;
}

.attribute-list {
  overflow: hidden;
  margin-top: 8px;
  border: 1px solid rgba(194, 151, 70, 0.16);
  border-radius: 8px;
  background: rgba(10, 13, 10, 0.38);
}

.attribute-list__row {
  display: flex;
  min-height: 30px;
  padding: 4px 10px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(194, 151, 70, 0.1);
}

.attribute-list__row:last-child {
  border-bottom: 0;
}

.attribute-list__row span {
  color: #948a73;
  font-size: 12px;
}

.attribute-list__row strong {
  color: #dbc388;
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

.attribute-source-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(194, 151, 70, 0.18);
}

.attribute-source-section h3 {
  margin: 0 0 8px;
  color: #b9a575;
  font-size: 14px;
  font-weight: 500;
}

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

.reserved-slot-grid--kungfu {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.reserved-slot-card {
  display: grid;
  min-width: 0;
  min-height: 72px;
  padding: 5px 3px;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  justify-items: center;
  border: 1px dashed rgba(194, 151, 70, 0.28);
  border-radius: 7px;
  background: rgba(8, 11, 8, 0.28);
  color: inherit;
  text-align: center;
  cursor: pointer;
}

.reserved-slot-card:hover,
.reserved-slot-card:focus-visible {
  border-color: rgba(205, 166, 86, 0.68);
  background: rgba(61, 51, 29, 0.38);
  outline: none;
}

.reserved-slot-card__icon {
  display: grid;
  width: 38px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(194, 151, 70, 0.2);
  border-radius: 6px;
  background: rgba(18, 21, 16, 0.72);
  color: #5f5a4c;
  font-size: 11px;
}

.reserved-slot-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.equipment-slot-card[data-equipped="true"] {
  border-style: solid;
  border-color: var(--equipment-quality-color, rgba(205, 166, 86, 0.68));
  box-shadow: inset 0 0 10px color-mix(in srgb, var(--equipment-quality-color, #cda656) 15%, transparent);
}

.reserved-slot-card__content {
  width: 100%;
  min-width: 0;
}

.reserved-slot-card__label,
.reserved-slot-card__name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reserved-slot-card__label {
  color: #9c8e70;
  font-size: 10px;
}

.reserved-slot-card__name {
  margin-top: 2px;
  color: #615c4e;
  font-size: 9px;
  font-weight: 500;
}

.reserved-slot-grid--kungfu .reserved-slot-card {
  min-height: 68px;
  padding-inline: 2px;
}

.reserved-slot-grid--kungfu .reserved-slot-card__icon {
  width: 32px;
}

.reserved-slot-grid--kungfu .reserved-slot-card__label {
  font-size: 9px;
}

.reserved-slot-grid--kungfu .reserved-slot-card__name {
  font-size: 8px;
}

.attribute-modal {
  width: min(calc(100% - 32px), 420px);
  max-width: 420px;
  max-height: min(72vh, 540px);
  max-height: min(72dvh, 540px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(204, 164, 82, 0.5);
  border-radius: 10px;
  background: #141710;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.68);
  color: #ddd2b8;
}

.attribute-modal::backdrop {
  background: rgba(3, 4, 3, 0.76);
  backdrop-filter: blur(3px);
}

.attribute-modal__content {
  max-height: inherit;
  padding: 16px;
  overflow-y: auto;
}

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

.attribute-modal__heading h2 {
  margin: 0;
  color: #d3ad62;
  font-size: 18px;
}

.attribute-modal__close {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(194, 151, 70, 0.24);
  border-radius: 50%;
  background: rgba(31, 32, 25, 0.9);
  color: #ab9d7e;
  font-size: 20px;
  line-height: 1;
}

.advanced-attribute-board:empty {
  display: none;
}

.advanced-attribute-empty {
  padding: 24px 10px;
  margin: 12px 0 0;
  border: 1px dashed rgba(194, 151, 70, 0.18);
  border-radius: 8px;
  color: #736d5d;
  font-size: 13px;
  text-align: center;
}

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

.bag-panel .bag-heading h2 {
  margin: 0;
}

.bag-heading span {
  color: #8e846e;
  font-size: 11px;
}

.bag-categories {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.bag-categories::-webkit-scrollbar {
  display: none;
}

.bag-category-button {
  min-width: 0;
  min-height: 34px;
  padding: 6px 10px;
  flex: 1 0 56px;
  border: 1px solid rgba(194, 151, 70, 0.2);
  border-radius: 6px;
  background: rgba(17, 19, 15, 0.72);
  color: #827a67;
  font-size: 12px;
}

.bag-category-button.is-active {
  border-color: rgba(199, 156, 72, 0.68);
  background: linear-gradient(180deg, rgba(134, 99, 39, 0.72), rgba(83, 61, 26, 0.78));
  color: #f0d494;
}

.bag-category-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.bag-status {
  min-height: 1.4em;
  margin-top: 8px !important;
  color: #807966 !important;
  font-size: 11px;
}

.bag-status:empty {
  display: none;
}

.bag-status[data-state="error"] {
  color: #d88672 !important;
}

.bag-grid-empty {
  margin: 8px 0 0;
  color: #716b5c;
  font-size: 10px;
  text-align: center;
}

.bag-slot-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.bag-slot {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  padding: 4px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(194, 151, 70, 0.2);
  border-radius: 6px;
  background: rgba(10, 13, 10, 0.46);
  color: inherit;
}

.bag-slot--empty {
  border-style: dashed;
  background: rgba(7, 9, 7, 0.3);
}

.bag-slot--empty::after {
  width: 36%;
  aspect-ratio: 1;
  border: 1px solid rgba(194, 151, 70, 0.08);
  border-radius: 4px;
  content: "";
}

.bag-slot--occupied {
  border-color: var(--item-tier-color, rgba(194, 151, 70, 0.2));
  cursor: pointer;
}

.bag-slot--occupied:hover,
.bag-slot--occupied:focus-visible {
  border-color: var(--item-tier-color, rgba(205, 166, 86, 0.62));
  background: rgba(57, 48, 29, 0.42);
  box-shadow: 0 0 8px color-mix(in srgb, var(--item-tier-color, #cda656) 34%, transparent);
  outline: none;
}

.bag-slot__icon,
.bag-item-detail__icon {
  display: grid;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(194, 151, 70, 0.22);
  border-radius: 6px;
  background: rgba(18, 21, 16, 0.78);
  color: #6d6554;
}

.bag-slot__icon {
  width: 66%;
  aspect-ratio: 1;
  border-color: var(--item-tier-color, rgba(194, 151, 70, 0.22));
  font-size: 9px;
}

.bag-slot__icon img,
.bag-item-detail__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bag-slot__name,
.bag-slot__count {
  position: absolute;
  max-width: calc(100% - 6px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bag-slot__name {
  right: 3px;
  bottom: 3px;
  left: 3px;
  padding: 1px 2px;
  border-radius: 3px;
  background: rgba(8, 10, 8, 0.76);
  color: var(--item-tier-color, #bca873);
  font-size: 8px;
  text-align: center;
}

.bag-slot__count {
  top: 2px;
  right: 2px;
  padding: 1px 3px;
  border-radius: 999px;
  background: rgba(111, 78, 29, 0.92);
  color: #f0d494;
  font-size: 8px;
  font-weight: 500;
  line-height: 1.35;
}

.bag-slot__quality {
  position: absolute;
  top: 2px;
  left: 2px;
  max-width: calc(100% - 28px);
  overflow: hidden;
  padding: 1px 3px;
  border-radius: 999px;
  background: rgba(12, 13, 13, 0.82);
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 400px) {
  .bag-slot-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.bag-item-detail {
  display: flex;
  padding: 12px;
  margin-top: 14px;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(194, 151, 70, 0.16);
  border-radius: 8px;
  background: rgba(9, 12, 9, 0.45);
}

.bag-item-detail__icon {
  width: 54px;
  aspect-ratio: 1;
  flex: 0 0 54px;
  border-color: var(--item-tier-color, rgba(194, 151, 70, 0.22));
  font-size: 14px;
}

.bag-item-detail__identity {
  min-width: 0;
}

.bag-item-detail__identity strong,
.bag-item-detail__identity span {
  display: block;
}

.bag-item-detail__identity strong {
  color: #d6b977;
  font-size: 17px;
  font-weight: 500;
}

.bag-item-detail__identity span {
  margin-top: 5px;
  color: #8d846f;
  font-size: 12px;
}

.bag-item-detail__identity b {
  color: #bcaa80;
  font-weight: 500;
}

.bag-item-meta {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(194, 151, 70, 0.14);
  border-radius: 7px;
  background: rgba(7, 10, 7, 0.34);
}

.bag-item-meta__row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #817967;
  font-size: 11px;
}

.bag-item-meta__row dt,
.bag-item-meta__row dd {
  margin: 0;
}

.bag-item-meta__row dd {
  overflow: hidden;
  color: #b8aa89;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bag-item-detail__description {
  min-height: 3em;
  margin: 12px 0 0;
  color: #a09885;
  font-size: 12px;
  line-height: 1.65;
}

.bag-item-attributes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.bag-item-attributes[hidden] {
  display: none;
}

.bag-item-attributes span {
  padding: 6px 8px;
  border: 1px solid rgba(194, 151, 70, 0.14);
  border-radius: 6px;
  background: rgba(7, 10, 7, 0.34);
  color: #c5b081;
  font-size: 11px;
  text-align: center;
}

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

.bag-detail-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.bag-sell-note {
  margin: 10px 0 0;
  color: #716b5c;
  font-size: 10px;
  text-align: center;
}

.slot-selection-context {
  display: flex;
  padding: 12px;
  margin-top: 14px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(194, 151, 70, 0.16);
  border-radius: 8px;
  background: rgba(9, 12, 9, 0.45);
}

.slot-selection-context__icon {
  display: grid;
  width: 46px;
  aspect-ratio: 1;
  flex: 0 0 46px;
  place-items: center;
  border: 1px solid rgba(194, 151, 70, 0.22);
  border-radius: 7px;
  background: rgba(20, 23, 17, 0.8);
  color: #665f50;
  font-size: 11px;
}

.slot-selection-context span,
.slot-selection-context strong {
  display: block;
}

.slot-selection-context span {
  color: #807865;
  font-size: 11px;
}

.slot-selection-context strong {
  margin-top: 4px;
  color: #c9ad73;
  font-size: 15px;
  font-weight: 500;
}

.slot-selection-board {
  display: grid;
  max-height: min(44vh, 340px);
  padding: 12px;
  margin-top: 12px;
  gap: 8px;
  overflow-y: auto;
  border: 1px dashed rgba(194, 151, 70, 0.2);
  border-radius: 8px;
  color: #766f5e;
  text-align: center;
}

.equipment-choice {
  display: grid;
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  border: 1px solid rgba(194, 151, 70, 0.2);
  border-radius: 7px;
  background: rgba(12, 15, 11, 0.72);
  color: #a99d82;
  text-align: left;
  cursor: pointer;
}

.equipment-choice:hover,
.equipment-choice:focus-visible {
  border-color: rgba(205, 166, 86, 0.66);
  background: rgba(57, 48, 29, 0.42);
  outline: none;
}

.equipment-choice:disabled {
  cursor: default;
  opacity: 0.62;
}

.equipment-choice span,
.equipment-choice strong,
.equipment-choice small {
  display: block;
  min-width: 0;
}

.equipment-choice span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.equipment-choice strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-choice small {
  margin: 0;
  color: #817967;
  font-size: 10px;
}

.equipment-unequip-button {
  width: 100%;
}

.slot-selection-empty {
  padding: 18px 8px;
}

.slot-selection-board p {
  margin: 0;
  color: #91866f;
  font-size: 13px;
}

.slot-selection-board small {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.5;
}

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

.dungeon-heading h2 {
  margin: 0;
}

.dungeon-sweep-compact {
  padding: 4px 8px;
  border: 1px solid rgba(194, 151, 70, 0.28);
  border-radius: 999px;
  background: rgba(40, 34, 22, 0.58);
  color: #93866c;
  font-size: 10px;
  white-space: nowrap;
}

.dungeon-sweep-compact b {
  margin-left: 3px;
  color: #c9ad70;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.dungeon-categories {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.dungeon-category-button {
  min-width: 0;
  min-height: 34px;
  padding: 5px 3px;
  border: 1px solid rgba(194, 151, 70, 0.2);
  border-radius: 6px;
  background: rgba(20, 22, 17, 0.72);
  color: #92876f;
  cursor: pointer;
  font-size: 10px;
}

.dungeon-category-button span,
.dungeon-category-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dungeon-category-button small {
  margin-top: 1px;
  color: #625e53;
  font-size: 8px;
}

.dungeon-category-button.is-active {
  border-color: rgba(194, 151, 70, 0.6);
  background: linear-gradient(180deg, rgba(119, 87, 34, 0.72), rgba(66, 50, 24, 0.74));
  color: #ead49f;
}

.dungeon-category-button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.dungeon-active-run {
  display: flex;
  margin-top: 10px;
  padding: 9px 10px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(174, 133, 57, 0.34);
  border-radius: 7px;
  background: rgba(61, 47, 24, 0.45);
}

.dungeon-active-run[hidden] {
  display: none;
}

.dungeon-active-run span,
.dungeon-active-run strong,
.dungeon-active-run small {
  display: block;
}

.dungeon-active-run span {
  color: #7f7662;
  font-size: 8px;
}

.dungeon-active-run strong {
  margin-top: 2px;
  color: #cfb475;
  font-size: 13px;
  font-weight: 500;
}

.dungeon-active-run small {
  margin-top: 3px;
  color: #91856c;
  font-size: 9px;
}

.dungeon-active-run small b {
  color: #bca575;
  font-weight: 500;
}

.dungeon-active-run button {
  min-width: 72px;
  padding: 6px 8px;
  font-size: 9px;
}

.dungeon-active-run__actions {
  display: grid;
  gap: 5px;
  min-width: 94px;
}

.dungeon-status {
  min-height: 1.5em;
  margin-top: 9px !important;
  color: #817a68 !important;
  font-size: 10px;
}

.dungeon-status:empty {
  display: none;
}

.dungeon-status[data-state="ready"] {
  color: #9aad7b !important;
}

.dungeon-status[data-state="error"] {
  color: #d88672 !important;
}

.dungeon-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.dungeon-category-empty {
  margin: 0;
  padding: 18px 10px;
  border: 1px dashed rgba(194, 151, 70, 0.18);
  border-radius: 7px;
  color: #736d5e;
  text-align: center;
  font-size: 11px;
}

.dungeon-card {
  display: grid;
  grid-template-columns: minmax(56px, 20fr) minmax(0, 55fr) minmax(70px, 25fr);
  gap: 6px;
  align-items: stretch;
  padding: 8px;
  border: 1px solid rgba(194, 151, 70, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(28, 29, 20, 0.74), rgba(9, 12, 9, 0.54));
}

.dungeon-card__art {
  display: grid;
  width: 100%;
  aspect-ratio: 3 / 4;
  align-self: center;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(190, 145, 66, 0.36);
  border-radius: 7px;
  background: radial-gradient(circle, rgba(148, 103, 43, 0.22), #10130f 72%);
  color: #c09a55;
  font-size: 14px;
}

.dungeon-card__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dungeon-card__body {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.dungeon-card__body h3 {
  width: 100%;
  margin: 0;
  overflow: hidden;
  color: #d5b66f;
  font-size: 16px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dungeon-card__body > p {
  width: 100%;
  margin: 4px 0 0;
  color: #817a68;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.dungeon-card__recommendation {
  color: #aa9569 !important;
}

.dungeon-card__progress {
  color: #9ba77c !important;
  font-size: 10px !important;
}

.dungeon-card__daily {
  color: #c3a665 !important;
  font-weight: 500;
}

.dungeon-card__actions {
  display: grid;
  grid-template-rows: repeat(2, minmax(32px, 36px));
  gap: 6px;
  min-width: 0;
  align-content: center;
}

.dungeon-card__action-button {
  width: 100%;
  min-height: 32px;
  padding: 4px;
  font-size: 9px;
  line-height: 1.25;
}

.dungeon-card__action-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.dungeon-card__sweep-button.is-running,
.dungeon-card__sweep-button.is-settling {
  border-color: #4b4a40;
  background: #282923;
  color: #999486;
  opacity: 1;
  padding: 3px;
}

.dungeon-card__sweep-button span,
.dungeon-card__sweep-button strong {
  display: block;
  line-height: 1;
}

.dungeon-card__sweep-button span {
  font-size: 8px;
}

.dungeon-card__sweep-button strong {
  margin-top: 2px;
  color: #c1b18e;
  font-size: 10px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.dungeon-sweep-modal__content {
  width: min(280px, calc(100vw - 40px));
  text-align: center;
}

.dungeon-sweep-modal .attribute-modal__heading h2 {
  flex: 1;
  padding-left: 28px;
  text-align: center;
}

.dungeon-sweep-stepper {
  display: grid;
  grid-template-columns: 40px 72px 40px;
  margin-top: 14px;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dungeon-sweep-stepper button {
  width: 40px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(194, 151, 70, 0.32);
  border-radius: 6px;
  background: #25251d;
  color: #d2b572;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.dungeon-sweep-stepper button:disabled {
  border-color: #414139;
  color: #706e64;
  cursor: not-allowed;
  opacity: 0.65;
}

.dungeon-sweep-stepper strong {
  display: grid;
  min-height: 36px;
  place-items: center;
  border: 1px solid rgba(194, 151, 70, 0.2);
  border-radius: 6px;
  background: rgba(13, 16, 12, 0.72);
  color: #e0c17b;
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.dungeon-sweep-modal__meta {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: #918773;
  font-size: 11px;
  line-height: 1.4;
}

.dungeon-sweep-modal__meta b {
  color: #c7ad72;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.dungeon-sweep-confirm {
  width: min(180px, 100%);
  margin-top: 12px;
}

.dungeon-sweep-confirm:disabled {
  border-color: #4a493f;
  background: #292a26;
  color: #858278;
  cursor: not-allowed;
  opacity: 0.68;
}

.map-status {
  min-height: 1.5em;
  margin-top: 10px !important;
  color: #9f9a86 !important;
  font-size: 13px;
}

.map-status[data-state="success"] {
  color: #9fbd85 !important;
}

.map-status[data-state="error"] {
  color: #d88672 !important;
}

.monster-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.monster-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(194, 151, 70, 0.2);
  border-radius: 8px;
  background: rgba(12, 15, 11, 0.5);
}

.monster-card__art {
  display: grid;
  width: 76px;
  aspect-ratio: 3 / 4;
  place-items: center;
  overflow: hidden;
  border: 1px solid #4b432d;
  border-radius: 7px;
  background: radial-gradient(circle, rgba(141, 94, 46, 0.2), #10130f 70%);
  color: #b99554;
  font-size: 24px;
}

.monster-card__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.monster-card__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.monster-card__heading h3 {
  margin: 0;
  color: #d3ad62;
  font-size: 16px;
}

.monster-card__heading span {
  color: #94876d;
  font-size: 11px;
  white-space: nowrap;
}

.monster-card__body > p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
}

.monster-card__stats,
.monster-card__drops {
  color: #8c846f !important;
}

.monster-card__button {
  width: 100%;
  margin-top: 10px;
  padding-block: 8px;
}

.monster-card__button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.battle-report {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(194, 151, 70, 0.25);
  border-radius: 8px;
  background: rgba(22, 20, 14, 0.72);
}

.battle-report summary {
  color: #d3ad62;
  cursor: pointer;
}

.battle-report > p {
  margin-top: 9px;
  font-size: 12px;
}

.battle-report h3 {
  margin: 14px 0 7px;
  color: #b9a575;
  font-size: 14px;
}

.battle-rewards,
.battle-log {
  margin: 0;
  color: #a99f8d;
  font-size: 12px;
  line-height: 1.7;
}

.battle-log {
  max-height: 240px;
  padding-left: 24px;
  overflow-y: auto;
}

@media (max-width: 360px) {
  .monster-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .monster-card__art {
    width: 64px;
  }

  .dungeon-card {
    grid-template-columns: minmax(52px, 20fr) minmax(0, 54fr) minmax(66px, 26fr);
    gap: 5px;
    padding: 7px;
  }

  .dungeon-card__art {
    width: 100%;
  }

  .dungeon-card__body h3 {
    font-size: 14px;
  }

  .dungeon-card__body > p {
    margin-top: 3px;
    font-size: 10px;
  }

  .dungeon-card__progress,
  .dungeon-card__action-button {
    font-size: 9px !important;
  }
}

.create-form {
  margin-top: 16px;
}

.create-form label {
  display: block;
  margin-bottom: 8px;
  color: #c3b89e;
  font-size: 14px;
}

.create-form > input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #51482f;
  border-radius: 6px;
  outline: none;
  background: #10130f;
  color: #eee4cc;
}

.create-form > input:focus {
  border-color: #ad8a45;
  box-shadow: 0 0 0 3px rgba(173, 138, 69, 0.12);
}

.primary-button,
.secondary-button {
  padding: 10px 14px;
  border-radius: 6px;
}

.primary-button {
  border: 1px solid #bd9446;
  background: linear-gradient(180deg, #aa813a, #775621);
  color: #fff5db;
}

.secondary-button {
  border: 1px solid #625537;
  background: #25251d;
  color: #cabd9f;
}

.use-pill-button:not(:disabled) {
  border-color: #bd9446;
  background: linear-gradient(180deg, #aa813a, #775621);
  color: #fff5db;
}

.create-button {
  width: 100%;
  margin-top: 18px;
}

.gender-fieldset {
  padding: 0;
  margin: 18px 0 0;
  border: 0;
}

.gender-fieldset legend {
  margin-bottom: 10px;
  color: #c3b89e;
  font-size: 14px;
}

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

.gender-option {
  position: relative;
  display: grid;
  gap: 8px;
  color: #a99d82;
  text-align: center;
  cursor: pointer;
}

.gender-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.gender-portrait {
  display: grid;
  width: 100%;
  aspect-ratio: 3 / 4;
  place-items: center;
  overflow: hidden;
  border: 1px solid #4b432d;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 28%, rgba(195, 158, 82, 0.12), transparent 48%),
    #121510;
  color: #c5a765;
  font-size: 30px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.gender-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gender-option input:checked + .gender-portrait {
  border-color: #c99f4d;
  box-shadow: 0 0 0 3px rgba(201, 159, 77, 0.14);
  transform: translateY(-2px);
}

.gender-option input:focus-visible + .gender-portrait {
  outline: 2px solid #e2bd71;
  outline-offset: 2px;
}

.player-identity {
  display: flex;
  align-items: center;
  gap: 11px;
}

.player-identity strong {
  display: block;
  color: #e3c98e;
  font-size: 17px;
}

.player-summary {
  min-width: 0;
}

.player-summary strong,
.player-summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-summary span {
  display: block;
  margin-top: 4px;
  color: #91866f;
  font-size: 12px;
}

.gender-portrait--compact {
  width: 52px;
  height: 52px;
  aspect-ratio: 1;
  flex: 0 0 52px;
  font-size: 18px;
}

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

.future-grid span {
  padding: 14px;
  border: 1px solid #403b2b;
  border-radius: 7px;
  color: #bbae8e;
  text-align: center;
}

.future-grid small {
  display: block;
  margin-top: 5px;
  color: #716b5b;
}

.more-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.more-menu-entry {
  display: grid;
  min-height: 72px;
  padding: 12px;
  place-content: center;
  gap: 5px;
  border: 1px solid #4a422f;
  border-radius: 7px;
  background: rgba(31, 31, 24, 0.86);
  color: #d7c59f;
  text-align: center;
}

.more-menu-entry small {
  color: #8e846d;
  font-size: 11px;
}

.more-menu-entry:disabled {
  cursor: default;
  opacity: 0.58;
}

.redeem-code-modal__content {
  display: grid;
  gap: 14px;
}

.redeem-code-form {
  display: grid;
  gap: 9px;
}

.redeem-code-form label {
  color: #b9aa87;
  font-size: 13px;
}

.redeem-code-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(194, 151, 70, 0.42);
  border-radius: 6px;
  outline: 0;
  background: #0e100c;
  color: #eee1c4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.redeem-code-form input:focus {
  border-color: #c79a45;
  box-shadow: 0 0 0 2px rgba(194, 151, 70, 0.14);
}

.redeem-code-status {
  min-height: 20px;
  margin: 0;
  color: #938970;
  font-size: 13px;
  text-align: center;
}

.redeem-code-status[data-state="error"] {
  color: #df9d8f;
}

.redeem-code-status[data-state="success"] {
  color: #ddbc73;
}

.redeem-code-rewards {
  display: grid;
  padding: 10px 12px;
  margin: 0;
  gap: 6px;
  border: 1px solid rgba(194, 151, 70, 0.22);
  border-radius: 7px;
  background: rgba(12, 14, 10, 0.56);
  color: #cbbd9d;
  font-size: 13px;
  list-style: none;
}

.redeem-code-rewards li[data-pending="true"] {
  color: #d6a06d;
}

.reset-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(194, 151, 70, 0.18);
}

.reset-section h3 {
  margin: 0 0 8px;
  color: #c9b485;
  font-size: 16px;
}

.reset-section > p {
  margin-bottom: 14px;
}

.danger-button {
  padding: 10px 14px;
  border: 1px solid #8c4e40;
  border-radius: 6px;
  background: #43251f;
  color: #e6b2a6;
}

.reset-confirmation {
  padding: 14px;
  border: 1px solid rgba(181, 91, 70, 0.48);
  border-radius: 7px;
  background: rgba(73, 35, 28, 0.45);
}

.reset-confirmation strong {
  display: block;
  margin-bottom: 12px;
  color: #e1aa9e;
  font-size: 14px;
  font-weight: 500;
}

.reset-actions {
  display: flex;
  gap: 10px;
}

.bottom-nav {
  position: fixed;
  z-index: 10;
  bottom: 0;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(var(--bottom-nav-count, 5), minmax(0, 1fr));
  width: min(100%, 480px);
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateX(-50%);
  border-top: 1px solid rgba(194, 151, 70, 0.25);
  background: rgba(16, 18, 14, 0.97);
  backdrop-filter: blur(12px);
}

.bottom-nav button {
  min-height: 64px;
  border: 0;
  background: transparent;
  color: #807967;
  font-size: 14px;
}

.bottom-nav button.is-active {
  color: #dfbd76;
  background: linear-gradient(180deg, rgba(179, 136, 56, 0.12), transparent);
}

/* V1.3 修炼页骨架：固定视口，立绘与修炼信息并排。 */
html,
body {
  height: 100%;
  overflow: hidden;
}

.game-shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
}

.game-header {
  flex: 0 0 auto;
}

.game-content {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow-y: auto;
}

.player-interface {
  display: grid;
  min-height: 100%;
  flex: 1 1 auto;
  grid-template-rows: auto minmax(0, 1fr);
}

.page-panel {
  min-height: 0;
  overflow-y: auto;
}

.cultivate-panel {
  display: flex;
  height: 100%;
  min-height: 0;
  padding: 10px;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.cultivate-overview {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(92px, 0.38fr) minmax(0, 0.62fr);
  gap: 9px;
  align-items: start;
}

.cultivate-character-stage {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.cultivate-info-panel {
  min-width: 0;
  height: 100%;
  padding: 9px;
  margin-top: 0;
}

.cultivate-info-heading h2 {
  margin-bottom: 0;
  font-size: 15px;
}

.cultivation-progress-block {
  margin-top: 8px;
}

.cultivation-progress-block .progress-label {
  gap: 5px;
  margin-bottom: 4px;
  font-size: 10px;
}

.cultivation-progress-block .progress-label strong {
  font-size: 11px;
  white-space: nowrap;
}

.cultivation-progress-block progress {
  display: block;
  height: 7px;
}

.cultivate-compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(194, 151, 70, 0.1);
  color: #857d69;
  font-size: 10px;
}

.cultivate-compact-row strong {
  color: #c6ad73;
  font-size: 11px;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.qi-sea-progress-block .cultivate-state {
  display: block;
  max-width: none;
  padding: 0;
  margin-top: 4px;
  border: 0;
  border-radius: 0;
  font-size: 9px;
  line-height: 1.35;
  text-align: left;
}

.offline-message {
  min-height: 0;
  margin-top: 4px !important;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.35 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offline-message:empty,
.breakthrough-result:empty {
  display: none;
}

.breakthrough-card {
  margin-top: 0;
}

.breakthrough-actions {
  gap: 8px;
}

.breakthrough-action-button {
  min-height: 58px;
  padding: 7px 8px;
}

.breakthrough-action-button strong {
  font-size: 15px;
}

.pill-panel {
  gap: 6px;
  margin-top: 6px;
}

  .pill-status {
    font-size: 10px;
  }

  .barrier-pill-panel {
    margin-top: 6px;
    padding: 6px 8px;
  }

  .barrier-pill-status {
    font-size: 10px;
  }

.heart-demon-button {
  min-height: 48px;
  margin-top: 6px;
}

.breakthrough-result {
  min-height: 0;
  margin-top: 6px !important;
  font-size: 11px;
  line-height: 1.35 !important;
}

  .use-pill-button:disabled,
  .use-barrier-pill-button:disabled,
  .heart-demon-button:disabled,
.breakthrough-button:disabled {
  border-color: #4a493f;
  background: #292a26;
  color: #8b897f;
  opacity: 0.62;
}

@media (max-height: 700px) {
  .game-header {
    padding: 8px 14px 7px;
  }

  .game-header h1 {
    font-size: 18px;
  }

  .game-header__subtitle {
    margin-top: 1px;
    font-size: 9px;
  }

  .game-content {
    gap: 7px;
    padding: 7px 8px;
  }

  .player-interface {
    gap: 7px;
  }

  .role-card--compact {
    padding: 6px 9px;
  }

  .gender-portrait--compact {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .player-identity strong {
    font-size: 15px;
  }

  .player-summary span {
    margin-top: 2px;
    font-size: 10px;
  }

  .cultivate-panel {
    padding: 7px;
    gap: 6px;
  }

  .cultivate-overview {
    grid-template-columns: minmax(86px, 0.35fr) minmax(0, 0.65fr);
    gap: 7px;
  }

  .cultivate-info-panel {
    padding: 7px;
  }

  .cultivate-info-heading h2 {
    font-size: 13px;
  }

  .cultivation-progress-block {
    margin-top: 6px;
  }

  .cultivate-compact-row {
    padding: 4px 0;
  }

  .breakthrough-action-button {
    min-height: 50px;
    padding: 5px 7px;
  }

  .breakthrough-action-button strong {
    font-size: 14px;
  }

  .breakthrough-action-button small {
    margin-top: 2px;
    font-size: 9px;
  }
}
