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

:root {
  --white:   #ffffff;
  --bg:      #f5f5f0;
  --border:  #e1e4e8;
  --text:    #24292e;
  --muted:   #6a737d;
  --accent:  #0366d6;
  --hover:   #f1f8ff;
  --green:   #28a745;
  --radius:  8px;
}

body { font-family:'Inter',-apple-system,sans-serif; background:var(--bg); color:var(--text); font-size:14px; }
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:underline; }
.container { max-width:980px; margin:0 auto; padding:0 20px; }

/* ── Header ── */
.header {
  background:var(--white);
  border-bottom:1px solid var(--border);
  position:sticky; top:0; z-index:200;
  box-shadow:0 1px 3px rgba(0,0,0,.06);
}
.hdr {
  display:flex; align-items:center; gap:16px;
  padding:12px 0;
}
.logo {
  display:flex; align-items:center; gap:8px;
  color:var(--text); font-size:18px; text-decoration:none; white-space:nowrap;
}
.logo-emoji { font-size:24px; }

/* Search */
.search-wrap { flex:1; max-width:520px; position:relative; }
.search-icon { position:absolute; left:11px; top:50%; transform:translateY(-50%); color:var(--muted); font-size:13px; pointer-events:none; }
.search-input {
  width:100%; padding:9px 12px 9px 34px;
  border:1px solid var(--border); border-radius:20px;
  font-size:14px; background:var(--bg); outline:none;
  transition:all .15s;
}
.search-input:focus { background:var(--white); border-color:var(--accent); box-shadow:0 0 0 3px rgba(3,102,214,.12); }

/* Category Nav Pills */
.cat-nav {
  border-top:1px solid var(--border);
  overflow-x:auto; white-space:nowrap;
  scrollbar-width:none; padding:0;
}
.cat-nav::-webkit-scrollbar { display:none; }
.cat-nav .container {
  display:flex; gap:4px; padding:8px 20px;
}
.cat-pill {
  display:inline-flex; align-items:center; gap:4px;
  padding:5px 14px; border-radius:16px;
  border:1px solid var(--border); background:var(--white);
  color:var(--muted); font-size:12px; font-weight:500;
  white-space:nowrap; text-decoration:none;
  transition:all .15s; cursor:pointer;
}
.cat-pill:hover { background:var(--hover); border-color:var(--accent); color:var(--accent); text-decoration:none; }
.cat-pill.active { background:var(--accent); border-color:var(--accent); color:#fff; }

/* ── Hero ── */
.hero {
  background:var(--white);
  border-bottom:1px solid var(--border);
  padding:48px 0 36px; text-align:center;
}
.hero-eyebrow { font-size:12px; color:var(--muted); font-style:italic; margin-bottom:10px; }
.hero-title { font-size:clamp(28px,5vw,52px); font-weight:700; letter-spacing:-.02em; margin-bottom:10px; }
.hero-sub { color:var(--muted); font-size:15px; line-height:1.7; margin-bottom:28px; }
.hero-stats { display:flex; justify-content:center; gap:40px; flex-wrap:wrap; }
.hero-stat { display:flex; flex-direction:column; align-items:center; }
.hero-stat strong { font-size:22px; font-weight:700; color:var(--accent); }
.hero-stat span { font-size:12px; color:var(--muted); margin-top:2px; }

/* ── Main ── */
.main { padding:24px 0 60px; }

/* ── Category Section (homepage) ── */
.cat-section {
  background:var(--white);
  border:1px solid var(--border);
  border-radius:var(--radius);
  margin-bottom:16px;
  overflow:hidden;
}
.cat-section-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 20px 12px;
  border-bottom:1px solid var(--border);
  position:relative;
}
.cat-section-title {
  font-size:16px; font-weight:600;
  display:flex; align-items:center; gap:8px;
  position:absolute; left:50%; transform:translateX(-50%);
  white-space:nowrap;
}
.cat-icon { font-size:18px; }
.see-more-link { font-size:12px; color:var(--accent); font-weight:500; }
.see-more-link:hover { text-decoration:underline; }

/* ── Emoji Grid (homepage — 5 col like Slackmojis) ── */
.emoji-grid-home {
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  padding:6px 10px;
}

/* ── Emoji Grid (single cat / search page) ── */
.emoji-grid-page {
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:2px;
  margin-top:12px;
}

