:root {
  --bg: #09090b; /* Very dark, almost black */
  --bg-card: #121214;
  --bg-input: #0a0a0c;
  --bg-hover: #18181b;
  --border: #222225;
  --border-hover: #333338;
  --red: #e60000;
  --red-hover: #cc0000;
  --text: #ffffff;
  --muted: #a1a1aa;
  --dim: #71717a;
  --nav-bg: rgba(18, 18, 20, 0.6);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: inherit; background: none; }
input, select { font-family: inherit; }
img { display: block; max-width: 100%; }

/* PARTICLES (TINY RED DOTS) */
#cvs { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
#app { position: relative; z-index: 1; }

/* NAVBAR */
.nav-wrap { position: sticky; top: 0; z-index: 1000; display: flex; justify-content: center; padding: 20px 24px; }
.nav-center {
  display: flex; align-items: center; gap: 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 8px 8px 20px;
}
.nav-logo-txt { font-size: 15px; font-weight: 800; letter-spacing: 0.5px; margin-right: 12px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-a {
  font-size: 12px; font-weight: 500; color: var(--muted);
  padding: 6px 14px; border-radius: 999px; transition: 0.2s;
}
.nav-a:hover { color: var(--text); }
.nav-a.act { background: #1c1c1f; color: var(--text); }
.nav-auth { display: flex; align-items: center; gap: 12px; margin-left: 12px; }
.btn-login {
  color: var(--text); font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); padding: 8px 16px; border-radius: 999px;
}
.btn-login:hover { background: var(--bg-hover); }
.or-txt { font-size: 11px; color: var(--dim); }
.btn-reg {
  background: var(--red); color: #fff; font-size: 12px; font-weight: 600;
  padding: 8px 16px; border-radius: 999px;
}
.btn-reg:hover { background: var(--red-hover); }
.nav-cart-icon {
  width: 32px; height: 32px; background: rgba(255,0,0,0.1); border: 1px solid rgba(230,0,0,0.3);
  color: var(--red); border-radius: 8px; display: flex; align-items: center; justify-content: center;
  margin-left: 12px; position: relative; cursor: pointer;
}
.nav-cart-icon:hover { background: rgba(255,0,0,0.2); }
.cart-badge {
  position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700; width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* HERO */
.hero { display: flex; align-items: center; max-width: 1100px; margin: 60px auto; padding: 0 40px; gap: 80px; }
.hero-l { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(230,0,0,0.1); border: 1px solid rgba(230,0,0,0.2);
  padding: 6px 12px; border-radius: 999px;
}
.hero-badge img { width: 16px; height: 16px; border-radius: 4px; }
.hero-badge-txt { font-size: 10px; font-weight: 700; color: var(--red); text-transform: uppercase; }
.hero-title { font-size: 42px; font-weight: 800; line-height: 1.1; }
.hero-sub { font-size: 15px; color: var(--muted); }
.btn-hero-buy {
  background: var(--red); color: #fff; font-size: 13px; font-weight: 600;
  padding: 10px 24px; border-radius: 999px; margin-top: 10px;
}
.btn-hero-buy:hover { background: var(--red-hover); }
.hero-r { flex: 1; display: flex; justify-content: flex-end; }
.hero-img { width: 100%; max-width: 440px; border-radius: 20px; object-fit: cover; aspect-ratio: 4/3; }

/* MARKET */
.mkt { max-width: 1100px; margin: 0 auto 100px; padding: 0 40px; }
.mkt-title { font-size: 18px; font-weight: 700; margin-bottom: 24px; }
.mkt-tabs { display: flex; gap: 8px; margin-bottom: 32px; }
.mkt-tab {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border);
  padding: 8px 16px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--muted);
}
.mkt-tab.act { background: #1c1c1f; color: var(--text); border-color: var(--border-hover); }

/* GRID & CARDS */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; display: flex; flex-direction: column;
  transition: border-color 0.2s; cursor: pointer;
}
.card:hover { border-color: var(--border-hover); }
.card-img-w { position: relative; width: 100%; aspect-ratio: 16/9; background: #1a1a1a; }
.card-img-w img { width: 100%; height: 100%; object-fit: cover; }
.card-icons {
  position: absolute; top: 12px; left: 12px; right: 12px;
  display: flex; justify-content: space-between;
}
.c-icon {
  width: 28px; height: 28px; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px;
}
.card-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.c-stock { font-size: 11px; font-weight: 600; color: var(--red); margin-bottom: 6px; }
.c-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.c-price-row { display: flex; align-items: center; gap: 6px; margin-top: auto; margin-bottom: 16px; }
.c-price-lbl { font-size: 12px; color: var(--dim); }
.c-price { font-size: 14px; font-weight: 700; }
.c-btn {
  background: var(--red); color: #fff; font-size: 13px; font-weight: 600;
  padding: 10px; border-radius: 999px; width: 100%; text-align: center; display: block;
}
.c-btn:hover { background: var(--red-hover); }

/* COMMUNITY */
.comm { max-width: 1100px; margin: 0 auto 100px; padding: 0 40px; }
.comm-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; display: flex; align-items: center; padding: 40px; gap: 60px;
}
.comm-l { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.comm-ttl { font-size: 22px; font-weight: 700; }
.comm-txt { font-size: 14px; color: var(--muted); line-height: 1.5; }
.comm-note { font-size: 12px; color: var(--dim); }
.comm-r { flex: 1; display: flex; justify-content: flex-end; }
.comm-img { width: 100%; max-width: 320px; border-radius: 16px; object-fit: cover; aspect-ratio: 4/3; }

/* FOOTER */
.footer {
  max-width: 1100px; margin: 0 auto; padding: 40px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border); font-size: 12px; color: var(--dim);
}
.ft-l { display: flex; align-items: center; gap: 20px; }
.ft-logo { font-size: 14px; font-weight: 800; color: var(--text); }
.ft-links { display: flex; gap: 16px; }
.ft-a:hover { color: var(--text); }

