:root {
  --bg: #0A0C0F;
  --surface: #14181C;
  --surface2: rgba(20,24,28,0.72);
  --text: #E0E0E0;
  --muted: #9099A2;
  --cyan: #00F0FF;
  --pink: #FF2E88;
  --danger: #ff3b3b;
  --ok: #2dff9b;
  --mono: "Courier New", monospace;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 800px at 15% 0%, rgba(0,240,255,0.14), transparent 60%),
    radial-gradient(900px 700px at 85% 15%, rgba(255,46,136,0.12), transparent 55%),
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: auto, auto, 64px 64px, 64px 64px;
  background-position: center;
  opacity: 0.9;
  pointer-events: none;
  filter: saturate(120%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(10,12,15,0.72);
  backdrop-filter: blur(10px);
}

.brand-v2 .brand-link,
.brand-v3 .brand-link {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 14px;
  position: relative;
}
.brand-v2 .brand-link::before,
.brand-v3 .brand-link::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(0,240,255,0.25), rgba(255,46,136,0.18), rgba(0,240,255,0.12));
  opacity: 0.15;
  pointer-events: none;
}
.brand-v2 .brand-link::after,
.brand-v3 .brand-link::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(0,240,255,0.6), rgba(255,46,136,0.55), transparent);
  opacity: 0.35;
  filter: blur(0.2px);
  transform-origin: left;
}
.brand-v2 .brand-link:hover::before,
.brand-v3 .brand-link:hover::before { opacity: 0.26; }
.brand-v2 .brand-link:hover::after,
.brand-v3 .brand-link:hover::after { opacity: 0.75; animation: brandSweep 900ms ease both; }

.brand-v2 .brand-mark,
.brand-v3 .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(24px 24px at 30% 30%, rgba(0,240,255,0.22), transparent 65%),
    radial-gradient(28px 28px at 70% 70%, rgba(255,46,136,0.18), transparent 70%),
    rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.25),
    0 0 30px rgba(0,240,255,0.08),
    0 0 34px rgba(255,46,136,0.06);
  overflow: hidden;
}
.brand-v2 .brand-mark::before,
.brand-v3 .brand-mark::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    linear-gradient(90deg, transparent 0, rgba(255,255,255,0.08) 45%, transparent 60%);
  transform: rotate(25deg);
  opacity: 0.0;
}
.brand-v2 .brand-mark::after,
.brand-v3 .brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 10px 10px;
  opacity: 0.12;
  pointer-events: none;
}
.brand-v2 .brand-mark-inner,
.brand-v3 .brand-mark-inner {
  font-family: var(--mono);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 14px;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
  text-shadow:
    0 0 10px rgba(0,240,255,0.22),
    0 0 14px rgba(255,46,136,0.12);
}
.brand-v2 .brand-link:hover .brand-mark::before,
.brand-v3 .brand-link:hover .brand-mark::before {
  opacity: 0.75;
  animation: brandScan 900ms ease both;
}

.brand-v2 .brand-text,
.brand-v3 .brand-text { display: inline-flex; flex-direction: column; line-height: 1.05; }
.brand-v2 .brand-wordmark,
.brand-v3 .brand-wordmark {
  font-family: var(--mono);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 16px;
  position: relative;
  display: inline-flex;
  gap: 0;
}
.brand-v2 .brand-wordmark::before,
.brand-v2 .brand-wordmark::after,
.brand-v3 .brand-wordmark::before,
.brand-v3 .brand-wordmark::after {
  content: attr(aria-label);
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0.0;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: blur(0.2px);
}
.brand-v2 .brand-link:hover .brand-wordmark::before,
.brand-v3 .brand-link:hover .brand-wordmark::before {
  opacity: 0.75;
  color: var(--cyan);
  transform: translate(1px, -1px);
  animation: brandGlitch 600ms ease both;
}
.brand-v2 .brand-link:hover .brand-wordmark::after,
.brand-v3 .brand-link:hover .brand-wordmark::after {
  opacity: 0.75;
  color: var(--pink);
  transform: translate(-1px, 1px);
  animation: brandGlitch 600ms ease both reverse;
}
.brand-v2 .wm-game,
.brand-v3 .wm-game { color: rgba(224,224,224,0.96); }
.brand-v2 .wm-swap,
.brand-v3 .wm-swap {
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(0,240,255,0.25);
}
.brand-v2 .brand-sub,
.brand-v3 .brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

