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

:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --accent: #6c5ce7;
    --accent-hover: #5a4bd1;
    --border: #e5e7eb;
    --radius: 12px;
}

[data-theme="dark"] {
    --bg: #121212;
    --surface: #1e1e1e;
    --text: #e4e4e7;
    --text-muted: #9ca3af;
    --accent: #a78bfa;
    --accent-hover: #8b6ff0;
    --border: #2e2e2e;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}

.search-form {
    flex: 1;
    max-width: 500px;
}

.search-form input {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s;
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--accent);
}

.search-form input:focus {
    border-color: var(--accent);
}

/* Layout */
.layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
}

.categories-nav h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.categories-nav ul {
    list-style: none;
}

.categories-nav li a {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.categories-nav li a:hover {
    color: var(--accent);
}

.categories-nav .count {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Content */
.section {
    margin-bottom: 2.5rem;
}

.section h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.section-desc {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Emoji grid */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.emoji-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.15s, box-shadow 0.15s;
}

.emoji-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.emoji-card img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.emoji-name {
    font-size: 0.8rem;
    color: var(--text);
    word-break: break-word;
}

.emoji-downloads {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.btn-download {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 0.75rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-download:hover {
    background: var(--accent-hover);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state code {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
}

/* Prose (about, privacy) */
.prose {
    max-width: 700px;
}

.prose h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.prose p, .prose ol, .prose ul {
    margin-bottom: 0.75rem;
}

.prose ol, .prose ul {
    padding-left: 1.5rem;
}

.prose a {
    color: var(--accent);
}

/* Ad slots */
.ad-slot {
    text-align: center;
}

.ad-slot--banner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1.5rem;
}

.ad-slot--sidebar {
    margin-top: 2rem;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    margin-top: 2rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer nav {
    display: flex;
    gap: 1.5rem;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer a:hover {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .categories-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .categories-nav li a {
        padding: 0.3rem 0.7rem;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 50px;
        font-size: 0.8rem;
    }

    .categories-nav .count {
        display: none;
    }
}
