:root {
  --bg: #dbeaf7;
  --panel: #f7fbff;
  --panel-strong: #ffffff;
  --ink: #18263a;
  --muted: #60738d;
  --line: #b8cee5;
  --line-dark: #41658d;
  --gold: #d4a743;
  --red: #b4443f;
  --blue: #286aa5;
  --green: #3f7d63;
  --violet: #655c9d;
  --shadow: rgba(22, 52, 88, 0.18);
  --radius: 8px;
}

/* Map clarity 1.4.1 */
.map-workspace {
  display: grid;
  gap: 0;
  min-width: 0;
}

.map-location-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.62);
}

.map-location-bar > div,
.map-section-heading > div,
.map-route-plan-head > div,
.map-region-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.map-location-bar span,
.map-section-heading span,
.map-route-plan span,
.map-region-summary span,
.map-route-current > div > span,
.map-local-summary > div > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.map-location-bar strong {
  color: #7b3832;
  overflow-wrap: anywhere;
}

.map-location-bar small,
.map-section-heading small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
}

.map-view-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 236, 216, 0.56);
}

.map-view-tabs button {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 56px;
  padding: 8px 12px;
  border-color: rgba(92, 73, 55, 0.2);
  background: rgba(255, 250, 240, 0.66);
  text-align: left;
}

.map-view-tabs button strong,
.map-view-tabs button span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.map-view-tabs button strong {
  color: #3f3126;
  font-size: 13px;
}

.map-view-tabs button span {
  color: var(--muted);
  font-size: 11px;
}

.map-view-tabs button.is-active {
  border-color: rgba(47, 95, 134, 0.58);
  background: rgba(230, 241, 247, 0.9);
  box-shadow: inset 3px 0 0 var(--blue);
}

.map-route-view,
.map-overview-view,
.map-local-view {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.map-route-current,
.map-local-summary {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.78);
}

.map-current-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 250, 240, 0.86);
  border-radius: 50%;
  background: var(--zone-color, var(--blue));
  box-shadow: 0 0 0 1px rgba(92, 73, 55, 0.28);
  color: #fff8e6;
  font-weight: 900;
}

.map-route-current > div,
.map-local-summary > div,
.map-stop-copy,
.map-local-connection > div,
.map-region-node > div,
.map-route-steps li > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.map-route-current strong,
.map-local-summary strong,
.map-next-stop strong,
.map-local-connection strong,
.map-region-node strong,
.map-route-steps strong {
  color: #3f3126;
  overflow-wrap: anywhere;
}

.map-route-current small,
.map-local-summary small,
.map-next-stop small,
.map-local-connection small,
.map-region-node small,
.map-route-steps small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.map-route-current > button,
.map-route-plan button,
.map-next-stop > button,
.map-local-connection > button {
  min-height: 44px;
  padding: 8px 12px;
}

.map-route-plan {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(47, 95, 134, 0.3);
  border-radius: 8px;
  background: rgba(230, 241, 247, 0.66);
}

.map-route-plan.is-empty,
.map-route-plan.is-arrived {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.map-route-plan.is-arrived {
  border-color: rgba(63, 118, 84, 0.36);
  background: rgba(235, 246, 232, 0.76);
}

.map-route-plan.is-danger {
  border-color: rgba(157, 47, 45, 0.36);
  background: rgba(255, 240, 234, 0.78);
}

.map-route-plan.is-empty > div:first-child,
.map-route-plan.is-arrived > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.map-route-plan strong {
  color: #174e79;
  overflow-wrap: anywhere;
}

.map-route-plan small {
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.map-route-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.map-route-plan-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.map-route-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.map-route-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 8px 0;
}

.map-route-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 44px;
  bottom: -8px;
  width: 2px;
  background: rgba(47, 95, 134, 0.28);
}

.map-route-index {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(47, 95, 134, 0.4);
  border-radius: 50%;
  background: #eef6fa;
  color: #174e79;
  font-size: 12px;
  font-weight: 900;
  z-index: 1;
}

.map-route-steps li.is-origin .map-route-index {
  border-color: rgba(123, 56, 50, 0.44);
  background: #fff6e6;
  color: #7b3832;
}

.map-route-steps li.is-next {
  margin: 2px 0;
  padding: 10px;
  border: 1px solid rgba(63, 118, 84, 0.3);
  border-radius: 8px;
  background: rgba(238, 247, 235, 0.82);
}

.map-route-steps li.is-next::after {
  left: 24px;
  top: 48px;
}

.map-route-steps li em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.map-route-steps li button {
  min-height: 44px;
  padding: 8px 11px;
  border-color: rgba(63, 118, 84, 0.42);
  background: rgba(238, 247, 235, 0.94);
}

.map-next-stops,
.map-local-connections {
  display: grid;
  gap: 10px;
}

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

.map-section-heading strong {
  color: #3f3126;
}

.map-next-stop-list,
.map-local-connection-list {
  display: grid;
  gap: 8px;
}

.map-next-stop {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.76);
}

.map-next-stop.risk-safe,
.map-local-connection.risk-safe {
  border-color: rgba(63, 118, 84, 0.36);
}

.map-next-stop.risk-warn,
.map-local-connection.risk-warn {
  border-color: rgba(195, 149, 53, 0.5);
}

.map-next-stop.risk-danger,
.map-local-connection.risk-danger {
  border-color: rgba(157, 47, 45, 0.42);
  background: rgba(255, 244, 238, 0.82);
}

.map-stop-direction {
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  border: 1px solid rgba(47, 95, 134, 0.28);
  border-radius: 8px;
  background: rgba(230, 241, 247, 0.72);
  color: #174e79;
  font-size: 12px;
  font-weight: 900;
}

.map-stop-copy > span {
  color: #7b3832;
  font-size: 11px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.map-region-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 7px;
}

.map-region-selector button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 7px;
  align-items: center;
  min-width: 0;
  min-height: 54px;
  padding: 7px 9px;
  text-align: left;
}

.map-region-selector button > span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--region-color);
  color: #fff8e6;
  font-size: 11px;
  font-weight: 900;
}

.map-region-selector strong,
.map-region-selector small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.map-region-selector strong {
  color: #3f3126;
  font-size: 12px;
}

.map-region-selector small {
  color: var(--muted);
  font-size: 10px;
}

.map-region-selector button.is-active {
  border-color: rgba(47, 95, 134, 0.56);
  background: rgba(230, 241, 247, 0.84);
}

.map-region-selector button.is-current {
  box-shadow: inset 0 0 0 1px rgba(195, 149, 53, 0.4);
}

.map-region-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
}

.map-region-summary strong {
  color: #7b3832;
}

.map-region-summary small {
  color: var(--muted);
  line-height: 1.45;
}

.map-region-summary p {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: right;
}

.map-region-node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.map-region-node {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 5px 9px;
  align-items: center;
  min-width: 0;
  min-height: 82px;
  padding: 10px;
  text-align: left;
}

.map-region-node .zone-mark {
  grid-row: span 2;
}

.map-region-node em,
.map-region-node b {
  font-size: 11px;
  font-style: normal;
  text-align: right;
}

.map-region-node em {
  color: var(--muted);
}

.map-region-node b {
  color: #174e79;
}

.map-region-node.is-current {
  border-color: rgba(63, 118, 84, 0.44);
  background: rgba(238, 247, 235, 0.84);
}

.map-region-node.is-target {
  border-color: rgba(47, 95, 134, 0.58);
  box-shadow: inset 3px 0 0 var(--blue);
}

.map-local-breadcrumb {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
}

.map-local-breadcrumb > span {
  position: relative;
  display: grid;
  grid-template-columns: 26px auto;
  gap: 1px 7px;
  align-items: center;
  min-width: 150px;
  padding: 8px 10px;
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.66);
}

.map-local-breadcrumb > span:not(:last-child)::after {
  content: ">";
  position: absolute;
  right: -7px;
  color: var(--muted);
  z-index: 1;
}

.map-local-breadcrumb i {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(47, 95, 134, 0.12);
  color: #174e79;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.map-local-breadcrumb strong,
.map-local-breadcrumb small {
  overflow-wrap: anywhere;
}

.map-local-breadcrumb strong {
  color: #3f3126;
  font-size: 12px;
}

.map-local-breadcrumb small {
  color: var(--muted);
  font-size: 10px;
}

.map-local-breadcrumb > span.is-current {
  border-color: rgba(47, 95, 134, 0.5);
  background: rgba(230, 241, 247, 0.82);
}

.map-local-summary {
  grid-template-columns: 36px minmax(0, 1fr);
}

.map-local-connection {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.74);
}

.map-empty-state {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px dashed rgba(92, 73, 55, 0.26);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.48);
  text-align: center;
}

.map-empty-state strong {
  color: #3f3126;
}

