@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #14171f;
  --muted: #6b7484;
  --faint: #aab2c0;
  --line: #e9edf3;
  --accent: #2f6fed;
  --accent-2: #4f8bff;
  --accent-soft: #eaf1fe;
  --money: #1f9d57;
  --gold1: #ffd75e; --gold2: #f5a623; --gold-deep: #8a5a00;
  --promo1: #9a7bff; --promo2: #6d4bff;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20,30,60,.04), 0 6px 20px rgba(20,30,60,.06);
  --shadow-h: 0 8px 28px rgba(40,60,120,.14);
  --maxw: 680px;
  --font: 'Manrope', -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text);
  padding-bottom: 48px; font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
svg { display: block; flex: none; }
a { text-decoration: none; color: inherit; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

header { position: sticky; top: 0; z-index: 5; background: rgba(243,245,249,.82); backdrop-filter: blur(12px); padding: 12px 0 8px; }
.tabs { display: flex; gap: 4px; background: #e6eaf1; padding: 5px; border-radius: 14px; }
.tab { flex: 1; padding: 10px; border: none; border-radius: 10px; background: transparent;
  color: var(--muted); font-size: 14px; font-weight: 700; font-family: inherit; transition: .18s; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

main { padding-top: 14px; }
.view { display: none; } .view.active { display: block; }
.filter { display: flex; gap: 8px; margin-bottom: 14px; }
.chip { padding: 8px 15px; border-radius: 22px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); font-size: 13px; font-weight: 600; font-family: inherit; transition: .15s; }
.chip:hover { border-color: #cfd6e2; }
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }

.list { display: flex; flex-direction: column; gap: 12px; }
.item { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; cursor: pointer; }
.item:hover { transform: translateY(-2px); box-shadow: var(--shadow-h); }
.item.boosted { border: 1px solid #d9ccff; box-shadow: 0 0 0 1px #d9ccff, var(--shadow); }
.item.boosted::before, .item.champion::before {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; }
.item.boosted::before { background: linear-gradient(180deg, var(--promo1), var(--promo2)); }
.item.champion { border: 1px solid #f4cf7a; background: linear-gradient(180deg, #fffaf0, #fff);
  box-shadow: 0 0 0 1px #f4cf7a, 0 10px 30px rgba(245,166,35,.18); }
.item.champion::before { background: linear-gradient(180deg, var(--gold1), var(--gold2)); }

.head { display: flex; align-items: flex-start; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 18px; flex: none; background-size: cover; background-position: center; }
.head .info { flex: 1; min-width: 0; }
.head h4 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.submeta { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.typechip { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.rating { display: inline-flex; align-items: center; gap: 4px; color: #b07d00; font-size: 13px; font-weight: 700; }
.rating.empty-r { color: var(--faint); font-weight: 500; }

.badge { position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 5px 10px; border-radius: 8px; }
.badge.gold { background: linear-gradient(135deg, var(--gold1), var(--gold2)); color: #5e3d00;
  box-shadow: 0 3px 10px rgba(245,166,35,.45); }
.badge.promo { background: linear-gradient(135deg, var(--promo1), var(--promo2)); color: #fff;
  box-shadow: 0 3px 10px rgba(109,75,255,.35); }
.badge.state { position: static; background: #eef1f6; color: var(--muted); font-weight: 700; letter-spacing: 0; }
.badge.state.on { background: #e3f7ec; color: #1f9d57; }

.price { color: var(--money); font-weight: 700; font-size: 14px; margin-top: 12px; }
.desc { color: var(--muted); font-size: 13.5px; margin-top: 8px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
img.cover { width: 100%; border-radius: 12px; margin-top: 10px; }

.row-btns { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
button { cursor: pointer; font-family: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 12px;
  font-size: 13.5px; font-weight: 700; font-family: inherit; padding: 10px 15px; border: 1px solid transparent; transition: .15s; }
.btn.primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; box-shadow: 0 4px 14px rgba(47,111,237,.3); }
.btn.primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(47,111,237,.38); }
.btn.ghost { background: var(--card); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: #c9d2e0; background: #fafbfd; }
.btn.ghost.muted { color: var(--muted); }
.btn.block { width: 100%; padding: 14px; font-size: 15px; }
.btn.sq { padding: 10px 12px; }

.empty { color: var(--muted); text-align: center; padding: 48px 0; }

.lead { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: default; }
.lead:hover { transform: none; box-shadow: var(--shadow); }
.lead .pos { width: 30px; display: flex; justify-content: center; align-items: center; font-weight: 800; color: var(--faint); }
.lead .who { flex: 1; font-weight: 700; }
.lead .sc { color: var(--muted); font-size: 12.5px; font-weight: 500; margin-top: 3px; display: flex; align-items: center; gap: 5px; }

.modal { position: fixed; inset: 0; background: rgba(15,22,40,.45); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.modal.hidden { display: none; }
.sheet { background: var(--card); width: 100%; max-width: 460px; border-radius: 20px; padding: 22px; max-height: 90vh; overflow: auto; box-shadow: 0 24px 70px rgba(15,22,40,.34); }
.sheet h3 { margin: 0 0 14px; font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.sheet input, .sheet textarea { width: 100%; background: #f6f8fc; border: 1px solid var(--line);
  color: var(--text); border-radius: 12px; padding: 12px; font-size: 15px; margin-bottom: 10px; font-family: inherit; transition: .15s; }
.sheet input:focus, .sheet textarea:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.sheet .row { display: flex; gap: 8px; } .sheet .row input { flex: 1; }
.sheet label { display: block; color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.sheet label input { margin-top: 5px; }
.seg { display: flex; gap: 8px; margin-bottom: 12px; }
.segbtn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px; border-radius: 12px; border: 1px solid var(--line); background: #f6f8fc; color: var(--muted); font-weight: 700; font-size: 14px; font-family: inherit; transition: .15s; }
.segbtn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.actions { display: flex; gap: 8px; margin-top: 8px; } .actions .btn { flex: 1; }
.file { display: inline-flex; align-items: center; gap: 8px; background: #f6f8fc; border: 1px dashed #cdd6e4; border-radius: 12px; padding: 11px 14px; color: var(--muted); font-size: 14px; font-weight: 600; }
.file input { display: none; }
#imgPreview img { max-width: 120px; border-radius: 10px; margin-top: 8px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 0 0 14px; }
.stars { display: flex; justify-content: center; gap: 10px; margin: 4px 0 16px; }
.stars span { cursor: pointer; transition: transform .1s; }
.stars span:hover { transform: scale(1.15); }
.stars span svg path { fill: #dfe4ec; transition: .1s; }
.stars span.on svg path { fill: var(--gold2); }
