:root {
  --bg: #0b0710;
  --bg-2: #130b1d;
  --card: #1a1026;
  --card-2: #211633;
  --line: #2c2040;
  --text: #f3eefb;
  --muted: #a99fc4;
  --muted-2: #7d7396;
  --primary: #7c3aed;
  --primary-2: #a78bfa;
  --cta: #22c55e;
  --cta-2: #16a34a;
  --hot: #f43f5e;
  --gold: #f5c518;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Poppins', system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #2a1145 0%, transparent 55%),
              radial-gradient(900px 500px at -10% 10%, #14213a 0%, transparent 50%),
              var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 22px;
  background: rgba(11,7,16,.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-size: 20px; }
.brand b { color: var(--primary-2); font-weight: 700; }
.brand svg { color: var(--primary-2); }
.tabs { display: flex; gap: 4px; background: var(--card); padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.tab {
  border: 0; background: transparent; color: var(--muted);
  font: 500 14px/1 'Poppins', sans-serif; padding: 9px 16px; border-radius: 9px;
  cursor: pointer; transition: color .2s, background .2s;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: linear-gradient(135deg, var(--primary), #5b21b6); color: #fff; }

/* ---------- banner ---------- */
.banner {
  margin: 0; padding: 10px 22px; text-align: center; font-size: 13px;
  background: rgba(245,197,24,.12); color: var(--gold);
  border-bottom: 1px solid rgba(245,197,24,.25);
}
.hidden { display: none !important; }

/* ---------- views ---------- */
.view { max-width: 1200px; margin: 0 auto; padding: 28px 22px 60px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 40px 0 30px; }
.hero h1 { font-size: clamp(28px, 5vw, 48px); font-weight: 700; margin: 0 0 12px; letter-spacing: -.02em; }
.grad { background: linear-gradient(100deg, var(--primary-2), var(--cta)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { color: var(--muted); max-width: 620px; margin: 0 auto 26px; font-size: 16px; }

.search-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  max-width: 720px; margin: 0 auto; padding: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.search-bar svg { color: var(--muted-2); margin-left: 8px; flex: none; }
.search-bar input {
  flex: 1 1 160px; min-width: 0; background: transparent; border: 0; color: var(--text);
  font: 400 15px 'Poppins', sans-serif; padding: 12px 10px; outline: none;
}
.search-bar input::placeholder { color: var(--muted-2); }
.search-bar.wide { max-width: 860px; }

.btn-cta {
  flex: none; border: 0; cursor: pointer; color: #04210f; font: 600 15px 'Poppins', sans-serif;
  padding: 12px 22px; border-radius: 10px; background: linear-gradient(135deg, var(--cta), var(--cta-2));
  transition: filter .2s, transform .05s;
}
.btn-cta:hover { filter: brightness(1.08); }
.btn-cta:active { transform: translateY(1px); }
.btn-cta:disabled { opacity: .6; cursor: progress; }
.btn-ghost {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font: 500 14px 'Poppins', sans-serif; padding: 9px 16px; border-radius: 10px; cursor: pointer;
  transition: color .2s, border-color .2s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--primary); }

/* ---------- feed controls ---------- */
.feed-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 26px 0 18px; }
.filters { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.chk { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; cursor: pointer; }
.chk input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.range { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.range b { color: var(--primary-2); }
.range input { accent-color: var(--primary); cursor: pointer; }

/* ---------- grid + cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .2s;
  display: flex; flex-direction: column;
}
.card:hover { border-color: var(--primary); box-shadow: 0 8px 30px rgba(124,58,237,.22); transform: translateY(-3px); }
.card-img { aspect-ratio: 16/9; background: linear-gradient(135deg, #2a1145, #14213a); position: relative; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font: 700 13px 'Poppins', sans-serif; padding: 5px 10px; border-radius: 8px; color: #fff;
  background: linear-gradient(135deg, var(--hot), #be123c); box-shadow: 0 4px 14px rgba(244,63,94,.4);
}
.badge.face { background: linear-gradient(135deg, var(--gold), #d4a017); color: #2a1d00; box-shadow: 0 4px 14px rgba(245,197,24,.35); }
.card-body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-weight: 600; font-size: 16px; line-height: 1.3; margin: 0; }
.card-meta { color: var(--muted); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 10px; }
.price { font-size: 22px; font-weight: 700; color: var(--cta); }
.price-was { font-size: 13px; color: var(--muted-2); text-decoration: line-through; }
.src-tag { margin-left: auto; font-size: 12px; color: var(--muted); background: var(--card-2); padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); }

/* ---------- empty / loading ---------- */
.state { grid-column: 1/-1; text-align: center; padding: 60px 20px; color: var(--muted); }
.skeleton { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); height: 290px; overflow: hidden; position: relative; }
.skeleton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ---------- watchlist ---------- */
.watch-head h2 { font-size: 26px; margin: 0 0 6px; }
.watch-head .sub { color: var(--muted); margin: 0 0 20px; }
.watch-form, .watch-load { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.watch-form input, .watch-load input {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; color: var(--text);
  padding: 11px 13px; font: 400 14px 'Poppins', sans-serif; outline: none; flex: 1 1 150px; min-width: 0;
}
.watch-form input:focus, .watch-load input:focus, .search-bar input:focus-visible { border-color: var(--primary); }
.watch-list { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.watch-item {
  display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
}
.watch-item .w-main { flex: 1; }
.watch-item .w-title { font-weight: 600; }
.watch-item .w-cond { color: var(--muted); font-size: 13px; }
.w-del { border: 1px solid var(--line); background: transparent; color: var(--hot); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; }
.w-del:hover { border-color: var(--hot); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(5,3,8,.7); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; max-width: 560px; width: 100%; max-height: 88vh; overflow: auto; position: relative; box-shadow: var(--shadow); }
.modal-close { position: absolute; top: 12px; right: 14px; background: var(--card); border: 1px solid var(--line); color: var(--muted); width: 34px; height: 34px; border-radius: 9px; font-size: 22px; line-height: 1; cursor: pointer; }
.modal-close:hover { color: var(--text); }
.m-hero { aspect-ratio: 16/9; background: linear-gradient(135deg, #2a1145, #14213a); }
.m-hero img { width: 100%; height: 100%; object-fit: cover; }
.m-body { padding: 20px 22px 24px; }
.m-body h3 { margin: 0 0 6px; font-size: 22px; }
.cmp-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.cmp-table th, .cmp-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.cmp-table th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.cmp-best { color: var(--cta); font-weight: 700; }
.buy-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; text-decoration: none; }

/* ---------- footer ---------- */
.foot { text-align: center; color: var(--muted-2); font-size: 12px; padding: 30px 22px 40px; border-top: 1px solid var(--line); }
.foot span { color: var(--muted); font-weight: 600; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .tabs { width: 100%; justify-content: center; }
  .btn-cta { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