/* MODAL */
.ovl {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  display: flex; align-items: center; justify-content: center;
  z-index: 5000; opacity: 0; visibility: hidden; transition: 0.2s;
}
.ovl.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; width: 100%; max-width: 440px;
  transform: translateY(20px); transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ovl.open .modal { transform: translateY(0); }
.m-head { display: flex; align-items: center; justify-content: space-between; padding: 24px 24px 16px; }
.m-ttl { font-size: 20px; font-weight: 700; }
.m-x { font-size: 20px; color: var(--muted); cursor: pointer; }
.m-x:hover { color: var(--text); }
.m-desc { padding: 0 24px 24px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.m-warn { display: block; margin-top: 12px; font-style: italic; font-weight: 700; text-decoration: underline; color: var(--muted); }
.m-body { border-top: 1px solid var(--border); padding: 24px; display: flex; flex-direction: column; gap: 20px; }

.f-lbl { font-size: 12px; color: var(--dim); margin-bottom: 8px; }
.sel-w { position: relative; }
.sel {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-weight: 500;
  padding: 12px 16px; border-radius: 12px; appearance: none; cursor: pointer;
}
.sel:focus { border-color: var(--border-hover); outline: none; }
.sel-arr { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--dim); pointer-events: none; }

.qty-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px 12px;
}
.qty-btn {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer;
}
.qty-btn:hover { border-color: var(--border-hover); color: var(--text); }
.qty-val { font-size: 13px; font-weight: 600; }