.map-empty-state span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 820px) {
  .map-region-selector {
    grid-auto-flow: column;
    grid-auto-columns: minmax(132px, 42vw);
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }

  .map-region-selector button {
    scroll-snap-align: start;
  }

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

@media (max-width: 560px) {
  .map-location-bar,
  .map-section-heading,
  .map-region-summary,
  .map-route-plan-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-location-bar small,
  .map-section-heading small,
  .map-region-summary p {
    text-align: left;
  }

  .map-view-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 8px;
  }

  .map-view-tabs button {
    justify-items: center;
    min-height: 48px;
    padding: 7px 5px;
    text-align: center;
  }

  .map-view-tabs button span {
    display: none;
  }

  .map-route-view,
  .map-overview-view,
  .map-local-view {
    padding: 10px;
  }

  .map-route-current,
  .map-next-stop,
  .map-local-connection {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .map-route-current > button,
  .map-next-stop > button,
  .map-local-connection > button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .map-route-plan.is-empty,
  .map-route-plan.is-arrived {
    grid-template-columns: 1fr;
  }

  .map-route-plan.is-empty > button,
  .map-route-plan-actions,
  .map-route-plan-actions button {
    width: 100%;
  }

  .map-route-steps li {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .map-route-steps li > button,
  .map-route-steps li > em {
    grid-column: 2;
    justify-self: stretch;
  }

  .map-route-steps li > button {
    width: 100%;
  }

  .map-region-node-grid {
    grid-template-columns: 1fr;
  }

  .map-region-node {
    min-height: 76px;
  }
}

/* UI refactor V5: quests, dungeons, shops and settings workspaces. */
.adventure-module-v5 .panel-body,
.quest-module-v5 .panel-body,
.settings-module-v5 .panel-body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.adventure-v5-summary,
.quest-v5-kpis,
.shop-v5-summary,
.settings-v5-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.adventure-v5-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.adventure-v5-summary > div,
.quest-v5-kpis span,
.shop-v5-summary > div,
.settings-v5-card {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(37, 110, 168, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 10px;
}

.adventure-v5-summary > div.is-warn,
.adventure-v5-summary > div.is-active {
  border-color: rgba(180, 83, 9, 0.24);
  background: rgba(255, 247, 237, 0.78);
}

.adventure-v5-summary span,
.quest-v5-stage span,
.quest-v5-focus span,
.shop-v5-summary span,
.settings-v5-card span,
.settings-v5-section span {
  color: var(--hs-color-text-muted);
  font-size: 11px;
  font-weight: 800;
}

.adventure-v5-summary strong,
.quest-v5-stage strong,
.quest-v5-focus strong,
.shop-v5-summary strong,
.settings-v5-card strong,
.settings-v5-section strong {
  overflow: hidden;
  color: var(--hs-color-text);
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adventure-v5-summary small,
.quest-v5-stage small,
.quest-v5-focus small,
.shop-v5-summary small,
.settings-v5-card small {
  overflow: hidden;
  color: var(--hs-color-text-muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quest-v5-overview {
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) minmax(320px, 1.35fr) minmax(220px, 0.9fr);
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}

.quest-v5-stage,
.quest-v5-focus {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(47, 133, 90, 0.16);
  border-radius: 8px;
  background: rgba(240, 253, 244, 0.62);
  padding: 10px;
}

.quest-v5-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quest-v5-kpis span {
  padding: 7px 8px;
}

.quest-v5-kpis b {
  color: var(--hs-color-text-muted);
  font-size: 11px;
}

.quest-v5-kpis em {
  color: var(--hs-color-text);
  font-size: 16px;
  font-style: normal;
  font-weight: 900;
}

.quest-v5-actions,
.shop-v5-actions,
.settings-v5-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.quest-v5-actions button,
.shop-v5-actions button,
.settings-v5-actions button,
.quest-destination-action {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 42px;
  border-radius: 8px;
  text-align: left;
}

.quest-v5-actions button,
.shop-v5-actions button {
  flex: 1 1 180px;
}

.quest-destination-action {
  width: 100%;
  border: 1px solid rgba(37, 110, 168, 0.16);
  background: rgba(239, 246, 255, 0.72);
  padding: 8px 10px;
}

.quest-destination-action.is-ready {
  border-color: rgba(47, 133, 90, 0.2);
  background: rgba(240, 253, 244, 0.72);
}

.quest-destination-action.is-route {
  border-color: rgba(180, 83, 9, 0.22);
  background: rgba(255, 247, 237, 0.78);
}

.quest-destination-action.is-compact {
  margin-top: 2px;
}

.quest-destination-action strong,
.quest-destination-action span,
.quest-v5-actions strong,
.quest-v5-actions span,
.shop-v5-actions strong,
.shop-v5-actions span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quest-destination-action span,
.quest-v5-actions span,
.shop-v5-actions span {
  color: var(--hs-color-text-muted);
  font-size: 11px;
}

.quest-module-v5 .quest-list {
  gap: 8px;
}

.quest-module-v5 .quest-card {
  gap: 7px;
}

.shop-panel-v5 {
  display: grid;
  gap: 10px;
}

.shop-v5-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.settings-v5-section,
.settings-v5-danger {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(92, 73, 55, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.56);
  padding: 10px;
}

.settings-v5-section {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
}

.settings-v5-section > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-v5-danger summary {
  cursor: pointer;
  font-weight: 900;
}

.settings-v5-danger p {
  margin: 0;
  color: var(--hs-color-text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.settings-v5-danger button {
  justify-self: start;
  border-color: rgba(185, 28, 28, 0.25);
  color: #991b1b;
}

.online-module-v1 .panel-body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.online-v1-status,
.online-equipment-panel,
.online-leaderboard-panel,
.online-friends-panel,
.online-mail-panel,
.online-world-panel,
.online-party-panel,
.online-message-panel,
.online-activity-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(37, 110, 168, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  padding: 10px;
}

.online-v1-status {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
}

.online-v1-status > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.online-v1-status strong,
.online-equipment-panel > strong {
  overflow: hidden;
  color: var(--hs-color-text);
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-v1-status span,
.online-equipment-panel > small,
.online-leaderboard-tools span {
  color: var(--hs-color-text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.online-v1-tabs,
.online-leaderboard-tools,
.online-friend-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.online-profile-grid,
.online-future-grid,
.online-friend-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.online-friend-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.online-friend-add > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.online-friend-add input {
  min-width: 140px;
  max-width: 180px;
  border: 1px solid rgba(37, 110, 168, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 8px 10px;
}

.online-friend-section,
.online-mail-list,
.online-mail-detail,
.online-profile-actions {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(37, 110, 168, 0.12);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.48);
  padding: 8px;
}

.online-friend-section > strong,
.online-mail-list > strong {
  color: var(--hs-color-text);
  font-size: 13px;
  font-weight: 900;
}

.online-profile-actions {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.online-profile-actions small {
  color: var(--hs-color-text-muted);
  font-size: 12px;
}

.online-friend-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(37, 110, 168, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  padding: 8px;
}

.online-friend-row > button {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-align: left;
}

.online-friend-row strong,
.online-friend-row span,
.online-friend-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-friend-row span,
.online-friend-row small {
  color: var(--hs-color-text-muted);
  font-size: 11px;
}

.online-friend-row > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.online-mail-panel {
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.4fr);
}

.online-world-panel {
  grid-template-columns: minmax(210px, 0.78fr) minmax(0, 1.55fr);
  align-items: start;
}

.online-world-list,
.online-world-detail,
.online-world-rank {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.online-world-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

.online-world-list button {
  display: grid;
  gap: 2px;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(37, 110, 168, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  padding: 8px;
  text-align: left;
}

.online-world-list button.is-active {
  border-color: rgba(37, 110, 168, 0.34);
  background: rgba(219, 234, 254, 0.8);
}

.online-world-list span,
.online-world-list small,
.online-world-title span,
.online-world-title small,
.online-world-progress span,
.online-world-progress small,
.online-world-actions small {
  color: var(--hs-color-text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.online-world-list strong,
.online-world-title strong,
.online-world-progress strong,
.online-world-rank > strong {
  overflow: hidden;
  color: var(--hs-color-text);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-world-title,
.online-world-progress {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(37, 110, 168, 0.12);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.52);
  padding: 10px;
}

.online-world-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.online-world-progress-track {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: rgba(37, 110, 168, 0.14);
}

.online-world-progress-track i {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--hs-color-primary), #50a7d7);
}

.online-world-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.online-world-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.online-world-actions small {
  min-width: min(260px, 100%);
}

.online-world-rank {
  max-height: 360px;
  overflow: auto;
  border-top: 1px solid rgba(37, 110, 168, 0.12);
  padding-top: 8px;
}

.online-party-panel,
.online-party-presets,
.online-party-section,
.online-party-card {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.online-party-presets {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.online-party-presets-title {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
}

.online-party-presets-title strong,
.online-party-section > strong,
.online-party-title strong,
.online-party-progress strong,
.online-party-preset strong {
  overflow: hidden;
  color: var(--hs-color-text);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-party-presets-title span,
.online-party-title span,
.online-party-title small,
.online-party-progress span,
.online-party-progress small,
.online-party-preset span,
.online-party-preset small,
.online-party-reward,
.online-party-actions small,
.online-party-empty {
  color: var(--hs-color-text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.online-party-preset,
.online-party-card {
  border: 1px solid rgba(37, 110, 168, 0.12);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.52);
  padding: 10px;
}

.online-party-preset {
  display: grid;
  gap: 5px;
}

.online-party-preset button {
  justify-self: start;
  min-height: 36px;
}

.online-party-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.online-party-section {
  align-content: start;
  border: 1px solid rgba(37, 110, 168, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
  padding: 8px;
}

.online-party-title,
.online-party-progress {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.online-party-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.online-party-reward {
  display: grid;
  gap: 2px;
  border-top: 1px solid rgba(37, 110, 168, 0.1);
  padding-top: 6px;
}

.online-party-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.online-party-actions button {
  min-height: 36px;
}

.online-party-action-list {
  display: grid;
  gap: 5px;
  border-top: 1px solid rgba(37, 110, 168, 0.1);
  padding-top: 6px;
}

.online-party-action-list span {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(37, 110, 168, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.58);
  padding: 6px;
}

.online-party-action-list b,
.online-party-action-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-party-action-list small {
  color: var(--hs-color-text-muted);
  font-size: 11px;
}

.online-message-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.online-message-board,
.online-message-title,
.online-message-list,
.online-message-row,
.online-message-compose,
.online-message-friends {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.online-message-board {
  align-content: start;
  border: 1px solid rgba(37, 110, 168, 0.12);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.5);
  padding: 10px;
}

.online-message-title {
  gap: 3px;
}

.online-message-title strong,
.online-message-row strong {
  overflow: hidden;
  color: var(--hs-color-text);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-message-title span,
.online-message-row span,
.online-message-friends small {
  color: var(--hs-color-text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.online-message-list {
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.online-message-row {
  border: 1px solid rgba(37, 110, 168, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  padding: 8px;
}

.online-message-row > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.online-message-row p {
  margin: 0;
  color: var(--hs-color-text);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.online-message-compose {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.online-message-compose input {
  min-width: 0;
  border: 1px solid rgba(37, 110, 168, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 8px 10px;
}

.online-message-friends {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.online-message-friends button {
  overflow: hidden;
  min-height: 36px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-message-friends button.is-active {
  border-color: rgba(37, 110, 168, 0.34);
  background: rgba(219, 234, 254, 0.8);
}

.online-activity-panel,
.online-activity-actions,
.online-presence-section,
.online-activity-feed {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.online-activity-actions {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid rgba(37, 110, 168, 0.12);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.5);
  padding: 10px;
}

.online-activity-actions > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.online-activity-actions strong,
.online-presence-section > strong,
.online-activity-title strong {
  overflow: hidden;
  color: var(--hs-color-text);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-activity-actions span,
.online-activity-title span,
.online-presence-card span,
.online-presence-card small,
.online-presence-card em,
.online-activity-row span,
.online-activity-row small {
  color: var(--hs-color-text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.online-presence-grid,
.online-activity-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.online-presence-section,
.online-activity-feed {
  align-content: start;
  border: 1px solid rgba(37, 110, 168, 0.12);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.5);
  padding: 10px;
}

.online-presence-card,
.online-activity-row {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(37, 110, 168, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  padding: 8px;
  text-align: left;
}

button.online-presence-card,
button.online-activity-row {
  cursor: pointer;
}

.online-presence-card.is-online {
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(240, 253, 244, 0.72);
}

.online-presence-card strong,
.online-activity-row strong,
.online-activity-row b {
  overflow: hidden;
  color: var(--hs-color-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-presence-card em {
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-activity-title,
.online-activity-row > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.online-activity-feed {
  max-height: 520px;
  overflow: auto;
}

.online-activity-row {
  margin-bottom: 6px;
}

.online-mail-list {
  max-height: 430px;
  overflow: auto;
}

.online-mail-list button {
  display: grid;
  gap: 2px;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(37, 110, 168, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  padding: 8px;
  text-align: left;
}

.online-mail-list button.is-active {
  border-color: rgba(37, 110, 168, 0.3);
  background: rgba(219, 234, 254, 0.76);
}

.online-mail-list span,
.online-mail-list small,
.online-mail-title span,
.online-mail-title small,
.online-mail-reward span {
  color: var(--hs-color-text-muted);
  font-size: 11px;
}

.online-mail-list b,
.online-mail-title strong,
.online-mail-reward strong {
  overflow: hidden;
  color: var(--hs-color-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-mail-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.online-mail-detail p {
  margin: 0;
  color: var(--hs-color-text);
  font-size: 13px;
  line-height: 1.55;
}

.online-mail-reward {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  border-top: 1px solid rgba(37, 110, 168, 0.12);
  padding-top: 8px;
}

.online-mail-reward span {
  grid-column: 1 / -1;
}

.online-equipment-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.online-equipment-list span,
.online-rank-row {
  min-width: 0;
  border: 1px solid rgba(37, 110, 168, 0.12);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.56);
  padding: 8px;
}

.online-equipment-list span {
  display: grid;
  gap: 2px;
}

.online-equipment-list b,
.online-equipment-list small {
  color: var(--hs-color-text-muted);
  font-size: 11px;
}

.online-equipment-list em {
  overflow: hidden;
  color: var(--hs-color-text);
  font-style: normal;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-leaderboard-list {
  display: grid;
  gap: 6px;
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

.online-rank-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 84px 96px;
  gap: 8px;
  align-items: center;
  width: 100%;
  color: inherit;
  text-align: left;
}

.online-rank-row.is-self {
  border-color: rgba(47, 133, 90, 0.26);
  background: rgba(240, 253, 244, 0.72);
}

.online-rank-row strong,
.online-rank-row em {
  color: var(--hs-color-text);
  font-style: normal;
  font-weight: 900;
}

.online-rank-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.online-rank-row b,
.online-rank-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-rank-row b {
  color: var(--hs-color-text);
}

.online-rank-row small {
  color: var(--hs-color-text-muted);
  font-size: 11px;
}

.map-panel-v5 .simple-map-panel,
.dungeon-panel-v5 {
  border-radius: 8px;
}

@media (max-width: 1080px) {
  .quest-v5-overview {
    grid-template-columns: 1fr;
  }

  .adventure-v5-summary,
  .shop-v5-summary,
  .settings-v5-grid,
  .online-profile-grid,
  .online-future-grid,
  .online-friend-columns,
  .online-world-stats,
  .online-party-presets,
  .online-party-columns,
  .online-message-panel,
  .online-presence-grid,
  .online-activity-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .adventure-v5-summary,
  .quest-v5-kpis,
  .shop-v5-summary,
  .settings-v5-grid,
  .online-profile-grid,
  .online-future-grid,
  .online-friend-columns,
  .online-equipment-list,
  .online-world-stats,
  .online-party-presets,
  .online-party-columns,
  .online-message-panel,
  .online-message-friends,
  .online-message-compose,
  .online-presence-grid,
  .online-activity-columns {
    grid-template-columns: 1fr;
  }

  .settings-v5-section,
  .online-v1-status,
  .online-mail-panel,
  .online-world-panel,
  .online-mail-reward,
  .online-profile-actions,
  .online-activity-actions {
    grid-template-columns: 1fr;
  }

  .online-friend-add {
    align-items: stretch;
    flex-direction: column;
  }

  .online-friend-add input {
    width: 100%;
    max-width: none;
  }

  .online-friend-row {
    grid-template-columns: 1fr;
  }

  .online-world-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .online-world-actions button {
    width: 100%;
    min-height: 44px;
  }

  .online-party-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .online-party-actions button,
  .online-party-preset button {
    width: 100%;
    min-height: 44px;
  }

  .online-message-compose button {
    width: 100%;
    min-height: 44px;
  }

  .online-activity-actions .settings-v5-actions,
  .online-activity-actions button {
    width: 100%;
  }

  .online-friend-row > div {
    justify-content: flex-start;
  }

  .quest-v5-actions,
  .shop-v5-actions,
  .settings-v5-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .quest-v5-actions button,
  .shop-v5-actions button,
  .settings-v5-actions button,
  .quest-destination-action,
  .settings-v5-danger button {
    width: 100%;
    min-height: 44px;
  }

  .online-rank-row {
    grid-template-columns: 34px minmax(0, 1fr) 58px;
  }

  .online-rank-row > small {
    display: none;
  }

  .adventure-v5-summary strong,
  .quest-v5-stage strong,
  .quest-v5-focus strong,
  .shop-v5-summary strong,
  .settings-v5-card strong,
  .online-v1-status strong {
    white-space: normal;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(42, 99, 151, 0.92) 0%, rgba(219, 234, 247, 0.96) 280px, rgba(245, 249, 253, 1) 100%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.26) 0, rgba(255, 255, 255, 0.26) 1px, transparent 1px, transparent 18px);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
}

.render-fragment-host {
  display: contents;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff, #e8f2fc);
  color: var(--ink);
  cursor: pointer;
  min-height: 40px;
  padding: 8px 12px;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: linear-gradient(180deg, #ffffff, #fff2c8);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  min-height: 42px;
  padding: 8px 10px;
}

.app-shell {
  min-height: 100vh;
  padding: 22px;
}

.game {
  display: grid;
  gap: 16px;
  max-width: 1360px;
  margin: 0 auto;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(35, 82, 128, 0.12)),
    rgba(22, 63, 108, 0.42);
  color: #ffffff;
  padding: 12px;
  box-shadow: 0 12px 30px rgba(10, 32, 60, 0.18);
}

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

.release-badge {
  align-self: center;
  border: 1px solid rgba(255, 235, 174, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff3c9;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.seal {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  color: #ffffff;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 237, 178, 0.44), rgba(212, 167, 67, 0.28) 54%, transparent 56%),
    linear-gradient(135deg, #2b83c6, #173f6c);
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
  letter-spacing: 0;
}

.brand p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-actions button,
.ghost-button {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.top-actions button:hover:not(:disabled),
.ghost-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.26);
}

.account-panel {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(140px, 180px) minmax(140px, 180px) auto auto minmax(180px, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  padding: 8px;
}

.account-panel.is-logged-in {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.account-panel input {
  min-height: 36px;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.96);
  font-size: 13px;
}

.account-panel button {
  min-height: 36px;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  padding: 6px 10px;
  font-size: 13px;
}

.account-panel span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.account-panel strong {
  overflow: hidden;
  color: #ffffff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-panel small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(480px, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.module-nav {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.module-nav-button {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 58px;
  border-color: rgba(255, 255, 255, 0.38);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(33, 84, 135, 0.22)),
    rgba(28, 74, 125, 0.48);
  color: rgba(255, 255, 255, 0.92);
  text-align: left;
}

.module-nav-button strong,
.module-nav-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-nav-button strong {
  font-size: 15px;
}

.module-nav-button span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.module-nav-button.is-active {
  border-color: rgba(212, 167, 67, 0.86);
  background:
    linear-gradient(180deg, #ffffff, #eef6ff),
    linear-gradient(135deg, rgba(212, 167, 67, 0.2), rgba(40, 106, 165, 0.1));
  color: #1f527f;
  box-shadow: inset 0 0 0 1px rgba(212, 167, 67, 0.26);
}

.module-nav-button.is-active span {
  color: #60738d;
}

.module-nav-button[data-module="forge"] {
  border-color: rgba(212, 167, 67, 0.62);
  background:
    linear-gradient(180deg, rgba(255, 247, 223, 0.22), rgba(110, 76, 18, 0.2)),
    rgba(38, 87, 130, 0.52);
}

.module-nav-button[data-module="forge"].is-active {
  border-color: rgba(212, 167, 67, 0.94);
  background:
    linear-gradient(180deg, #fff9e8, #eef6ff),
    linear-gradient(135deg, rgba(212, 167, 67, 0.28), rgba(40, 106, 165, 0.12));
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.24);
}

.status-strip div {
  display: grid;
  gap: 3px;
  min-width: 0;
  background: rgba(24, 73, 123, 0.42);
  padding: 10px 12px;
}

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

.status-strip span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.status-strip strong {
  color: #ffffff;
  font-size: 13px;
}

.status-strip .is-danger strong {
  color: #ffd5c7;
}

.module-shell,
.module-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.module-shell > .panel {
  min-width: 0;
}

.module-shell .panel-body,
.module-content,
.main-content,
.side-content,
.city-place-content,
.forge-panel,
.shop-panel,
.character-content,
.player-tab-content {
  min-width: 0;
  max-width: 100%;
}

.live-log-panel {
  position: sticky;
  top: 14px;
  min-width: 0;
}

.live-log-panel .panel-body {
  display: grid;
  gap: 12px;
}

.live-situation,
.live-latest {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.56);
  padding: 10px;
}

.live-situation.is-combat {
  border-color: rgba(157, 47, 45, 0.3);
  background: rgba(255, 242, 230, 0.68);
}

.live-situation-title {
  display: grid;
  gap: 3px;
}

.live-situation-title span,
.live-situation-meta,
.live-latest span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.live-situation-title strong,
.live-latest strong {
  overflow-wrap: anywhere;
  color: #7b3832;
  line-height: 1.45;
}

.live-situation-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.live-latest {
  border-left: 4px solid var(--blue);
}

.live-latest.good {
  border-left-color: var(--green);
}

.live-latest.danger {
  border-left-color: var(--red);
}

.ghost-log-button {
  width: 100%;
  border-color: rgba(39, 107, 115, 0.28);
  background: rgba(236, 246, 234, 0.72);
  color: #276b73;
  font-weight: 800;
}

.adventure-context {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.adventure-context div {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.54);
  padding: 10px;
}

.adventure-context span,
.adventure-context small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.adventure-context strong {
  overflow-wrap: anywhere;
  color: #1f527f;
  font-size: 15px;
}

.current-goal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 280px);
  gap: 10px;
  align-items: stretch;
  border: 1px solid rgba(212, 167, 67, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 243, 255, 0.92)),
    linear-gradient(90deg, rgba(212, 167, 67, 0.12), rgba(40, 106, 165, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
  margin-bottom: 14px;
  padding: 12px;
}

.current-goal.is-compact {
  grid-template-columns: 1fr;
  margin-bottom: 0;
  padding: 10px;
}

.current-goal-main,
.current-goal-side {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.current-goal-main span,
.current-goal-main small,
.current-goal-side span,
.current-goal-side small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.current-goal-main strong {
  overflow-wrap: anywhere;
  color: #1f527f;
  font-size: 17px;
}

.current-goal-side {
  align-content: stretch;
}

.goal-action-button {
  display: grid;
  gap: 5px;
  min-height: 62px;
  border-color: rgba(212, 167, 67, 0.72);
  background: linear-gradient(180deg, #fffdf7, #ffe7a8);
  color: #654714;
  text-align: left;
}

.goal-action-button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-action-button .goal-action-meta {
  display: block;
  overflow: visible;
  border-radius: 5px;
  background: rgba(50, 16, 6, 0.22);
  color: #fff1b8;
  padding: 2px 5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.current-goal-prep {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}

.current-goal-prep span {
  display: grid;
  align-items: start;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(79, 125, 173, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.66);
  padding: 7px 8px;
}

.current-goal-prep b,
.current-goal-prep em {
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.current-goal-prep b {
  color: #1f527f;
}

.current-goal-prep em {
  color: var(--muted);
  font-style: normal;
}

.current-goal-prep .is-ready {
  border-color: rgba(63, 125, 99, 0.24);
  background: rgba(235, 249, 242, 0.8);
}

.current-goal-prep .is-warn {
  border-color: rgba(212, 167, 67, 0.34);
  background: rgba(255, 246, 220, 0.86);
}

.current-goal-prep .is-danger {
  border-color: rgba(180, 68, 63, 0.34);
  background: rgba(255, 235, 232, 0.86);
}

.character-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.character-overview,
.character-content {
  min-width: 0;
}

.player-portrait-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.78), rgba(248, 240, 219, 0.68)),
    color-mix(in srgb, var(--race-color, #9d2f2d) 10%, transparent);
  padding: 12px;
}

.player-portrait-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.player-portrait-meta strong {
  overflow-wrap: anywhere;
  color: #7b3832;
  font-size: 18px;
}

.player-portrait-meta span,
.player-portrait-meta small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.character-content .compact-tabs {
  margin-top: 0;
}

.city-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 14px;
}

.city-board,
.city-npc-panel {
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.52);
  padding: 12px;
}

.city-board {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.city-board > strong {
  color: #7b3832;
  font-size: 16px;
}

.city-board > span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.city-places {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  position: sticky;
  top: 8px;
  z-index: 12;
  border: 1px solid rgba(79, 125, 173, 0.18);
  border-radius: 10px;
  background: rgba(246, 250, 255, 0.96);
  box-shadow: 0 8px 18px rgba(25, 56, 94, 0.1);
  margin-bottom: 14px;
  padding: 8px;
}

.city-places button {
  display: grid;
  gap: 3px;
  min-height: 58px;
  text-align: left;
}

.city-places button[data-city-place="forge"] {
  border-color: rgba(195, 149, 53, 0.58);
  background: linear-gradient(180deg, rgba(255, 247, 223, 0.92), rgba(248, 236, 205, 0.86));
}

.city-places button.is-active {
  border-color: var(--gold);
  background: #fff4da;
}

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

.city-places span {
  color: var(--muted);
  font-size: 12px;
}

.city-place-content {
  min-width: 0;
}

.city-online-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(79, 125, 173, 0.18);
  border-radius: 10px;
  background: rgba(246, 250, 255, 0.78);
  padding: 12px;
}

.city-audience-online {
  margin-bottom: 12px;
}

.city-online-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.city-online-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.city-online-header strong {
  overflow: hidden;
  color: #3f3126;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-online-header span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.city-online-header button {
  min-height: 38px;
  white-space: nowrap;
}

.city-message-compose {
  border-top: 1px solid rgba(79, 125, 173, 0.14);
  padding-top: 8px;
}

.city-online-party-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.city-secondary-events {
  margin-top: 14px;
}

.city-npc-panel {
  display: grid;
  gap: 7px;
  align-content: center;
  justify-items: start;
}

.npc-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(92, 73, 55, 0.28);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(195, 149, 53, 0.36), rgba(39, 107, 115, 0.18));
  color: #7b3832;
  font-weight: 800;
}

.city-npc-panel strong {
  color: #3f3126;
}

.city-npc-panel span:not(.npc-avatar) {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.city-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.city-score-grid span {
  display: grid;
  gap: 1px;
  border: 1px solid rgba(92, 73, 55, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.58);
  padding: 7px;
}

.city-score-grid b {
  color: #7b3832;
  font-size: 16px;
}

.city-score-grid em {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-section-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.city-shop-roster,
.city-npc-list,
.city-reputation-board,
.city-hidden-list,
.city-event-panel,
.city-fast-routes,
.city-station {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.city-shop-roster > strong,
.city-npc-list > strong,
.city-reputation-board > strong,
.city-hidden-list > strong,
.city-hidden-heading strong,
.city-fast-routes > strong,
.city-event-title strong {
  color: #7b3832;
  font-size: 15px;
}

.city-shop-card,
.city-npc-card,
.city-reputation-board,
.station-card,
.city-event-panel,
.city-hidden-row,
.locked-shop-list {
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.52);
}

.city-shop-card {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.city-shop-card.is-active {
  border-color: rgba(195, 149, 53, 0.5);
  background: rgba(255, 244, 218, 0.72);
}

.city-shop-card span,
.city-shop-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-shop-card span {
  color: #3f3126;
  font-weight: 800;
}

.city-shop-card small,
.city-reputation-board > span,
.station-card span,
.station-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.city-npc-card {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.city-npc-card.is-ready {
  border-color: rgba(63, 118, 84, 0.38);
  background: rgba(238, 248, 236, 0.56);
}

.city-npc-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.city-npc-heading div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.city-npc-heading strong,
.city-npc-heading small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-npc-heading strong {
  color: #3f3126;
  font-size: 14px;
}

.city-npc-heading small,
.city-npc-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.city-npc-card p {
  margin: 0;
}

.city-relation-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(92, 73, 55, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.54);
  padding: 6px 8px;
}

.city-relation-line span {
  border-radius: 999px;
  background: rgba(92, 73, 55, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 2px 7px;
  white-space: nowrap;
}

.city-relation-line .relation-known {
  background: rgba(195, 149, 53, 0.16);
  color: #7b5a23;
}

.city-relation-line .relation-trusted,
.city-relation-line .relation-ally {
  background: rgba(63, 118, 84, 0.14);
  color: #2f6142;
}

.city-relation-line small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.npc-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.npc-checks span {
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 999px;
  background: rgba(92, 73, 55, 0.07);
  color: var(--muted);
  font-size: 12px;
  padding: 2px 7px;
}

.npc-checks span.is-ready {
  border-color: rgba(63, 118, 84, 0.3);
  background: rgba(63, 118, 84, 0.1);
  color: #2f6142;
}

.city-hidden-quest {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px dashed rgba(92, 73, 55, 0.22);
  padding-top: 7px;
}

.city-hidden-quest span,
.city-hidden-quest strong {
  color: #7b3832;
  font-size: 12px;
}

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

.city-dialogue-actions button,
.city-commission-button,
.city-hidden-filters button,
.city-hidden-action,
.city-event-list button,
.city-fast-route-list button {
  display: grid;
  gap: 3px;
  min-width: 0;
  text-align: left;
}

.city-dialogue-actions button {
  min-height: 54px;
}

.city-dialogue-actions span,
.city-dialogue-actions small,
.city-commission-button span,
.city-commission-button small,
.city-hidden-filters span,
.city-hidden-filters small,
.city-hidden-action span,
.city-hidden-action small,
.city-event-list b,
.city-event-list small,
.city-event-list em,
.city-fast-route-list b,
.city-fast-route-list small,
.city-fast-route-list em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-dialogue-actions span,
.city-commission-button span,
.city-hidden-filters span,
.city-hidden-action span,
.city-event-list b,
.city-fast-route-list b {
  font-weight: 800;
}

.city-dialogue-actions small,
.city-commission-button small,
.city-hidden-filters small,
.city-hidden-action small,
.city-event-list small,
.city-fast-route-list small {
  color: var(--muted);
  font-size: 12px;
}

.city-commission-button {
  border-color: rgba(39, 107, 115, 0.3);
  background: rgba(236, 246, 234, 0.72);
}

.city-commission-stack {
  display: grid;
  gap: 7px;
}

.city-reputation-board,
.station-card,
.locked-shop-list {
  padding: 10px;
}

.city-map-panel {
  display: grid;
  gap: 12px;
}

.city-map-summary {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.52);
  padding: 10px 12px;
}

.city-map-summary strong {
  color: #7b3832;
  font-size: 15px;
}

.city-map-summary span {
  color: var(--muted);
  font-size: 12px;
}

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

.city-map-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 92px;
  text-align: left;
}

.city-map-card span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.city-map-card b,
.city-map-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-map-card b {
  color: #3f3126;
  font-size: 14px;
}

.city-map-card small {
  color: var(--muted);
  font-size: 12px;
}

.city-map-card em {
  color: #7b3832;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.city-event-panel {
  margin-bottom: 14px;
  padding: 10px;
}

.city-event-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.city-event-title span {
  color: var(--muted);
  font-size: 12px;
}

.city-event-list,
.city-fast-route-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.city-event-list button,
.city-fast-route-list button {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 62px;
}

.city-event-list em,
.city-fast-route-list em {
  color: #7b3832;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.city-hidden-list {
  border-top: 1px solid rgba(92, 73, 55, 0.18);
  padding-top: 12px;
}

.city-hidden-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.city-hidden-heading span {
  color: var(--muted);
  font-size: 12px;
}

.city-hidden-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.city-hidden-filters button {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 38px;
  border-color: rgba(92, 73, 55, 0.18);
  background: rgba(255, 250, 240, 0.45);
}

.city-hidden-filters button.is-active {
  border-color: rgba(123, 56, 50, 0.34);
  background: rgba(255, 239, 213, 0.8);
  color: #7b3832;
}

.city-hidden-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
}

.city-hidden-row.is-ready {
  border-color: rgba(63, 118, 84, 0.34);
}

.city-hidden-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.city-hidden-row b,
.city-hidden-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-hidden-row b {
  color: #3f3126;
  font-size: 13px;
}

.city-hidden-row small {
  color: var(--muted);
  font-size: 12px;
}

.city-hidden-row strong {
  color: #7b3832;
  font-size: 12px;
  white-space: nowrap;
}

.city-hidden-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.city-hidden-action {
  min-width: 92px;
  border-color: rgba(39, 107, 115, 0.28);
  background: rgba(236, 246, 234, 0.72);
}

.city-zone-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  max-height: 440px;
  overflow: auto;
}

.city-route-heading {
  padding: 0;
}

.career-module .rebirth-panel,
.city-module .shop-panel {
  margin-top: 0;
}

.career-module .rebirth-panel {
  border-top: 0;
  padding-top: 0;
}

.log-module .log {
  min-height: 420px;
  max-height: min(620px, calc(100vh - 330px));
  border-top: 0;
  padding: 0;
}

.panel {
  border: 1px solid rgba(79, 125, 173, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 247, 254, 0.96)),
    repeating-linear-gradient(90deg, rgba(40, 106, 165, 0.035) 0, rgba(40, 106, 165, 0.035) 1px, transparent 1px, transparent 12px);
  box-shadow: 0 16px 34px var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(79, 125, 173, 0.24);
  background:
    linear-gradient(90deg, rgba(40, 106, 165, 0.1), rgba(212, 167, 67, 0.08)),
    rgba(255, 255, 255, 0.42);
  padding: 12px 14px;
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
  color: #1f527f;
}

.panel-body {
  padding: 14px;
}

.main-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.main-panel,
.player-panel,
.side-right {
  min-width: 0;
}

.tab-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.5);
  padding: 10px 14px;
}

.compact-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.46);
  margin-top: 14px;
  padding: 5px;
}

.side-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-width: 0 0 1px;
  border-radius: 0;
  margin-top: 0;
  padding: 10px 14px;
}

.tab-button {
  min-height: 34px;
  border-color: rgba(92, 73, 55, 0.18);
  border-radius: 7px;
  background: rgba(248, 240, 219, 0.62);
  color: #514435;
  font-size: 13px;
  font-weight: 700;
}

.tab-button.is-active {
  border-color: rgba(123, 56, 50, 0.55);
  background: linear-gradient(180deg, rgba(255, 247, 223, 0.98), rgba(231, 216, 181, 0.98));
  color: #7b3832;
  box-shadow: inset 0 0 0 1px rgba(195, 149, 53, 0.22);
}

.main-content,
.side-content {
  padding: 14px;
}

.main-content.is-map {
  padding: 0;
}

.player-tab-content {
  margin-top: 12px;
}

.player-tab-content > .equipment-panel,
.player-tab-content > .consumable-panel,
.player-tab-content > .skill-panel,
.player-tab-content > .race-summary,
.main-content > .shop-panel,
.main-content > .rebirth-panel {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.hero-panel {
  overflow: hidden;
}

.intro-scene {
  position: relative;
  min-height: 360px;
  padding: clamp(22px, 4vw, 46px);
  color: #fff7df;
  background:
    linear-gradient(90deg, rgba(18, 20, 18, 0.92) 0%, rgba(18, 20, 18, 0.62) 48%, rgba(18, 20, 18, 0.16) 100%),
    url("assets/luolan-battlefield.svg");
  background-size: cover;
  background-position: center;
}

.intro-copy {
  position: relative;
  max-width: 620px;
  z-index: 1;
}

.intro-copy h2 {
  margin: 0 0 12px;
  font-size: clamp(34px, 7vw, 70px);
  line-height: 0.96;
  letter-spacing: 0;
}

.intro-copy p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 247, 223, 0.86);
  font-size: 16px;
  line-height: 1.8;
}

.creation {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
}

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

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

.gender-selector button {
  display: grid;
  gap: 3px;
  min-height: 58px;
  text-align: left;
}

.gender-selector button strong {
  color: var(--ink);
  font-size: 16px;
}

.gender-selector button span {
  color: var(--muted);
  font-size: 12px;
}

.gender-selector button.is-selected {
  border-color: var(--red);
  background: #fff4da;
  box-shadow: inset 0 0 0 1px rgba(157, 47, 45, 0.24);
}

.race-option {
  display: grid;
  gap: 5px;
  min-height: 214px;
  padding: 12px;
  text-align: left;
}

.race-option-top {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.race-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.race-option strong {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 16px;
}

.race-option span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.race-option b {
  color: var(--ink);
}

.race-meta {
  color: #7b3832 !important;
  font-weight: 700;
}

.race-detail {
  color: #4d6254 !important;
}

.race-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.race-stats i {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.72);
  color: #514435;
  font-style: normal;
  font-size: 12px;
  padding: 2px 7px;
}

.race-option.is-selected {
  border-color: var(--red);
  background: #fff4da;
  box-shadow: inset 0 0 0 1px rgba(157, 47, 45, 0.24);
}

.race-option.is-locked {
  border-style: dashed;
  background: rgba(248, 240, 219, 0.6);
  opacity: 0.82;
}

.race-option.is-locked .race-meta {
  color: #5f6670 !important;
}

.race-portrait {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(92, 73, 55, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.58), rgba(92, 73, 55, 0.1)),
    rgba(255, 250, 240, 0.76);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.55);
  color: var(--race-color, #7b3832);
  flex: 0 0 auto;
}

.race-portrait.is-small {
  width: 54px;
  height: 62px;
}

.race-portrait.is-large {
  width: 108px;
  height: 126px;
}

.race-portrait.is-combat {
  width: 118px;
  height: 138px;
}

.race-portrait-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}

.race-portrait b {
  font-size: 24px;
}

.primary-button {
  border-color: #6d231f;
  background: linear-gradient(180deg, #b7423d, #852925);
  color: #fff6df;
}

.primary-button:hover:not(:disabled) {
  border-color: #c39535;
  background: linear-gradient(180deg, #c34a44, #932c28);
}

.full-button {
  width: 100%;
}

.stat-list,
.inventory-list,
.quest-list {
  display: grid;
  gap: 10px;
}

.stat-row,
.inventory-row,
.quest-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-width: 0;
  border-bottom: 1px dashed rgba(92, 73, 55, 0.22);
  padding-bottom: 8px;
}

.stat-row span,
.inventory-row span,
.quest-row span {
  min-width: 0;
  color: var(--muted);
}

.stat-row strong,
.inventory-row strong,
.quest-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.quest-tracker {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(92, 73, 55, 0.18);
  margin-top: 12px;
  padding-top: 12px;
}

.quest-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(92, 73, 55, 0.22);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.55);
  padding: 10px;
}

.quest-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.quest-card strong {
  color: #7b3832;
  font-size: 15px;
}

.quest-type {
  border: 1px solid rgba(123, 56, 50, 0.18);
  border-radius: 999px;
  background: rgba(195, 149, 53, 0.12);
  color: #7b3832;
  font-size: 12px;
  padding: 2px 8px;
  white-space: nowrap;
}

.quest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quest-meta span {
  border-radius: 999px;
  background: rgba(92, 73, 55, 0.08);
  color: var(--muted);
  font-size: 12px;
  padding: 2px 7px;
}

.quest-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(39, 107, 115, 0.16);
  border-radius: 8px;
  background: rgba(39, 107, 115, 0.06);
  padding: 6px 8px;
}

.quest-submit span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.quest-submit strong {
  overflow-wrap: anywhere;
  color: #3f3126;
  font-size: 13px;
  text-align: right;
}

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

.chapter-stage,
.reputation-panel {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.45);
  margin-top: 10px;
  padding: 10px;
}

.chapter-stage strong {
  color: #7b3832;
  font-size: 14px;
}

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

.reputation-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.reputation-row span {
  color: var(--muted);
  font-size: 12px;
}

.reputation-row strong {
  color: #3f3126;
  font-size: 12px;
  text-align: right;
}

.quest-unlock,
.quest-route {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #6b5842;
  font-size: 12px;
  line-height: 1.45;
}

.quest-unlock span {
  border-radius: 999px;
  background: rgba(39, 107, 115, 0.1);
  color: var(--blue);
  padding: 2px 7px;
}

.quest-route {
  border-left: 3px solid rgba(39, 107, 115, 0.55);
  padding-left: 8px;
}

.quest-objectives {
  display: grid;
  gap: 5px;
}

.quest-objective-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-left: 3px solid rgba(195, 149, 53, 0.72);
  padding-left: 8px;
}

.quest-objective-line.is-done {
  border-left-color: var(--green);
}

.quest-objective-line.is-done span {
  color: #3f7654;
}

.quest-objective-line button {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.quest-hidden {
  color: #8a5a23;
  font-size: 12px;
  line-height: 1.45;
}

.equipment-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(92, 73, 55, 0.18);
  margin-top: 12px;
  padding-top: 12px;
}

.equipment-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.equipment-title strong {
  color: #7b3832;
}

.equipment-slots {
  display: grid;
  gap: 8px;
}

.equipment-slot {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(92, 73, 55, 0.22);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.58);
  padding: 8px 10px;
}

.equipment-slot span {
  color: var(--muted);
  font-size: 12px;
}

.equipment-slot strong {
  min-width: 0;
  color: #3f3126;
  font-size: 13px;
  line-height: 1.35;
}

.equipment-slot strong small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.slot-action {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

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

.equip-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 9px 10px;
  text-align: left;
}

.equip-button span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.equip-button b {
  overflow-wrap: anywhere;
  color: #3f3126;
  font-size: 14px;
}

.equip-button small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.equip-button em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 26px;
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 999px;
  background: rgba(195, 149, 53, 0.14);
  color: #7b3832;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.quality-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.82);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  margin-right: 6px;
  padding: 1px 6px;
  vertical-align: 1px;
  white-space: nowrap;
}

.grade-fine {
  border-color: rgba(63, 118, 84, 0.42);
}

.grade-fine .quality-badge,
.quality-badge.grade-fine {
  background: rgba(63, 118, 84, 0.13);
  color: #2f6142;
}

.grade-rare {
  border-color: rgba(101, 79, 132, 0.48);
}

.grade-rare .quality-badge,
.quality-badge.grade-rare {
  background: rgba(101, 79, 132, 0.13);
  color: #5b4778;
}

.grade-epic {
  border-color: rgba(185, 97, 32, 0.52);
  box-shadow: 0 0 0 1px rgba(226, 175, 78, 0.16);
}

.grade-epic .quality-badge,
.quality-badge.grade-epic {
  background: rgba(226, 175, 78, 0.18);
  color: #8a421f;
}

.equip-replace-prompt {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(195, 149, 53, 0.48);
  border-radius: 8px;
  background: rgba(255, 244, 218, 0.72);
  padding: 10px;
}

.equip-replace-prompt strong {
  color: #7b3832;
  font-size: 14px;
}

.equip-replace-prompt span,
.equip-replace-prompt small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.replace-actions button {
  min-height: 34px;
  padding: 6px 8px;
}

.forge-section-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.forge-section-tabs button {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 54px;
  border-radius: 8px;
  padding: 8px 10px;
  color: #4b4036;
  text-align: left;
}

.forge-section-tabs button strong {
  font-size: 14px;
}

.forge-section-tabs button span,
.forge-section-tabs button em {
  font-size: 11px;
  font-style: normal;
  color: var(--muted);
}

.forge-section-tabs button em {
  font-weight: 700;
}

.forge-section-tabs button.is-active {
  border-color: rgba(123, 56, 50, 0.55);
  background: rgba(255, 244, 218, 0.9);
  color: #7b3832;
}

.forge-material-panel {
  display: grid;
  gap: 8px;
}

.forge-material-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}

.forge-material-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 64px;
  text-align: left;
}

.forge-material-card > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

.forge-material-card > span b {
  color: #4d3a28;
  font-size: 14px;
}

.forge-material-card > span small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.forge-material-card > em {
  flex: 0 0 auto;
  color: #7b3832;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.forge-material-card:disabled > em {
  color: var(--muted);
}

.forge-panel {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(92, 73, 55, 0.18);
  padding-top: 10px;
}

.city-forge-panel {
  display: grid;
  gap: 10px;
}

.city-forge-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
  padding: 10px 12px;
}

.city-forge-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.city-forge-summary strong {
  color: #7b3832;
}

.city-forge-summary span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}

.city-place-action,
.shop-title-action {
  min-height: 34px;
  border-color: rgba(195, 149, 53, 0.54);
  background: linear-gradient(180deg, rgba(255, 247, 223, 0.96), rgba(248, 236, 205, 0.9));
  color: #7b5a16;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.forge-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.forge-panel-head strong {
  color: #7b3832;
}

.forge-panel-head span {
  color: var(--muted);
  font-size: 12px;
}

.forge-guidance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(79, 125, 173, 0.2);
  border-left: 3px solid rgba(212, 167, 67, 0.72);
  border-radius: 8px;
  background: rgba(242, 248, 255, 0.72);
  padding: 8px 10px;
}

.forge-guidance strong {
  color: #1f527f;
  font-size: 13px;
  white-space: nowrap;
}

.forge-guidance span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.forge-filter-group {
  display: grid;
  gap: 5px;
}

.forge-filter-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.forge-filter-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.forge-filter-tabs.is-kind {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.forge-filter-tabs.is-growth {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.forge-filter-tabs button {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 38px;
  border-radius: 8px;
  padding: 6px 4px;
  color: #514435;
  font-size: 12px;
  font-weight: 700;
}

.forge-filter-tabs button.is-active {
  border-color: rgba(123, 56, 50, 0.55);
  background: rgba(255, 244, 218, 0.9);
  color: #7b3832;
}

.forge-filter-tabs em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.forge-suit-filter-group {
  gap: 7px;
}

.forge-suit-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px;
  max-height: 228px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}

.forge-suit-tabs button {
  display: grid;
  gap: 2px;
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  padding: 6px 8px;
  color: #514435;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.forge-suit-tabs button.is-active {
  border-color: rgba(123, 56, 50, 0.55);
  background: rgba(255, 244, 218, 0.9);
  color: #7b3832;
}

.forge-suit-tabs em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.forge-suit-detail,
.forge-suit-overview {
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.82), rgba(242, 248, 255, 0.58));
  padding: 10px;
}

.forge-suit-detail {
  display: grid;
  gap: 9px;
}

.forge-suit-detail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.forge-suit-detail-head strong {
  color: #7b3832;
  font-size: 15px;
}

.forge-suit-detail-head span,
.forge-suit-detail > small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.forge-suit-bonuses,
.forge-suit-parts {
  display: grid;
  gap: 6px;
}

.forge-suit-bonus-row {
  border-left: 3px solid rgba(195, 149, 53, 0.68);
  background: rgba(255, 244, 218, 0.62);
  color: #745126;
  font-size: 12px;
  line-height: 1.4;
  padding: 5px 8px;
}

.forge-suit-parts {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.forge-suit-parts span {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.68);
  padding: 7px 8px;
}

.forge-suit-parts span.is-owned {
  border-color: rgba(63, 118, 84, 0.3);
  background: rgba(63, 118, 84, 0.08);
}

.forge-suit-parts span.is-equipped {
  border-color: rgba(63, 118, 84, 0.46);
  background: rgba(63, 118, 84, 0.14);
}

.forge-suit-parts strong {
  color: #3f3126;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.forge-suit-parts em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.forge-suit-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.forge-suit-overview button {
  display: grid;
  gap: 5px;
  min-height: 96px;
  border-radius: 8px;
  padding: 9px;
  text-align: left;
}

.forge-suit-overview strong {
  color: #7b3832;
  font-size: 13px;
}

.forge-suit-overview span,
.forge-suit-overview small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.forge-growth-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(92, 73, 55, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
  padding: 10px;
}

.forge-growth-list {
  display: grid;
  gap: 7px;
}

.forge-growth-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(92, 73, 55, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.52);
  padding: 8px;
}

.forge-growth-card > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.forge-growth-card strong {
  color: #3f3126;
  font-size: 13px;
}

.forge-growth-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.forge-growth-actions {
  display: grid;
  gap: 6px;
}

.forge-growth-actions button {
  min-width: 58px;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.forge-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 76px;
  padding: 10px;
  text-align: left;
}

.forge-button span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.forge-button b {
  color: #3f3126;
  font-size: 14px;
}

.forge-button small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.forge-recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.forge-recipe-tags i {
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.72);
  color: #7b3832;
  font-size: 11px;
  font-style: normal;
  padding: 2px 7px;
}

.forge-button em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 28px;
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 999px;
  background: rgba(195, 149, 53, 0.14);
  color: #7b3832;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.forge-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.forge-materials span {
  display: grid;
  gap: 2px;
  max-width: 100%;
  border: 1px solid rgba(157, 47, 45, 0.22);
  border-radius: 8px;
  background: rgba(157, 47, 45, 0.07);
  color: #7b3832;
  padding: 4px 7px;
}

.forge-materials b {
  font-size: 12px;
}

.forge-materials small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.forge-materials span.is-ready {
  border-color: rgba(63, 118, 84, 0.32);
  background: rgba(63, 118, 84, 0.09);
  color: #3f7654;
}

.forge-source-hint {
  border-left: 3px solid rgba(195, 149, 53, 0.55);
  color: #745126 !important;
  padding-left: 7px;
}

.suit-panel {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.5);
  padding: 9px 10px;
}

.suit-panel strong {
  color: #7b3832;
  font-size: 13px;
}

.suit-panel span {
  border-left: 3px solid rgba(92, 73, 55, 0.2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  padding-left: 7px;
}

.suit-panel span.is-active {
  border-left-color: var(--green);
  color: #2f6142;
}

.empty-equipment {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.consumable-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(92, 73, 55, 0.18);
  margin-top: 12px;
  padding-top: 12px;
}

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

.consumable-title strong {
  color: #7b3832;
}

.consumable-title span {
  color: var(--muted);
  font-size: 12px;
}

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

.inventory-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}

.inventory-search input {
  min-width: 0;
  height: 36px;
  border: 1px solid rgba(92, 73, 55, 0.24);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.78);
  color: #3f3126;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
}

.inventory-search button {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.inventory-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(92, 73, 55, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.42);
  padding: 8px 10px;
}

.inventory-pagination span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-pagination div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.inventory-pagination button {
  min-height: 30px;
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.inventory-pagination button.is-active {
  border-color: rgba(123, 56, 50, 0.55);
  background: rgba(255, 244, 218, 0.92);
  color: #7b3832;
}

.inventory-source-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.48);
  padding: 9px 10px;
}

.inventory-source-panel > strong,
.inventory-source-title strong {
  color: #7b3832;
  font-size: 13px;
}

.inventory-source-panel > span,
.inventory-source-title span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-source-title,
.item-source-card-title,
.item-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.inventory-source-list,
.item-source-rows {
  display: grid;
  gap: 6px;
}

.item-source-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.36);
  padding: 8px;
}

.item-source-card-title strong {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: #3f3126;
  font-size: 13px;
}

.item-source-card-title span,
.item-source-card small,
.item-source-row em {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.item-source-row {
  border-top: 1px dashed rgba(92, 73, 55, 0.14);
  padding-top: 5px;
}

.item-source-row span {
  overflow-wrap: anywhere;
  color: #3f3126;
  font-size: 12px;
}

.item-source-row strong {
  color: #7b3832;
  font-size: 12px;
  white-space: nowrap;
}

.item-source-row em {
  grid-column: 1 / -1;
  font-style: normal;
}

.inventory-v2-log-list {
  display: grid;
  gap: 6px;
}

.inventory-v2-log-row {
  display: grid;
  grid-template-columns: 76px 54px minmax(0, 1fr) minmax(80px, auto);
  gap: 6px 8px;
  align-items: center;
  border-top: 1px dashed rgba(92, 73, 55, 0.14);
  padding-top: 6px;
  min-width: 0;
}

.inventory-v2-log-row span,
.inventory-v2-log-row strong,
.inventory-v2-log-row em,
.inventory-v2-log-row small {
  min-width: 0;
  font-size: 11px;
  line-height: 1.35;
}

.inventory-v2-log-row span,
.inventory-v2-log-row strong {
  white-space: nowrap;
}

.inventory-v2-log-row span,
.inventory-v2-log-row small {
  color: var(--muted);
}

.inventory-v2-log-row strong {
  color: #7b3832;
}

.inventory-v2-log-row em {
  overflow-wrap: anywhere;
  color: #3f3126;
  font-style: normal;
}

.inventory-v2-log-row small {
  overflow-wrap: anywhere;
  text-align: right;
}

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

.item-category-tabs button {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 42px;
  border-radius: 8px;
  padding: 6px 4px;
  color: #514435;
  font-size: 12px;
  font-weight: 700;
}

.item-category-tabs button.is-active {
  border-color: rgba(123, 56, 50, 0.55);
  background: rgba(255, 244, 218, 0.9);
  color: #7b3832;
}

.item-category-tabs em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.managed-item {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.58);
  padding: 9px 10px;
}

.managed-item-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.managed-item-main strong {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: #3f3126;
  font-size: 14px;
}

.managed-item-main strong em {
  color: #7b3832;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.managed-item-main span,
.managed-item-main small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.managed-item-main .item-lore {
  color: #6b4334;
}

.managed-item-main .item-purpose {
  color: #3f5f51;
}

.managed-item-main .item-action-protection {
  color: #8a4a32;
}

.equipment-growth-panel {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(92, 73, 55, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.34);
  padding: 7px;
}

.equipment-growth-panel > b {
  color: #7b3832;
  font-size: 12px;
}

.equipment-growth-panel span {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
}

.equipment-growth-panel strong {
  color: #3f3126;
  font-size: 12px;
  white-space: nowrap;
}

.equipment-growth-panel em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

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

.item-actions button {
  min-height: 30px;
  border-radius: 7px;
  padding: 4px 5px;
  font-size: 12px;
}

.consumable-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 54px;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
}

.consumable-button span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.consumable-button b,
.consumable-button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(92, 73, 55, 0.18);
  margin-top: 12px;
  padding-top: 12px;
}

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

.skill-title strong {
  color: #7b3832;
}

.skill-title span {
  color: var(--muted);
  font-size: 12px;
}

.skill-list {
  display: grid;
  gap: 7px;
}

.skill-chain-panel {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.54);
  padding: 10px;
}

.skill-chain-panel > strong {
  color: #7b3832;
}

.skill-chain-panel > span {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.skill-chain-panel > span.is-ready b {
  color: #256249;
}

.skill-chain-panel b,
.skill-chain-panel em,
.skill-chain-panel small {
  font-style: normal;
}

.skill-chain-panel em,
.skill-chain-panel small {
  color: var(--muted);
}

.skill-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-filter-tabs button {
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.64);
  color: #4f3d2e;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  min-height: 32px;
  padding: 6px 9px;
}

.skill-filter-tabs button.is-active {
  background: rgba(123, 56, 50, 0.12);
  border-color: rgba(123, 56, 50, 0.35);
  color: #7b3832;
}

.skill-filter-tabs em {
  color: var(--muted);
  font-style: normal;
}

.skill-tree-panel {
  display: grid;
  gap: 10px;
}

.skill-tree-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.skill-tree-summary strong {
  color: #3f3126;
  font-size: 13px;
}

.skill-tree-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(var(--skill-tree-cols, 4), minmax(150px, 1fr));
  overflow-x: auto;
  padding-bottom: 2px;
}

.skill-tree-tier {
  display: grid;
  gap: 8px;
  min-width: 150px;
}

.skill-tree-tier-title {
  color: #7b3832;
  font-size: 12px;
  font-weight: 700;
}

.skill-tree-node {
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.56);
  display: grid;
  gap: 5px;
  min-height: 116px;
  padding: 9px;
}

.skill-tree-node.is-current {
  border-color: rgba(123, 56, 50, 0.46);
  background: rgba(123, 56, 50, 0.08);
}

.skill-tree-node.is-path {
  box-shadow: inset 3px 0 0 rgba(123, 56, 50, 0.26);
}

.skill-tree-node.is-future {
  opacity: 0.7;
}

.skill-tree-node strong {
  color: #3f3126;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 13px;
}

.skill-tree-node em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.skill-tree-node span,
.skill-tree-node small,
.skill-tree-skill small {
  color: var(--muted);
  font-size: 12px;
}

.skill-tree-skill {
  border-top: 1px solid rgba(92, 73, 55, 0.14);
  display: grid;
  gap: 4px;
  padding-top: 6px;
}

.skill-tree-skill b {
  color: #7b3832;
  font-size: 12px;
}

.skill-chip {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.54);
  padding: 8px 10px;
}

.skill-chip-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.skill-chip b {
  color: #3f3126;
  font-size: 13px;
}

.skill-chip b em {
  color: #7b3832;
  font-style: normal;
  font-weight: 600;
}

.skill-chip small {
  color: var(--muted);
  font-size: 12px;
}

.skill-chip.is-locked {
  opacity: 0.68;
}

.skill-chip.is-upgradeable {
  border-color: rgba(123, 56, 50, 0.34);
}

.skill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.skill-actions button {
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: #7b3832;
  cursor: pointer;
  font-size: 12px;
  min-height: 30px;
  padding: 5px 8px;
  white-space: nowrap;
}

.skill-actions button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.consumable-button small {
  color: var(--muted);
  font-size: 12px;
}

.consumable-button em {
  color: #7b3832;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.inventory-summary {
  display: grid;
  gap: 6px;
  border-top: 1px solid rgba(92, 73, 55, 0.18);
  margin-top: 12px;
  padding-top: 12px;
}

.inventory-summary strong {
  color: #7b3832;
}

.inventory-summary span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.race-summary {
  display: grid;
  gap: 6px;
  border-top: 1px solid rgba(92, 73, 55, 0.18);
  margin-top: 12px;
  padding-top: 12px;
}

.race-summary strong {
  color: #7b3832;
}

.race-summary span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.attribute-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(92, 73, 55, 0.18);
  margin-top: 12px;
  padding-top: 12px;
}

.attribute-title {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.attribute-title strong {
  color: #7b3832;
}

.attribute-title span {
  color: var(--muted);
  font-size: 12px;
}

.attribute-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 7px;
}

.attribute-grid span {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.58);
  padding: 8px;
}

.attribute-grid b {
  overflow-wrap: anywhere;
  color: #7b3832;
  font-size: 13px;
}

.attribute-grid em {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.attribute-grid strong {
  overflow-wrap: anywhere;
  color: #3f3126;
  font-size: 17px;
}

.attribute-grid small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.attribute-grid button {
  border-radius: 6px;
  min-height: 28px;
  padding: 4px 8px;
}

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

.rebirth-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(92, 73, 55, 0.18);
  margin-top: 14px;
  padding-top: 14px;
}

.rebirth-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.rebirth-title strong {
  font-size: 16px;
}

.rebirth-title span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
}

