body.market-page {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
}

body.market-page * {
  scrollbar-width: thin;
  scrollbar-color: #7ea24c #2a2216;
}

body.market-page *::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

body.market-page *::-webkit-scrollbar-track {
  background: #2a2216;
  border-left: 1px solid #5a4a35;
}

body.market-page *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #95ba5f 0%, #607d36 100%);
  border: 2px solid #2a2216;
}

body.market-page *::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #a7cc73 0%, #6f8f42 100%);
}

#marketRoot {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.market-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  grid-template-rows: auto 1fr;
  gap: 14px;
  padding: 14px;
}

.market-message {
  grid-column: 1 / -1;
  border: 2px solid #8d5a48;
  background: linear-gradient(180deg, #4f2c22 0%, #3d221a 100%);
  color: #ffd2c1;
  padding: 8px 10px;
  font-size: 22px;
  box-shadow: inset 0 0 0 1px #2a1913;
}

.market-message.is-info {
  border-color: #6d5a3d;
  background: linear-gradient(180deg, #3d3223 0%, #2c2318 100%);
  color: #f2e8cf;
}

.market-message.is-success {
  border-color: #6a8e3d;
  background: linear-gradient(180deg, #334d24 0%, #25371b 100%);
  color: #e7ffd1;
}

.market-create-panel,
.market-list-panel {
  overflow: auto;
}

.market-closed {
  margin: 8px 0 12px;
  padding: 10px;
  border: 2px solid #9a6f4b;
  background: rgba(94, 45, 25, 0.35);
  color: #ffd9bf;
  font-size: 20px;
}

.market-mode-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.mode-btn {
  flex: 1;
}

.mode-btn.active {
  border-color: #94c65f;
  background: #496130;
  color: #e9ffd1;
}

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

.market-form label {
  font-size: 11px;
}

.market-select-wrap {
  position: relative;
  width: 100%;
}

.market-native-select {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.market-form input,
.market-form select,
.market-filter-grid input,
.market-filter-grid select {
  width: 100%;
  border: 2px solid #6d5a3d;
  background: #1f1810;
  color: #f2e8cf;
  padding: 8px;
  font-family: "VT323", monospace;
  font-size: 23px;
}

.market-form input[type="number"]::-webkit-outer-spin-button,
.market-form input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.market-form input[type="number"] {
  -moz-appearance: textfield;
}

.market-filter-grid input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.market-form select option,
.market-filter-grid select option {
  background: #2a2115;
  color: #f2e8cf;
}

.market-custom-select {
  position: relative;
  overflow: visible;
}

.market-custom-select .select-trigger {
  width: 100%;
  text-align: left;
  min-height: 42px;
  padding-right: 32px;
  position: relative;
}

.market-custom-select .select-trigger::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #d8f0a9;
  transform: translateY(-25%);
  pointer-events: none;
  filter: drop-shadow(1px 1px 0 #1b150d);
}

.market-custom-select .select-menu {
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  bottom: auto;
  max-height: min(42vh, 290px);
  z-index: 45;
}

.market-item-info {
  font-size: 22px;
  color: #d7eeb0;
  min-height: 24px;
  line-height: 1.2;
}

.market-filter-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
}

.market-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.listing-card {
  border: 2px solid #665339;
  background: linear-gradient(180deg, #3d3223 0%, #2c2318 100%);
  box-shadow: inset 0 0 0 1px #221a11;
  padding: 8px;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 10px;
  align-items: center;
}

.listing-card .icon {
  width: 44px;
  height: 44px;
}

.listing-main {
  min-width: 0;
}

.listing-title {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  color: #ebffd1;
  margin-bottom: 4px;
}

.listing-meta {
  font-size: 21px;
  color: #f2e8cf;
}

.listing-sub {
  font-size: 18px;
  color: #cdbf9e;
}

.listing-price {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.listing-price .icon {
  width: 20px;
  height: 20px;
}

.listing-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.empty-state {
  border: 2px dashed #6c5c43;
  padding: 14px;
  text-align: center;
  color: #d7c9ab;
  font-size: 22px;
}

@media (max-width: 1000px) {
  .market-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    padding: 8px;
    gap: 8px;
  }

  .market-filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}
