:root {
  --bg: #050507;
  --bg-1: #0b0b10;
  --bg-2: #12121a;
  --line: #23232e;
  --line-soft: #1a1a22;
  --text: #f0f0f5;
  --text-dim: #9a9aa8;
  --text-faint: #64646f;
  --accent: #8b5cf6;
  --accent-dim: #6d43d6;
  --blue: #3b82f6;
  --win: #4ade80;
  --loss: #f87171;
  --gold: #fbbf24;
  --radius: 12px;
  --radius-sm: 8px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Inter', system-ui, sans-serif; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* splash + gate */
.splash, .gate { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: var(--bg); z-index: 100; }
.splash-mark, .logo-mark, .gate .splash-mark { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 34px; letter-spacing: -1px; }
.splash-mark span, .logo-mark span { color: var(--accent); }
.splash-bar { width: 120px; height: 2px; background: var(--line); border-radius: 1px; overflow: hidden; }
.splash-bar::after { content: ''; display: block; width: 40%; height: 100%; background: var(--accent); animation: slide 1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
.gate-card { text-align: center; max-width: 380px; padding: 20px; }
.gate-card h1 { font-family: 'Space Grotesk', sans-serif; font-size: 24px; margin: 16px 0 8px; }
.gate-card p { color: var(--text-dim); margin: 0 0 20px; line-height: 1.5; }

/* buttons + inputs */
.btn { font-family: inherit; font-weight: 600; font-size: 13px; border-radius: var(--radius-sm); border: 1px solid transparent; padding: 9px 16px; cursor: pointer; transition: background .15s, border-color .15s; text-decoration: none; display: inline-block; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dim); }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--line); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn-danger { background: transparent; color: var(--loss); border-color: rgba(248,113,113,.35); }
.in { background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 11px; font-family: inherit; font-size: 13px; }
.in:focus { outline: none; border-color: var(--accent); }
.in-sm { max-width: 120px; }

/* app shell */
.app { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line-soft); padding: 18px 14px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-mark { font-size: 22px; }
.logo-text { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 17px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item { display: flex; align-items: center; justify-content: space-between; background: none; border: none; color: var(--text-dim); font-family: inherit; font-size: 14px; font-weight: 500; padding: 9px 11px; border-radius: var(--radius-sm); cursor: pointer; text-align: left; }
.nav-item:hover { background: var(--bg-1); color: var(--text); }
.nav-item.active { background: var(--bg-2); color: var(--text); }
.nav-item kbd { font-family: var(--mono); font-size: 10px; color: var(--text-faint); background: var(--bg); border: 1px solid var(--line-soft); border-radius: 4px; padding: 1px 5px; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: var(--radius-sm); background: var(--bg-1); font-size: 12px; color: var(--text-dim); }
.sf-av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.sf-role { font-family: var(--mono); font-size: 10px; text-transform: uppercase; color: var(--gold); }

/* main + views */
.main { padding: 24px 26px 60px; max-width: 1500px; }
.view { display: none; }
.view.active { display: block; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.view-head h2 { font-family: 'Space Grotesk', sans-serif; font-size: 24px; margin: 0; }
.controls, .filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters { margin-bottom: 18px; }
.sub { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin: 0 0 10px; }

/* grid of skin cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.card { background: linear-gradient(180deg, var(--bg-1), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; transition: border-color .15s, transform .12s; position: relative; overflow: hidden; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-img { width: 100%; height: 120px; object-fit: contain; background: radial-gradient(circle at 50% 40%, rgba(139,92,246,.08), transparent 70%); border-radius: 6px; }
.card-name { font-size: 12.5px; font-weight: 600; margin: 8px 0 4px; line-height: 1.3; height: 32px; overflow: hidden; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.card-price { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.card-ref { font-size: 11px; color: var(--text-faint); text-decoration: line-through; }
.disc { position: absolute; top: 10px; right: 10px; font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 5px; background: rgba(74,222,128,.15); color: var(--win); }
.disc.neg { background: rgba(248,113,113,.12); color: var(--loss); }
.float-bar { height: 4px; border-radius: 2px; margin-top: 8px; background: linear-gradient(90deg, #4ade80 0 7%, #a3e635 7% 15%, #facc15 15% 38%, #fb923c 38% 45%, #f87171 45% 100%); position: relative; }
.float-bar .tick { position: absolute; top: -2px; width: 2px; height: 8px; background: #fff; box-shadow: 0 0 3px rgba(0,0,0,.8); border-radius: 1px; }
.float-val { font-family: var(--mono); font-size: 10px; color: var(--text-faint); margin-top: 4px; }
.card-cta { display: flex; gap: 6px; margin-top: 10px; }

/* stacks (watchlist) */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--bg-1); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); font-size: 13px; }
.stack-row .meta { color: var(--text-dim); font-size: 11px; }
.hit-thumb { width: 40px; height: 30px; object-fit: contain; }

/* compare */
.compare-out { max-width: 640px; }
.cmp-item { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cmp-item img { width: 64px; height: 48px; object-fit: contain; }
.cmp-table { width: 100%; border-collapse: collapse; }
.cmp-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.cmp-market { font-weight: 600; }
.cmp-price { font-family: var(--mono); text-align: right; }
.cmp-table tr.best td { background: rgba(74,222,128,.06); }
.cmp-table tr.best .cmp-price { color: var(--win); font-weight: 600; }
.cmp-link a { color: var(--accent); text-decoration: none; font-size: 12px; }

.panel-narrow { max-width: 560px; background: var(--bg-1); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px; }
.panel-narrow p { color: var(--text-dim); line-height: 1.6; font-size: 13px; }
.empty { color: var(--text-faint); padding: 40px 0; text-align: center; }

/* toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--bg-2); border: 1px solid var(--line); padding: 11px 18px; border-radius: var(--radius-sm); font-size: 13px; z-index: 200; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.toast.err { border-color: var(--loss); }
.toast.ok { border-color: var(--win); }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .nav { flex-direction: row; }
  .sidebar-foot { display: none; }
  .split { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .card:hover { transform: none; } .splash-bar::after { animation: none; width: 100%; } }
