/* ShelfLife — Spotlight design system: tokens, reset, nav, buttons, chips, toasts */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0e;
  --bg-2: #0b0b10;
  --surface: #141419;
  --surface-2: #16161c;
  --surface-3: #1e1e26;
  --line: rgba(255,255,255,.07);
  --line-strong: rgba(255,255,255,.14);
  --border: #26262f;
  --border-2: #2a2a35;

  --accent: #5b9dff;
  --accent-deep: #3f7fe6;
  --accent-soft: #7fb0ff;
  --accent-dim: rgba(91,157,255,.12);
  --accent-line: rgba(91,157,255,.3);
  --accent-glow: rgba(63,127,230,.45);

  --text: #f2f2f8;
  --text-2: #e2e2ec;
  --text-secondary: #9898b0;
  --text-muted: #6a6a82;
  --text-faint: #6f6f88;

  --gold: #e2b64a;
  --steam: #7ec8e3;
  --green: #34d399;
  --red: #f87171;

  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: Manrope, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --radius: 13px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --card-w: 232px;
  --gutter: 26px;
}

html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-soft); }
button { font-family: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Type helpers ── */
.mono { font-family: var(--font-mono); }
.kicker {
  font: 700 11px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--accent);
}

/* ── Nav (frosted) ── */
.nav {
  display: flex; align-items: center; gap: 12px;
  padding: 14px var(--gutter);
  background: rgba(16,16,20,.55);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.nav-logo { display: flex; align-items: center; gap: 10px; color: var(--text); }
.nav-logo:hover { color: var(--text); }
.nav-logo-svg { width: 30px; height: 26px; color: var(--accent); flex-shrink: 0; transition: filter .2s; }
.nav-logo:hover .nav-logo-svg { filter: drop-shadow(0 0 8px rgba(91,157,255,.6)); }
.nav-logo-text { font: 700 18px var(--font-display); letter-spacing: -.01em; }
.nav-crumb {
  font: 600 11px var(--font-mono); color: var(--text-faint); letter-spacing: .04em; text-transform: uppercase;
  margin-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.nav-link, .nav-refresh-btn {
  background: none; border: none; cursor: pointer; padding: 0;
  font: 600 12px var(--font-body); color: var(--text-secondary); transition: color .15s;
}
.nav-link:hover, .nav-refresh-btn:hover { color: var(--text); }
.nav-refresh-btn:disabled { opacity: .5; cursor: default; }
.nav-avatar {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 2px solid rgba(91,157,255,.5); background: linear-gradient(135deg,#3f6fd6,#7a4fd6);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; border-radius: 10px; white-space: nowrap;
  font: 700 13px var(--font-display); color: #fff; padding: 11px 24px;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  box-shadow: 0 8px 22px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px var(--accent-glow); color: #fff; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-steam {
  font: 600 13px var(--font-body); color: #dfe6ee;
  background: rgba(27,40,56,.7); border: 1px solid rgba(120,150,175,.4);
  backdrop-filter: blur(6px);
}
.btn-steam:hover { background: rgba(38,58,80,.85); color: #fff; border-color: rgba(140,175,200,.6); }
.btn-ghost {
  font: 600 13px var(--font-body); color: var(--text-secondary);
  background: transparent; border: 1px solid var(--border-2); padding: 10px 18px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--line-strong); }
.btn-ghost.danger:hover { color: var(--red); border-color: var(--red); }
.btn-outline {
  font: 600 12px var(--font-body); color: var(--text-secondary);
  background: var(--surface-2); border: 1px solid var(--border); padding: 7px 14px; border-radius: 8px;
}
.btn-outline:hover { color: var(--text); border-color: var(--accent-line); }
.btn-taste {
  font: 600 12px var(--font-body); color: var(--green);
  background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.32); border-radius: 8px; padding: 6px 12px 6px 9px;
}
.btn-taste:hover { background: rgba(16,185,129,.15); border-color: rgba(16,185,129,.5); color: var(--green); }
.btn-taste svg { width: 20px; height: 17px; }

/* ── Mono chips (stat readouts) ── */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font: 600 11px var(--font-mono); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap;
  color: var(--text-secondary); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 7px; padding: 4px 9px;
}
.chip--glass { color: #c7c7d6; background: rgba(255,255,255,.07); border-color: var(--line-strong); }
.chip--gold { color: var(--gold); background: rgba(212,160,23,.14); border-color: rgba(212,160,23,.3); }
.chip--steam { color: var(--steam); background: rgba(126,200,227,.12); border-color: rgba(126,200,227,.3); }
.chip--green { color: var(--green); background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.3); }
.chip--accent { color: var(--accent-soft); background: var(--accent-dim); border-color: var(--accent-line); }
.chip--sale { color: #fff; background: linear-gradient(180deg,#22c55e,#15803d); border-color: rgba(34,197,94,.6); }

/* ── Shelf Score tiers ── */
.tier--top  { --tier: #34d399; --tier-bg: rgba(16,185,129,.16); --tier-bd: rgba(16,185,129,.42); }
.tier--high { --tier: #4ade80; --tier-bg: rgba(34,197,94,.13);  --tier-bd: rgba(34,197,94,.36); }
.tier--mid  { --tier: #f5c34b; --tier-bg: rgba(234,179,8,.13);  --tier-bd: rgba(234,179,8,.36); }
.tier--low  { --tier: #fb923c; --tier-bg: rgba(249,115,22,.13); --tier-bd: rgba(249,115,22,.36); }
.tier--none { --tier: #f87171; --tier-bg: rgba(239,68,68,.13);  --tier-bd: rgba(239,68,68,.36); }
.score-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font: 700 12px var(--font-mono); color: var(--tier, var(--text-secondary));
  background: var(--tier-bg, var(--surface-2)); border: 1px solid var(--tier-bd, var(--border));
  border-radius: 8px; padding: 3px 8px 3px 6px;
  backdrop-filter: blur(8px);
}
.score-badge svg { width: 14px; height: 12px; flex-shrink: 0; }

/* ── Reason chips ── */
.reason-chip {
  display: inline-block; font: 600 11.5px var(--font-body); color: var(--accent-soft);
  background: var(--accent-dim); border: 1px solid var(--accent-line); border-radius: 20px;
  padding: 4px 12px; white-space: nowrap; overflow: hidden; max-width: min(100%, 260px);
}
.reason-chip::before { content: '✦ '; }

/* Scrolling text inside a chip that overflows */
.scroll-inner { display: inline-block; white-space: nowrap; }
.scroll-active .scroll-inner { animation: sl-tag-scroll var(--tag-scroll-duration, 5s) linear infinite; }
@keyframes sl-tag-scroll {
  0%, 15%  { transform: translateX(0); }
  70%, 85% { transform: translateX(var(--tag-scroll-dist)); }
  99%      { transform: translateX(var(--tag-scroll-dist)); }
  100%     { transform: translateX(0); }
}

/* ── Toasts ── */
#toast-container {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 3000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
  background: var(--surface); border: 1px solid var(--border-2); border-left: 3px solid var(--red);
  border-radius: 10px; padding: 10px 16px; font: 500 13px var(--font-body); color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,.5); max-width: min(90vw, 420px);
  opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast--ok { border-left-color: var(--green); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 700px) {
  :root { --gutter: 16px; }
  .nav { padding: 12px var(--gutter); gap: 9px; }
  .nav-logo-text { font-size: 16px; }
  .nav-crumb { display: none; }
  .nav-actions { gap: 12px; }
  .nav-link { display: none; }
}
