
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900');
/* ── Hero ── */
.hero {
  position: relative;
  width: 100%;
  height: 50vh;
  background-image: url('Marketplace.png');
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  border-bottom: 2px solid #D4AF37;
  overflow: hidden;
  margin-bottom: -70px;
}

.marketplace-container {
  padding: 60px 20px;
}

/* ── Grid ── */
.dex-grid {
  display: grid;
  gap: 16px;
  padding: 0 5%;
  max-width: 1400px;
  margin: 0 auto;
}

.dex-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.dex-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.dex-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 1100px) {
  .dex-grid.cols-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .dex-grid.cols-4,
  .dex-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .dex-grid.cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .dex-grid.cols-4,
  .dex-grid.cols-3,
  .dex-grid.cols-2 { grid-template-columns: 1fr; }
}

/* SEARCH FUNCTION */
.market-search-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px auto;
    flex-wrap: wrap;
    max-width: 600px;
}

.market-search-container input {
    flex: 1;
    min-width: 200px;
    max-width: 320px;
    padding: 8px 18px;
    border-radius: 50px;
    border: 2px solid #D4AF37;
    background: #1E2329;
    color: #F8F9FA;
    font-size: 14px;
    outline: none;
}

.market-search-container input::placeholder {
    color: #F8F9FA;
}

#marketSearchStatus {
    width: 80%;
    font-size: 14px;
    color: #F8F9FA;
    padding-left: 10px;
}

#clearSearchContainer {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.market-filters-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px auto 20px;
    flex-wrap: wrap;
    max-width: 700px;
}

.market-filter-select {
    padding: 8px 16px;
    border-radius: 50px;
    border: 2px solid #D4AF37;
    background: #1E2329;
    color: #F8F9FA;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

.market-filter-select option {
    background: #1E2329;
    color: #F8F9FA;
}

.dex-btn--outline {
    background: #1E2329;
    border: 2px solid #D4AF37;
    color: #D4AF37;
}

/* ── Card ── */
.dex-card {
  display: flex;
  flex-direction: column;
  background: #1E2329;
  border: 2px solid #D4AF37;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s, transform 0.3s, box-shadow 0.3s;
}

.dex-card:hover {
  border-color: var(--gold-mid);
  background: rgba(200,155,42,0.07);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(200,155,42,0.12);
}

/* Corner accent on hover */
.dex-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 20px; height: 20px;
  border-top: 1px solid var(--gold-mid);
  border-left: 1px solid var(--gold-mid);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 2;
}
.dex-card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 20px; height: 20px;
  border-bottom: 1px solid var(--gold-mid);
  border-right: 1px solid var(--gold-mid);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 2;
}
.dex-card:hover::before,
.dex-card:hover::after { opacity: 1; }

/* ── Card Image ── */
.dex-img-wrap {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #1E2329;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dex-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}
.dex-card:hover .dex-img-wrap img { transform: scale(1.04); }

/* ── Card Text ── */
.dex-card-title {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #D4AF37;
  margin: 14px 14px 4px;
}

.dex-card-sub {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: #F8F9FA;
  text-transform: uppercase;
  margin: 0 14px 12px;
}

/* ── Card Row ── */
.dex-row,
.card-dex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 14px;
  border-top: 2px solid #D4AF37;
  margin-top: auto;
}

.dex-condition {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 3px 10px;
  background: black;
  border: 2px solid #D4AF37;
  color: #D4AF37;
  border-radius: 2px;
}

.dex-price,
.dex-display {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  color: #D4AF37;
}

.dex-score {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  color: #4ade80;
  letter-spacing: 0.1em;
}

/* ── View All Button ── */
.view-deals-container {
  display: flex;
  justify-content: center;
  padding: 48px 0 0;
}

