@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #0c0d11;
  --surface: #15161d;
  --surface-raised: #1a1c25;
  --border: #262834;
  --border-soft: #1e202a;
  --text: #eceef2;
  --text-muted: #838692;
  --text-faint: #52545e;
}

* { box-sizing: border-box; }

:root {
  --good: #45d190;
  --good-dim: #1d3d30;
  --warn: #e4ae39;

  --r-consumer: #b0c3d9;
  --r-industrial: #5e98d9;
  --r-milspec: #4b69ff;
  --r-restricted: #8847ff;
  --r-classified: #d32ce6;
  --r-covert: #eb4b4b;
  --r-contraband: #e4ae39;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  position: relative;
  min-height: 100vh;
}

.scanline-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(circle, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 75%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border-soft);
}
.brand {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.02em;
}
.brand span { color: var(--good); }

.badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-faint);
}
.badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  vertical-align: middle;
}
.badge.live { color: var(--good); border-color: rgba(69, 209, 144, 0.35); }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px 80px; }

.hero {
  padding: 64px 0 36px;
  text-align: center;
}
.hero h1 {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 600;
  font-size: 34px;
  line-height: 1.2;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.hero-sub {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0;
}

.search-form {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 18px;
}

.field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-raised);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  transition: border-color 0.15s ease;
}
.field:focus-within { border-color: var(--r-milspec); }
.field-query { flex: 1; }

.field input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  padding: 13px 0;
  width: 100%;
  outline: none;
  font-family: 'Inter', sans-serif;
}
.field input::placeholder { color: var(--text-faint); }

.field-price { width: 150px; flex-shrink: 0; }
.field-price .prefix, .field-price .suffix {
  color: var(--text-faint);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
}
.field-price input { font-family: 'JetBrains Mono', monospace; text-align: right; }
.field-price input::-webkit-outer-spin-button,
.field-price input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn {
  padding: 0 22px;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--r-milspec); color: #fff; }
.btn-primary:hover { filter: brightness(1.12); }

.results-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-faint);
  margin: 0 4px 12px;
  min-height: 16px;
}

.results { display: flex; flex-direction: column; gap: 12px; }

.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 70px 20px;
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rarity-color, var(--border));
  border-radius: 10px;
  padding: 18px 20px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { transform: translateY(-1px); border-color: var(--border); }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 12px;
}
.card-head .weapon {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.card-head .name {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 500;
  font-size: 16px;
}

.price-block { text-align: right; flex-shrink: 0; }
.price-block .best-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 19px;
  font-weight: 500;
  color: var(--good);
  line-height: 1.2;
}
.savings-chip {
  display: inline-block;
  margin-top: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--good);
  background: var(--good-dim);
  padding: 2px 7px;
  border-radius: 4px;
}

.pending-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--text-faint);
}
.pending-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.5;
}

.market-row {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
}
.market-row .label {
  font-size: 12px;
  color: var(--text-muted);
}
.market-row.cheapest .label { color: var(--good); font-weight: 500; }

.bar-track {
  background: var(--border-soft);
  border-radius: 3px;
  height: 5px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--text-faint);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.market-row.cheapest .bar-fill { background: var(--good); }

.market-row .price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  text-align: right;
  color: var(--text-muted);
  min-width: 62px;
}
.market-row.cheapest .price { color: var(--good); font-weight: 500; }

.skeleton { animation: pulse 1.4s ease-in-out infinite; }
.skeleton .sk-line {
  background: var(--surface-raised);
  border-radius: 4px;
  height: 12px;
}
.skeleton .sk-title { width: 40%; height: 15px; margin-bottom: 10px; }
.skeleton .sk-row { width: 100%; height: 16px; margin-bottom: 8px; }
@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@media (max-width: 560px) {
  .hero { padding: 40px 0 28px; }
  .hero h1 { font-size: 26px; }
  .search-form { flex-wrap: wrap; }
  .field-price { width: 100%; }
  .btn { width: 100%; padding: 13px; }
}