/* ── Emoji Card ── */
.emoji-card {
  display:flex; align-items:center; gap:10px;
  padding:8px 12px; cursor:pointer;
  border-radius:6px; transition:background .12s;
  min-width:0;
}
.emoji-card:hover { background:var(--hover); }
.emoji-card img {
  width:36px; height:36px;
  object-fit:contain; flex-shrink:0;
  border-radius:4px;
}
.emoji-name {
  font-size:12px; color:var(--muted);
  white-space:nowrap; overflow:hidden;
  text-overflow:ellipsis; flex:1;
}

/* ── See More Bar ── */
.see-more-bar {
  padding:10px 20px 12px;
  border-top:1px solid var(--border);
  text-align:center;
}
.see-more-btn {
  font-size:12px; color:var(--accent);
  font-weight:500; text-decoration:none;
}
.see-more-btn:hover { text-decoration:underline; }

/* ── Page Header (cat/search pages) ── */
.page-header {
  display:flex; align-items:center; flex-wrap:wrap;
  gap:10px; margin-bottom:16px; padding:16px 0 8px;
  border-bottom:1px solid var(--border);
}
.page-header h1 { font-size:20px; font-weight:700; }
.count-badge {
  background:var(--accent); color:#fff;
  padding:2px 10px; border-radius:10px;
  font-size:12px; font-weight:600;
}
.clear-btn {
  font-size:12px; color:var(--muted);
  background:var(--bg); border:1px solid var(--border);
  padding:4px 12px; border-radius:4px;
  margin-left:auto; text-decoration:none;
}
.clear-btn:hover { background:#e9ecef; text-decoration:none; }

/* ── Popular Searches ── */
.popular-searches {
  display:flex; flex-wrap:wrap; align-items:center;
  gap:8px; padding:20px 0 8px;
}
.ps-label { font-size:13px; color:var(--muted); font-weight:600; }
.ps-tag {
  padding:4px 14px; border-radius:14px;
  border:1px solid var(--border); background:var(--white);
  color:var(--muted); font-size:12px; text-decoration:none;
  transition:all .15s;
}
.ps-tag:hover { background:var(--accent); border-color:var(--accent); color:#fff; text-decoration:none; }

/* ── SEO Text ── */
.seo-text {
  background:var(--white); border:1px solid var(--border);
  border-radius:var(--radius); padding:24px 28px;
  margin-top:20px; color:var(--muted);
}
.seo-text h2 { font-size:16px; font-weight:600; color:var(--text); margin-bottom:8px; margin-top:16px; }
.seo-text h2:first-child { margin-top:0; }
.seo-text p { font-size:14px; line-height:1.7; }

/* ── Empty State ── */
.empty-state { text-align:center; padding:60px 20px; color:var(--muted); }
.empty-state p { font-size:17px; margin-bottom:16px; }
.btn-back { display:inline-block; padding:8px 20px; background:var(--accent); color:#fff; border-radius:6px; font-size:14px; text-decoration:none; }

/* ── Pagination ── */
.pagination { display:flex; justify-content:center; flex-wrap:wrap; gap:4px; margin-top:28px; }
.pg { padding:6px 12px; border-radius:4px; border:1px solid var(--border); background:var(--white); font-size:13px; color:var(--text); text-decoration:none; transition:all .12s; }
.pg:hover { background:var(--hover); text-decoration:none; }
.pg.active { background:var(--accent); border-color:var(--accent); color:#fff; }

/* ── Footer ── */
.footer { background:var(--white); border-top:1px solid var(--border); padding:28px 0; }
.footer-inner { text-align:center; }
.footer-logo { display:inline-flex; align-items:center; gap:8px; font-size:18px; color:var(--text); margin-bottom:8px; }
.footer-desc { color:var(--muted); font-size:13px; margin-bottom:6px; }
.footer-copy { color:var(--muted); font-size:12px; }
.footer-copy a { color:var(--muted); }
.footer-copy a:hover { color:var(--accent); }

/* ── Toast ── */
.toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%) translateY(60px); background:var(--green); color:#fff; padding:10px 24px; border-radius:6px; font-size:13px; font-weight:600; box-shadow:0 4px 12px rgba(0,0,0,.15); transition:transform .25s; pointer-events:none; z-index:999; }
.toast.show { transform:translateX(-50%) translateY(0); }

/* ── Responsive ── */
@media(max-width:700px) {
  .emoji-grid-home,
  .emoji-grid-page { grid-template-columns:repeat(2,1fr); }
  .hdr { flex-wrap:wrap; }
  .search-wrap { max-width:100%; }
  .hero { padding:28px 0; }
  .hero-stats { gap:20px; }
}
@media(min-width:701px) and (max-width:900px) {
  .emoji-grid-home,
  .emoji-grid-page { grid-template-columns:repeat(3,1fr); }
}