@keyframes brandScan {
  0% { transform: translateX(-25%) rotate(25deg); }
  100% { transform: translateX(25%) rotate(25deg); }
}
@keyframes brandSweep {
  0% { transform: scaleX(0.2); filter: blur(0.6px); }
  100% { transform: scaleX(1); filter: blur(0.0px); }
}
@keyframes brandGlitch {
  0% { clip-path: inset(0 0 0 0); }
  25% { clip-path: inset(0 0 55% 0); }
  50% { clip-path: inset(35% 0 0 0); }
  75% { clip-path: inset(10% 0 35% 0); }
  100% { clip-path: inset(0 0 0 0); }
}

/* Brand v3: terminal cursor + rare flicker */
.brand-v3 .brand-wordmark .wm-swap::after {
  content: " ▋";
  display: inline-block;
  color: rgba(224,224,224,0.85);
  margin-left: 2px;
  transform: translateY(-1px);
  animation: brandCursor 900ms steps(1, end) infinite;
  text-shadow: 0 0 14px rgba(0,240,255,0.18);
}
.brand-v3 .brand-link {
  animation: brandFlicker 11s infinite;
}
.brand-v3 .brand-mark-inner {
  animation: brandMicroJitter 7s infinite;
}

@keyframes brandCursor {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}
@keyframes brandFlicker {
  0%, 92% { opacity: 1; filter: none; }
  93% { opacity: 0.78; filter: saturate(130%) contrast(1.05); }
  93.5% { opacity: 1; }
  96% { opacity: 1; }
  96.4% { opacity: 0.86; filter: saturate(140%) contrast(1.08); }
  96.7% { opacity: 1; }
  100% { opacity: 1; filter: none; }
}
@keyframes brandMicroJitter {
  0%, 97% { transform: translate(0, 0); }
  97.4% { transform: translate(0.4px, -0.3px); }
  97.8% { transform: translate(-0.4px, 0.2px); }
  98.2% { transform: translate(0, 0); }
  100% { transform: translate(0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-v3 .brand-link,
  .brand-v3 .brand-mark-inner,
  .brand-v3 .brand-wordmark .wm-swap::after {
    animation: none !important;
  }
}

.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav a { color: var(--text); text-decoration: none; opacity: 0.9; }
.nav a:hover { opacity: 1; color: var(--cyan); text-shadow: 0 0 16px rgba(0,240,255,0.35); }

.container {
  width: 1280px;
  max-width: calc(100% - 48px);
  margin: 24px auto 64px;
}

.footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 18px 0;
  background: rgba(10,12,15,0.75);
  backdrop-filter: blur(10px);
}
.footer-inner {
  width: 1280px;
  max-width: calc(100% - 48px);
  margin: 0 auto;
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2), 0 20px 60px rgba(0,0,0,0.55);
}
.panel.glass {
  background: var(--surface2);
  backdrop-filter: blur(14px);
}

.panel-title {
  font-family: var(--mono);
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-size: 12px;
}

.cats { display: grid; gap: 8px; }
.cat a { color: var(--text); text-decoration: none; }
.cat a:hover { color: var(--cyan); }

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,0.07);
}
.alert-ok { background: rgba(45,255,155,0.07); border-color: rgba(45,255,155,0.25); }
.alert-err { background: rgba(255,59,59,0.06); border-color: rgba(255,59,59,0.25); }

.title { font-family: var(--mono); font-size: 44px; margin: 0 0 10px; }
.h2 { font-family: var(--mono); letter-spacing: 0.04em; margin: 0 0 12px; }
.accent { color: var(--cyan); text-shadow: 0 0 18px rgba(0,240,255,0.4); }
.lead { color: var(--muted); margin: 0 0 18px; line-height: 1.55; }

.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 18px; align-items: start; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.section { margin-top: 22px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(20,24,28,0.62);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(0,240,255,0.22);
  box-shadow: 0 0 0 1px rgba(0,240,255,0.12), 0 18px 50px rgba(0,0,0,0.55);
}

