:root {
  --primary: #6356f2;
  --accent: #9b59ff;
  --background: #1e1b2e;
  --foreground: #e0e0ff;
  --card: #2a1e3d;
  --border: #4b3a66;
  --muted: #b0a6d0;
  --hover: #3b2a5e;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", Arial, sans-serif;
  background: var(--background);
  color: var(--foreground);
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

a { text-decoration: none; color: inherit; }

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  justify-items: center;
  background: rgba(42,30,61,0.3);
}

.market-card {
  background: var(--card);
  border-radius: 16px;
  width: 220px;
  min-height: 280px;
  text-align: center;
  padding: 1rem;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.market-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.3);
}

.market-card img {
  width: 60%;
  height: 120px;
  object-fit: contain;
  margin-bottom: 0.75rem;
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s;
}

.market-card:hover img {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.market-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0.3rem 0;
  color: var(--primary);
}

.market-card p {
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 36px;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.market-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.9rem;
}

.btn-sm {
  background: var(--primary);
  color: #fff;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-sm:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.badge.new { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.badge.hot { background: linear-gradient(135deg, #dc2626, #ef4444); }
.badge.free { background: linear-gradient(135deg, #059669, #10b981); }

.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.75);
  overflow-y: auto;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--card);
  max-width: 600px;
  margin: 5% auto;
  padding: 2rem;
  border-radius: 16px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  color: var(--foreground);
}

.close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s;
}

.close:hover { color: var(--foreground); }

@media (max-width: 768px) {
  .market-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
