/* Market V1: isolated market and inventory listing UI. */

.market-v1-shell,
.market-v1-inventory-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.market-v1-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.market-v1-page-head h2,
.market-v1-section-head h3 {
  margin: 0;
  color: #f8fbff;
  font-weight: 900;
  line-height: 1.15;
}

.market-v1-page-head h2 {
  font-size: 30px;
}

.market-v1-takeover-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-bottom: 10px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #ffe45c;
  color: #151000;
  border: 2px solid #ff8a00;
  box-shadow: 0 10px 26px rgba(255,138,0,.28);
  font-size: 16px;
  font-weight: 900;
}

.market-v1-section-head h3 {
  font-size: 22px;
}

.market-v1-muted {
  margin: 8px 0 0;
  color: #b8c3d9;
  font-size: 14px;
  line-height: 1.6;
}

.market-v1-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
}

.market-v1-tab {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: transparent;
  color: #c7d2e8;
  font-weight: 900;
  cursor: pointer;
}

.market-v1-tab.active {
  background: rgba(95,148,255,.22);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(150,184,255,.25) inset;
}

.market-v1-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
}

.market-v1-section[hidden] {
  display: none !important;
}

.market-v1-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.market-v1-slot-pill,
.market-v1-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: #edf3ff;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.market-v1-toolbar,
.market-v1-inventory-toolbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.market-v1-inventory-toolbar {
  grid-template-columns: minmax(220px, 320px) 1fr auto;
}

.market-v1-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.market-v1-field label {
  color: #aeb9d1;
  font-size: 12px;
  font-weight: 900;
}

.market-v1-input,
.market-v1-select {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid rgba(180,195,220,.22);
  border-radius: 10px;
  background: rgba(12,17,29,.86);
  color: #eef4ff;
  padding: 0 12px;
  font: 800 14px/1.2 "Microsoft YaHei", Arial, sans-serif;
  outline: none;
}

.market-v1-input:focus,
.market-v1-select:focus {
  border-color: rgba(120,172,255,.62);
  box-shadow: 0 0 0 3px rgba(92,145,255,.16);
}

.market-v1-actions {
  display: contents;
}

.market-v1-btn {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 0 12px;
  background: linear-gradient(180deg, #ffb45c, #f08334);
  color: #1c1208;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(240,131,52,.20);
}

.market-v1-btn.secondary {
  background: rgba(255,255,255,.08);
  color: #f2f6ff;
  box-shadow: none;
  border: 1px solid rgba(255,255,255,.08);
}

.market-v1-btn.ghost {
  background: transparent;
  color: #dce6fb;
  box-shadow: none;
  border: 1px solid rgba(255,255,255,.12);
}

.market-v1-btn.danger {
  background: linear-gradient(180deg, #ff8d8d, #e95555);
  color: #240b0b;
}

.market-v1-btn:disabled {
  cursor: not-allowed;
  opacity: .52;
  box-shadow: none;
}

.market-v1-message {
  min-height: 20px;
  color: #ffd990;
  font-size: 13px;
  font-weight: 800;
}

.market-v1-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 14px;
}

.market-v1-community-grid {
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
}

.market-v1-card {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(15,21,35,.92);
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
}

.market-v1-card-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: rgba(255,255,255,.04);
}

.market-v1-card-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  min-height: 182px;
}

.market-v1-card-title {
  min-height: 40px;
  color: #f7fbff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.4;
  word-break: break-word;
}

.market-v1-card-desc {
  min-height: 34px;
  color: #aeb9d1;
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.market-v1-price-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.market-v1-price-line {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
}

.market-v1-price-label {
  display: block;
  color: #aab6ce;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
}

.market-v1-price-value {
  color: #ffe28c;
  font-size: 15px;
  font-weight: 900;
  word-break: break-word;
}

.market-v1-owner-line {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #cbd7ed;
  font-size: 12px;
  font-weight: 800;
}

.market-v1-owner-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(117,177,255,.13);
  color: #dbeaff;
  border: 1px solid rgba(117,177,255,.22);
  white-space: nowrap;
}

.market-v1-owner-tag.self {
  background: rgba(255,214,118,.16);
  color: #ffe8ac;
  border-color: rgba(255,214,118,.28);
}

.market-v1-owner-note {
  min-width: 0;
  color: #aeb9d1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-v1-card-action {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.market-v1-card-action .market-v1-btn {
  width: 100%;
}

.market-v1-empty {
  grid-column: 1 / -1;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255,255,255,.12);
  border-radius: 8px;
  color: #aeb9d1;
  background: rgba(255,255,255,.035);
  font-weight: 800;
  text-align: center;
  padding: 18px;
}

.market-v1-showcase-grid {
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
}

.market-v1-empty-slot {
  min-height: 220px;
  border: 1px dashed rgba(255,255,255,.10);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7f8aa3;
  font-weight: 900;
}

.market-v1-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4,8,16,.72);
  backdrop-filter: blur(8px);
}

.market-v1-modal-backdrop[hidden] {
  display: none !important;
}

.market-v1-modal {
  width: min(520px, 100%);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12);
  background: #111827;
  color: #eef4ff;
  box-shadow: 0 28px 80px rgba(0,0,0,.42);
  overflow: hidden;
}

.market-v1-modal-head,
.market-v1-modal-body,
.market-v1-modal-actions {
  padding: 18px;
}

.market-v1-modal-head {
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.market-v1-modal-head h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
}

.market-v1-modal-item {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.market-v1-modal-item img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
}

.market-v1-modal-title {
  color: #fff;
  font-weight: 900;
  line-height: 1.4;
}

.market-v1-modal-sub {
  margin-top: 6px;
  color: #aeb9d1;
  font-size: 13px;
  line-height: 1.5;
}

.market-v1-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.market-v1-error {
  min-height: 20px;
  margin-top: 8px;
  color: #ffb4b4;
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 1040px) {
  .market-v1-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-v1-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 720px) {
  .market-v1-page-head,
  .market-v1-section-head {
    align-items: stretch;
  }

  .market-v1-tabs,
  .market-v1-tab,
  .market-v1-count-pill,
  .market-v1-slot-pill {
    width: 100%;
  }

  .market-v1-toolbar,
  .market-v1-inventory-toolbar,
  .market-v1-actions {
    grid-template-columns: 1fr;
  }

  .market-v1-price-box {
    grid-template-columns: 1fr;
  }

  .market-v1-modal-actions {
    flex-direction: column-reverse;
  }
}
