.market-shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(16, 17, 20, 0.74), #101114 42%),
    url("assets/studio-bg.png") center top / cover fixed;
  color: var(--text);
}

.market-main {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 80px 0 72px;
}

.market-hero,
.market-toolbar,
.market-tabs,
.market-notice,
.market-count,
.market-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 25, 31, 0.88);
  backdrop-filter: blur(18px);
}

.market-hero {
  display: grid;
  gap: 10px;
  padding: 14px 30px 16px;
  box-shadow: var(--shadow);
}

.market-hero-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.market-hero h1 {
  margin-bottom: 0;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1;
}

.market-hero p:not(.eyebrow) {
  margin-bottom: 0;
  color: #d8d2c8;
  font-size: 18px;
}

.listing-button,
.market-tabs button,
.filter-pills button,
.modal-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 900;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.listing-button {
  color: #071211;
  border-color: transparent;
  background: linear-gradient(135deg, var(--teal), var(--amber));
}

.listing-button:hover,
.market-tabs button:hover,
.filter-pills button:hover,
.modal-link-button:hover,
.market-card:hover {
  border-color: rgba(57, 215, 200, 0.72);
  box-shadow: 0 0 0 1px rgba(57, 215, 200, 0.14), 0 12px 30px rgba(57, 215, 200, 0.14);
  transform: translateY(-2px);
}

.market-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 11, 14, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.filter-pills button {
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #c8c2b8;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  transition: none;
}

.filter-pills button.is-active {
  color: #071211;
  background: linear-gradient(135deg, var(--teal), var(--amber));
  box-shadow: 0 8px 22px rgba(57, 215, 200, 0.18);
}

.filter-pills button:hover {
  color: #071211 !important;
  background: linear-gradient(135deg, var(--teal), var(--amber)) !important;
  border-color: transparent !important;
  box-shadow: 0 8px 22px rgba(57, 215, 200, 0.18) !important;
  transform: none !important;
}

.market-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 11, 14, 0.62);
}

.market-search input {
  width: 100%;
  border: 0;
  color: var(--text);
  background: transparent;
  outline: none;
}

.market-tabs {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.sort-tabs,
.scope-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.market-tabs button.is-active {
  color: #071211;
  border-color: transparent;
  background: var(--green);
}

.market-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  padding: 8px 12px;
  border-color: rgba(255, 255, 255, 0.07);
  color: #d8d2c8;
  font-size: 14px;
  line-height: 1.45;
  background: rgba(10, 11, 14, 0.24);
}

.market-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 14px 16px;
}

.market-count strong {
  font-size: 18px;
}

.market-count span {
  color: var(--teal);
  font-weight: 900;
}

.track-market {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.market-card {
  display: grid;
  grid-template-rows: 221px minmax(0, auto) auto;
  height: 343px;
  gap: 4px;
  padding: 8px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.license-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  height: 100%;
  border-radius: 8px;
  color: #071211;
  background:
    linear-gradient(135deg, rgba(57, 215, 200, 0.95), rgba(255, 199, 102, 0.92)),
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.34), transparent 38%);
  font-size: 13px;
  font-weight: 900;
}

.market-song h2 {
  margin: 0 0 1px;
  font-size: 14px;
  line-height: 1.12;
}

.market-song {
  align-self: end;
  margin-bottom: 0;
  transform: translateY(19px);
  min-height: 0;
}

.market-song p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.16;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  min-height: 0;
}

.seller-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  font-size: 10px;
}

.seller-line span {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.market-price {
  display: grid;
  gap: 6px;
  margin-top: 0;
  min-width: 0;
  text-align: left;
}

.market-price strong {
  display: block;
  margin-bottom: 4px;
  color: var(--amber);
  font-size: 20px;
  line-height: 1.05;
  transform: translateY(19px);
}

.market-price button {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: #071211;
  background: var(--teal);
  font-weight: 900;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.listing-grid label {
  display: grid;
  gap: 8px;
  color: #e8e0d4;
  font-size: 13px;
  font-weight: 800;
}

.listing-grid input,
.listing-grid select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #20242b;
  outline: none;
}

@media (max-width: 900px) {
  .market-main {
    width: min(100% - 32px, 720px);
    padding-top: 72px;
  }

  .market-hero,
  .market-hero-head,
  .market-tabs {
    align-items: stretch;
    flex-direction: column;
  }

  .market-hero-head {
    display: grid;
  }

  .market-toolbar,
  .listing-grid {
    grid-template-columns: 1fr;
  }

  .track-market {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-pills {
    flex-wrap: wrap;
    border-radius: 16px;
  }

  .market-price {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .track-market {
    grid-template-columns: 1fr;
  }
}
