.detail-hero {
  padding: 32px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  margin-bottom: 22px;
}

.detail-hero__content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
}

.detail-hero__breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.detail-back {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f3efe6;
  font-weight: 700;
}

.detail-hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

.detail-stat-card {
  min-height: 140px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-stat-card__label {
  color: #a6b0b8;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-stat-card__value {
  color: #fff8ef;
  font-size: 1.55rem;
  line-height: 1.05;
}

.detail-stat-card__hint {
  margin: 0;
  color: #c9c1b3;
  line-height: 1.55;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 0.82fr;
  gap: 22px;
  align-items: start;
}

.detail-form-card,
.detail-side-card,
.game-panel {
  padding: 28px;
}

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

.field-grid--two {
  grid-template-columns: repeat(2, 1fr);
}

.field-grid__wide {
  grid-column: 1 / -1;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field span {
  color: #c9c1b3;
  font-size: 0.92rem;
}

.form-input,
.form-select {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  padding: 0 16px;
  outline: none;
}

.form-select option {
  color: #111;
}

.form-switch {
  min-height: 92px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.form-switch input {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: #efe3c8;
}

.form-switch strong {
  display: block;
  color: #fff8ef;
  margin-bottom: 6px;
}

.form-switch small {
  color: #a6b0b8;
  line-height: 1.5;
}

.detail-side-card__stack {
  display: grid;
  gap: 14px;
}

.detail-side-stat {
  min-height: auto;
}

.detail-note {
  padding: 18px;
  border-radius: 20px;
  background: rgba(239, 227, 200, 0.08);
  border: 1px solid rgba(239, 227, 200, 0.12);
}

.detail-note strong {
  display: block;
  color: #fff8ef;
  margin-bottom: 8px;
}

.detail-note p {
  margin: 0;
  color: #c9c1b3;
  line-height: 1.6;
}

.detail-note--market {
  margin-bottom: 18px;
}

.detail-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.game-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
}

.game-layout__main,
.game-layout__side {
  display: grid;
  gap: 22px;
}

.game-profile {
  display: grid;
  gap: 18px;
}

.game-profile__identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.game-avatar {
  width: 78px;
  height: 78px;
  border-radius: 24px;
  background: linear-gradient(180deg, #efe3c8 0%, #d5bea0 100%);
  color: #2d3339;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 900;
}

.game-profile__names {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.game-profile__names strong {
  color: #fff8ef;
  font-size: 1.28rem;
}

.game-profile__names span {
  color: #a6b0b8;
}

.game-profile__metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.game-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.game-action-card {
  min-height: 160px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
}

.game-action-card__icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: rgba(239, 227, 200, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.game-action-card strong {
  font-size: 1.02rem;
  color: #fff8ef;
}

.game-action-card span:last-child {
  color: #a6b0b8;
  line-height: 1.55;
}

.game-reset-btn {
  min-height: 46px;
}

.game-dual-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.game-column {
  display: grid;
  gap: 12px;
}

.game-column__title {
  margin: 0;
  color: #fff8ef;
  font-size: 1.05rem;
}

.game-unit-list,
.leaderboard-list,
.game-feed {
  display: grid;
  gap: 12px;
}

.game-unit-card,
.leaderboard-item,
.game-feed__item {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.game-unit-card__head,
.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.game-unit-card strong,
.leaderboard-item strong,
.game-feed__item strong {
  color: #fff8ef;
}

.game-unit-card p,
.game-feed__item p {
  margin: 10px 0 0;
  color: #a6b0b8;
  line-height: 1.55;
}

.game-progress {
  margin-top: 14px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.game-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #efe3c8 0%, #b7d9fb 100%);
}

.leaderboard-item__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.leaderboard-item__meta span {
  color: #a6b0b8;
  font-size: 0.9rem;
}

.leaderboard-item--highlight {
  border-color: rgba(239, 227, 200, 0.22);
  background: rgba(239, 227, 200, 0.08);
}

.detail-empty {
  padding: 32px;
  text-align: center;
}

.detail-empty h2 {
  margin: 0 0 10px;
  color: #fff8ef;
}

.detail-empty p {
  margin: 0;
  color: #c9c1b3;
}

@media (max-width: 1180px) {
  .detail-grid,
  .game-layout,
  .currency-page-grid,
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .game-profile__metrics,
  .currency-stat-grid,
  .detail-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .field-grid--two,
  .game-dual-grid,
  .game-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .detail-form-card,
  .detail-side-card,
  .game-panel,
  .detail-hero {
    padding: 20px;
  }

  .game-profile__metrics,
  .currency-stat-grid,
  .detail-stat-grid {
    grid-template-columns: 1fr;
  }

  .detail-actions,
  .detail-hero__actions {
    flex-direction: column;
  }

  .detail-actions .primary-btn,
  .detail-actions .secondary-btn,
  .detail-hero__actions .primary-btn,
  .detail-hero__actions .secondary-btn {
    width: 100%;
  }
}

.detail-grid--bottom {
  margin-top: 22px;
}

.detail-actions--inline {
  margin-top: 16px;
  justify-content: flex-start;
}

.hardware-market-panel {
  margin-top: 22px;
  padding: 28px;
}

.hardware-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hardware-market-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.market-toolbar {
  margin: 18px 0 22px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(239, 227, 200, 0.08);
  border: 1px solid rgba(239, 227, 200, 0.14);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
  align-items: center;
}

.market-toolbar__summary {
  display: grid;
  gap: 8px;
}

.market-toolbar__summary strong {
  color: #fff8ef;
  font-size: 1rem;
}

.market-toolbar__summary p {
  margin: 0;
  color: #c9c1b3;
  line-height: 1.55;
}

.market-toolbar__actions,
.composer-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.market-toolbar__actions {
  justify-content: flex-end;
}

.market-page-panel {
  margin-top: 22px;
  padding: 28px;
}

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

.market-filter-group {
  display: grid;
  gap: 8px;
}

.market-filter-group__label {
  color: #c9c1b3;
  font-size: 0.92rem;
}

.market-switch {
  min-height: 78px;
}

.market-results-count {
  color: #fff8ef;
  font-size: 1rem;
}

.market-entry-card--selected {
  border-color: rgba(239, 227, 200, 0.22);
  background: rgba(239, 227, 200, 0.08);
}

.hardware-readonly-field .form-input {
  color: #d9d4c9;
  cursor: default;
}

.composer-shortcuts {
  margin-bottom: 16px;
}

.hardware-card {
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 16px;
}

.hardware-card--custom {
  border-color: rgba(239, 227, 200, 0.22);
  background: rgba(239, 227, 200, 0.06);
}

.hardware-card--market.hardware-card--equipped {
  border-color: rgba(158, 214, 163, 0.22);
  background: rgba(158, 214, 163, 0.06);
}

.hardware-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.hardware-card__identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.hardware-card__image {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.hardware-card__title {
  margin: 0 0 8px;
  color: #fff8ef;
  font-size: 1.12rem;
}

.hardware-card__price {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 227, 200, 0.12);
  border: 1px solid rgba(239, 227, 200, 0.18);
  color: #f3e5c9;
  font-weight: 800;
  white-space: nowrap;
}

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

.hardware-market-stats,
.hardware-inline-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hardware-market-stats span,
.hardware-inline-stats span {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e5e1d8;
  font-size: 0.82rem;
  font-weight: 700;
}

.hardware-danger-btn {
  border-color: rgba(255, 131, 131, 0.22);
  color: #ffd2d2;
}

.hardware-preview-box {
  min-height: 120px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 16px;
}

.hardware-preview-box__image {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.hardware-equipped-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.hardware-equipped-card {
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 16px;
}

.hardware-equipped-card--empty {
  justify-content: center;
  min-height: 180px;
}

.hardware-equipped-card__image {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.hardware-equipped-card__meta {
  display: grid;
  gap: 10px;
}

.hardware-equipped-card__meta strong {
  color: #fff8ef;
  font-size: 1.06rem;
}

.hardware-equipped-card__meta p {
  margin: 0;
  color: #a6b0b8;
  line-height: 1.55;
}

.hardware-inventory-list {
  display: grid;
  gap: 12px;
}

.hardware-inventory-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.hardware-inventory-item--equipped {
  border-color: rgba(158, 214, 163, 0.22);
  background: rgba(158, 214, 163, 0.06);
}

.hardware-inventory-item__image {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.hardware-inventory-item__meta {
  display: grid;
  gap: 4px;
}

.hardware-inventory-item__meta strong {
  color: #fff8ef;
}

.hardware-inventory-item__meta p {
  margin: 0;
  color: #a6b0b8;
  line-height: 1.5;
}

@media (max-width: 1080px) {
  .hardware-equipped-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .hardware-card__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hardware-preview-box,
  .hardware-equipped-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

.territory-list {
  display: grid;
  gap: 16px;
}

.territory-list--game {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.territory-card {
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 16px;
}

.territory-card--current {
  border-color: rgba(158, 214, 163, 0.24);
  background: rgba(158, 214, 163, 0.06);
}

.territory-card--locked {
  opacity: 0.8;
}

.territory-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.territory-card__head h3 {
  margin: 0 0 8px;
  color: #fff8ef;
}

.territory-card__head p {
  margin: 0;
  color: #a6b0b8;
  line-height: 1.55;
}

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

.territory-remove-btn {
  min-height: 42px;
}

.build-inline-stats {
  margin-bottom: 18px;
}

.build-warning-chip {
  border-color: rgba(255, 188, 118, 0.18);
  background: rgba(255, 188, 118, 0.12);
  color: #ffe0b1;
}

.build-stack {
  display: grid;
  gap: 18px;
}

.build-slot-group {
  display: grid;
  gap: 12px;
}

.build-part-list {
  display: grid;
  gap: 12px;
}

.build-part-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.build-part-card--empty {
  display: grid;
  justify-content: stretch;
}

.build-part-card--empty strong {
  color: #fff8ef;
}

.build-part-card--empty p {
  margin: 4px 0 0;
  color: #a6b0b8;
}

.build-part-card__main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.build-part-card__image {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.build-part-card__meta {
  display: grid;
  gap: 8px;
}

.build-part-card__meta strong {
  color: #fff8ef;
}

.build-part-card__meta p {
  margin: 0;
  color: #a6b0b8;
}

.inventory-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.rate-history {
  display: grid;
  gap: 16px;
}

.rate-history__bars {
  min-height: 180px;
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: end;
  gap: 6px;
}

.rate-history__bar {
  display: block;
  border-radius: 999px 999px 12px 12px;
  background: linear-gradient(180deg, #efe3c8 0%, #8fbaf0 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 20px;
}

.rate-history__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #c9c1b3;
  font-size: 0.92rem;
}

.currency-hero {
  grid-template-columns: 1fr 0.74fr;
}

.currency-ticker {
  min-height: 260px;
  padding: 28px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 20% 15%, rgba(239, 227, 200, 0.2), transparent 36%),
    radial-gradient(circle at 78% 75%, rgba(143, 186, 240, 0.18), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(239, 227, 200, 0.16);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
}

.currency-ticker__label {
  color: #c9c1b3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  font-weight: 800;
}

.currency-ticker__value {
  color: #fff8ef;
  font-size: clamp(2.1rem, 5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.currency-ticker__delta {
  width: fit-content;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-weight: 900;
}

.currency-ticker__delta--up,
.currency-mini-delta--up {
  color: #d6f2d8;
  background: rgba(158, 214, 163, 0.1);
  border: 1px solid rgba(158, 214, 163, 0.18);
}

.currency-ticker__delta--down,
.currency-mini-delta--down {
  color: #ffd2d2;
  background: rgba(255, 131, 131, 0.1);
  border: 1px solid rgba(255, 131, 131, 0.18);
}

.currency-ticker p {
  margin: 0;
  color: #c9c1b3;
  line-height: 1.55;
}

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

.currency-page-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  align-items: start;
}

.currency-chart-panel,
.currency-side-card {
  padding: 28px;
}

.currency-side {
  display: grid;
  gap: 22px;
}

.currency-chart {
  min-height: 380px;
  display: grid;
  gap: 16px;
}

.currency-chart__bars {
  min-height: 330px;
  display: grid;
  grid-template-columns: repeat(var(--currency-points), minmax(4px, 1fr));
  align-items: end;
  gap: 5px;
  padding: 18px;
  border-radius: 26px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    rgba(255, 255, 255, 0.025);
  background-size: 100% 25%, 10% 100%, auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.currency-chart__bar {
  min-height: 12px;
  border-radius: 999px 999px 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14);
}

.currency-chart__bar--up {
  background: linear-gradient(180deg, #efe3c8 0%, #9ed6a3 100%);
}

.currency-chart__bar--down {
  background: linear-gradient(180deg, #ffd2d2 0%, #8fbaf0 100%);
}

.currency-chart__axis {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #c9c1b3;
  font-size: 0.92rem;
}

.currency-history-list {
  display: grid;
  gap: 10px;
}

.currency-history-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.currency-history-item strong {
  display: block;
  color: #fff8ef;
  margin-bottom: 4px;
}

.currency-history-item span {
  color: #a6b0b8;
  font-size: 0.9rem;
}

.currency-mini-delta {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  white-space: nowrap;
}

.game-rig-layout {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 18px;
}

.game-rig-list,
.player-market-list {
  display: grid;
  gap: 14px;
}

.rig-card,
.rig-focus-card {
  width: 100%;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
}

.rig-card {
  display: grid;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.rig-card--active {
  border-color: rgba(239, 227, 200, 0.22);
  background: rgba(239, 227, 200, 0.08);
}

.rig-card__head,
.rig-focus-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.rig-card__head strong,
.rig-focus-card__head h3 {
  display: block;
  margin: 0 0 6px;
  color: #fff8ef;
}

.rig-card__head span,
.rig-focus-card__head p,
.rig-card__note {
  color: #a6b0b8;
  line-height: 1.55;
  margin: 0;
}

.rig-focus-card {
  display: grid;
  gap: 18px;
}

.rig-focus-card__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.rig-build-grid {
  display: grid;
  gap: 16px;
}

.inventory-actions--column {
  display: grid;
  gap: 10px;
  justify-content: stretch;
}

.inventory-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
}

.inventory-price-input {
  min-height: 42px;
}

.player-listing-card--own {
  border-color: rgba(158, 214, 163, 0.22);
  background: rgba(158, 214, 163, 0.06);
}

.territory-page-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
}

.territory-page-side {
  display: grid;
  gap: 22px;
}

.city-scene-wrap {
  padding: 14px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(143, 186, 240, 0.14), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 560px;
  overflow: auto;
}

.city-scene {
  position: relative;
  min-height: 520px;
  min-width: 720px;
}

.city-scene__grid {
  position: relative;
  width: 100%;
  height: 100%;
}

.city-plot {
  --unit: 86px;
  --depth: calc(var(--plot-h) * 18px + 18px);
  position: absolute;
  left: calc(var(--plot-x) * 104px + var(--plot-y) * 22px + 44px);
  top: calc(var(--plot-y) * 104px + 220px - (var(--plot-h) * 22px));
  width: var(--unit);
  height: var(--unit);
  border: 0;
  background: transparent;
  padding: 0;
  cursor: default;
}

.city-plot__top,
.city-plot__side {
  position: absolute;
  display: block;
}

.city-plot__top {
  inset: 0;
  border-radius: 18px;
  transform: rotate(-45deg) skew(15deg, 15deg);
  transform-origin: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.city-plot__side--left,
.city-plot__side--right {
  width: 50%;
  height: calc(var(--plot-h) * 18px + 18px);
  bottom: -8px;
}

.city-plot__side--left {
  left: 4px;
  transform: skewY(45deg);
  transform-origin: top left;
  border-radius: 0 0 14px 14px;
}

.city-plot__side--right {
  right: 4px;
  transform: skewY(-45deg);
  transform-origin: top right;
  border-radius: 0 0 14px 14px;
}

.city-plot--player .city-plot__top {
  background: linear-gradient(180deg, rgba(239, 227, 200, 0.96), rgba(203, 176, 136, 0.96));
}

.city-plot--player .city-plot__side--left {
  background: linear-gradient(180deg, rgba(202, 168, 125, 0.95), rgba(132, 101, 69, 0.95));
}

.city-plot--player .city-plot__side--right {
  background: linear-gradient(180deg, rgba(168, 135, 99, 0.95), rgba(110, 82, 55, 0.95));
}

.city-plot--community .city-plot__top {
  background: linear-gradient(180deg, rgba(143, 186, 240, 0.95), rgba(90, 128, 177, 0.95));
}

.city-plot--community .city-plot__side--left {
  background: linear-gradient(180deg, rgba(78, 111, 155, 0.95), rgba(47, 72, 108, 0.95));
}

.city-plot--community .city-plot__side--right {
  background: linear-gradient(180deg, rgba(93, 129, 180, 0.95), rgba(54, 81, 120, 0.95));
}

.city-plot--active .city-plot__top {
  box-shadow: 0 0 0 3px rgba(255, 248, 239, 0.18), 0 18px 35px rgba(239, 227, 200, 0.18);
}

.city-plot--selected .city-plot__top {
  box-shadow: 0 0 0 4px rgba(143, 186, 240, 0.2), 0 18px 35px rgba(143, 186, 240, 0.22);
}

.city-plot__badge {
  position: absolute;
  right: 6px;
  top: 6px;
  min-width: 36px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 20, 24, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff8ef;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.territory-inspector {
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  gap: 16px;
}

.territory-inspector--player {
  border-color: rgba(239, 227, 200, 0.22);
  background: rgba(239, 227, 200, 0.08);
}

.territory-inspector--community {
  border-color: rgba(143, 186, 240, 0.16);
  background: rgba(143, 186, 240, 0.07);
}

.territory-inspector__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.territory-inspector__head h3 {
  margin: 0 0 8px;
  color: #fff8ef;
}

.territory-inspector__head p,
.territory-inspector__copy {
  margin: 0;
  color: #c9c1b3;
  line-height: 1.6;
}

@media (max-width: 860px) {
  .market-toolbar,
  .market-filter-grid,
  .territory-grid,
  .game-rig-layout,
  .territory-page-grid,
  .rig-focus-card__stats,
  .inventory-price-row {
    grid-template-columns: 1fr;
  }

  .market-toolbar__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .build-part-card,
  .build-part-card__main,
  .hardware-inventory-item,
  .rig-card__head,
  .rig-focus-card__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .inventory-actions {
    margin-left: 0;
    width: 100%;
    justify-content: stretch;
  }

  .inventory-actions .secondary-btn,
  .build-part-card .secondary-btn {
    width: 100%;
  }

  .city-scene-wrap {
    min-height: 460px;
  }

  .territory-inspector__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

.role-badge--linked {
  background: rgba(158, 214, 163, 0.12);
  color: #d8f4da;
  border-color: rgba(158, 214, 163, 0.18);
}

.role-badge--warning {
  background: rgba(255, 196, 112, 0.12);
  color: #ffe2b6;
  border-color: rgba(255, 196, 112, 0.18);
}

.linked-role-admin-panel {
  margin-top: 22px;
  padding: 28px;
  position: relative;
  overflow: visible;
  background:
    radial-gradient(circle at 12% 0%, rgba(88, 101, 242, 0.16), transparent 34%),
    radial-gradient(circle at 92% 14%, rgba(35, 165, 90, 0.14), transparent 32%),
    rgba(15, 18, 28, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.server-linked-roles-list {
  display: block;
  position: relative;
  z-index: 1;
}

.linked-role-editor {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.linked-role-editor__sidebar,
.linked-role-editor__detail {
  min-width: 0;
}

.linked-role-editor__sidebar {
  padding: 18px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    rgba(10, 13, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.linked-role-editor__sidebar-head,
.linked-role-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #fff8ef;
}

.linked-role-editor__sidebar-head span,
.linked-role-picker-head strong {
  color: #efe3c8;
  font-size: 0.84rem;
}

.linked-role-picker-head span {
  display: block;
  color: #fff8ef;
  font-weight: 850;
}

.linked-role-picker-head small {
  display: block;
  margin-top: 3px;
  color: #aeb7bf;
  font-size: 0.78rem;
}

.linked-role-search-input {
  min-height: 42px;
  margin-bottom: 12px;
}

.linked-role-editor__list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.linked-role-row {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: #fff8ef;
  text-align: left;
  cursor: pointer;
  outline: none;
  position: relative;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.linked-role-row:hover,
.linked-role-row:focus-visible,
.linked-role-row.is-active {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--role-color, #99aab5) 14%, transparent), rgba(239, 227, 200, 0.08));
  border-color: color-mix(in srgb, var(--role-color, #99aab5) 32%, rgba(239, 227, 200, 0.2));
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
  transform: translateX(2px);
}

.linked-role-row__color {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--role-color, #99aab5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.linked-role-row__text {
  min-width: 0;
}

.linked-role-row__text strong,
.linked-role-row__text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linked-role-row__text small {
  margin-top: 3px;
  color: #aeb7bf;
  font-size: 0.76rem;
}

.linked-role-editor__note {
  margin: 0;
}

.linked-role-admin-card {
  padding: 22px;
  border-radius: 28px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(9, 12, 21, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.11);
  display: grid;
  gap: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}

.linked-role-admin-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.linked-role-admin-card__head code {
  color: #efe3c8;
  font-size: 0.76rem;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linked-role-admin-card__identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.linked-role-admin-card__identity h3 {
  margin: 0 0 8px;
  color: #fff8ef;
}

.linked-role-admin-card__color {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  flex: 0 0 auto;
  background: var(--role-color);
  border: 2px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14);
}

.linked-role-admin-toggle {
  min-height: 84px;
}

.linked-role-picker {
  display: grid;
  gap: 8px;
  min-height: 160px;
  max-height: 312px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(239, 227, 200, 0.2);
  border-radius: 16px;
  background: rgba(14, 18, 28, 0.55);
}

.linked-role-picker-wrap {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.linked-role-tokenbox {
  position: relative;
  min-height: 116px;
  padding: 12px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(49, 51, 56, 0.95), rgba(30, 31, 36, 0.95)),
    rgba(30, 31, 36, 0.96);
  border: 1px solid rgba(148, 155, 164, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 34px rgba(0, 0, 0, 0.22);
}

.linked-role-tokenbox:focus-within {
  border-color: rgba(88, 101, 242, 0.68);
  box-shadow:
    0 0 0 3px rgba(88, 101, 242, 0.16),
    0 20px 36px rgba(0, 0, 0, 0.28);
}

.linked-role-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
  align-items: center;
}

.linked-role-selected-empty {
  color: rgba(219, 222, 225, 0.58);
  font-size: 0.86rem;
}

.linked-role-token {
  --role-token-bg: color-mix(in srgb, var(--role-color, #99aab5) 22%, rgba(88, 101, 242, 0.2));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 34px;
  padding: 6px 8px 6px 10px;
  border-radius: 999px;
  color: #f2f3f5;
  background: var(--role-token-bg);
  border: 1px solid color-mix(in srgb, var(--role-color, #99aab5) 42%, rgba(255, 255, 255, 0.12));
}

.linked-role-token__dot,
.linked-role-option__color {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--role-color, #99aab5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}

.linked-role-token__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 760;
  font-size: 0.86rem;
}

.linked-role-token__remove {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.74);
  cursor: pointer;
  line-height: 1;
  transition: background 140ms ease, color 140ms ease;
}

.linked-role-token__remove:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.linked-role-picker-input {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  padding: 0 2px;
  border: 0;
  outline: none;
  background: transparent;
  color: #f2f3f5;
  font: inherit;
}

.linked-role-picker-input::placeholder {
  color: rgba(219, 222, 225, 0.55);
}

.linked-role-picker-popover {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(100% + 8px);
  z-index: 30;
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow: auto;
  padding: 8px;
  border-radius: 18px;
  background: rgba(43, 45, 49, 0.98);
  border: 1px solid rgba(148, 155, 164, 0.22);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
}

.linked-role-picker-popover[hidden] {
  display: none;
}

.linked-role-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 9px 10px;
  border-radius: 14px;
  color: #f2f3f5;
  cursor: pointer;
  outline: none;
  transition: background 140ms ease, transform 140ms ease;
}

.linked-role-option:hover,
.linked-role-option:focus-visible {
  background: rgba(88, 101, 242, 0.22);
  transform: translateX(2px);
}

.linked-role-option[hidden],
.linked-role-option.is-selected {
  display: none;
}

.linked-role-option__name {
  min-width: 0;
}

.linked-role-option__name strong,
.linked-role-option__name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linked-role-option__name small {
  margin-top: 2px;
  color: #b5bac1;
  font-size: 0.75rem;
}

.linked-role-option__pick {
  color: #b5bac1;
  font-size: 0.76rem;
}

.linked-role-choice {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 12px;
  color: #fff8ef;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.linked-role-choice:has(input:checked) {
  background: rgba(158, 214, 163, 0.1);
  border: 1px solid rgba(158, 214, 163, 0.18);
}

.linked-role-choice:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.linked-role-choice input {
  accent-color: #efe3c8;
}

.linked-role-choice__color {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--role-color, #99aab5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.linked-role-choice__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.linked-role-choice__name strong,
.linked-role-choice__name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linked-role-choice__name small {
  margin-top: 2px;
  color: #aeb7bf;
  font-size: 0.75rem;
}

@media (max-width: 860px) {
  .linked-role-editor {
    grid-template-columns: 1fr;
  }

  .linked-role-admin-panel {
    padding: 20px;
  }
}