.career-current {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 6px;
  background: rgba(255, 250, 240, 0.6);
  padding: 10px;
}

.career-current strong {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 15px;
}

.career-current em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

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

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

.rebirth-option {
  display: grid;
  gap: 6px;
  min-height: 126px;
  text-align: left;
}

.rebirth-option strong {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.rebirth-option em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.rebirth-option span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.rebirth-option.is-ready {
  border-color: var(--gold);
  background: #fff4da;
}

.empty-state {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px;
}

.bar-group {
  display: grid;
  gap: 8px;
  margin: 12px 0 2px;
}

.meter {
  display: grid;
  gap: 5px;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.meter-track {
  overflow: hidden;
  height: 10px;
  border: 1px solid rgba(92, 73, 55, 0.28);
  border-radius: 999px;
  background: rgba(92, 73, 55, 0.12);
}

.meter-fill {
  height: 100%;
  width: 50%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

.meter-fill.hp {
  background: linear-gradient(90deg, #9d2f2d, #d0673c);
}

.meter-fill.energy {
  background: linear-gradient(90deg, #276b73, #3f7654);
}

.meter-fill.exp {
  background: linear-gradient(90deg, #c39535, #745126);
}

.center-stack {
  display: grid;
  gap: 16px;
}

.map-panel {
  overflow: hidden;
}

.world-region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  padding: 14px 14px 0;
}

.world-region-button {
  display: grid;
  gap: 7px;
  min-height: 78px;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.9), rgba(236, 226, 200, 0.92)),
    linear-gradient(135deg, rgba(47, 95, 134, 0.1), rgba(157, 47, 45, 0.05));
}

.world-region-button.is-active {
  border-color: var(--blue);
  background:
    linear-gradient(180deg, rgba(255, 249, 234, 0.95), rgba(226, 236, 226, 0.95)),
    linear-gradient(135deg, rgba(47, 95, 134, 0.16), rgba(182, 74, 46, 0.07));
}

.world-region-button.is-current {
  box-shadow: inset 0 0 0 1px rgba(195, 149, 53, 0.45);
}

.region-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.region-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid rgba(92, 73, 55, 0.3);
  border-radius: 50%;
  color: #fff8e6;
  font-size: 13px;
  font-weight: 800;
}

.region-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.continent-map {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 50%, rgba(63, 118, 84, 0.16), transparent 28%),
    radial-gradient(circle at 78% 50%, rgba(111, 90, 168, 0.16), transparent 22%),
    radial-gradient(circle at 50% 18%, rgba(47, 127, 159, 0.18), transparent 24%),
    radial-gradient(circle at 22% 52%, rgba(116, 81, 38, 0.18), transparent 23%),
    radial-gradient(circle at 50% 82%, rgba(182, 74, 46, 0.18), transparent 24%),
    rgba(255, 250, 240, 0.56);
}

.continent-backdrop {
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(92, 73, 55, 0.16);
  border-radius: 8px;
  pointer-events: none;
}

.continent-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 94px;
  min-height: 64px;
  padding: 7px;
  border-color: rgba(92, 73, 55, 0.24);
  background: rgba(255, 250, 240, 0.82);
  text-align: center;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.continent-node span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--region-color);
  color: #fff8e6;
  font-weight: 800;
}

