:root {
  --bg: #0b0b0d;
  --bg-2: #111114;
  --card: #17171b;
  --line: #2a2a31;
  --text: #f4f4f5;
  --muted: #9a9aa3;
  --accent: #f5c518;
  --accent-2: #e0a800;
  --gold: #f5c518;
  --radius: 12px;
  --font: "Outfit", "Segoe UI", sans-serif;
  --shadow: 0 16px 40px rgba(0,0,0,.35);
}

body.theme-ember { --accent: #f5c518; --accent-2: #e0a800; --gold: #f5c518; }
body.theme-sakura { --accent: #ff7eb3; --accent-2: #e25d93; --gold: #ffc48a; }
body.theme-alpine { --accent: #3ddc84; --accent-2: #2aa86a; --gold: #e2b13c; }
body.theme-legends { --accent: #7cba4c; --accent-2: #5a9e3f; --gold: #e6b422; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  background: radial-gradient(900px 280px at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%), #0b0b0d;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }

.container { width: min(1180px, calc(100% - 28px)); margin: 0 auto; }
.muted { color: var(--muted); }
.pixel { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 800; }

.ticker {
  background: var(--accent);
  color: #111;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .02em;
  padding: 8px 16px;
  text-align: center;
}

.mc-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,11,13,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.mc-nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.mc-brand-ip { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .04em; }
.brand img { width: 34px; height: 34px; }

.ip-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #1a1a1f;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}
.ip-chip small { color: var(--accent); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.ip-chip [data-copy-status] { color: var(--muted); font-size: 11px; font-weight: 700; }
.ip-chip:hover, .ip-chip.copied { border-color: var(--accent); }

.nav-links { display: flex; gap: 16px; align-items: center; color: var(--muted); flex-wrap: wrap; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-toggle { display: none; background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px 12px; }

.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #1a1a1f;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  font-weight: 700;
}
.user-chip img { width: 28px; height: 28px; border-radius: 8px; image-rendering: pixelated; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer; font-weight: 800;
}
.btn-primary { background: var(--accent); color: #111; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-danger { background: #e85d6c; color: #fff; }

.page-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  padding: 22px 0 48px;
  align-items: start;
}
.page-main { min-width: 0; }

.hero-mc {
  text-align: center;
  padding: 48px 24px 28px;
  margin-bottom: 18px;
}
.hero-mc h1 {
  margin: 10px 0 8px;
  font-size: clamp(40px, 8vw, 72px);
  letter-spacing: .08em;
  font-weight: 800;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; justify-content: center; }
.online-pill {
  display: inline-flex; gap: 8px; align-items: center;
  background: #1a1a1f; color: var(--accent); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 13px;
  border: 1px solid var(--line);
}
.online-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: block; }
.trust-row { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 16px; }

.store-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.product-card, .card, .widget, .preview {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.product-card, .card { padding: 16px; }
.product-card h3, .card h3 { margin: 0 0 8px; }
.product-card img.thumb { width: 100%; height: 120px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
.price-tag { color: var(--gold); font-weight: 800; font-size: 18px; }

.compare-wrap {
  background: #fff;
  color: #222;
  border-radius: 16px;
  overflow: auto;
  margin: 18px 0;
}
.compare-wrap table { width: 100%; border-collapse: collapse; min-width: 720px; }
.compare-wrap th, .compare-wrap td { padding: 12px 10px; border-bottom: 1px solid #eee; text-align: center; }
.compare-wrap th:first-child, .compare-wrap td:first-child { text-align: left; font-weight: 700; color: #333; }
.compare-head { background: #fafafa; }
.compare-name { font-size: 22px; font-weight: 800; letter-spacing: .04em; }
.compare-buy { display: inline-block; border-radius: 8px; padding: 8px 12px; font-weight: 800; color: #fff; margin: 6px 0; }
.compare-ok { color: #22c55e; font-weight: 800; }
.compare-no { color: #d4d4d8; font-weight: 800; }
.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 16px; }
.cat-tabs a { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.cat-tabs a.active { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 800; }

.widget { padding: 14px; margin-bottom: 14px; }
.widget h3 { margin: 0 0 12px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.widget-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.widget-row:last-child { border-bottom: 0; }
.widget-row img { width: 28px; height: 28px; border-radius: 6px; image-rendering: pixelated; }
.widget-row b { display: block; font-size: 13px; }
.widget-row span { color: var(--muted); font-size: 12px; }
.rank { margin-left: auto; font-weight: 800; color: var(--gold); font-size: 12px; }
.rank.top-1 { color: #f5d76e; } .rank.top-2 { color: #cfd8e3; } .rank.top-3 { color: #d49a6a; }

.profile-hero { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; }
.profile-hero img.body { image-rendering: pixelated; height: 160px; width: auto; }
.chest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.chest-item { text-align: center; padding: 14px; }
.chest-item img { width: 64px; height: 64px; object-fit: contain; margin: 0 auto 8px; image-rendering: pixelated; }
.chest-item .st { font-size: 12px; color: var(--muted); }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.section { padding: 8px 0 18px; }
.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-ok { background: #163224; border-color: #2f6a48; }
.alert-err { background: #3a1820; border-color: #7a3140; }
.alert-info { background: #182433; border-color: #35506e; }

.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.form input, .form textarea, .form select {
  background: #12161d; border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 11px 12px;
}
.help { background: #12161d; border: 1px dashed var(--line); border-radius: 10px; padding: 12px; font-size: 13px; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; font-size: 14px; }

.footer { border-top: 1px solid var(--line); padding: 36px 0 28px; color: var(--muted); background: #09090b; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 20px; }
.footer a:hover { color: var(--text); }

.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); padding: 18px 14px; background: #141418; }
.sidebar a, .sidebar form button {
  display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--muted);
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
}
.sidebar a:hover { background: #1d1d22; color: var(--text); }
.app-main { padding: 22px; }
.auth-wrap { min-height: 70vh; display: grid; place-items: center; padding: 40px 0; }
.auth-card { width: min(420px, 100%); padding: 22px; }

@media (max-width: 980px) {
  .page-with-sidebar, .store-grid, .grid-3, .grid-2, .app-shell, .profile-hero, .footer-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; inset: 62px 14px auto; background: #151518; border: 1px solid var(--line); padding: 14px; border-radius: 14px; }
  .nav-toggle { display: block; }
  .mc-brand-ip { flex: 1; }
}
