:root {
  --hp-accent: #c9a227;
  --hp-ok: #6f9d45;
  --hp-bad: #b4544a;
  --hp-fir: #d8b64c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #101315;
  color: #e4e8ea;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0;
}

button,
input {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid rgba(201, 162, 39, 0.45);
  outline-offset: 2px;
}

.hp-fir {
  width: 14px;
  height: 14px;
  flex: none;
  color: #d8b64c;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
.hp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #2b3238;
  border-radius: 6px;
  background: #1e2428;
  color: #e4e8ea;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms cubic-bezier(0.4, 0, 0.2, 1), border-color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hp-btn:hover {
  background: #252c31;
  border-color: #3a444b;
}
.hp-btn:active {
  transform: scale(0.98);
}
.hp-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.hp-btn--primary {
  background: #c9a227;
  border-color: #c9a227;
  color: #151006;
  font-weight: 600;
}
.hp-btn--primary:hover {
  background: #dcb42f;
  border-color: #dcb42f;
}
.hp-btn--ghost {
  background: transparent;
}
.hp-btn--sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.hp-search {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #2b3238;
  border-radius: 6px;
  background: #101315;
  color: #e4e8ea;
  font-size: 13px;
}
.hp-search::placeholder {
  color: #6a747b;
}
.hp-search:focus {
  border-color: #c9a227;
  outline: 2px solid rgba(201, 162, 39, 0.45);
  outline-offset: -1px;
}

.hp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #98a2a9;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.hp-toggle input {
  width: 14px;
  height: 14px;
  accent-color: #c9a227;
  cursor: pointer;
}

.hp-shell {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 100vh;
}
.hp-shell[data-inv=closed] {
  grid-template-columns: 0 1fr;
}
.hp-shell .hp-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
@media (max-width: 1100px) {
  .hp-shell, .hp-shell[data-inv=closed] {
    grid-template-columns: 1fr;
  }
}

.hp-scrim {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hp-scrim[data-open="1"] {
  opacity: 1;
  pointer-events: auto;
}

.hp-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid #2b3238;
  background: rgba(16, 19, 21, 0.92);
  backdrop-filter: blur(8px);
}
.hp-bar__brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-inline-end: auto;
}
.hp-bar__brand h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hp-bar__brand span {
  color: #6a747b;
  font-size: 12px;
}
.hp-bar .hp-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 78px;
}
.hp-bar .hp-stat__key {
  color: #6a747b;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hp-bar .hp-stat__value {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1100px) {
  .hp-bar {
    padding: 12px 16px;
  }
}