.continent-node strong,
.continent-node small {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continent-node strong {
  color: #3f3126;
  font-size: 12px;
}

.continent-node small {
  color: var(--muted);
  font-size: 11px;
}

.continent-node.is-active {
  border-color: var(--blue);
  background: rgba(236, 246, 234, 0.92);
}

.continent-node.is-current {
  box-shadow: 0 0 0 2px rgba(195, 149, 53, 0.36);
}

.region-detail,
.zone-map-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 0;
}

.region-detail {
  align-items: flex-start;
}

.region-detail strong,
.zone-map-heading strong {
  flex: 0 0 auto;
}

.region-detail span,
.zone-map-heading span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
}

.simple-map-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid rgba(92, 73, 55, 0.14);
  background: rgba(255, 250, 240, 0.36);
}

.simple-map-current {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
}

.simple-map-current span {
  color: var(--muted);
  font-size: 12px;
}

.simple-map-current strong {
  color: #7b3832;
}

.simple-map-current small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.45;
}

.simple-map-section {
  display: grid;
  gap: 8px;
}

.simple-map-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.simple-map-heading strong {
  color: #3f3126;
}

.simple-map-heading span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.simple-destination-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.simple-destination-grid.is-compact {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.simple-destination-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  min-height: 88px;
  align-items: center;
  padding: 10px;
  border-color: rgba(92, 73, 55, 0.22);
  background: rgba(255, 250, 240, 0.78);
  text-align: left;
}

.simple-destination-card .zone-mark {
  grid-row: span 3;
}

.simple-destination-card strong,
.simple-destination-card small,
.simple-destination-card em {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simple-destination-card strong {
  color: #3f3126;
}

.simple-destination-card small {
  color: var(--muted);
  font-size: 12px;
}

.simple-destination-card em {
  color: #6b5643;
  font-size: 12px;
  font-style: normal;
}

.simple-destination-card.is-reachable {
  border-color: rgba(63, 118, 84, 0.48);
  background: rgba(238, 247, 235, 0.86);
}

.simple-destination-card.risk-warn {
  border-color: rgba(195, 149, 53, 0.58);
}

.simple-destination-card.risk-danger {
  border-color: rgba(157, 47, 45, 0.5);
  background: rgba(255, 244, 238, 0.88);
}

.simple-destination-card:disabled:not(.is-current) {
  opacity: 0.68;
}

.road-status-panel {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 10px;
  border-top: 1px solid rgba(92, 73, 55, 0.14);
  padding: 12px 14px 0;
}

.road-current,
.road-targets button {
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.56);
  padding: 10px;
}

.road-current {
  display: grid;
  gap: 3px;
}

.road-current span,
.road-current small,
.road-targets small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.road-current strong {
  color: #7b3832;
}

.road-targets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.road-targets button {
  display: grid;
  gap: 3px;
  min-height: 58px;
  text-align: left;
}

.road-targets span {
  overflow: hidden;
  color: #3f3126;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.road-map {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  margin: 14px;
  border: 1px solid rgba(92, 73, 55, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(rgba(92, 73, 55, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 73, 55, 0.05) 1px, transparent 1px),
    rgba(255, 250, 240, 0.54);
  background-size: 24px 24px;
}

.road-line {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: 2px;
  border-radius: 999px;
  background: rgba(92, 73, 55, 0.28);
  transform: rotate(var(--angle));
  transform-origin: left center;
  z-index: 0;
}

.road-line.is-active {
  height: 3px;
  background: rgba(195, 149, 53, 0.74);
}

.road-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 132px;
  min-height: 98px;
  padding: 8px;
  border-color: rgba(92, 73, 55, 0.24);
  background: rgba(255, 250, 240, 0.9);
  text-align: center;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.road-node.is-current {
  border-color: var(--blue);
  background: rgba(226, 239, 230, 0.94);
}

.road-node.is-reachable:not(.is-current) {
  border-color: rgba(63, 118, 84, 0.44);
  box-shadow: 0 0 0 1px rgba(63, 118, 84, 0.12);
}

.road-node:disabled:not(.is-current) {
  opacity: 0.62;
}

.road-node strong,
.road-node small {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.road-node strong {
  color: #3f3126;
  font-size: 12px;
}

.road-node small {
  color: var(--muted);
  font-size: 11px;
}

.road-requirements,
.zone-requirements {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.road-requirements {
  justify-content: center;
}

.road-requirements i,
.zone-requirements i {
  border-radius: 999px;
  background: rgba(123, 56, 50, 0.1);
  color: #7b3832;
  font-style: normal;
  font-size: 10px;
  line-height: 1.2;
  padding: 2px 5px;
}

.zone-requirements {
  margin-top: -2px;
}

.road-map-empty {
  color: var(--muted);
  padding: 14px;
}

.world-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding: 14px;
}

.zone-button {
  display: grid;
  align-content: space-between;
  gap: 8px;
  min-height: 118px;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255, 249, 234, 0.9), rgba(232, 219, 188, 0.92)),
    linear-gradient(135deg, rgba(39, 107, 115, 0.12), rgba(157, 47, 45, 0.06));
}

.zone-button.is-active {
  border-color: var(--blue);
  background:
    linear-gradient(180deg, rgba(255, 249, 234, 0.95), rgba(227, 238, 229, 0.95)),
    linear-gradient(135deg, rgba(39, 107, 115, 0.18), rgba(157, 47, 45, 0.05));
}

.zone-button.is-reachable {
  border-color: rgba(63, 118, 84, 0.42);
}

.zone-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.zone-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid rgba(92, 73, 55, 0.35);
  border-radius: 50%;
  color: #fff8e6;
  background: var(--blue);
}

.zone-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.zone-threat {
  color: #7b3832;
  font-size: 12px;
}

.zone-requirements i {
  font-size: 11px;
  padding: 3px 7px;
}

.battle-result-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(195, 149, 53, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 247, 223, 0.82), rgba(255, 250, 240, 0.62)),
    rgba(195, 149, 53, 0.08);
  margin-bottom: 12px;
  padding: 12px;
}

.battle-result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.battle-result-heading > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.battle-result-heading span,
.loot-group span,
.loot-empty,
.loot-influence {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.battle-result-heading strong {
  overflow-wrap: anywhere;
  color: #7b3832;
}

.battle-result-rewards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.battle-result-rewards span {
  border: 1px solid rgba(92, 73, 55, 0.16);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.72);
  color: var(--muted);
  font-size: 12px;
  padding: 4px 9px;
}

.battle-result-rewards b {
  color: #7b3832;
}

.loot-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.loot-group {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(92, 73, 55, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
  padding: 8px;
}

.loot-group strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.loot-group.is-rare {
  border-color: rgba(101, 79, 132, 0.36);
  background: rgba(101, 79, 132, 0.1);
}

.loot-influence {
  border-left: 3px solid var(--green);
  padding-left: 8px;
}

.boss-rematch-prep-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.9fr) minmax(150px, 190px);
  gap: 10px;
  align-items: stretch;
  border: 1px solid rgba(180, 68, 63, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 248, 235, 0.9), rgba(255, 238, 221, 0.76)),
    rgba(180, 68, 63, 0.08);
  margin-bottom: 12px;
  padding: 12px;
}

.boss-rematch-copy,
.boss-rematch-action {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.boss-rematch-copy span,
.boss-rematch-copy small,
.boss-rematch-action span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.boss-rematch-copy strong {
  overflow-wrap: anywhere;
  color: #7b3832;
  font-size: 16px;
}

.boss-rematch-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.boss-rematch-checks span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(92, 73, 55, 0.16);
  border-radius: 7px;
  background: rgba(255, 250, 240, 0.72);
  padding: 7px 8px;
}

.boss-rematch-checks b,
.boss-rematch-checks em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.boss-rematch-checks b {
  color: #1f527f;
}

.boss-rematch-checks em {
  color: var(--muted);
  font-style: normal;
}

.boss-rematch-checks .is-ready {
  border-color: rgba(63, 125, 99, 0.26);
  background: rgba(235, 249, 242, 0.82);
}

.boss-rematch-checks .is-warn {
  border-color: rgba(212, 167, 67, 0.34);
  background: rgba(255, 246, 220, 0.88);
}

.boss-rematch-checks .is-danger {
  border-color: rgba(180, 68, 63, 0.34);
  background: rgba(255, 235, 232, 0.9);
}

.boss-rematch-action {
  align-content: center;
  justify-items: start;
  min-height: 58px;
  border-color: rgba(180, 68, 63, 0.46);
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(255, 226, 203, 0.86));
  text-align: left;
}

.boss-rematch-action strong {
  color: #7b3832;
}

@media (max-width: 520px) {
  .boss-rematch-checks {
    grid-template-columns: 1fr;
  }
}

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

.action-button {
  display: grid;
  justify-items: start;
  gap: 4px;
  min-height: 74px;
  text-align: left;
}

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

.action-button span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.action-button.city-shortcut-button {
  border-color: rgba(212, 167, 67, 0.62);
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(255, 235, 178, 0.86));
}

.action-button.city-shortcut-button strong {
  color: #7b5a16;
}

.trial-button {
  margin-top: 12px;
}

.shop-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(92, 73, 55, 0.18);
  margin-top: 14px;
  padding-top: 14px;
}

.shop-title {
  display: grid;
  gap: 4px;
}

.shop-title.has-action {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.shop-title > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.shop-title strong {
  color: #7b3832;
}

.shop-title span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.shop-filter-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.shop-filter-tabs button {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 38px;
  border-radius: 8px;
  padding: 6px 4px;
  color: #514435;
  font-size: 12px;
  font-weight: 700;
}

.shop-filter-tabs button.is-active {
  border-color: rgba(123, 56, 50, 0.55);
  background: rgba(255, 244, 218, 0.9);
  color: #7b3832;
}

.shop-filter-tabs em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.shop-guidance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(79, 125, 173, 0.2);
  border-left: 3px solid rgba(212, 167, 67, 0.72);
  border-radius: 8px;
  background: rgba(242, 248, 255, 0.72);
  padding: 8px 10px;
}

.shop-guidance > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.shop-guidance strong {
  color: #1f527f;
  font-size: 13px;
  white-space: nowrap;
}

.shop-guidance span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.shop-guidance-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.shop-guidance-actions button {
  min-height: 32px;
  border-color: rgba(31, 82, 127, 0.34);
  background: rgba(255, 253, 246, 0.86);
  color: #1f527f;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.shop-shelf {
  display: grid;
  gap: 8px;
}

.shop-shelf-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(92, 73, 55, 0.14);
  padding-bottom: 5px;
}

.shop-shelf-title strong {
  color: #7b3832;
  font-size: 13px;
  white-space: nowrap;
}

.shop-shelf-title span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.shop-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.shop-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  text-align: left;
}

.shop-item span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.shop-item b,
.shop-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-item b {
  color: #3f3126;
  font-size: 13px;
}

.shop-item small {
  color: var(--muted);
  font-size: 12px;
}

.shop-item em {
  min-width: 54px;
  color: #7b3832;
  font-size: 12px;
  font-style: normal;
  text-align: right;
}

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

.locked-shop-list > strong {
  color: #7b3832;
  font-size: 13px;
}

.locked-shop-shelf {
  display: grid;
  gap: 6px;
}

.locked-shop-shelf > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.locked-shop-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px dashed rgba(92, 73, 55, 0.24);
  border-radius: 8px;
  background: rgba(92, 73, 55, 0.05);
  padding: 8px 10px;
}

.locked-shop-item span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.locked-shop-item b,
.locked-shop-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.locked-shop-item b {
  color: #3f3126;
  font-size: 13px;
}

.locked-shop-item small {
  color: var(--muted);
  font-size: 12px;
}

.locked-shop-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.combat-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  border: 1px solid rgba(79, 125, 173, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(224, 240, 255, 0.74), rgba(255, 255, 255, 0.42)),
    url("assets/luolan-battlefield.svg");
  background-size: cover;
  background-position: center;
  padding: 12px;
}

.combat-panel {
  min-width: 0;
}

.fighter {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 24px rgba(22, 52, 88, 0.14);
  padding: 12px;
}

.fighter h3 {
  margin: 0;
  color: #1f527f;
  font-size: 17px;
}

.enemy-drop-preview {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(101, 79, 132, 0.2);
  border-radius: 8px;
  background: rgba(101, 79, 132, 0.07);
  padding: 8px;
}

.enemy-drop-preview summary {
  cursor: pointer;
  list-style: none;
}

.enemy-drop-preview summary::-webkit-details-marker {
  display: none;
}

.enemy-drop-preview summary::after {
  content: "展开";
  justify-self: end;
  border: 1px solid rgba(101, 79, 132, 0.18);
  border-radius: 999px;
  color: #5d4079;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
}

.enemy-drop-preview[open] summary::after {
  content: "收起";
}

.enemy-drop-title,
.enemy-drop-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}

.enemy-drop-title strong {
  color: #5d4079;
  font-size: 13px;
}

.enemy-drop-title span,
.enemy-drop-row em,
.enemy-drop-more {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.enemy-drop-list {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.enemy-drop-row {
  grid-template-columns: minmax(0, 1fr) auto;
  border-top: 1px dashed rgba(101, 79, 132, 0.16);
  padding-top: 4px;
}

.enemy-drop-row span {
  overflow-wrap: anywhere;
  color: #3f3126;
  font-size: 12px;
}

.enemy-drop-row strong {
  color: #7b3832;
  font-size: 12px;
  white-space: nowrap;
}

.enemy-drop-row em {
  grid-column: 1 / -1;
  font-style: normal;
}

.enemy-visual {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  overflow: hidden;
  border: 1px solid rgba(79, 125, 173, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(40, 106, 165, 0.12), rgba(255, 255, 255, 0.42)),
    repeating-linear-gradient(0deg, rgba(40, 106, 165, 0.08), rgba(40, 106, 165, 0.08) 1px, transparent 1px, transparent 13px);
}

.enemy-visual::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 22%;
  width: 78px;
  height: 96px;
  border-radius: 48% 48% 42% 42%;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 246, 214, 0.82) 0 10px, transparent 11px),
    linear-gradient(180deg, var(--enemy-color, #9d2f2d), rgba(33, 28, 22, 0.92));
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
  transform: translateX(-50%);
}

.enemy-visual::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 48%;
  width: 130px;
  height: 14px;
  border-radius: 999px;
  background: rgba(33, 28, 22, 0.5);
  transform: translateX(-50%) rotate(-8deg);
}

.enemy-visual.has-portrait {
  background:
    linear-gradient(180deg, rgba(40, 106, 165, 0.1), rgba(255, 255, 255, 0.44)),
    rgba(255, 255, 255, 0.74);
}

.enemy-visual.is-elite {
  border-color: rgba(199, 77, 53, 0.72);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 208, 118, 0.28), transparent 48%),
    linear-gradient(180deg, rgba(112, 26, 42, 0.28), rgba(255, 255, 255, 0.5)),
    rgba(255, 248, 232, 0.78);
}

.enemy-visual.is-boss {
  border-color: rgba(96, 46, 156, 0.78);
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 238, 174, 0.35), transparent 42%),
    linear-gradient(180deg, rgba(25, 22, 74, 0.44), rgba(255, 255, 255, 0.48)),
    rgba(242, 237, 255, 0.8);
}

.enemy-visual.has-portrait::before,
.enemy-visual.has-portrait::after {
  display: none;
}

.enemy-portrait {
  display: block;
  width: min(100%, 168px);
  height: 140px;
  object-fit: contain;
  padding: 7px;
  filter: drop-shadow(0 14px 16px rgba(28, 21, 16, 0.22));
}

.player-combat-portrait {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  overflow: hidden;
  border: 1px solid rgba(79, 125, 173, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(40, 106, 165, 0.08)),
    rgba(255, 255, 255, 0.7);
}

.boss-phase-card {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(157, 47, 45, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 242, 230, 0.84), rgba(255, 250, 240, 0.68)),
    rgba(157, 47, 45, 0.07);
  padding: 11px 12px;
}

.boss-phase-card span,
.boss-phase-card small,
.boss-phase-card em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.boss-phase-card strong {
  color: #7b3832;
  line-height: 1.35;
}

.boss-phase-card em {
  font-style: normal;
  color: #9d2f2d;
}

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

.combat-command-bar {
  position: sticky;
  top: 8px;
  z-index: 8;
  border: 2px solid rgba(125, 84, 32, 0.65);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.96), rgba(236, 224, 196, 0.92));
  box-shadow: 0 8px 16px rgba(1, 8, 21, 0.18);
  margin-bottom: 12px;
  padding: 8px;
}

.combat-consumable-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  border: 2px solid rgba(39, 107, 115, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(245, 253, 255, 0.96), rgba(225, 244, 248, 0.9));
  box-shadow: 0 7px 14px rgba(1, 8, 21, 0.12);
  margin: -2px 0 12px;
  padding: 8px;
}

.combat-consumable-bar button {
  display: grid;
  gap: 3px;
  min-height: 58px;
  border-color: rgba(39, 107, 115, 0.42);
  background: linear-gradient(180deg, #ffffff, #e7fbff);
  text-align: left;
}

.combat-consumable-bar strong,
.combat-consumable-bar span,
.combat-consumable-bar small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-consumable-bar strong {
  color: #276b73;
}

.combat-consumable-bar em {
  margin-left: 5px;
  color: #8a2c1a;
  font-style: normal;
}

.combat-consumable-bar span,
.combat-consumable-bar small {
  color: var(--muted);
  font-size: 12px;
}

.combat-consumable-bar.is-empty {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 46px;
  color: var(--muted);
}

.combat-consumable-bar.is-empty span {
  border-radius: 999px;
  background: rgba(39, 107, 115, 0.12);
  color: #276b73;
  font-weight: 800;
  padding: 3px 8px;
}

.combat-consumable-bar.is-empty strong {
  color: var(--muted);
  font-size: 13px;
}

.combat-buttons button,
.combat-skill-list button {
  border-color: rgba(40, 106, 165, 0.34);
  background: linear-gradient(180deg, #ffffff, #e7f2ff);
}

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

.combat-skill-list button {
  display: grid;
  gap: 3px;
  min-height: 54px;
  text-align: left;
}

.combat-skill-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-skill-list span {
  color: var(--muted);
  font-size: 12px;
}

.balance-sampling-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.balance-sampling-title,
.balance-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.balance-sampling-title strong,
.balance-section-title strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.balance-sampling-title span,
.balance-section-title span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.balance-sampling-title em {
  flex: 0 0 auto;
  border: 1px solid rgba(39, 107, 115, 0.22);
  border-radius: 999px;
  background: rgba(236, 246, 234, 0.76);
  color: #276b73;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 4px 9px;
}

.balance-stage-grid,
.balance-playstyle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.balance-stage-card,
.balance-playstyle-card,
.balance-sample-row {
  border: 1px solid rgba(92, 73, 55, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.62);
  padding: 11px;
}

.balance-stage-card.has-data,
.balance-playstyle-card.has-data {
  border-color: rgba(39, 107, 115, 0.26);
  background: rgba(236, 246, 234, 0.5);
}

.balance-stage-card strong,
.balance-playstyle-card strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.balance-stage-card span,
.balance-playstyle-card span,
.balance-playstyle-card small,
.balance-sample-row small,
.balance-sample-row em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.balance-stage-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.balance-stage-metrics em {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #5c4937;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  padding: 3px 7px;
}

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

.balance-sample-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.7fr);
  gap: 8px 12px;
}

.balance-sample-row strong {
  color: var(--ink);
  font-size: 13px;
  text-align: right;
}

.balance-sample-row em {
  grid-column: 1 / -1;
  font-style: normal;
}

.log-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.log-filter button {
  min-height: 30px;
  border-color: rgba(92, 73, 55, 0.2);
  background: rgba(255, 250, 240, 0.62);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
}

.log-filter button.is-active {
  border-color: rgba(39, 107, 115, 0.42);
  background: rgba(236, 246, 234, 0.82);
  color: #276b73;
}

.log {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 220px;
  max-height: 320px;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding: 12px 14px;
}

.live-log-panel .log {
  min-height: 220px;
  max-height: calc(100vh - 460px);
  border-top: 0;
  padding: 0;
}

.live-log-panel .log.is-compact {
  gap: 7px;
}

.live-log-panel .log-entry {
  font-size: 13px;
  line-height: 1.45;
}

.journey-overview-panel .quest-list {
  max-height: 260px;
  overflow: auto;
}

.journey-overview-panel .quest-tracker {
  max-height: calc(100vh - 520px);
  overflow: auto;
}

.side-content .log {
  min-height: 420px;
  max-height: calc(100vh - 260px);
  border-top: 0;
  padding: 0;
}

.side-content .quest-tracker {
  max-height: calc(100vh - 360px);
  overflow: auto;
}

.log-entry {
  border-left: 3px solid rgba(195, 149, 53, 0.75);
  padding-left: 10px;
  color: #44382b;
  line-height: 1.55;
}

.log-entry.danger {
  border-left-color: var(--red);
}

.log-entry.good {
  border-left-color: var(--green);
}

.log-entry.system {
  border-left-color: var(--blue);
}

.log-entry.category-phase {
  background: rgba(157, 47, 45, 0.06);
  padding-top: 6px;
  padding-bottom: 6px;
}

.log-entry.category-loot {
  background: rgba(195, 149, 53, 0.08);
  padding-top: 6px;
  padding-bottom: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(92, 73, 55, 0.22);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.66);
  color: var(--muted);
  font-size: 12px;
  padding: 3px 9px;
  white-space: nowrap;
}

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

.ending {
  display: grid;
  gap: 16px;
}

.ending-banner {
  min-height: 280px;
  display: grid;
  align-content: end;
  padding: clamp(22px, 4vw, 42px);
  color: #fff7df;
  background:
    linear-gradient(180deg, rgba(22, 27, 28, 0.12), rgba(22, 27, 28, 0.84)),
    url("assets/luolan-battlefield.svg");
  background-size: cover;
  background-position: center;
}

.ending-banner h2 {
  margin: 0 0 8px;
  font-size: clamp(32px, 6vw, 62px);
  line-height: 1;
}

.ending-banner p {
  margin: 0;
  max-width: 680px;
  color: rgba(255, 247, 223, 0.84);
  line-height: 1.8;
}