.m-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.m-tot { font-size: 15px; font-weight: 700; color: var(--text); }
.m-acts { display: flex; gap: 12px; margin-top: 8px; }
.m-btn {
  flex: 1; padding: 12px; border-radius: 12px; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.m-btn.buy { background: var(--red); color: #fff; }
.m-btn.buy:hover { background: var(--red-hover); }
.m-btn.cart { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.m-btn.cart:hover { border-color: var(--border-hover); color: var(--text); }

/* CHECKOUT */
.co {
  position: fixed; inset: 0; background: var(--bg); z-index: 6000;
  display: none; overflow-y: auto;
}
.co.on { display: flex; }
.co-back {
  position: absolute; top: 40px; left: 40px; color: var(--muted);
  cursor: pointer; display: flex; align-items: center;
}
.co-back:hover { color: var(--text); }

.co-l { flex: 1; border-right: 1px solid var(--border); padding: 100px 60px 60px; max-width: 50%; }
.co-r { flex: 1; padding: 100px 60px 60px; display: flex; flex-direction: column; gap: 32px; max-width: 50%; }

.co-ttl { font-size: 20px; font-weight: 700; margin-bottom: 32px; }
.co-item { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; position: relative; }
.co-item-img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.co-item-info { flex: 1; }
.co-item-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.co-item-qty { color: var(--dim); font-size: 12px; font-weight: 400; }
.co-item-price { font-size: 13px; font-weight: 600; margin-right: 24px; }
.co-item-remove { position: absolute; right: 0; color: var(--dim); cursor: pointer; }
.co-item-remove:hover { color: var(--red); }
.co-empty { font-size: 14px; color: var(--dim); margin-bottom: 24px; }

.co-disc { position: relative; margin-bottom: 32px; }
.co-disc input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  padding: 12px 90px 12px 16px; border-radius: 12px; color: var(--text); font-size: 13px;
}
.co-disc input:focus { border-color: var(--border-hover); outline: none; }
.co-disc button {
  position: absolute; right: 6px; top: 6px; bottom: 6px;
  background: var(--bg-hover); border: 1px solid var(--border); border-radius: 8px;
  padding: 0 16px; font-size: 12px; font-weight: 500; color: var(--muted);
}
.co-disc button:hover { color: var(--text); }

.co-sum { background: transparent; border: 1px solid var(--border); border-radius: 12px; padding: 0 16px; }
.co-row {
  display: flex; justify-content: space-between; padding: 16px 0;
  border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted);
}
.co-row:last-child { border-bottom: none; }
.co-row.tot { font-weight: 700; color: var(--text); }
.co-fee-i { display: inline-flex; width: 14px; height: 14px; border: 1px solid var(--dim); border-radius: 50%; align-items: center; justify-content: center; font-size: 9px; margin-left: 6px; }

.co-lbl { font-size: 12px; color: var(--dim); margin-bottom: 8px; }
.co-inp {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  padding: 12px 16px; border-radius: 12px; color: var(--text); font-size: 13px;
}
.co-inp:focus { border-color: var(--border-hover); outline: none; }

.pmethods { display: flex; flex-direction: column; gap: 12px; }
.pm {
  border: 1px solid var(--border); background: var(--bg-input);
  border-radius: 12px; padding: 16px; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; transition: 0.2s;
}
.pm.sel { border-color: var(--red); background: rgba(230,0,0,0.05); }
.pm-name { font-size: 13px; font-weight: 600; }
.pm-icons { display: flex; gap: 6px; }
.pm-ico { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; }
.pm-ico.btc { background: #f7931a; }
.pm-ico.ltc { background: #345d9d; }
.pm-ico.eth { background: #627eea; }
.pm-ico.more { background: #333; font-size: 9px; }

.co-btn {
  width: 100%; background: var(--bg-hover); color: var(--muted);
  font-size: 14px; font-weight: 600; padding: 16px; border-radius: 12px;
  text-align: center; transition: 0.2s;
}
.co-btn.rdy { background: var(--red); color: #fff; }
.co-btn.rdy:hover { background: var(--red-hover); }
.co-sec { font-size: 11px; color: var(--dim); display: flex; gap: 8px; align-items: flex-start; line-height: 1.5; }

/* TOAST */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 12px 24px; border-radius: 999px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: 0.2s; z-index: 9999;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* RESPONSIVE */
@media(max-width: 900px) {
  .hero { flex-direction: column; text-align: center; align-items: center; padding: 40px 24px; }
  .hero-l { align-items: center; }
  .co.on { flex-direction: column; }
  .co-l, .co-r { max-width: 100%; padding: 40px 24px; }
  .co-l { border-right: none; border-bottom: 1px solid var(--border); padding-top: 80px; }
  .comm-card { flex-direction: column; padding: 32px 24px; text-align: center; }
  .comm-l { align-items: center; }
  .nav-center { padding: 8px 20px; }
  .nav-links, .nav-auth { display: none; }
}