.hp-plan {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 24px;
  background-image: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 32px 32px;
}
.hp-plan .hp-zone {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hp-plan .hp-zone__head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hp-plan .hp-zone__head h2 {
  color: #98a2a9;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hp-plan .hp-zone__head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, #2b3238, transparent);
}
.hp-plan .hp-zone__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 12px;
}
.hp-plan .hp-zone .hp-node {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid #2b3238;
  border-radius: 10px;
  background: #171b1e;
  color: inherit;
  text-align: start;
  cursor: pointer;
  transition: background 150ms cubic-bezier(0.4, 0, 0.2, 1), border-color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hp-plan .hp-zone .hp-node:hover {
  background: #1e2428;
  border-color: #3a444b;
}
.hp-plan .hp-zone .hp-node:active {
  transform: scale(0.99);
}
.hp-plan .hp-zone .hp-node[data-state=locked] {
  opacity: 0.5;
  border-style: dashed;
}
.hp-plan .hp-zone .hp-node[data-state=ready] {
  border-color: rgba(201, 162, 39, 0.45);
}
.hp-plan .hp-zone .hp-node[data-state=max] {
  border-color: rgba(111, 157, 69, 0.45);
}
.hp-plan .hp-zone .hp-node__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.hp-plan .hp-zone .hp-node__icon {
  width: 34px;
  height: 34px;
  flex: none;
  color: #98a2a9;
}
.hp-plan .hp-zone .hp-node[data-state=built] .hp-plan .hp-zone .hp-node__icon, .hp-plan .hp-zone .hp-node[data-state=ready] .hp-plan .hp-zone .hp-node__icon {
  color: #e4e8ea;
}
.hp-plan .hp-zone .hp-node[data-state=max] .hp-plan .hp-zone .hp-node__icon {
  color: #6f9d45;
}
.hp-plan .hp-zone .hp-node__flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid #2b3238;
  border-radius: 999px;
  color: #6a747b;
  font-size: 11px;
  font-weight: 600;
}
.hp-plan .hp-zone .hp-node__flag[data-kind=ready] {
  border-color: rgba(201, 162, 39, 0.45);
  color: #c9a227;
}
.hp-plan .hp-zone .hp-node__flag[data-kind=max] {
  border-color: rgba(111, 157, 69, 0.45);
  color: #6f9d45;
}
.hp-plan .hp-zone .hp-node__flagicon {
  width: 12px;
  height: 12px;
}
.hp-plan .hp-zone .hp-node__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hp-plan .hp-zone .hp-node__name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}
.hp-plan .hp-zone .hp-node__sub {
  color: #98a2a9;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.hp-plan .hp-zone .hp-node__pips {
  display: flex;
  gap: 4px;
  margin-top: auto;
}
.hp-plan .hp-zone .hp-node__pips span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #2b3238;
}
.hp-plan .hp-zone .hp-node__pips span[data-on="1"] {
  background: #c9a227;
}
.hp-plan .hp-zone .hp-node[data-state=max] .hp-plan .hp-zone .hp-node__pips span[data-on="1"] {
  background: #6f9d45;
}
@media (max-width: 1100px) {
  .hp-plan {
    padding: 16px;
  }
}