.small-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 1120px) {
  .module-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

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

  .live-log-panel {
    position: static;
  }

  .live-log-panel .log {
    max-height: 320px;
  }

  .side-right {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .account-panel,
  .account-panel.is-logged-in,
  .creation,
  .layout,
  .combat-area,
  .status-strip,
  .adventure-context,
  .current-goal,
  .character-layout,
  .city-layout,
  .city-places,
  .city-section-grid,
  .city-score-grid,
  .city-zone-list,
  .city-map-grid,
  .city-map-card,
  .city-online-party-grid,
  .city-relation-line,
  .city-event-list,
  .city-fast-route-list,
  .city-dialogue-actions,
  .city-hidden-filters,
  .simple-map-current,
  .simple-destination-grid,
  .simple-destination-grid.is-compact,
  .current-goal-prep,
  .balance-stage-grid,
  .balance-playstyle-grid,
  .balance-sample-row,
  .road-status-panel {
    grid-template-columns: 1fr;
  }

  .continent-map {
    min-height: 420px;
  }

  .continent-node {
    width: 78px;
    min-height: 58px;
  }

  .road-map {
    min-height: 620px;
    margin: 12px;
  }

  .road-node {
    width: 112px;
    min-height: 92px;
  }

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

  .city-places {
    position: static;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
  }

  .city-online-header {
    align-items: stretch;
    flex-direction: column;
  }

  .city-online-header button {
    width: 100%;
    min-height: 44px;
  }

  .shop-title.has-action {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: flex-start;
  }

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

  .skill-tree-grid {
    grid-template-columns: repeat(var(--skill-tree-cols, 4), minmax(180px, 1fr));
  }

  .skill-chip {
    grid-template-columns: 1fr;
  }

  .skill-actions {
    justify-content: flex-start;
  }

  .side-content .log,
  .side-content .quest-tracker {
    max-height: 360px;
  }

  .side-content .log,
  .live-log-panel .log {
    min-height: 280px;
  }

  .world-map,
  .world-region-grid,
  .actions-grid,
  .boss-rematch-prep-card,
  .attribute-grid,
  .shop-list,
  .shop-filter-tabs,
  .item-category-tabs,
  .forge-filter-tabs,
  .forge-filter-tabs.is-kind,
  .forge-filter-tabs.is-growth,
  .equipment-growth-panel span,
  .rebirth-grid {
    grid-template-columns: 1fr;
  }

  .region-detail,
  .battle-result-heading,
  .city-forge-summary,
  .forge-suit-detail-head,
  .forge-panel-head,
  .forge-guidance,
  .shop-title.has-action,
  .shop-guidance,
  .shop-shelf-title,
  .zone-map-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .region-detail span,
  .city-forge-summary span,
  .shop-shelf-title span,
  .forge-guidance span,
  .shop-guidance span,
  .forge-panel-head span,
  .zone-map-heading span {
    text-align: left;
  }

  .shop-guidance-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .quest-objective-line {
    grid-template-columns: 1fr;
  }

  .quest-submit {
    align-items: flex-start;
    flex-direction: column;
  }

  .quest-submit strong {
    text-align: left;
  }

  .city-hidden-row,
  .locked-shop-item,
  .city-event-list button,
  .city-fast-route-list button {
    grid-template-columns: 1fr;
  }

  .city-hidden-row strong,
  .locked-shop-item em,
  .city-event-list em,
  .city-fast-route-list em {
    justify-self: start;
  }

  .city-hidden-heading,
  .city-hidden-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .city-event-list small,
  .city-event-list em,
  .city-fast-route-list small,
  .city-fast-route-list em,
  .city-hidden-row small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .quest-objective-line button {
    justify-self: start;
  }

  .race-grid,
  .inventory-search,
  .inventory-pagination,
  .inventory-v2-log-row,
  .item-actions,
  .combat-skill-list,
  .combat-buttons {
    grid-template-columns: 1fr;
  }

  .inventory-v2-log-row small {
    text-align: left;
  }

  .inventory-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .inventory-pagination div {
    justify-content: flex-start;
  }

  .intro-scene {
    min-height: 420px;
  }

  .rebirth-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .rebirth-title span {
    text-align: left;
  }

  .player-portrait-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .race-portrait.is-large {
    width: 82px;
    height: 98px;
  }
}

@media (max-width: 460px) {
  .module-nav {
    grid-template-columns: 1fr;
  }

  .module-nav-button,
  .status-strip div {
    min-height: 0;
  }

  .brand {
    align-items: flex-start;
  }

  .release-badge {
    align-self: flex-start;
  }

  .seal {
    width: 40px;
    height: 40px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .equipment-title,
  .equipment-slot {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .equipment-title {
    flex-direction: column;
  }

  .slot-action {
    justify-self: start;
  }

  .equip-button,
  .forge-button,
  .forge-growth-card {
    grid-template-columns: 1fr;
  }

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

  .race-option-top,
  .player-portrait-card {
    grid-template-columns: 1fr;
  }

  .race-option-top {
    justify-items: start;
  }

  .equip-button em,
  .forge-button em {
    justify-self: start;
  }
}

/* 1.0 fantasy browser RPG shell. Original visual direction from local reference template. */
:root {
  --bg: #0d2441;
  --panel: #f8f1df;
  --panel-strong: #fffaf0;
  --ink: #1c2632;
  --muted: #66758a;
  --line: rgba(125, 84, 32, 0.26);
  --line-dark: #7d5420;
  --gold: #d5a94e;
  --gold-dark: #7d5420;
  --gold-light: #fff1b7;
  --red: #a54128;
  --blue: #0d477f;
  --green: #3f8f54;
  --violet: #67519a;
  --shadow: rgba(1, 8, 21, 0.34);
  --radius: 9px;
}

html,
body {
  min-height: 100%;
  background:
    radial-gradient(circle at 50% -12%, rgba(143, 211, 255, 0.42), transparent 38%),
    linear-gradient(180deg, rgba(4, 23, 51, 0.24), rgba(2, 14, 33, 0.86)),
    url("assets/sky_fantasy_backdrop.png") center top / cover fixed no-repeat;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 18%, transparent 0 38%, rgba(0, 12, 28, 0.2) 74%),
    linear-gradient(180deg, rgba(2, 20, 48, 0.08), rgba(2, 20, 48, 0.54));
  z-index: -1;
}

.app-shell {
  min-height: 100vh;
  padding: 16px;
}

.game {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(1240px, 100%);
  min-height: calc(100vh - 32px);
  border: 5px solid var(--gold-dark);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(13, 42, 82, 0.16)),
    url("assets/sky_fantasy_backdrop.png") center 40% / cover no-repeat;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.48),
    inset 0 0 0 2px var(--gold-light),
    inset 0 0 0 8px rgba(7, 43, 85, 0.72);
  padding: 14px;
}

.game::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 24, 52, 0.04), rgba(5, 49, 87, 0.16) 45%, rgba(2, 17, 37, 0.62)),
    radial-gradient(circle at 50% 44%, transparent 50%, rgba(0, 0, 0, 0.24));
  z-index: -1;
}

.topbar,
.module-nav,
.status-strip,
.play-layout,
.creation,
.hero-panel {
  position: relative;
  z-index: 1;
}

button {
  border: 3px solid var(--gold-dark);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(77, 183, 235, 0.2), rgba(5, 37, 72, 0.18)),
    linear-gradient(180deg, #fefdf9, #d9ebfb);
  box-shadow:
    inset 0 0 0 1px rgba(255, 241, 183, 0.66),
    0 3px 9px rgba(1, 8, 21, 0.18);
}

button:hover:not(:disabled) {
  border-color: var(--gold);
  background:
    linear-gradient(180deg, rgba(255, 248, 219, 0.6), rgba(255, 226, 134, 0.18)),
    linear-gradient(180deg, #ffffff, #eef7ff);
}

input {
  border: 2px solid rgba(125, 84, 32, 0.42);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.96);
  box-shadow: inset 0 2px 4px rgba(1, 8, 21, 0.08);
}

.topbar {
  grid-template-columns: minmax(300px, 1fr) auto;
  border: 3px solid var(--gold-dark);
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(49, 143, 205, 0.9), rgba(7, 43, 85, 0.96)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22), transparent);
  box-shadow:
    inset 0 0 0 2px rgba(255, 241, 183, 0.72),
    0 7px 18px var(--shadow);
  padding: 10px 12px;
}

.brand {
  gap: 13px;
}

