:root {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1f2630;
  --border: #2a323d;
  --text: #e6edf3;
  --text-dim: #9aa6b2;
  --accent: #58a6ff;
  --ok: #57c98a;
  --code: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font:
    15px/1.55 -apple-system,
    BlinkMacSystemFont,
    "Hiragino Sans",
    "Yu Gothic UI",
    "Noto Color Emoji",
    "Apple Color Emoji",
    system-ui,
    sans-serif;
}

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

header {
  margin-bottom: 18px;
}

h1 {
  font-size: 28px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0;
  color: var(--text-dim);
  max-width: 720px;
}

.lede strong {
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--code);
  font-size: 12.5px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}

/* ────────── search ────────── */

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

#search {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 44px 12px 16px;
  border-radius: 8px;
  font: inherit;
  font-size: 17px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

#search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.hint {
  position: absolute;
  right: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--code);
  font-size: 11px;
  color: var(--text-dim);
  pointer-events: none;
  display: none;
}

#search:not(:focus):placeholder-shown + .hint {
  display: inline-block;
}

.status-row {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
  color: var(--text-dim);
}

.copied {
  color: var(--ok);
  font-weight: 500;
  font-family: var(--code);
}

/* ────────── results ────────── */

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

.emoji-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 8px 8px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.08s, border-color 0.12s, box-shadow 0.12s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.emoji-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.emoji-card:active {
  transform: translateY(0);
}

.emoji-card.copied-flash {
  border-color: var(--ok);
  box-shadow: 0 0 0 1px var(--ok);
}

.emoji-glyph {
  font-size: 38px;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji",
    "Twemoji Mozilla", sans-serif;
}

.emoji-name {
  font-size: 11.5px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.2;
  margin-top: 2px;
}

.emoji-tags {
  font-size: 10.5px;
  color: var(--text-dim);
  font-family: var(--code);
  line-height: 1.3;
  word-break: break-all;
  min-height: 14px;
}

.category-header {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 12px 0 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.category-header:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 16px;
  color: var(--text-dim);
  font-size: 14px;
}

/* ────────── footer ────────── */

footer {
  margin-top: 24px;
  font-size: 12.5px;
  color: var(--text-dim);
}

footer p {
  margin: 4px 0;
}