.hp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 24px 32px;
  color: #6a747b;
  font-size: 12px;
}
.hp-legend__row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hp-inv {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  border-inline-end: 1px solid #2b3238;
  background: #171b1e;
  transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hp-inv__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #2b3238;
}
.hp-inv__titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hp-inv__title {
  color: #98a2a9;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hp-inv__tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hp-inv__list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  overflow-y: auto;
}
.hp-inv__empty {
  margin: 0;
  padding: 32px 16px;
  color: #6a747b;
  font-size: 13px;
  text-align: center;
}
.hp-inv .hp-item {
  display: grid;
  grid-template-columns: 1fr 84px;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: background 150ms cubic-bezier(0.4, 0, 0.2, 1), border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hp-inv .hp-item:hover {
  border-color: #232a2f;
  background: #1e2428;
}
.hp-inv .hp-item[data-done="1"] {
  opacity: 0.45;
}
.hp-inv .hp-item__main {
  min-width: 0;
}
.hp-inv .hp-item__name {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hp-inv .hp-item__meta {
  color: #98a2a9;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.hp-inv .hp-item__meta b {
  color: #e4e8ea;
  font-weight: 600;
}
.hp-inv .hp-item__bar {
  height: 2px;
  margin-top: 6px;
  border-radius: 2px;
  background: #2b3238;
  overflow: hidden;
}
.hp-inv .hp-item__bar span {
  display: block;
  height: 100%;
  background: #c9a227;
  transition: width 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hp-inv .hp-item[data-done="1"] .hp-inv .hp-item__bar span {
  background: #6f9d45;
}
.hp-inv .hp-item .hp-stepper {
  display: flex;
  align-items: center;
  border: 1px solid #2b3238;
  border-radius: 6px;
  background: #101315;
  overflow: hidden;
}
.hp-inv .hp-item .hp-stepper button {
  width: 24px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #98a2a9;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 150ms cubic-bezier(0.4, 0, 0.2, 1), color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hp-inv .hp-item .hp-stepper button:hover {
  background: #1e2428;
  color: #e4e8ea;
}
.hp-inv .hp-item .hp-stepper button:active {
  transform: scale(0.94);
}
.hp-inv .hp-item .hp-stepper input {
  width: 36px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #e4e8ea;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  -moz-appearance: textfield;
}
.hp-inv .hp-item .hp-stepper input::-webkit-outer-spin-button, .hp-inv .hp-item .hp-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.hp-inv .hp-item .hp-stepper input:focus {
  outline: 2px solid rgba(201, 162, 39, 0.45);
  outline-offset: -2px;
}
.hp-shell[data-inv=closed] .hp-inv {
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 1100px) {
  .hp-inv {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 41;
    width: min(340px, 90vw);
    transform: translateX(-100%);
    transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  .hp-shell[data-inv=open] .hp-inv {
    transform: translateX(0);
  }
  .hp-shell[data-inv=closed] .hp-inv {
    opacity: 1;
    pointer-events: none;
  }
}

.hp-drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: min(460px, 100vw);
  border-inline-start: 1px solid #2b3238;
  background: #171b1e;
  transform: translateX(100%);
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hp-drawer[data-open="1"] {
  transform: translateX(0);
}
.hp-drawer__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #2b3238;
}
.hp-drawer__head .hp-drawer__icon {
  width: 38px;
  height: 38px;
  flex: none;
  color: #e4e8ea;
}
.hp-drawer__title {
  flex: 1;
  min-width: 0;
}
.hp-drawer__title h2 {
  font-size: 16px;
  font-weight: 600;
}
.hp-drawer__title p {
  margin: 2px 0 0;
  color: #98a2a9;
  font-size: 12px;
}
.hp-drawer__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  padding: 16px;
  overflow-y: auto;
}
.hp-drawer__body .hp-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 6px;
  background: rgba(201, 162, 39, 0.08);
  color: #e7d597;
  font-size: 12px;
}
.hp-drawer__body .hp-sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hp-drawer__body .hp-sec__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #6a747b;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hp-drawer__body .hp-sec__notes {
  display: flex;
  gap: 8px;
  padding-inline-start: 2px;
  color: #98a2a9;
  font-size: 12px;
}
.hp-drawer__body .hp-sec__notes::before {
  content: "";
  width: 2px;
  flex: none;
  border-radius: 2px;
  background: #2b3238;
}
.hp-drawer__body .hp-sec__notes ul {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding-inline-start: 16px;
}
.hp-drawer__body .hp-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.hp-drawer__body .hp-levels button {
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #2b3238;
  border-radius: 6px;
  background: #101315;
  color: #98a2a9;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms cubic-bezier(0.4, 0, 0.2, 1), border-color 150ms cubic-bezier(0.4, 0, 0.2, 1), color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hp-drawer__body .hp-levels button:hover {
  border-color: #3a444b;
  color: #e4e8ea;
}
.hp-drawer__body .hp-levels button[data-built="1"] {
  color: #6f9d45;
}
.hp-drawer__body .hp-levels button[data-selected="1"] {
  border-color: #c9a227;
  background: #1e2428;
  color: #e4e8ea;
}
.hp-drawer__body .hp-req {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #232a2f;
  border-radius: 6px;
  background: #101315;
  font-size: 13px;
}
.hp-drawer__body .hp-req__mark {
  width: 16px;
  height: 16px;
  flex: none;
}
.hp-drawer__body .hp-req__mark[data-ok="1"] {
  color: #6f9d45;
}
.hp-drawer__body .hp-req__mark[data-ok="0"] {
  color: #b4544a;
}
.hp-drawer__body .hp-req__label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.hp-drawer__body .hp-req__value {
  color: #98a2a9;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hp-drawer__body .hp-req__value b {
  font-weight: 600;
}
.hp-drawer__body .hp-req__value[data-ok="1"] b {
  color: #6f9d45;
}
.hp-drawer__body .hp-req__value[data-ok="0"] b {
  color: #b4544a;
}
.hp-drawer__foot {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #2b3238;
  background: #171b1e;
}
.hp-drawer__foot .hp-btn {
  flex: 1;
  justify-content: center;
}