.seal {
  width: 64px;
  height: 64px;
  border: 3px solid var(--gold-dark);
  background:
    radial-gradient(circle at 35% 25%, #3aa3d8, #0d477f 62%, #051d3a);
  box-shadow:
    inset 0 0 0 2px var(--gold-light),
    0 5px 13px rgba(1, 8, 21, 0.36);
  color: var(--gold-light);
  font-size: 22px;
  text-shadow: 0 2px 2px #00101e;
}

.brand h1 {
  color: #fff7d8;
  font-size: clamp(30px, 4.4vw, 52px);
  text-shadow:
    0 2px 0 #5e3411,
    0 5px 12px rgba(0, 0, 0, 0.38);
}

.brand p {
  color: rgba(255, 247, 216, 0.84);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.release-badge {
  border: 2px solid rgba(255, 241, 183, 0.82);
  background: rgba(4, 29, 59, 0.58);
  color: #fff1b7;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.top-actions button,
.ghost-button,
.account-panel button {
  border-color: var(--gold-dark);
  background:
    linear-gradient(180deg, rgba(77, 183, 235, 0.28), rgba(5, 37, 72, 0.22)),
    linear-gradient(180deg, #1f7fbd, #072b55);
  color: #fff7d8;
  text-shadow: 0 1px 2px #00101e;
}

.top-actions button:hover:not(:disabled),
.ghost-button:hover:not(:disabled),
.account-panel button:hover:not(:disabled) {
  background:
    radial-gradient(circle at 50% 20%, rgba(116, 213, 255, 0.45), transparent 48%),
    linear-gradient(180deg, #2794d4, #083a67);
}

.account-panel,
.account-panel.is-logged-in {
  border: 2px solid rgba(255, 241, 183, 0.46);
  border-radius: 10px;
  background: rgba(4, 29, 59, 0.48);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.account-panel small,
.account-panel span small {
  color: rgba(255, 247, 216, 0.76);
}

.module-nav {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 7px;
  border: 3px solid var(--gold-dark);
  border-radius: 10px;
  background: rgba(4, 29, 59, 0.66);
  box-shadow:
    inset 0 0 0 1px rgba(255, 241, 183, 0.55),
    0 6px 16px rgba(1, 8, 21, 0.24);
  padding: 7px;
}

.module-nav-button {
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  min-height: 58px;
  border-color: rgba(180, 218, 246, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, #105b92, #083d70);
  color: rgba(255, 247, 216, 0.94);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 2px 7px rgba(1, 8, 21, 0.2);
  text-align: left;
  text-shadow: 0 1px 1px rgba(0, 16, 30, 0.65);
}

.module-nav-button::before {
  content: "";
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background-color: rgba(232, 244, 255, 0.12);
  background-image: url("assets/ui_nav_icons_flat.png");
  background-repeat: no-repeat;
  background-size: 400% 200%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.13);
}

.module-nav-button[data-module="adventure"]::before { background-position: 0% 0%; }
.module-nav-button[data-module="character"]::before { background-position: 33.333% 0%; }
.module-nav-button[data-module="items"]::before { background-position: 66.666% 100%; }
.module-nav-button[data-module="world"]::before { background-position: 66.666% 0%; }
.module-nav-button[data-module="city"]::before { background-position: 100% 0%; }
.module-nav-button[data-module="forge"]::before { background-position: 0% 100%; }
.module-nav-button[data-module="quests"]::before { background-position: 33.333% 100%; }
.module-nav-button[data-module="career"]::before { background-position: 66.666% 100%; }
.module-nav-button[data-module="log"]::before { background-position: 100% 100%; }

.module-nav-button strong {
  grid-column: 2;
  color: #fff7d8;
  font-size: 15px;
}

.module-nav-button span {
  grid-column: 2;
  color: rgba(255, 241, 183, 0.72);
}

.module-nav-button.is-active,
.module-nav-button[data-module="forge"].is-active {
  border-color: rgba(255, 218, 106, 0.76);
  background:
    linear-gradient(180deg, rgba(255, 249, 222, 0.16), rgba(255, 249, 222, 0.04)),
    linear-gradient(180deg, #1b89c9, #0b5791);
  color: #fff7d8;
  box-shadow:
    inset 0 0 0 1px rgba(255, 240, 171, 0.42),
    0 0 10px rgba(116, 213, 255, 0.18),
    0 2px 7px rgba(1, 8, 21, 0.22);
}

.module-nav-button.is-active span {
  color: rgba(255, 241, 183, 0.82);
}

.module-nav-button[data-module="forge"] {
  background:
    linear-gradient(90deg, rgba(255, 198, 101, 0.16), rgba(255, 198, 101, 0) 54%),
    linear-gradient(180deg, #12679e, #0a4779);
}

.status-strip {
  gap: 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.status-strip div {
  border: 3px solid var(--gold-dark);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(31, 127, 189, 0.9), rgba(7, 43, 85, 0.96)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 241, 183, 0.66),
    0 4px 12px rgba(1, 8, 21, 0.22);
}

.status-strip span {
  color: rgba(255, 241, 183, 0.72);
}

.status-strip strong {
  color: #fff7d8;
  text-shadow: 0 1px 2px #00101e;
}

.play-layout {
  grid-template-columns: minmax(0, 1fr) minmax(290px, 340px);
  gap: 14px;
}

.panel {
  overflow: hidden;
  border: 3px solid var(--gold-dark);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(241, 231, 210, 0.97)),
    repeating-linear-gradient(90deg, rgba(13, 71, 127, 0.04) 0, rgba(13, 71, 127, 0.04) 1px, transparent 1px, transparent 14px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 241, 183, 0.62),
    0 12px 26px rgba(1, 8, 21, 0.22);
}

.panel-header {
  border-bottom: 3px solid var(--gold-dark);
  background:
    linear-gradient(180deg, rgba(70, 172, 228, 0.34), rgba(4, 31, 62, 0.24)),
    linear-gradient(180deg, #0d477f, #072b55);
  box-shadow: inset 0 0 0 1px rgba(255, 241, 183, 0.6);
}

.panel-header h2,
.panel-header h3 {
  color: #fff7d8;
  font-size: 19px;
  text-shadow: 0 2px 2px #00101e;
}

.panel-body,
.main-content,
.side-content {
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.94), rgba(246, 237, 217, 0.88));
}

.badge {
  border: 2px solid rgba(125, 84, 32, 0.34);
  background: linear-gradient(180deg, #fff9e8, #ead9ac);
  color: #624417;
  font-weight: 800;
}

.current-goal,
.battle-result-card,
.boss-rematch-prep-card,
.city-board,
.city-npc-panel,
.live-situation,
.live-latest,
.shop-guidance,
.forge-guidance,
.simple-map-current,
.road-current,
.road-targets button,
.city-shop-card,
.quest-card,
.stat-row,
.inventory-row,
.equipment-slot,
.skill-chip,
.city-event-list button,
.city-fast-route-list button {
  border: 2px solid rgba(125, 84, 32, 0.24);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.88), rgba(238, 226, 198, 0.76));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

.current-goal {
  border-color: rgba(213, 169, 78, 0.62);
  background:
    radial-gradient(circle at 50% 0, rgba(95, 195, 255, 0.16), transparent 46%),
    linear-gradient(180deg, rgba(255, 250, 231, 0.96), rgba(238, 226, 198, 0.88));
}

.current-goal-main strong,
.adventure-context strong,
.city-board > strong,
.city-npc-panel strong,
.battle-result-heading strong,
.boss-rematch-copy strong,
.quest-card-heading strong,
.simple-map-current strong,
.road-current strong,
.zone-title,
.fighter h3,
.forge-panel-head strong,
.shop-title strong {
  color: #0d477f;
}

.goal-action-button,
.primary-button,
.full-button.trial-button,
.action-button.primary-button,
.combat-buttons .primary-button,
.command-grid .attack {
  border-color: #6f2d18;
  background:
    linear-gradient(180deg, rgba(255, 199, 137, 0.38), transparent),
    linear-gradient(180deg, #b94727, #752416);
  color: #fff7d8;
  text-shadow: 0 2px 2px #321006;
}

.goal-action-button:hover:not(:disabled),
.primary-button:hover:not(:disabled),
.full-button.trial-button:hover:not(:disabled),
.action-button.primary-button:hover:not(:disabled),
.combat-buttons .primary-button:hover:not(:disabled) {
  background:
    linear-gradient(180deg, rgba(255, 232, 172, 0.42), transparent),
    linear-gradient(180deg, #c95735, #84301c);
}

.goal-action-button strong,
.goal-action-button small,
.action-button.primary-button strong,
.action-button.primary-button span,
.primary-button strong,
.primary-button span {
  color: #fff9df;
  text-shadow: 0 1px 2px rgba(38, 11, 2, 0.72);
}

.goal-action-button small,
.action-button.primary-button span,
.primary-button span {
  color: #ffe8a3;
  font-weight: 700;
}

.actions-grid {
  gap: 10px;
}

.dungeon-panel {
  display: grid;
  gap: 12px;
  border: 2px solid rgba(125, 84, 32, 0.28);
  border-radius: 9px;
  background:
    radial-gradient(circle at 12% 0, rgba(13, 71, 127, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 253, 246, 0.9), rgba(238, 226, 198, 0.78));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.52);
  margin-bottom: 12px;
  padding: 12px;
}

.dungeon-panel.is-active {
  border-color: rgba(93, 65, 130, 0.42);
  background:
    radial-gradient(circle at 12% 0, rgba(93, 65, 130, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(255, 253, 246, 0.92), rgba(230, 222, 205, 0.82));
}

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

.dungeon-heading > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dungeon-heading span,
.dungeon-chest-summary span {
  color: var(--muted);
  font-size: 12px;
}

.dungeon-heading strong,
.dungeon-chest-summary strong {
  overflow-wrap: anywhere;
  color: #0d477f;
  font-size: 16px;
}

.dungeon-heading small,
.dungeon-chest-summary small {
  color: var(--muted);
  line-height: 1.45;
}

.dungeon-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.dungeon-status-grid span,
.dungeon-room-trail span {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(125, 84, 32, 0.2);
  border-radius: 7px;
  background: rgba(255, 250, 240, 0.68);
  padding: 8px;
}

.dungeon-status-grid b {
  color: #624417;
  font-size: 12px;
}

.dungeon-status-grid em {
  overflow-wrap: anywhere;
  color: #233a55;
  font-size: 13px;
  font-style: normal;
}

.dungeon-room-trail {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dungeon-room-trail span {
  display: inline-flex;
  color: #624417;
  font-size: 12px;
}

.dungeon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dungeon-actions button {
  min-height: 38px;
}

.dungeon-chest-summary {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(125, 84, 32, 0.22);
  border-radius: 8px;
  background: rgba(255, 250, 235, 0.78);
  padding: 10px;
}

.dungeon-chest-summary p {
  margin: 0;
  overflow-wrap: anywhere;
  color: #3f3126;
  font-size: 13px;
  line-height: 1.55;
}

.action-button,
.city-place-action,
.shop-title-action,
.tab-button,
.forge-filter-tabs button,
.shop-filter-tabs button,
.item-category-tabs button,
.compact-tabs button,
.main-tabs button,
.combat-buttons button,
.combat-skill-list button,
.forge-button,
.equip-button,
.simple-destination-card,
.zone-button,
.road-node,
.city-map-card {
  border-color: var(--gold-dark);
  background:
    linear-gradient(180deg, rgba(70, 172, 228, 0.16), rgba(4, 31, 62, 0.07)),
    linear-gradient(180deg, #fffef8, #e6f1fb);
  box-shadow:
    inset 0 0 0 1px rgba(255, 241, 183, 0.58),
    0 4px 10px rgba(1, 8, 21, 0.12);
}

.action-button strong,
.forge-button b,
.equip-button b {
  color: #0d477f;
}

.tab-button.is-active,
.forge-filter-tabs button.is-active,
.shop-filter-tabs button.is-active,
.item-category-tabs button.is-active,
.compact-tabs button.is-active,
.main-tabs button.is-active,
.city-places button.is-active {
  border-color: var(--gold-light);
  background:
    radial-gradient(circle at 50% 20%, rgba(116, 213, 255, 0.36), transparent 45%),
    linear-gradient(180deg, #1d80c1, #073762);
  color: #fff7d8;
  text-shadow: 0 1px 2px #00101e;
}

.tab-button.is-active *,
.forge-filter-tabs button.is-active *,
.shop-filter-tabs button.is-active *,
.item-category-tabs button.is-active *,
.compact-tabs button.is-active *,
.main-tabs button.is-active *,
.city-places button.is-active * {
  color: #fff7d8 !important;
}

.city-places {
  border: 3px solid var(--gold-dark);
  border-radius: 10px;
  background: rgba(4, 29, 59, 0.68);
  box-shadow:
    inset 0 0 0 1px rgba(255, 241, 183, 0.55),
    0 8px 18px rgba(1, 8, 21, 0.18);
}

.city-places button {
  border-color: var(--gold-dark);
  background:
    linear-gradient(180deg, rgba(70, 172, 228, 0.28), rgba(4, 31, 62, 0.16)),
    linear-gradient(180deg, #fefdf9, #d9ebfb);
}

.city-places button[data-city-place="forge"] {
  background:
    linear-gradient(180deg, rgba(255, 198, 101, 0.28), rgba(4, 31, 62, 0.08)),
    linear-gradient(180deg, #fffaf0, #e6f1fb);
}

.intro-scene,
.ending-banner {
  min-height: clamp(360px, 45vh, 540px);
  background:
    linear-gradient(90deg, rgba(3, 21, 47, 0.76), rgba(3, 21, 47, 0.34) 52%, rgba(3, 21, 47, 0.08)),
    url("assets/sky_fantasy_backdrop.png") center 38% / cover no-repeat;
}

.intro-copy h2,
.ending-banner h2 {
  color: #fff7d8;
  text-shadow:
    0 2px 0 #5e3411,
    0 5px 12px rgba(0, 0, 0, 0.5);
}

.intro-copy p,
.ending-banner p {
  color: rgba(255, 247, 216, 0.88);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.race-option,
.rebirth-option,
.shop-item,
.inventory-item,
.equipment-card,
.skill-card {
  border-color: rgba(125, 84, 32, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.9), rgba(236, 224, 196, 0.78));
}

.race-option.is-selected {
  border-color: var(--gold-light);
  background:
    radial-gradient(circle at 50% 0, rgba(95, 195, 255, 0.2), transparent 42%),
    linear-gradient(180deg, #fff9e8, #ead9ac);
}

.race-portrait,
.player-portrait-card,
.player-combat-portrait,
.enemy-visual {
  border: 3px solid var(--gold-dark);
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.84), rgba(13, 71, 127, 0.1)),
    rgba(255, 250, 240, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(255, 241, 183, 0.65),
    0 5px 12px rgba(1, 8, 21, 0.14);
}

.combat-panel .panel-body {
  background:
    linear-gradient(180deg, rgba(4, 29, 59, 0.2), rgba(2, 17, 37, 0.36)),
    url("assets/sky_fantasy_backdrop.png") center 64% / cover no-repeat;
}

.combat-area {
  position: relative;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 360px;
  border: 4px solid var(--gold-dark);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(2, 20, 42, 0.22)),
    url("assets/sky_fantasy_backdrop.png") center 66% / cover no-repeat;
  box-shadow:
    inset 0 0 0 2px rgba(255, 241, 183, 0.7),
    0 8px 18px rgba(1, 8, 21, 0.28);
  padding: 14px;
}

.combat-area::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 22px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.3), transparent 70%);
  pointer-events: none;
}

.fighter {
  position: relative;
  z-index: 1;
  align-content: start;
  border: 3px solid rgba(125, 84, 32, 0.75);
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.84), rgba(4, 29, 59, 0.62));
  box-shadow:
    inset 0 0 0 1px rgba(255, 241, 183, 0.72),
    0 9px 22px rgba(1, 8, 21, 0.28);
}

.fighter h3 {
  color: #fff7d8;
  text-shadow: 0 2px 2px #00101e;
}

.fighter .badge {
  background: rgba(4, 29, 59, 0.62);
  color: #fff1b7;
}

.enemy-visual,
.player-combat-portrait {
  min-height: 176px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.24), transparent 40%),
    rgba(4, 29, 59, 0.42);
}

.enemy-portrait {
  height: 168px;
  filter: drop-shadow(0 16px 18px rgba(1, 8, 21, 0.38));
}

.meter {
  border: 2px solid rgba(62, 36, 8, 0.72);
  background: rgba(4, 15, 28, 0.74);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.42);
}

.meter-fill.hp,
.meter-fill.energy,
.meter-fill.exp,
.meter span,
.hp i {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.meter-fill.hp {
  background: linear-gradient(90deg, #1aaa45, #b7ef56);
}

.meter-fill.energy {
  background: linear-gradient(90deg, #1887d6, #79e8ff);
}

.meter-fill.exp {
  background: linear-gradient(90deg, #d7a43e, #fff1b7);
}

.combat-buttons,
.combat-skill-list {
  gap: 8px;
}

.combat-buttons button,
.combat-skill-list button {
  min-height: 48px;
  text-align: center;
}

.combat-buttons button[data-action="attack-normal"] {
  background:
    linear-gradient(180deg, rgba(255, 199, 137, 0.38), transparent),
    linear-gradient(180deg, #b94727, #752416);
  color: #fff7d8;
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 2px 2px #321006;
}

.boss-phase-card {
  border: 3px solid #6f2d18;
  background:
    linear-gradient(180deg, rgba(255, 209, 162, 0.9), rgba(111, 45, 24, 0.18)),
    #fff6df;
  box-shadow:
    inset 0 0 0 1px rgba(255, 241, 183, 0.72),
    0 6px 14px rgba(111, 45, 24, 0.16);
}

.boss-phase-card strong {
  color: #8a2c1a;
}

.shop-panel,
.forge-panel,
.city-forge-panel,
.city-station,
.skill-panel,
.equipment-panel,
.consumable-panel {
  border-color: rgba(125, 84, 32, 0.2);
}

.shop-title,
.forge-panel-head,
.city-forge-summary,
.zone-map-heading,
.shop-shelf-title {
  border-color: rgba(125, 84, 32, 0.26);
}

.log {
  border-color: rgba(125, 84, 32, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.78), rgba(238, 226, 198, 0.6));
}

.log-entry {
  border-left-width: 4px;
  background: rgba(255, 253, 246, 0.72);
}

.live-log-panel {
  top: 12px;
}

.world-map,
.continent-map,
.road-map,
.simple-map-panel {
  background:
    linear-gradient(rgba(255, 255, 255, 0.12), rgba(2, 20, 42, 0.1)),
    rgba(255, 250, 240, 0.72);
}

@media (min-width: 900px) {
  .game {
    min-height: min(900px, calc(100vh - 32px));
  }

  .topbar {
    grid-template-columns: minmax(360px, 1fr) auto;
  }
}

@media (max-width: 1120px) {
  .module-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

@media (max-width: 820px) {
  .app-shell {
    padding: 8px;
  }

  .game {
    min-height: calc(100vh - 16px);
    border-width: 4px;
    padding: 10px;
  }

  .topbar,
  .account-panel,
  .account-panel.is-logged-in {
    grid-template-columns: 1fr;
  }

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

  .status-strip,
  .adventure-context,
  .current-goal-prep,
  .combat-area {
    grid-template-columns: 1fr;
  }

  .combat-area {
    min-height: auto;
  }

  .city-places {
    position: static;
    border: 3px solid var(--gold-dark);
    background: rgba(4, 29, 59, 0.68);
    padding: 7px;
  }
}

@media (max-width: 520px) {
  .brand {
    align-items: flex-start;
  }

  .seal {
    width: 50px;
    height: 50px;
    font-size: 18px;
  }

  .brand h1 {
    font-size: 30px;
  }

  .brand p {
    font-size: 12px;
  }

  .module-nav {
    grid-template-columns: 1fr;
  }

  .module-nav-button {
    min-height: 50px;
    text-align: left;
  }

  .module-nav-button::before {
    width: 32px;
    height: 32px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Portrait display scale pass: stage-filling presence without warping the cutouts. */
.race-option {
  min-height: 330px;
}

.race-option-top {
  grid-template-columns: 162px minmax(0, 1fr);
}

.race-portrait.is-small {
  width: 150px;
  height: 184px;
  --portrait-scale: 1.36;
  --portrait-shift-y: 6%;
}

.race-portrait.is-large {
  width: 360px;
  height: 430px;
  --portrait-scale: 1.48;
  --portrait-shift-y: 8%;
}

.race-portrait.is-combat {
  width: min(100%, 450px);
  height: 468px;
  --portrait-scale: 1.52;
  --portrait-shift-y: 9%;
}

.race-portrait-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  padding: 0;
  transform: translateY(var(--portrait-shift-y, 5%)) scale(var(--portrait-scale, 1.3));
  transform-origin: center bottom;
}

.character-layout {
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
}

.character-module .panel-body {
  container-type: inline-size;
}

.player-portrait-card {
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 0;
  align-items: center;
}

.character-content,
.player-tab-content,
.attribute-panel {
  min-width: 0;
}

.character-overview .stat-list {
  max-height: min(560px, 60vh);
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.player-portrait-card .race-portrait.is-large {
  width: 112px;
  height: 140px;
  --portrait-scale: 1.42;
  --portrait-shift-y: 7%;
}

.player-combat-portrait,
.enemy-visual {
  align-items: flex-end;
  min-height: 492px;
}

.enemy-portrait {
  width: 100%;
  height: 486px;
  object-fit: cover;
  object-position: center bottom;
  padding: 0;
  transform: translateY(7%) scale(1.34);
  transform-origin: center bottom;
}

.enemy-visual.is-elite .enemy-portrait {
  height: 500px;
  transform: translateY(7%) scale(1.4);
}

.enemy-visual.is-boss {
  min-height: 560px;
}

.enemy-visual.is-boss .enemy-portrait {
  width: 100%;
  height: 552px;
  transform: translateY(8%) scale(1.52);
}

.combat-area {
  min-height: 720px;
}

@container (min-width: 980px) {
  .character-layout {
    grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  }
}

@media (min-width: 821px) and (max-width: 1180px) {
  .character-layout {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }

  .player-portrait-card {
    grid-template-columns: 108px minmax(0, 1fr);
    min-height: 0;
  }

  .player-portrait-card .race-portrait.is-large {
    width: 108px;
    height: 136px;
  }
}

@media (max-width: 820px) {
  .combat-panel .panel-body {
    padding-top: 220px;
  }

  .combat-command-bar {
    position: fixed;
    top: 8px;
    left: 10px;
    right: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 7px;
  }

  .combat-command-bar button {
    min-height: 46px;
    padding: 6px 8px;
  }

  .combat-consumable-bar {
    position: fixed;
    top: 136px;
    left: 10px;
    right: 10px;
    z-index: 7;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 96px;
    overflow: auto;
    margin: 0;
    padding: 7px;
  }

  .combat-consumable-bar button {
    min-height: 50px;
    padding: 6px 8px;
  }

  .combat-consumable-bar.is-empty {
    grid-template-columns: 1fr;
    align-content: center;
  }

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

  .player-portrait-card {
    grid-template-columns: 96px minmax(0, 1fr);
    min-height: 0;
  }

  .race-option-top {
    grid-template-columns: 136px minmax(0, 1fr);
  }

  .race-portrait.is-small {
    width: 128px;
    height: 160px;
  }

  .race-portrait.is-large {
    width: 128px;
    height: 164px;
  }

  .player-portrait-card .race-portrait.is-large {
    width: 96px;
    height: 122px;
  }

  .character-overview .stat-list {
    max-height: 300px;
  }

  .race-portrait.is-combat {
    width: min(100%, 336px);
    height: 368px;
  }

  .player-combat-portrait,
  .enemy-visual {
    min-height: 388px;
  }

  .enemy-visual.is-boss {
    min-height: 430px;
  }

  .enemy-portrait,
  .enemy-visual.is-elite .enemy-portrait {
    height: 380px;
  }

  .enemy-visual.is-boss .enemy-portrait {
    height: 422px;
  }

  .combat-area {
    min-height: auto;
  }
}

@media (max-width: 520px) {
  .race-option {
    min-height: 0;
  }

  .race-option-top,
  .player-portrait-card {
    grid-template-columns: 1fr;
  }

  .race-option-top {
    justify-items: start;
  }

  .player-portrait-card {
    justify-items: stretch;
    text-align: left;
  }

  .player-portrait-meta {
    justify-items: start;
  }

  .race-portrait.is-small {
    width: min(54vw, 160px);
    height: 194px;
  }

  .race-portrait.is-large {
    width: min(42vw, 150px);
    height: 188px;
  }

  .player-portrait-card .race-portrait.is-large {
    width: min(42vw, 150px);
    max-width: 150px;
    height: 188px;
  }

  .character-overview .stat-list {
    max-height: 240px;
  }

  .race-portrait.is-combat {
    width: min(100%, 328px);
    height: 356px;
  }

  .player-combat-portrait,
  .enemy-visual {
    min-height: 366px;
  }

  .enemy-portrait,
  .enemy-visual.is-elite .enemy-portrait {
    height: 358px;
  }

  .enemy-visual.is-boss {
    min-height: 402px;
  }

  .enemy-visual.is-boss .enemy-portrait {
    height: 394px;
  }
}

/* Compact operation pass: keep battle, character and inventory actions visible without long scrolling. */
.character-layout {
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 10px;
}

.player-portrait-card {
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
}

.player-portrait-card .race-portrait.is-large {
  width: 72px;
  height: 92px;
  --portrait-scale: 1.2;
  --portrait-shift-y: 3%;
}

.player-portrait-meta {
  gap: 3px;
}

.player-portrait-meta strong {
  font-size: 15px;
  line-height: 1.25;
}

.player-portrait-meta span,
.player-portrait-meta small {
  font-size: 12px;
  line-height: 1.35;
}

.character-overview .stat-list {
  max-height: min(380px, 48vh);
}

.equipment-panel,
.consumable-panel {
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
}

.equipment-title span {
  color: var(--muted);
  font-size: 12px;
}

.equipment-slots {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 6px;
}

.equipment-slot {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 6px;
  padding: 6px 8px;
}

.equipment-slot strong,
.equipment-slot strong small,
.equip-button b,
.equip-button small,
.managed-item-main strong,
.managed-item-main span,
.managed-item-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-filter-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.equipment-filter-tabs button {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 34px;
  border-radius: 8px;
  padding: 5px 4px;
  color: #514435;
  font-size: 12px;
  font-weight: 700;
}

.equipment-filter-tabs button.is-active {
  border-color: rgba(123, 56, 50, 0.55);
  background: rgba(255, 244, 218, 0.9);
  color: #7b3832;
}

.equipment-filter-tabs em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.equip-list,
.consumable-list {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 6px;
  max-height: min(420px, 52vh);
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.equip-button {
  min-height: 42px;
  padding: 7px 8px;
}

.equip-button span {
  gap: 2px;
}

.equip-button b,
.managed-item-main strong {
  font-size: 13px;
}

.equip-button small,
.managed-item-main span,
.managed-item-main small {
  font-size: 11px;
  line-height: 1.3;
}

.equip-button.is-ready:not(:disabled) {
  border-color: rgba(63, 118, 84, 0.46);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(232, 246, 236, 0.9));
}

.managed-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 7px 8px;
}

.managed-item-main {
  gap: 3px;
}

.equipment-growth-panel {
  max-height: 64px;
  overflow: auto;
  padding: 5px 6px;
  scrollbar-width: thin;
}

.item-actions {
  grid-template-columns: repeat(2, minmax(54px, 1fr));
  min-width: 124px;
  gap: 5px;
}

.item-actions button {
  min-height: 28px;
  padding: 3px 5px;
  font-size: 11px;
}

.combat-panel .panel-body {
  display: grid;
  gap: 8px;
  font-size: 13px;
}

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

.combat-command-bar {
  border-width: 1px;
  margin-bottom: 4px;
  padding: 6px;
}

.combat-command-bar button {
  min-height: 36px;
  padding: 5px 8px;
  font-size: 12px;
}

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

.combat-choice-panel {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid rgba(79, 125, 173, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  padding: 6px;
}

.combat-action-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.combat-action-title strong {
  overflow: hidden;
  color: #1f527f;
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-action-title span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.combat-consumable-bar {
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  max-height: 128px;
  overflow: auto;
  margin: 0;
  border-width: 1px;
  box-shadow: none;
  padding: 5px;
  scrollbar-width: thin;
}

.combat-consumable-bar button {
  min-height: 36px;
  padding: 4px 6px;
  font-size: 11px;
}

.combat-consumable-bar strong,
.combat-skill-list strong {
  font-size: 12px;
  line-height: 1.2;
}

.combat-consumable-bar span,
.combat-consumable-bar small,
.combat-skill-list span {
  font-size: 11px;
  line-height: 1.2;
}

.combat-area {
  min-height: 0;
  gap: 8px;
  padding: 8px;
}

.fighter {
  gap: 6px;
  padding: 8px;
}

.fighter h3 {
  font-size: 14px;
}

.fighter .badges {
  gap: 5px;
  max-height: 58px;
  overflow: auto;
  scrollbar-width: thin;
}

.fighter .badge {
  font-size: 11px;
  padding: 2px 6px;
}

.player-combat-portrait,
.enemy-visual {
  align-items: flex-end;
  min-height: 136px;
  max-height: 168px;
}

.race-portrait.is-combat {
  width: min(100%, 130px);
  height: 156px;
  --portrait-scale: 1.2;
  --portrait-shift-y: 3%;
}

.enemy-portrait,
.enemy-visual.is-elite .enemy-portrait {
  width: 100%;
  height: 160px;
  object-fit: contain;
  object-position: center bottom;
  padding: 4px;
  transform: none;
}

.enemy-visual.is-boss {
  min-height: 188px;
  max-height: 210px;
}

.enemy-visual.is-boss .enemy-portrait {
  height: 204px;
  object-fit: contain;
  transform: none;
}

.combat-skill-list {
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 5px;
  max-height: 128px;
  margin-top: 0;
  overflow: auto;
  scrollbar-width: thin;
}

.combat-skill-list button {
  min-height: 36px;
  padding: 4px 6px;
  font-size: 11px;
}

.combat-skill-list.is-empty {
  display: grid;
  align-items: center;
  min-height: 40px;
  border: 1px dashed rgba(79, 125, 173, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--muted);
  padding: 8px;
  font-size: 12px;
}

@media (max-width: 820px) {
  .combat-panel .panel-body {
    padding-top: 0;
  }

  .combat-command-bar {
    position: sticky;
    top: 6px;
    left: auto;
    right: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .combat-consumable-bar {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    z-index: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 118px;
  }

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

  .player-combat-portrait,
  .enemy-visual {
    min-height: 118px;
    max-height: 142px;
  }

  .race-portrait.is-combat {
    width: min(100%, 112px);
    height: 136px;
  }

  .enemy-portrait,
  .enemy-visual.is-elite .enemy-portrait {
    height: 136px;
  }

  .enemy-visual.is-boss {
    min-height: 154px;
  }

  .enemy-visual.is-boss .enemy-portrait {
    height: 154px;
  }

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

  .player-portrait-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .player-portrait-card .race-portrait.is-large {
    width: 64px;
    height: 82px;
  }

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

  .equipment-filter-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .equip-list,
  .consumable-list {
    grid-template-columns: 1fr;
    max-height: 360px;
  }

  .managed-item {
    grid-template-columns: 1fr;
  }

  .item-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .player-portrait-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .player-portrait-card .race-portrait.is-large {
    width: 58px;
    height: 74px;
  }

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

/* Inventory detail pass: item list is compact, selected item shows complete text and actions. */
.inventory-item-workbench {
  display: grid;
  grid-template-columns: minmax(210px, 0.9fr) minmax(260px, 1.1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.inventory-item-workbench .consumable-list {
  grid-template-columns: 1fr;
  max-height: min(460px, 58vh);
}

.managed-item-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.58);
  padding: 7px 8px;
  text-align: left;
}

.managed-item-summary.is-active {
  border-color: rgba(123, 56, 50, 0.55);
  background: rgba(255, 244, 218, 0.9);
}

.managed-item-summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.managed-item-summary b {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  color: #3f3126;
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.managed-item-summary b em {
  flex: 0 0 auto;
  border: 1px solid rgba(63, 118, 84, 0.28);
  border-radius: 999px;
  background: rgba(63, 118, 84, 0.12);
  color: #2f6142;
  font-size: 10px;
  font-style: normal;
  padding: 1px 5px;
}

.managed-item-summary small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.managed-item-summary > strong {
  color: #7b3832;
  font-size: 12px;
  white-space: nowrap;
}

.inventory-detail-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-height: min(520px, 62vh);
  overflow: auto;
  border: 1px solid rgba(92, 73, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.5);
  padding: 8px;
  scrollbar-width: thin;
}

.inventory-detail-panel.is-empty {
  align-content: center;
  min-height: 120px;
  color: var(--muted);
}

.inventory-detail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inventory-detail-title strong {
  color: #7b3832;
  font-size: 13px;
}

.inventory-detail-title span {
  color: var(--muted);
  font-size: 11px;
}

.managed-item.is-detail {
  grid-template-columns: 1fr;
  gap: 8px;
  border-color: rgba(92, 73, 55, 0.12);
  background: rgba(255, 255, 255, 0.42);
}

.managed-item.is-detail .managed-item-main strong,
.managed-item.is-detail .managed-item-main span,
.managed-item.is-detail .managed-item-main small {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.managed-item.is-detail .managed-item-main strong {
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.35;
}

.managed-item.is-detail .managed-item-main span,
.managed-item.is-detail .managed-item-main small {
  font-size: 12px;
  line-height: 1.45;
}

.managed-item.is-detail .equipment-growth-panel {
  max-height: none;
  overflow: visible;
}

.managed-item.is-detail .item-refine-panel,
.managed-item.is-detail .item-star-panel,
.managed-item.is-detail .item-affix-panel {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
}

.managed-item.is-detail .item-refine-panel {
  border: 1px solid rgba(180, 83, 9, 0.22);
  background: rgba(251, 191, 36, 0.08);
}

.managed-item.is-detail .item-star-panel {
  border: 1px solid rgba(217, 119, 6, 0.2);
  background: rgba(245, 158, 11, 0.07);
}

.managed-item.is-detail .item-affix-panel {
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(59, 130, 246, 0.06);
}

.managed-item.is-detail .item-actions {
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  min-width: 0;
}

.managed-item.is-detail .item-actions button {
  min-height: 30px;
  font-size: 12px;
}

@media (max-width: 820px) {
  .inventory-item-workbench {
    grid-template-columns: 1fr;
  }

  .inventory-detail-panel {
    max-height: none;
  }
}

/* Combat usability pass: scrollable choices, stable clicks and shorter mobile flow. */
.combat-panel {
  scroll-margin-top: 8px;
}

.combat-panel .panel-body {
  gap: 7px;
}

.combat-command-bar {
  position: static;
  top: auto;
  z-index: auto;
  margin-bottom: 0;
}

.combat-command-bar button {
  min-width: 0;
  touch-action: manipulation;
}

.combat-choice-grid {
  align-items: stretch;
}

.combat-choice-panel {
  min-height: 0;
}

.combat-consumable-bar,
.combat-skill-list {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  align-content: start;
  max-height: min(236px, 32vh);
  min-height: 82px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.combat-consumable-bar button,
.combat-skill-list button {
  align-content: start;
  min-width: 0;
  min-height: 52px;
  padding: 7px 8px;
  text-align: left;
  touch-action: manipulation;
}

.combat-consumable-bar strong,
.combat-consumable-bar span,
.combat-consumable-bar small,
.combat-skill-list strong,
.combat-skill-list span {
  overflow: visible;
  color: inherit;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.combat-consumable-bar strong,
.combat-skill-list strong {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  color: #276b73;
  font-size: 12px;
  line-height: 1.25;
}

.combat-skill-list strong {
  color: #1f527f;
}

.combat-consumable-bar em {
  flex: 0 0 auto;
  margin-left: 0;
}

.combat-consumable-bar span,
.combat-consumable-bar small,
.combat-skill-list span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.combat-consumable-bar.is-empty,
.combat-skill-list.is-empty {
  max-height: none;
  min-height: 72px;
  overflow: visible;
}

.combat-area {
  min-height: 0;
}

.fighter {
  min-width: 0;
}

.player-combat-portrait,
.enemy-visual {
  min-height: 118px;
  max-height: 148px;
}

.race-portrait.is-combat {
  width: min(100%, 112px);
  height: 138px;
  --portrait-scale: 1.24;
  --portrait-shift-y: 4%;
}

.enemy-portrait,
.enemy-visual.is-elite .enemy-portrait {
  height: 140px;
  object-fit: contain;
  transform: none;
}

.enemy-visual.is-boss {
  min-height: 152px;
  max-height: 170px;
}

.enemy-visual.is-boss .enemy-portrait {
  height: 164px;
  object-fit: contain;
  transform: none;
}

@media (max-width: 820px) {
  .combat-panel .panel-body {
    gap: 6px;
    padding-top: 0;
  }

  .combat-command-bar {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    padding: 5px;
  }

  .combat-command-bar button {
    min-height: 34px;
    padding: 4px 5px;
    font-size: 11px;
    line-height: 1.2;
  }

  .combat-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .combat-choice-panel {
    padding: 5px;
  }

  .combat-action-title strong,
  .combat-action-title span {
    font-size: 11px;
  }

  .combat-consumable-bar,
  .combat-skill-list {
    grid-template-columns: 1fr;
    max-height: min(210px, 30vh);
    min-height: 74px;
    padding: 5px;
  }

  .combat-consumable-bar button,
  .combat-skill-list button {
    min-height: 48px;
    padding: 6px 7px;
  }

  .combat-area {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
  }

  .fighter {
    gap: 5px;
    padding: 6px;
  }

  .fighter h3 {
    font-size: 12px;
    line-height: 1.2;
  }

  .fighter .badges {
    max-height: 44px;
  }

  .fighter .badge {
    font-size: 10px;
    line-height: 1.2;
    padding: 2px 5px;
  }

  .player-combat-portrait,
  .enemy-visual {
    min-height: 92px;
    max-height: 112px;
  }

  .race-portrait.is-combat {
    width: min(100%, 86px);
    height: 106px;
  }

  .enemy-portrait,
  .enemy-visual.is-elite .enemy-portrait {
    height: 106px;
  }

  .enemy-visual.is-boss {
    min-height: 112px;
    max-height: 124px;
  }

  .enemy-visual.is-boss .enemy-portrait {
    height: 120px;
  }
}

@media (max-width: 560px) {
  .combat-command-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .combat-choice-grid {
    grid-template-columns: 1fr;
  }

  .combat-consumable-bar,
  .combat-skill-list {
    max-height: min(178px, 26vh);
  }

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

.account-character-manager,
.account-warehouse-panel {
  align-items: stretch;
  flex-direction: column;
  gap: 12px;
}

.account-character-list,
.account-warehouse-grid {
  display: grid;
  gap: 8px;
}

.account-character-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--hs-border-subtle, rgba(120, 132, 158, 0.28));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.account-character-card.is-active {
  border-color: rgba(42, 130, 218, 0.5);
  background: rgba(232, 244, 255, 0.8);
}

.account-character-card div,
.account-character-card strong,
.account-character-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-character-card small {
  display: block;
  color: var(--hs-text-muted, #667085);
  font-size: 12px;
  line-height: 1.45;
}

.account-warehouse-panel {
  padding: 12px;
  border: 1px solid var(--hs-border-subtle, rgba(120, 132, 158, 0.28));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.account-warehouse-panel.is-locked {
  color: var(--hs-text-muted, #667085);
}

.account-warehouse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.account-warehouse-head span {
  display: block;
  color: var(--hs-text-muted, #667085);
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

.account-warehouse-grid > div {
  display: grid;
  gap: 6px;
  align-content: start;
}

.account-warehouse-grid button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 40px;
  text-align: left;
}

.account-warehouse-grid button span,
.account-warehouse-grid button em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-body {
  min-height: 100vh;
  margin: 0;
  background: #f4f7fb;
  color: #1f2937;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.admin-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.admin-panel {
  padding: 16px;
  border: 1px solid rgba(124, 137, 165, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(31, 41, 55, 0.08);
}

.admin-head,
.admin-section-title,
.admin-auth,
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-head h1 {
  margin: 4px 0;
  font-size: 24px;
}

.admin-head p,
.admin-section-title span {
  margin: 0;
  color: #667085;
  font-size: 13px;
}

.admin-section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  margin-top: 16px;
}

.admin-auth,
.admin-toolbar,
.admin-editor {
  margin-top: 12px;
}

.admin-auth input,
.admin-toolbar input,
.admin-toolbar select,
.admin-editor input,
.admin-editor select,
.admin-editor textarea {
  min-height: 40px;
  border: 1px solid rgba(124, 137, 165, 0.4);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: #1f2937;
}

.admin-auth input,
.admin-toolbar input,
.admin-editor textarea {
  flex: 1;
  min-width: 0;
}

.admin-editor {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.admin-editor textarea {
  grid-column: 1 / -1;
  min-height: 160px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.admin-message {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #eef2ff;
  color: #344054;
  font-size: 13px;
}

.admin-message.is-good {
  background: #ecfdf3;
  color: #027a48;
}

.admin-message.is-danger {
  background: #fef3f2;
  color: #b42318;
}

.admin-table-view {
  max-height: 420px;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid rgba(124, 137, 165, 0.24);
  border-radius: 8px;
}

.admin-table-view table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table-view th,
.admin-table-view td {
  padding: 8px;
  border-bottom: 1px solid rgba(124, 137, 165, 0.2);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.admin-table-hint {
  padding: 8px 10px;
  color: #667085;
  font-size: 12px;
  background: #f8fafc;
}

.admin-overrides,
.admin-users,
.admin-warehouse {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.admin-override-row,
.admin-users button,
.admin-warehouse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(124, 137, 165, 0.24);
  border-radius: 8px;
  background: #fff;
}

.admin-users button {
  text-align: left;
}

.admin-users span,
.admin-override-row span {
  color: #667085;
  font-size: 12px;
}

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

.admin-warehouse-columns > div {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(124, 137, 165, 0.22);
  border-radius: 8px;
  background: #fff;
}

.admin-warehouse-columns span {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.admin-empty {
  padding: 12px;
  color: #667085;
  font-size: 13px;
}

@media (max-width: 860px) {
  .account-warehouse-grid,
  .admin-grid,
  .admin-warehouse-columns {
    grid-template-columns: 1fr;
  }

  .admin-head,
  .admin-section-title,
  .admin-auth,
  .admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-section-actions {
    justify-content: flex-start;
  }

  .admin-editor {
    grid-template-columns: 1fr;
  }
}

/* UI refactor V1 foundation. New classes are isolated with hs-* and do not replace legacy pages yet. */
:root {
  --hs-font-sans: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  --hs-color-bg: #f3f7fb;
  --hs-color-surface: #ffffff;
  --hs-color-surface-soft: #f7fafc;
  --hs-color-surface-raised: #fffaf0;
  --hs-color-text: #172436;
  --hs-color-text-muted: #65758a;
  --hs-color-text-subtle: #8795a7;
  --hs-color-border: rgba(91, 119, 151, 0.22);
  --hs-color-border-strong: rgba(71, 95, 124, 0.38);
  --hs-color-primary: #256ea8;
  --hs-color-primary-strong: #0f4f82;
  --hs-color-primary-soft: #e8f4ff;
  --hs-color-accent: #d6a84c;
  --hs-color-accent-strong: #8b6321;
  --hs-color-success: #2f855a;
  --hs-color-warning: #b7791f;
  --hs-color-danger: #b5423a;
  --hs-color-info: #2b6cb0;
  --hs-quality-normal: #718096;
  --hs-quality-fine: #2f855a;
  --hs-quality-rare: #2b6cb0;
  --hs-quality-epic: #805ad5;
  --hs-quality-artifact: #b7791f;
  --hs-quality-mythic: #c53030;
  --hs-space-1: 4px;
  --hs-space-2: 8px;
  --hs-space-3: 12px;
  --hs-space-4: 16px;
  --hs-space-5: 20px;
  --hs-space-6: 24px;
  --hs-radius-sm: 6px;
  --hs-radius-md: 8px;
  --hs-radius-lg: 12px;
  --hs-shadow-sm: 0 2px 8px rgba(14, 36, 64, 0.08);
  --hs-shadow-md: 0 10px 28px rgba(14, 36, 64, 0.14);
  --hs-shadow-lg: 0 20px 56px rgba(14, 36, 64, 0.22);
  --hs-z-dropdown: 30;
  --hs-z-sticky: 40;
  --hs-z-overlay: 80;
  --hs-z-modal: 100;
  --hs-z-toast: 120;
  --hs-control-height: 44px;
}

.hs-stack {
  display: grid;
  gap: var(--hs-space-3);
}

.hs-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--hs-space-2);
}

.hs-button,
button.hs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hs-space-2);
  min-height: var(--hs-control-height);
  border: 1px solid var(--hs-color-border-strong);
  border-radius: var(--hs-radius-md);
  background: linear-gradient(180deg, var(--hs-color-surface), var(--hs-color-surface-soft));
  color: var(--hs-color-text);
  box-shadow: var(--hs-shadow-sm);
  padding: 8px 14px;
  font-family: var(--hs-font-sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.hs-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--hs-color-accent);
  background: linear-gradient(180deg, #ffffff, #fff5d7);
}

.hs-button:focus-visible {
  outline: 3px solid rgba(37, 110, 168, 0.28);
  outline-offset: 2px;
}

.hs-button:disabled,
.hs-button.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.hs-button--primary {
  border-color: var(--hs-color-primary-strong);
  background: linear-gradient(180deg, #3b8cc3, var(--hs-color-primary-strong));
  color: #ffffff;
}

.hs-button--danger {
  border-color: rgba(181, 66, 58, 0.72);
  background: linear-gradient(180deg, #fff5f4, #ffe5e2);
  color: var(--hs-color-danger);
}

.hs-button--ghost {
  background: rgba(255, 255, 255, 0.5);
  box-shadow: none;
}

.hs-button--sm {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 12px;
}

.hs-button--block {
  width: 100%;
}

.hs-panel,
.hs-card {
  border: 1px solid var(--hs-color-border);
  border-radius: var(--hs-radius-md);
  background: rgba(255, 255, 255, 0.92);
  color: var(--hs-color-text);
  box-shadow: var(--hs-shadow-sm);
}

.hs-panel {
  overflow: hidden;
}

.hs-panel__header,
.hs-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--hs-space-3);
  border-bottom: 1px solid var(--hs-color-border);
  padding: var(--hs-space-4);
}

.hs-panel__title,
.hs-card__title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.hs-panel__title strong,
.hs-card__title strong {
  overflow: hidden;
  color: var(--hs-color-text);
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hs-panel__title span,
.hs-card__title span {
  color: var(--hs-color-text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.hs-panel__body {
  padding: var(--hs-space-4);
}

.hs-card__body {
  padding: 0;
}

.hs-panel__footer,
.hs-card__footer {
  border-top: 1px solid var(--hs-color-border);
  padding: var(--hs-space-3) var(--hs-space-4);
}

.hs-card {
  display: grid;
  gap: var(--hs-space-3);
  padding: var(--hs-space-4);
}

.hs-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid var(--hs-color-border);
  border-radius: 999px;
  background: var(--hs-color-surface-soft);
  color: var(--hs-color-text-muted);
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
}

.hs-badge--normal { color: var(--hs-quality-normal); }
.hs-badge--fine { color: var(--hs-quality-fine); }
.hs-badge--rare { color: var(--hs-quality-rare); }
.hs-badge--epic { color: var(--hs-quality-epic); }
.hs-badge--artifact { color: var(--hs-quality-artifact); }
.hs-badge--mythic { color: var(--hs-quality-mythic); }

.hs-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hs-space-2);
}

.hs-tab {
  min-height: 38px;
  border: 1px solid var(--hs-color-border);
  border-radius: var(--hs-radius-sm);
  background: rgba(255, 255, 255, 0.72);
  color: var(--hs-color-text-muted);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
}

.hs-tab.is-active,
.hs-tab[aria-selected="true"] {
  border-color: var(--hs-color-primary);
  background: var(--hs-color-primary-soft);
  color: var(--hs-color-primary-strong);
}

.hs-modal {
  position: fixed;
  inset: 0;
  z-index: var(--hs-z-modal);
  display: grid;
  place-items: center;
  background: rgba(5, 17, 32, 0.52);
  padding: var(--hs-space-5);
}

.hs-modal__dialog {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--hs-color-border-strong);
  border-radius: var(--hs-radius-lg);
  background: var(--hs-color-surface);
  box-shadow: var(--hs-shadow-lg);
}

.hs-toast {
  position: fixed;
  right: var(--hs-space-5);
  bottom: var(--hs-space-5);
  z-index: var(--hs-z-toast);
  display: grid;
  gap: 2px;
  min-width: min(320px, calc(100vw - 32px));
  border: 1px solid var(--hs-color-border-strong);
  border-radius: var(--hs-radius-md);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--hs-shadow-md);
  padding: var(--hs-space-3);
}

.hs-toast strong {
  color: var(--hs-color-text);
  font-size: 14px;
  line-height: 1.3;
}

.hs-toast span {
  color: var(--hs-color-text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.hs-tooltip {
  position: relative;
}

.hs-tooltip[data-tooltip]:hover::after,
.hs-tooltip[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: var(--hs-z-dropdown);
  width: max-content;
  max-width: 240px;
  transform: translateX(-50%);
  border-radius: var(--hs-radius-sm);
  background: rgba(18, 31, 48, 0.94);
  color: #ffffff;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: var(--hs-shadow-md);
}

.hs-progress {
  display: grid;
  gap: 4px;
}

.hs-progress__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--hs-space-2);
  color: var(--hs-color-text-muted);
  font-size: 12px;
  font-weight: 800;
}

.hs-progress__track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(91, 119, 151, 0.16);
}

.hs-progress__bar {
  width: var(--hs-progress-value, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--hs-color-primary), #53a5d8);
}

.hs-empty,
.hs-error,
.hs-locked {
  display: grid;
  gap: var(--hs-space-2);
  place-items: center;
  min-height: 112px;
  border: 1px dashed var(--hs-color-border-strong);
  border-radius: var(--hs-radius-md);
  background: rgba(255, 255, 255, 0.58);
  color: var(--hs-color-text-muted);
  padding: var(--hs-space-5);
  text-align: center;
}

.hs-error {
  border-color: rgba(181, 66, 58, 0.42);
  color: var(--hs-color-danger);
}

.hs-locked {
  border-color: rgba(183, 121, 31, 0.42);
  color: var(--hs-color-warning);
}

@media (max-width: 820px) {
  :root {
    --hs-control-height: 44px;
  }

  .hs-panel__header,
  .hs-card__header {
    align-items: stretch;
    flex-direction: column;
    padding: var(--hs-space-3);
  }

  .hs-panel__body,
  .hs-card {
    padding: var(--hs-space-3);
  }

  .hs-button,
  button.hs-button {
    min-height: 44px;
  }

  .hs-modal {
    align-items: end;
    padding: 0;
  }

  .hs-modal__dialog {
    width: 100%;
    max-height: min(84vh, 720px);
    border-radius: var(--hs-radius-lg) var(--hs-radius-lg) 0 0;
  }

  .hs-toast {
    right: var(--hs-space-3);
    bottom: var(--hs-space-3);
  }
}

/* UI refactor V2: main shell and navigation. Scoped to the world screen only. */
.game-shell-v2 {
  gap: 12px;
}

.game-shell-v2 .shell-topbar {
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.35fr) auto;
  align-items: stretch;
  gap: 10px;
}

.game-shell-v2 .brand {
  min-width: 0;
}

.game-shell-v2 .brand h1 {
  font-size: clamp(24px, 3vw, 38px);
}

.game-shell-v2 .brand p {
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
}

.shell-resource-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  align-self: stretch;
  min-width: 0;
}

.shell-resource-bar span {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  padding: 7px 8px;
}

.shell-resource-bar small,
.shell-resource-bar strong,
.shell-resource-bar em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-resource-bar small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  font-weight: 700;
}

.shell-resource-bar strong {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.15;
}

.shell-resource-bar em {
  color: rgba(255, 241, 183, 0.86);
  font-size: 11px;
  font-style: normal;
}

.shell-resource-bar .is-danger {
  border-color: rgba(255, 196, 174, 0.62);
  background: rgba(154, 41, 34, 0.3);
}

.game-shell-v2 .top-actions {
  align-content: center;
  align-self: stretch;
}

.game-shell-v2 .account-panel {
  margin-top: 0;
}

.game-shell-v2 .desktop-module-nav {
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
}

.game-shell-v2 .module-nav-button {
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 2px 8px;
  min-height: 54px;
  padding: 8px 10px;
}

.game-shell-v2 .module-nav-button::before {
  display: none;
  content: none;
}

.game-shell-v2 .module-nav-button i {
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 241, 183, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff5d1;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.game-shell-v2 .module-nav-button strong {
  align-self: end;
  font-size: 14px;
}

.game-shell-v2 .module-nav-button span {
  align-self: start;
  font-size: 11px;
}

.game-shell-v2 .module-nav-button.is-active i {
  border-color: rgba(37, 110, 168, 0.28);
  background: var(--hs-color-primary-soft);
  color: var(--hs-color-primary-strong);
}

.game-shell-v2 .mobile-bottom-nav {
  display: none;
}

.game-shell-v2 .shell-status-strip {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.shell-goal-bar {
  min-width: 0;
}

.shell-goal-bar .current-goal {
  margin-bottom: 0;
}

.shell-goal-bar .current-goal.is-shell {
  border-color: rgba(181, 66, 58, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 246, 238, 0.96), rgba(255, 235, 232, 0.9)),
    linear-gradient(90deg, rgba(181, 66, 58, 0.12), rgba(214, 168, 76, 0.08));
}

.game-shell-v2 .play-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.game-shell-v2 .play-layout.is-module-page,
.game-shell-v2 .play-layout.is-log-page {
  width: 100%;
}

.game-shell-v2 .module-page-shell {
  width: 100%;
  min-width: 0;
}

.game-shell-v2 .module-page-shell > .panel {
  width: 100%;
}

.game-shell-v2 .live-log-panel {
  display: none;
}

@media (max-width: 1180px) {
  .game-shell-v2 .shell-topbar {
    grid-template-columns: minmax(260px, 1fr) auto;
  }

  .shell-resource-bar {
    grid-column: 1 / -1;
  }

  .game-shell-v2 .desktop-module-nav,
  .game-shell-v2 .shell-status-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .game-shell-v2 {
    padding-bottom: 78px;
  }

  .game-shell-v2 .shell-topbar,
  .game-shell-v2 .account-panel,
  .game-shell-v2 .account-panel.is-logged-in {
    grid-template-columns: 1fr;
  }

  .shell-resource-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-shell-v2 .desktop-module-nav {
    display: none;
  }

  .game-shell-v2 .mobile-bottom-nav {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: var(--hs-z-sticky);
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
    border: 1px solid rgba(125, 84, 32, 0.42);
    border-radius: 12px;
    background: rgba(255, 250, 240, 0.96);
    box-shadow: var(--hs-shadow-lg);
    padding: 5px;
  }

  .game-shell-v2 .mobile-bottom-nav .module-nav-button {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 52px;
    border-width: 1px;
    border-color: rgba(125, 84, 32, 0.2);
    background: rgba(255, 255, 255, 0.64);
    color: var(--hs-color-text-muted);
    padding: 4px 2px;
    text-align: center;
  }

  .game-shell-v2 .mobile-bottom-nav .module-nav-button i {
    grid-row: auto;
    width: 24px;
    height: 24px;
    border-color: rgba(37, 110, 168, 0.18);
    background: rgba(232, 244, 255, 0.7);
    color: var(--hs-color-primary-strong);
    font-size: 12px;
  }

  .game-shell-v2 .mobile-bottom-nav .module-nav-button strong {
    max-width: 100%;
    color: inherit;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
  }

  .game-shell-v2 .mobile-bottom-nav .module-nav-button.is-active {
    border-color: var(--hs-color-primary);
    background: var(--hs-color-primary-soft);
    color: var(--hs-color-primary-strong);
  }

  .game-shell-v2 .shell-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shell-goal-bar .current-goal {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .game-shell-v2 .play-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .shell-resource-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-shell-v2 .mobile-bottom-nav {
    left: 6px;
    right: 6px;
    bottom: 6px;
    gap: 3px;
  }

  .game-shell-v2 .mobile-bottom-nav .module-nav-button {
    min-height: 50px;
  }

  .game-shell-v2 .mobile-bottom-nav .module-nav-button i {
    width: 22px;
    height: 22px;
  }
}

/* UI refactor V3: combat screen. Keeps legacy combat actions and data-* protocol intact. */
.combat-panel-v3 {
  overflow: hidden;
}

.combat-panel-v3 .combat-header-v3 {
  align-items: center;
}

.combat-header-v3 > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.combat-header-v3 span,
.combat-header-v3 small {
  color: var(--hs-color-text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.combat-header-v3 h2 {
  overflow: hidden;
  margin: 0;
  color: var(--hs-color-text);
  font-size: 20px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.combat-panel-v3 .combat-body-v3 {
  display: grid;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(4, 29, 59, 0.16), rgba(2, 17, 37, 0.28)),
    url("assets/sky_fantasy_backdrop.png") center 64% / cover no-repeat;
}

.combat-feedback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(37, 110, 168, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 8px 10px;
}

.combat-feedback span {
  border-radius: 999px;
  background: var(--hs-color-primary-soft);
  color: var(--hs-color-primary-strong);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.combat-feedback strong {
  overflow: hidden;
  color: var(--hs-color-text);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-feedback.good span {
  background: rgba(47, 133, 90, 0.12);
  color: var(--hs-color-success);
}

.combat-feedback.danger span,
.combat-feedback.category-phase span {
  background: rgba(181, 66, 58, 0.12);
  color: var(--hs-color-danger);
}

.combat-feedback.category-loot span {
  background: rgba(183, 121, 31, 0.14);
  color: var(--hs-color-warning);
}

.combat-stage-v3 {
  min-height: 0;
  gap: 10px;
  padding: 10px;
}

.combat-fighter-card {
  gap: 8px;
  padding: 10px;
}

.combat-fighter-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
}

.combat-fighter-head span {
  grid-row: 1 / span 2;
  border: 1px solid rgba(255, 241, 183, 0.34);
  border-radius: 999px;
  background: rgba(4, 29, 59, 0.44);
  color: #fff1b7;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 900;
}

.combat-fighter-head h3,
.combat-fighter-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-fighter-head h3 {
  color: #fff7d8;
  font-size: 16px;
}

.combat-fighter-head small {
  color: rgba(255, 247, 216, 0.76);
  font-size: 11px;
}

.combat-fighter-visual {
  min-width: 0;
}

.combat-fighter-card .player-combat-portrait,
.combat-fighter-card .enemy-visual {
  min-height: 118px;
  max-height: 150px;
}

.combat-fighter-card .race-portrait.is-combat {
  width: min(100%, 112px);
  height: 136px;
  --portrait-scale: 1.22;
  --portrait-shift-y: 4%;
}

.combat-fighter-card .enemy-portrait,
.combat-fighter-card .enemy-visual.is-elite .enemy-portrait {
  height: 138px;
}

.combat-fighter-card .enemy-visual.is-boss .enemy-portrait {
  height: 156px;
}

.combat-meter-stack {
  display: grid;
  gap: 6px;
}

.combat-state-badges {
  max-height: 58px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.combat-control-deck {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(125, 84, 32, 0.24);
  border-radius: 10px;
  background: rgba(255, 250, 240, 0.78);
  padding: 8px;
}

.combat-panel-v3 .combat-command-bar {
  position: static;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  border-width: 1px;
  box-shadow: none;
  padding: 6px;
}

.combat-panel-v3 .combat-command-bar button {
  display: grid;
  gap: 3px;
  align-content: center;
  min-height: 48px;
  padding: 6px 8px;
  text-align: center;
}

.combat-panel-v3 .combat-command-bar button strong,
.combat-panel-v3 .combat-command-bar button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-panel-v3 .combat-command-bar button strong {
  font-size: 13px;
  line-height: 1.2;
}

.combat-panel-v3 .combat-command-bar button span {
  color: inherit;
  font-size: 11px;
  line-height: 1.25;
  opacity: 0.78;
}

.combat-panel-v3 .combat-choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.combat-panel-v3 .combat-choice-panel {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(79, 125, 173, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  padding: 7px;
}

.combat-panel-v3 .combat-action-title {
  align-items: center;
  min-height: 22px;
}

.combat-panel-v3 .combat-action-title strong {
  color: var(--hs-color-primary-strong);
}

.combat-panel-v3 .combat-consumable-bar,
.combat-panel-v3 .combat-skill-list {
  grid-template-columns: 1fr;
  max-height: min(228px, 30vh);
  margin: 0;
  border-width: 1px;
  box-shadow: none;
  padding: 5px;
}

.combat-panel-v3 .combat-consumable-bar button,
.combat-panel-v3 .combat-skill-list button {
  min-height: 48px;
}

.combat-log-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(37, 110, 168, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
  padding: 8px;
}

.combat-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.combat-log-head strong {
  color: var(--hs-color-text);
  font-size: 14px;
}

.combat-log-head span {
  color: var(--hs-color-text-muted);
  font-size: 12px;
}

.combat-log-panel .log-filter {
  margin: 0;
}

.combat-log-panel .log {
  max-height: 156px;
  overflow: auto;
  overscroll-behavior: contain;
}

.battle-result-card {
  box-shadow: var(--hs-shadow-md);
}

@media (max-width: 820px) {
  .combat-header-v3 {
    gap: 8px;
  }

  .combat-header-actions {
    justify-content: flex-start;
  }

  .combat-feedback {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .combat-feedback strong {
    white-space: normal;
  }

  .combat-panel-v3 .combat-command-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .combat-panel-v3 .combat-command-bar button {
    min-height: 44px;
    padding: 5px 4px;
  }

  .combat-panel-v3 .combat-command-bar button strong {
    font-size: 12px;
  }

  .combat-panel-v3 .combat-command-bar button span {
    font-size: 10px;
  }

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

  .combat-fighter-card {
    padding: 7px;
  }

  .combat-fighter-head {
    grid-template-columns: 1fr;
  }

  .combat-fighter-head span {
    grid-row: auto;
    justify-self: start;
  }

  .combat-fighter-head h3 {
    font-size: 13px;
  }

  .combat-fighter-head small {
    white-space: normal;
  }

  .combat-fighter-card .player-combat-portrait,
  .combat-fighter-card .enemy-visual {
    min-height: 92px;
    max-height: 112px;
  }

  .combat-fighter-card .race-portrait.is-combat {
    width: min(100%, 84px);
    height: 104px;
  }

  .combat-fighter-card .enemy-portrait,
  .combat-fighter-card .enemy-visual.is-elite .enemy-portrait {
    height: 104px;
  }

  .combat-fighter-card .enemy-visual.is-boss .enemy-portrait {
    height: 116px;
  }

  .combat-state-badges {
    max-height: 42px;
  }

  .combat-panel-v3 .combat-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .combat-panel-v3 .combat-consumable-bar,
  .combat-panel-v3 .combat-skill-list {
    max-height: min(184px, 24vh);
  }
}

@media (max-width: 560px) {
  .combat-panel-v3 .combat-command-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .combat-panel-v3 .combat-choice-grid {
    grid-template-columns: 1fr;
  }

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

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

/* UI refactor V4: character, inventory and equipment workspaces. */
.character-module-v4 .character-content {
  display: grid;
  gap: 10px;
  min-width: 0;
}

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

.character-v4-kpi {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(37, 110, 168, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  padding: 8px 10px;
}

.character-v4-kpi span {
  color: var(--hs-color-text-muted);
  font-size: 11px;
  font-weight: 800;
}

.character-v4-kpi strong,
.character-v4-kpi small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-v4-kpi strong {
  color: var(--hs-color-text);
  font-size: 15px;
  line-height: 1.25;
}

.character-v4-kpi small {
  color: var(--hs-color-text-muted);
  font-size: 11px;
}

.equipment-panel-v4 {
  display: grid;
  gap: 10px;
}

.equipment-v4-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(47, 133, 90, 0.16);
  border-radius: 8px;
  background: rgba(240, 253, 244, 0.62);
  padding: 8px;
}

.equipment-v4-actions button {
  min-height: 34px;
}

.equipment-v4-actions span {
  color: var(--hs-color-text-muted);
  font-size: 12px;
}

.equipment-v4-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.equipment-v4-slots,
.equipment-v4-candidates {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.equipment-panel-v4 .equipment-slots {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: min(560px, 60vh);
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.equipment-panel-v4 .equipment-slot {
  min-height: 58px;
}

.equipment-panel-v4 .equip-list {
  grid-template-columns: 1fr;
  max-height: min(560px, 60vh);
}

.equipment-panel-v4 .equip-button {
  align-items: start;
  min-height: 62px;
}

.equipment-panel-v4 .equip-button .equip-compare {
  display: -webkit-box;
  color: var(--hs-color-primary-strong);
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.equipment-panel-v4 .suit-panel {
  max-height: 170px;
  overflow: auto;
  scrollbar-width: thin;
}

.inventory-panel-v4 {
  display: grid;
  gap: 10px;
}

.inventory-panel-v4 .inventory-item-workbench {
  grid-template-columns: minmax(240px, 0.85fr) minmax(320px, 1.15fr);
  gap: 10px;
}

.inventory-panel-v4 .consumable-list {
  max-height: min(540px, 62vh);
}

.inventory-panel-v4 .inventory-detail-panel {
  position: sticky;
  top: 8px;
  max-height: min(560px, 64vh);
}

.item-quality-protection {
  border: 1px solid rgba(180, 83, 9, 0.2);
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.1);
  color: #8a4f0f;
  padding: 6px 8px;
}

.inventory-v2-log-drawer {
  border: 1px solid rgba(92, 73, 55, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.54);
  padding: 0;
}

.inventory-v2-log-drawer summary {
  cursor: pointer;
  color: var(--hs-color-text);
  font-size: 13px;
  font-weight: 900;
  list-style: none;
  padding: 9px 10px;
}

.inventory-v2-log-drawer summary::-webkit-details-marker {
  display: none;
}

.inventory-v2-log-drawer summary::after {
  content: "展开";
  float: right;
  color: var(--hs-color-text-muted);
  font-size: 12px;
}

.inventory-v2-log-drawer[open] summary::after {
  content: "收起";
}

.inventory-v2-log-drawer .inventory-source-panel {
  margin: 0 8px 8px;
}

@media (max-width: 1080px) {
  .character-v4-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .equipment-v4-workbench,
  .inventory-panel-v4 .inventory-item-workbench {
    grid-template-columns: 1fr;
  }

  .inventory-panel-v4 .inventory-detail-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 820px) {
  .character-module-v4 .character-overview {
    max-height: min(330px, 38vh);
    overflow: auto;
    scrollbar-width: thin;
  }

  .character-module-v4 .character-overview .stat-list {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .character-v4-kpis {
    grid-template-columns: 1fr;
  }

  .character-module-v4 .compact-tabs .tab-button,
  .inventory-panel-v4 .item-category-tabs button,
  .inventory-panel-v4 .inventory-search button,
  .inventory-panel-v4 .inventory-search input,
  .inventory-panel-v4 .managed-item-summary,
  .inventory-panel-v4 .item-actions button {
    min-height: 44px;
  }

  .inventory-panel-v4 .managed-item.is-detail .item-actions button {
    min-height: 44px;
  }

  .equipment-panel-v4 .equipment-slots {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .equipment-v4-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .equipment-v4-actions button {
    width: 100%;
    min-height: 44px;
  }

  .equipment-panel-v4 .equip-list,
  .inventory-panel-v4 .consumable-list {
    max-height: none;
  }
}

/* UI refactor V6: motion, feedback, guide and confirmation polish. */
.hs-toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: var(--hs-z-toast, 120);
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}

.hs-toast-stack .hs-toast {
  position: relative;
  right: auto;
  bottom: auto;
  min-width: 0;
  width: 100%;
  border-left: 4px solid var(--hs-color-info, #2b6cb0);
  animation: hs-toast-in 180ms ease-out;
  pointer-events: auto;
}

.hs-toast--good,
.hs-toast--reward {
  border-left-color: var(--hs-color-success, #2f855a);
}

.hs-toast--danger {
  border-left-color: var(--hs-color-danger, #b5423a);
}

.hs-toast__close {
  position: absolute;
  top: 6px;
  right: 7px;
  display: grid;
  place-items: center;
  min-width: 26px;
  width: 26px;
  min-height: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(91, 119, 151, 0.12);
  color: var(--hs-color-text-muted, #65758a);
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.hs-confirm-dialog {
  display: grid;
  overflow: hidden;
}

.hs-confirm-actions,
.reward-dialog-actions,
.guide-actions-v6 {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.hs-confirm-actions button,
.reward-dialog-actions button,
.guide-actions-v6 button {
  min-height: 40px;
}

.reward-dialog-v6 {
  display: grid;
  gap: 12px;
  padding: 16px;
  animation: hs-modal-rise 180ms ease-out;
}

.reward-dialog-head {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.reward-dialog-head > span,
.guide-card-v6 > span {
  color: var(--hs-color-accent-strong, #8b6321);
  font-size: 12px;
  font-weight: 900;
}

.reward-dialog-head strong {
  color: var(--hs-color-text, #172436);
  font-size: 20px;
  line-height: 1.2;
}

.reward-dialog-head small {
  color: var(--hs-color-text-muted, #65758a);
  line-height: 1.45;
}

.reward-dialog-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reward-dialog-kpis span,
.reward-dialog-drops span {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(47, 133, 90, 0.16);
  border-radius: 8px;
  background: rgba(240, 253, 244, 0.7);
  padding: 8px 10px;
}

.reward-dialog-kpis b {
  color: var(--hs-color-text-muted, #65758a);
  font-size: 12px;
}

.reward-dialog-kpis em {
  color: var(--hs-color-text, #172436);
  font-size: 18px;
  font-style: normal;
  font-weight: 900;
}

.reward-dialog-drops {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  scrollbar-width: thin;
}

.guide-overlay-v6 {
  position: fixed;
  right: 16px;
  bottom: 92px;
  z-index: calc(var(--hs-z-overlay, 80) + 1);
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.guide-card-v6 {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(214, 168, 76, 0.44);
  border-radius: 10px;
  background: rgba(255, 250, 240, 0.97);
  box-shadow: var(--hs-shadow-md, 0 10px 28px rgba(14, 36, 64, 0.14));
  padding: 12px;
  animation: hs-guide-in 220ms ease-out;
  pointer-events: auto;
}

.guide-card-v6 strong {
  color: var(--hs-color-text, #172436);
  font-size: 16px;
  line-height: 1.3;
}

.guide-card-v6 p {
  margin: 0;
  color: var(--hs-color-text-muted, #65758a);
  font-size: 13px;
  line-height: 1.5;
}

.battle-result-card,
.combat-feedback,
.managed-item,
.shop-item,
.forge-button,
.quest-card {
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.shop-item:hover:not(:disabled),
.forge-button:hover:not(:disabled),
.quest-card:hover,
.managed-item.is-detail {
  box-shadow: 0 8px 22px rgba(14, 36, 64, 0.1);
}

@keyframes hs-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hs-modal-rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hs-guide-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .hs-toast-stack {
    right: 10px;
    bottom: 74px;
    width: min(360px, calc(100vw - 20px));
  }

  .guide-overlay-v6 {
    right: 10px;
    bottom: 128px;
    width: min(380px, calc(100vw - 20px));
  }

  .reward-dialog-v6 {
    max-height: 84vh;
    overflow: auto;
  }

  .reward-dialog-drops,
  .reward-dialog-kpis {
    grid-template-columns: 1fr;
  }

  .hs-confirm-actions,
  .reward-dialog-actions,
  .guide-actions-v6 {
    align-items: stretch;
    flex-direction: column;
  }

  .hs-confirm-actions button,
  .reward-dialog-actions button,
  .guide-actions-v6 button {
    width: 100%;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hs-toast-stack .hs-toast,
  .reward-dialog-v6,
  .guide-card-v6,
  .battle-result-card,
  .combat-feedback,
  .managed-item,
  .shop-item,
  .forge-button,
  .quest-card {
    animation: none;
    transition: none;
  }
}

/* UI refactor V7: mobile adaptation and final legacy cleanup overrides. */
.game-shell-v2 .desktop-module-nav {
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
}

@media (max-width: 820px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .game-shell-v2 {
    padding-inline: 10px;
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .game-shell-v2.is-combat-mode {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .game-shell-v2 .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--hs-z-sticky);
    display: flex;
    grid-template-columns: none;
    gap: 6px;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    border-width: 1px 0 0;
    border-radius: 14px 14px 0 0;
    background: rgba(255, 250, 240, 0.98);
    box-shadow: 0 -8px 24px rgba(14, 36, 64, 0.14);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    scroll-padding-inline: 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .game-shell-v2 .mobile-bottom-nav::-webkit-scrollbar {
    display: none;
  }

  .game-shell-v2 .mobile-bottom-nav .module-nav-button {
    flex: 0 0 64px;
    min-width: 64px;
    min-height: 52px;
    scroll-snap-align: start;
    touch-action: manipulation;
  }

  .game-shell-v2.is-combat-mode .mobile-bottom-nav {
    display: none;
  }

  .game-shell-v2 button,
  .game-shell-v2 input,
  .game-shell-v2 select,
  .game-shell-v2 textarea,
  .hs-modal button {
    min-height: 44px;
  }

  .tab-button,
  .hs-tab,
  .shop-item,
  .forge-button,
  .managed-item-summary,
  .quest-destination-action,
  .city-entry-button,
  .city-shop-button,
  .combat-panel-v3 .combat-consumable-bar button,
  .combat-panel-v3 .combat-skill-list button {
    min-height: 44px;
  }

  .combat-panel-v3 {
    overflow: visible;
  }

  .combat-panel-v3 .combat-body-v3 {
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .combat-panel-v3 .combat-control-deck {
    border-radius: 10px;
    background: rgba(255, 250, 240, 0.82);
  }

  .combat-panel-v3 .combat-command-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: calc(var(--hs-z-sticky) + 1);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    margin: 0;
    border-width: 1px 0 0;
    border-radius: 14px 14px 0 0;
    background: rgba(255, 250, 240, 0.98);
    box-shadow: 0 -10px 28px rgba(14, 36, 64, 0.16);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  }

  .combat-panel-v3 .combat-command-bar button {
    min-width: 0;
    min-height: 50px;
    padding: 6px 4px;
    touch-action: manipulation;
  }

  .combat-panel-v3 .combat-command-bar button strong,
  .combat-panel-v3 .combat-command-bar button span {
    white-space: normal;
  }

  .combat-panel-v3 .combat-command-bar button strong {
    font-size: 12px;
  }

  .combat-panel-v3 .combat-command-bar button span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: 10px;
  }

  .combat-panel-v3 .combat-consumable-bar,
  .combat-panel-v3 .combat-skill-list {
    max-height: min(260px, 34vh);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .hs-modal {
    align-items: end;
    place-items: end center;
    padding: 0;
  }

  .hs-modal__dialog {
    width: 100%;
    max-width: none;
    max-height: min(88vh, 720px);
    max-height: min(88dvh, 720px);
    border-width: 1px 0 0;
    border-radius: 16px 16px 0 0;
    animation: hs-bottomsheet-in 180ms ease-out;
  }

  .reward-dialog-v6,
  .hs-confirm-dialog {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .hs-toast-stack {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .game-shell-v2.is-combat-mode .hs-toast-stack {
    bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 560px) {
  .game-shell-v2 {
    padding-inline: 8px;
  }

  .game-shell-v2 .mobile-bottom-nav .module-nav-button {
    flex-basis: 60px;
    min-width: 60px;
  }

  .combat-panel-v3 .combat-body-v3 {
    padding-bottom: calc(118px + env(safe-area-inset-bottom));
  }

  .combat-panel-v3 .combat-command-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .combat-panel-v3 .combat-command-bar button {
    min-height: 46px;
  }

  .combat-panel-v3 .combat-command-bar button span {
    display: none;
  }

  .combat-panel-v3 .combat-choice-grid {
    grid-template-columns: 1fr;
  }

  .combat-panel-v3 .combat-consumable-bar,
  .combat-panel-v3 .combat-skill-list {
    max-height: min(240px, 30vh);
  }

  .reward-dialog-drops,
  .reward-dialog-kpis {
    grid-template-columns: 1fr;
  }
}

@keyframes hs-bottomsheet-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hs-modal__dialog {
    animation: none;
  }
}

/* iPad Air 5 pass: 820 x 1180 tablet layout and interaction stability. */
@media (min-width: 768px) and (max-width: 1180px) {
  html,
  body {
    -webkit-text-size-adjust: 100%;
  }

  .game-shell-v2 {
    gap: 10px;
    width: 100%;
    max-width: 1180px;
    padding-inline: 12px;
  }

  .game-shell-v2 .brand h1 {
    font-size: 26px;
  }

  .game-shell-v2 .brand p,
  .game-shell-v2 .module-nav-button span,
  .shell-resource-bar em,
  .shell-status-strip span {
    font-size: 10px;
  }

  .panel {
    box-shadow: 0 10px 22px rgba(22, 52, 88, 0.12);
  }

  .panel-header {
    padding: 9px 11px;
  }

  .panel-body {
    padding: 10px;
  }

  .shell-resource-bar {
    gap: 5px;
  }

  .shell-resource-bar span {
    padding: 6px 7px;
  }

  .game-shell-v2 .module-nav-button {
    min-height: 48px;
    padding: 6px 8px;
  }

  .game-shell-v2 .module-nav-button i {
    width: 24px;
    height: 24px;
  }

  .game-shell-v2.is-combat-mode .play-layout {
    grid-template-columns: 1fr;
  }

  .game-shell-v2.is-combat-mode .live-log-panel {
    display: none;
  }

  .combat-panel-v3 .combat-body-v3 {
    gap: 8px;
  }

  .combat-panel-v3 .combat-control-deck {
    gap: 7px;
    padding: 7px;
  }

  .combat-panel-v3 .combat-command-bar button {
    min-height: 46px;
  }

  .combat-panel-v3 .combat-consumable-bar,
  .combat-panel-v3 .combat-skill-list {
    max-height: min(220px, 28dvh);
  }

  .combat-log-panel .log,
  .live-log-panel .log,
  .equipment-panel-v4 .equipment-slots,
  .equipment-panel-v4 .equip-list,
  .inventory-panel-v4 .consumable-list,
  .forge-list,
  .shop-list {
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .managed-item,
  .shop-item,
  .forge-button,
  .quest-card,
  .equipment-slot,
  .equip-button,
  .log-entry {
    contain: layout paint;
    content-visibility: auto;
    contain-intrinsic-size: 64px;
  }
}

@media (min-width: 960px) and (max-width: 1180px) {
  .game-shell-v2 .shell-topbar {
    grid-template-columns: minmax(170px, 0.72fr) minmax(430px, 1.28fr) auto;
    gap: 8px;
  }

  .shell-resource-bar {
    grid-column: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-shell-v2 .top-actions {
    justify-content: flex-end;
  }

  .game-shell-v2 .desktop-module-nav {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 6px;
  }

  .game-shell-v2 .desktop-module-nav .module-nav-button {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 50px;
    text-align: center;
  }

  .game-shell-v2 .desktop-module-nav .module-nav-button i {
    grid-row: auto;
  }

  .game-shell-v2 .desktop-module-nav .module-nav-button span {
    display: none;
  }

  .game-shell-v2 .shell-status-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .game-shell-v2 .play-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .live-log-panel {
    position: sticky;
    top: 8px;
  }

  .live-log-panel .log {
    min-height: 180px;
    max-height: min(340px, calc(100dvh - 360px));
  }

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

  .combat-fighter-card .player-combat-portrait,
  .combat-fighter-card .enemy-visual {
    min-height: 96px;
    max-height: 122px;
  }

  .combat-fighter-card .race-portrait.is-combat {
    width: min(100%, 88px);
    height: 110px;
  }

  .combat-fighter-card .enemy-portrait,
  .combat-fighter-card .enemy-visual.is-elite .enemy-portrait {
    height: 112px;
  }

  .combat-fighter-card .enemy-visual.is-boss .enemy-portrait {
    height: 126px;
  }
}

@media (min-width: 768px) and (max-width: 820px) {
  .game-shell-v2 {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .game-shell-v2 .shell-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .game-shell-v2 .account-panel,
  .game-shell-v2 .account-panel.is-logged-in {
    grid-template-columns: 1fr;
  }

  .shell-resource-bar {
    grid-column: 1 / -1;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .game-shell-v2 .mobile-bottom-nav {
    justify-content: center;
    gap: 7px;
    padding-inline: 12px;
  }

  .game-shell-v2 .mobile-bottom-nav .module-nav-button {
    flex: 0 0 76px;
    min-width: 76px;
    min-height: 56px;
  }

  .game-shell-v2 .shell-status-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .shell-goal-bar .current-goal {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.62fr);
  }

  .live-log-panel .log {
    min-height: 160px;
    max-height: 220px;
  }

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

  .character-module-v4 .character-overview {
    max-height: min(360px, 42dvh);
  }

  .equipment-v4-workbench,
  .inventory-panel-v4 .inventory-item-workbench {
    grid-template-columns: minmax(240px, 0.82fr) minmax(0, 1.18fr);
  }

  .inventory-panel-v4 .inventory-detail-panel {
    position: sticky;
    top: 8px;
    max-height: min(520px, 58dvh);
    overflow: auto;
  }

  .equipment-panel-v4 .equipment-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(390px, 42dvh);
  }

  .equipment-panel-v4 .equip-list,
  .inventory-panel-v4 .consumable-list {
    max-height: min(430px, 48dvh);
  }

  .combat-panel-v3 .combat-body-v3 {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }

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

  .combat-panel-v3 .combat-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .combat-panel-v3 .combat-command-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding-inline: 12px;
  }

  .combat-panel-v3 .combat-command-bar button {
    min-height: 52px;
  }
}

/* Text overflow pass: keep column labels and dense list text inside their panels. */
.game-shell-v2 :where(
  .module-shell,
  .module-stack,
  .panel,
  .panel-body,
  .panel-header,
  .character-content,
  .player-tab-content,
  .inventory-detail-panel,
  .equipment-v4-workbench,
  .inventory-item-workbench,
  .shop-panel,
  .forge-panel,
  .quest-module-v5,
  .city-module,
  .settings-module-v5,
  .career-module,
  .map-panel
) {
  min-width: 0;
  max-width: 100%;
}

.game-shell-v2 :where(
  .quest-v5-stage small,
  .quest-v5-focus small,
  .quest-v5-actions span,
  .quest-destination-action span,
  .shop-guidance span,
  .shop-shelf-title span,
  .forge-guidance span,
  .forge-panel-head span,
  .settings-v5-section span,
  .settings-v5-card small,
  .city-shop-card small,
  .city-npc-heading small,
  .city-event-list small,
  .city-fast-route-list small,
  .managed-item-summary strong,
  .managed-item-summary small,
  .inventory-detail-title strong,
  .inventory-detail-title span,
  .equipment-title strong,
  .equipment-title span,
  .equipment-slot strong,
  .equipment-slot small,
  .equip-button b,
  .equip-button small,
  .shop-item b,
  .shop-item small,
  .locked-shop-item b,
  .locked-shop-item small,
  .forge-button b,
  .forge-button small,
  .forge-growth-card strong,
  .forge-growth-card small,
  .quest-card strong,
  .quest-card span,
  .quest-card small,
  .log-entry,
  .combat-feedback strong
) {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.game-shell-v2 :where(
  .continent-node strong,
  .continent-node small,
  .road-node strong,
  .road-node small,
  .simple-destination-card strong,
  .simple-destination-card small,
  .simple-destination-card em,
  .road-targets span,
  .region-title strong,
  .zone-title strong
) {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.game-shell-v2 :where(.continent-node, .road-node) {
  align-content: center;
  line-height: 1.18;
}

.game-shell-v2 :where(.continent-node strong, .road-node strong) {
  font-size: 11px;
}

.game-shell-v2 :where(.simple-destination-card, .zone-button, .road-targets button) {
  min-width: 0;
}

.game-shell-v2 .continent-node strong,
.game-shell-v2 .continent-node small,
.game-shell-v2 .road-node strong,
.game-shell-v2 .road-node small,
.game-shell-v2 .simple-destination-card strong,
.game-shell-v2 .simple-destination-card small,
.game-shell-v2 .simple-destination-card em,
.game-shell-v2 .road-targets span,
.game-shell-v2 .quest-v5-stage small,
.game-shell-v2 .quest-v5-focus small,
.game-shell-v2 .quest-v5-actions span,
.game-shell-v2 .quest-destination-action span,
.game-shell-v2 .shop-item b,
.game-shell-v2 .shop-item small,
.game-shell-v2 .locked-shop-item b,
.game-shell-v2 .locked-shop-item small,
.game-shell-v2 .forge-button b,
.game-shell-v2 .forge-button small,
.game-shell-v2 .managed-item-summary strong,
.game-shell-v2 .managed-item-summary small,
.game-shell-v2 .equipment-slot strong,
.game-shell-v2 .equipment-slot small,
.game-shell-v2 .desktop-module-nav .module-nav-button span,
.game-shell-v2 .shell-status-strip strong,
.game-shell-v2 .settings-v5-section small,
.game-shell-v2 .settings-v5-card small {
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.game-shell-v2 .desktop-module-nav .module-nav-button {
  align-content: start;
}

.game-shell-v2 .desktop-module-nav .module-nav-button span {
  line-height: 1.25;
}

.game-shell-v2 .shell-status-strip div {
  align-content: center;
}

.game-shell-v2 .shell-status-strip strong {
  line-height: 1.25;
}

/* Module page pass: each module gets the full content page instead of sharing width with a side log. */
.game-shell-v2 .module-page-shell :where(
  .panel-header h2,
  .panel-header h3,
  .panel-header span,
  .panel-header .badge,
  .panel-body p,
  .panel-body small,
  .panel-body strong,
  .panel-body b,
  .panel-body em,
  .panel-body label,
  .panel-body li,
  .panel-body button strong,
  .panel-body button span,
  .panel-body button small,
  .tab-button,
  .hs-tab,
  .badge,
  .small-note
),
.game-shell-v2 .shell-resource-bar :where(small, strong, em),
.game-shell-v2 .shell-status-strip :where(span, strong),
.game-shell-v2 .desktop-module-nav .module-nav-button :where(strong, span) {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.25;
}

.game-shell-v2 .module-page-shell :where(.panel-body button, .tab-button, .hs-tab) {
  height: auto;
  min-width: 0;
}

@media (max-width: 820px) {
  .game-shell-v2 .mobile-bottom-nav .module-nav-button strong {
    display: block;
    max-width: 100%;
    min-height: 2.2em;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .game-shell-v2 .mobile-bottom-nav .module-nav-button {
    align-content: center;
  }

  .panel-header {
    flex-wrap: wrap;
  }

  .panel-header h2,
  .panel-header h3,
  .panel-header .badge {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .game-shell-v2 .mobile-bottom-nav .module-nav-button {
    flex-basis: 72px;
    min-width: 72px;
  }

  .game-shell-v2 .mobile-bottom-nav .module-nav-button i {
    width: 21px;
    height: 21px;
  }

  .game-shell-v2 .mobile-bottom-nav .module-nav-button strong {
    font-size: 10.5px;
    line-height: 1.08;
  }

  .shop-filter-tabs button,
  .forge-filter-tabs button,
  .forge-section-tabs button,
  .item-category-tabs button,
  .equipment-filter-tabs button,
  .compact-tabs .tab-button {
    overflow-wrap: anywhere;
    white-space: normal;
  }
}