.dex-btn {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  padding: 15px 52px;
  background: #1E2329;
  color: #D4AF37;
  border: 2px solid #D4AF37;
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.dex-btn:hover {
  color: var(--gold-light);
  border-color: var(--gold-mid);
  background: rgba(200,155,42,0.07);
}


/* ── Market Intelligence ── */
.market-intelligence {
  padding: 48px 24px 32px;
  max-width: 1100px;
  margin: 0 auto;
}
 
/* ── Header ── */
.mi-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 50px;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
 
.mi-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
 
.mi-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #D4AF37;
  font-weight: 600;
}
 
.mi-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
 
.mi-last-updated {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 500;
  color: #F8F9FA;
  letter-spacing: 1px;
}
 
.mi-refresh-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #D4AF37;
  background: #1E2329;
  border: 2px solid #D4AF37;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
 
.mi-refresh-btn:hover {
  border-color: #D4AF37;
  color: #D4AF37;
  background: rgba(184, 134, 11, 0.08);
}
 
.mi-refresh-btn.spinning svg {
  animation: mi-spin 0.7s linear infinite;
}
 
@keyframes mi-spin {
  to { transform: rotate(360deg); }
}
 
/* ── Grid ── */
.mi-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr 1fr;
  grid-template-rows: auto;
  gap: 12px;
  margin-bottom: 12px;
}
 
@media (max-width: 900px) {
  .mi-grid {
    grid-template-columns: 1fr 1fr;
  }
  .mi-card--gainers {
    grid-column: span 2;
  }
}
 
@media (max-width: 560px) {
  .mi-grid {
    grid-template-columns: 1fr;
  }
  .mi-card--gainers {
    grid-column: span 1;
  }
}
 
/* ── Base Card ── */
.mi-card {
  background: #1E2329;
  border: 2px solid #D4AF37;
  border-radius: 14px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease;
}
 
.mi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, rgba(184, 134, 11, 0.04) 0%, transparent 65%);
  pointer-events: none;
}
 
.mi-card:hover {
  border-color: #4a3a1a;
}
 
.mi-card-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #D4AF37;
  margin-bottom: 14px;
}
 
.mi-card-label svg {
  stroke: #D4AF37;
  flex-shrink: 0;
}
 
/* ── Deal Card ── */
.mi-deal-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
 
.mi-deal-info {
  flex: 1;
  min-width: 0;
}
 
.mi-deal-name {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 600;
  color: #D4AF37;
  margin: 0 0 4px;
  line-height: 1.3;
}
 
.mi-deal-set {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  color: #F8F9FA;
  margin: 0;
  letter-spacing: 0.5px;
}
 
/* Score ring */
.mi-deal-score-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
 
.mi-score-ring {
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
  position: absolute;
  inset: 0;
}
 
.mi-score-ring-bg {
  fill: none;
  stroke: black;
  stroke-width: 5;
}
 
.mi-score-ring-fill {
  fill: none;
  stroke: #D4AF37;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
 
.mi-score-num {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 600;
  color: #D4AF37;
  position: relative;
  z-index: 1;
}
 
/* Deal bar */
.mi-deal-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
 
.mi-deal-bar {
  flex: 1;
  height: 4px;
  background: #1a0f0a;
  border-radius: 99px;
  overflow: hidden;
}
 
.mi-deal-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #6a4a08, #b8860b, #ffd700);
  width: 0%;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
 
.mi-deal-bar-label {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #F8F9FA;
  white-space: nowrap;
}
 
/* ── Gainers Card ── */
.mi-gainers-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
 
.mi-gainer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: mi-fade-in 0.35s ease both;
}
 
.mi-gainer-rank {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  color: #D4AF37;
  width: 14px;
  flex-shrink: 0;
  text-align: right;
  font-weight: 600;
}
 