.card-media { display: block; height: 170px; background: rgba(0,0,0,0.25); }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(115%) contrast(1.05); }
.media-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.55);
  background: radial-gradient(400px 240px at 50% 20%, rgba(0,240,255,0.16), transparent 55%),
              radial-gradient(420px 260px at 30% 80%, rgba(255,46,136,0.14), transparent 60%),
              rgba(0,0,0,0.2);
}
.media-placeholder.big { height: 260px; }

.card-body { padding: 14px; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--cyan); }
.card-meta { display: flex; gap: 10px; align-items: center; margin-top: 8px; color: var(--muted); font-size: 13px; }
.card-bottom { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.price { font-family: var(--mono); color: var(--text); }
.price.big { font-size: 26px; }

.btn {
  border: 0;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--text);
  background: rgba(255,255,255,0.06);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(90deg, rgba(0,240,255,0.18), rgba(255,46,136,0.18));
  box-shadow: 0 0 0 1px rgba(0,240,255,0.22), 0 0 28px rgba(0,240,255,0.12);
}
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(255,46,136,0.22), 0 0 34px rgba(255,46,136,0.12); }

.btn-ghost {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.inline { display: inline; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.form { display: grid; gap: 12px; }
.form.row { display: flex; }
.field { display: grid; gap: 6px; }
.field span { color: var(--muted); font-size: 13px; }

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  outline: none;
  background: rgba(0,0,0,0.26);
  color: var(--text);
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(0,240,255,0.35);
  box-shadow: 0 0 0 3px rgba(0,240,255,0.08);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  font-size: 12px;
}
.tag-accent {
  border-color: rgba(0,240,255,0.25);
  box-shadow: 0 0 18px rgba(0,240,255,0.12);
}

.link { color: var(--cyan); text-decoration: none; }
.link:hover { text-shadow: 0 0 18px rgba(0,240,255,0.35); }

.muted { color: var(--muted); }
.sep { height: 1px; background: rgba(255,255,255,0.06); margin: 14px 0; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 14px; }
.kv .k { color: var(--muted); }
.kv .v { color: var(--text); }

.table { display: grid; gap: 8px; }
.tr { display: grid; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,0.18); border: 1px solid rgba(255,255,255,0.06); }
.cols-4 { grid-template-columns: 80px 1fr 140px 120px; }
.cols-5 { grid-template-columns: 80px 1fr 160px 120px 120px; }
.cols-6 { grid-template-columns: 80px 1fr 120px 120px 120px 120px; }
.tr.th { background: rgba(255,255,255,0.03); color: var(--muted); font-size: 13px; }

.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { padding: 8px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.18); }

.badge-iron { border-color: rgba(200,200,200,0.22); }
.badge-gold { border-color: rgba(255,215,0,0.26); box-shadow: 0 0 22px rgba(255,215,0,0.08); }
.badge-plat { border-color: rgba(180,240,255,0.28); box-shadow: 0 0 22px rgba(180,240,255,0.08); }
.badge-neon { border-color: rgba(255,46,136,0.28); box-shadow: 0 0 26px rgba(255,46,136,0.10); }

.product-head { display: grid; grid-template-columns: 420px 1fr; gap: 16px; align-items: start; }
.product-media img { width: 100%; height: 260px; object-fit: cover; border-radius: 14px; border: 1px solid rgba(255,255,255,0.06); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

.text { color: var(--text); line-height: 1.6; }

.chat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.chat-log {
  height: 420px;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  background: rgba(0,0,0,0.22);
}
.chat-msg { margin-bottom: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.03); }
.chat-msg.me { border-color: rgba(0,240,255,0.22); }
.chat-msg .meta { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.chat-msg .text { white-space: pre-wrap; }
.chat-form { display: grid; grid-template-columns: 1fr 220px 160px; gap: 10px; margin-top: 12px; }

.code {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,240,255,0.18);
  background: rgba(0,0,0,0.25);
  overflow: auto;
}

@media (max-width: 1320px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .product-head { grid-template-columns: 1fr; }
  .cols-6 { grid-template-columns: 80px 1fr 120px 120px; }
  .cols-5 { grid-template-columns: 80px 1fr 120px 120px; }
  .cols-4 { grid-template-columns: 80px 1fr; }
  .chat-form { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}