.mi-gainer-name {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 600;
  color: #F8F9FA;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
 
.mi-gainer-bar-wrap {
  width: 50px;
  height: 3px;
  background: #1a0f0a;
  border-radius: 99px;
  overflow: hidden;
  flex-shrink: 0;
}
 
.mi-gainer-bar {
  height: 100%;
  border-radius: 99px;
  background: #4caf80;
  width: 0%;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
 
.mi-gainer-pct {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  color: #4caf80;
  background: rgba(76, 175, 80, 0.1);
  border: 2px solid rgba(76, 175, 80, 0.2);
  border-radius: 99px;
  padding: 2px 8px;
  white-space: nowrap;
  min-width: 44px;
  text-align: center;
  flex-shrink: 0;
}
 
/* Skeleton loaders */
.mi-gainer-skeleton,
.mi-set-skeleton {
  height: 20px;
  background: linear-gradient(90deg, #1a0f0a 25%, #2a1a0a 50%, #1a0f0a 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: mi-shimmer 1.4s infinite;
}
 
.mi-set-skeleton { height: 30px; }
 
@keyframes mi-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
 
/* ── Sets Card ── */
.mi-sets-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
 
.mi-set-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
  animation: mi-fade-in 0.35s ease both;
}
 
.mi-set-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
 
.mi-set-name {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  color: #D4AF37;
}
 
.mi-set-count {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  color: #F8F9FA;
}
 
.mi-set-progress {
  height: 4px;
  background: #1a0f0a;
  border-radius: 99px;
  overflow: hidden;
}
 
.mi-set-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #3a2a08, #b8860b);
  width: 0%;
  transition: width 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}
 
/* ── Stats Card ── */
.mi-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
 
.mi-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
 
.mi-stat-num {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 600;
  color: #D4AF37;
  line-height: 1;
}
 
.mi-stat-num.mi-positive { color: #4caf80; }
 
.mi-stat-label {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #F8F9FA;
  font-weight: 600;
}
 
/* ── Ticker ── */
.mi-ticker {
  position: relative;
  background: #1E2329;
  border: 2px solid #D4AF37;
  border-radius: 8px;
  padding: 11px 0;
  overflow: hidden;
  margin-bottom: 20px;
}
 
.mi-ticker-track {
  overflow: hidden;
}
 
.mi-ticker-inner {
  display: flex;
  gap: 0;
  white-space: nowrap;
  width: max-content;
}
 
.mi-ticker-inner.mi-ticker-animate {
  animation: mi-ticker-scroll 30s linear infinite;
}
 
@keyframes mi-ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
 
.mi-ticker-item {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #D4AF37;
  padding: 0 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
 
.mi-ticker-separator {
  color: #D4AF37;
  margin: 0 4px;
}
 
.mi-ticker-item .mi-t-gold { color: #D4AF37; font-size: 12px; font-weight: 600;}
.mi-ticker-item .mi-t-green { color: #4caf80; font-size: 12px; font-weight: 600;}
.mi-ticker-item .mi-t-dim { color: #F8F9FA; font-size: 12px; font-weight: 600;}
 
.mi-ticker-loading {
  color: #3a2a0a;
  padding: 0 20px;
}
 
.mi-ticker-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  z-index: 1;
  pointer-events: none;
}
 
.mi-ticker-fade--left {
  left: 0;
  background: linear-gradient(to right, #080508 0%, transparent 100%);
}
 
.mi-ticker-fade--right {
  right: 0;
  background: linear-gradient(to left, #080508 0%, transparent 100%);
}
 
/* ── Animations ── */
@keyframes mi-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
 
.mi-card--deal    { animation: mi-fade-in 0.4s ease 0.05s both; }
.mi-card--gainers { animation: mi-fade-in 0.4s ease 0.15s both; }
.mi-card--sets    { animation: mi-fade-in 0.4s ease 0.25s both; }
.mi-card--stats   { animation: mi-fade-in 0.4s ease 0.35s both; }

/* Phone Accessibility */
@media (max-width: 560px) {
  .mi-header,
  .mi-header-right {
    flex-direction: column;
    align-items: flex-start;
  }

  .mi-refresh-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .mi-gainer-name {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
}

@media (max-width: 560px) {
  .mi-deal-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .mi-ticker-item {
    font-size: 12px;
    padding: 0 15px;
  }
}

@media (max-width: 560px) {
  .market-intelligence {
    padding: 32px 12px 20px;
  }

  .mi-card {
    padding: 14px;
  }
}



