/* ============================================================
   Quick Emoji — modern, friendly stylesheet
   ============================================================ */
:root {
    --accent: #5b6cff;
    --accent-dark: #4350e6;
    --accent-soft: #eef0ff;
    --bg: #f6f7fb;
    --card: #ffffff;
    --text: #1b1e2b;
    --muted: #6b7280;
    --line: #ececf3;
    --radius: 14px;
    --shadow-sm: 0 1px 2px rgba(20, 23, 40, .06), 0 1px 3px rgba(20, 23, 40, .05);
    --shadow-md: 0 8px 24px rgba(31, 38, 80, .10);
    --maxw: 1180px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
            "Malgun Gothic", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    overflow-x: hidden;
}

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

/* ---------- Header ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    text-align: center;
    padding: 14px 16px 16px;
}

.brand {
    display: inline-block;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.3px;
    color: var(--text);
    text-decoration: none;
}
.brand::before { content: "😀"; margin-right: 8px; }

.searchform { margin: 12px auto 0; max-width: 460px; }

.search-bar {
    width: 100%;
    padding: 13px 18px 13px 44px;
    font-size: 1rem;
    color: var(--text);
    background-color: #fff;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%239aa0ad" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>');
    background-repeat: no-repeat;
    background-position: left 14px center;
    background-size: 19px;
    border: 1px solid #dfe1ea;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    transition: border-color .15s, box-shadow .15s;
}
.search-bar::placeholder { color: #9aa0ad; }
.search-bar:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(91, 108, 255, .15);
}

.lang-switch {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: .85rem;
    color: var(--muted);
}
.lang-switch a { color: var(--accent); text-decoration: none; font-weight: 600; }
.lang-switch a:hover { text-decoration: underline; }
.lang-switch .lang-active { font-weight: 700; color: var(--text); }

#copyMessage {
    margin: 10px auto 0;
    display: inline-block;
    background: #18233a;
    color: #fff !important;
    font-size: .9rem;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 999px;
    box-shadow: var(--shadow-md);
}

/* ---------- Category nav ---------- */
.cat-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: var(--maxw);
    margin: 20px auto 4px;
    padding: 0 16px;
}
.cat-nav a {
    font-size: .9rem;
    font-weight: 600;
    padding: 8px 15px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #3a3f51;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform .12s, background .12s, color .12s, border-color .12s;
}
.cat-nav a:hover { transform: translateY(-1px); border-color: #d7dae6; }
.cat-nav a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Layout ---------- */
.container {
    display: flex;
    justify-content: center;
    gap: 24px;
    width: 100%;
    max-width: var(--maxw);
    margin: 8px auto 0;
    padding: 0 16px;
}

.sidebar {
    flex: 0 0 200px;
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-top: 8px;
}

.content { flex: 1 1 auto; min-width: 0; text-align: center; padding-bottom: 24px; }
.content > p { max-width: 760px; margin: 6px auto 18px; color: var(--muted); font-size: .98rem; }

/* ---------- Home emoji grid ---------- */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
    gap: 10px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 4px;
}
.emoji-item {
    font-size: 2.1rem;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border: 1px solid transparent;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    line-height: 1;
    color: inherit;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s;
}
.emoji-item:hover {
    transform: translateY(-3px) scale(1.04);
    border-color: #e3e5f0;
    box-shadow: var(--shadow-md);
}
.emoji-item:active { transform: translateY(-1px) scale(1.0); }

/* ---------- Cards / sections shared ---------- */
.detail { max-width: 820px; margin: 0 auto; padding: 0 16px 48px; text-align: center; }

.breadcrumb {
    max-width: var(--maxw);
    margin: 16px auto 0;
    padding: 0 18px;
    font-size: .85rem;
    color: var(--muted);
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Detail page ---------- */
.detail .hero {
    font-size: 5.5rem;
    line-height: 1;
    margin: 14px auto 0;
    width: 168px; height: 168px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #fff, #f1f3ff);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform .15s;
}
.detail .hero:hover { transform: translateY(-3px); }
.detail h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.4px; margin: 20px 0 14px; }

.copy-btn {
    font-size: 1.02rem;
    font-weight: 700;
    padding: 13px 30px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(91, 108, 255, .35);
    transition: transform .12s, background .12s, box-shadow .12s;
}
.copy-btn:hover { background: var(--accent-dark); transform: translateY(-2px); }
.copy-btn:active { transform: translateY(0); }

.detail .meta-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 28px 0;
    text-align: left;
    font-size: .93rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.detail .meta-table th, .detail .meta-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); }
.detail .meta-table tr:last-child th, .detail .meta-table tr:last-child td { border-bottom: none; }
.detail .meta-table th { width: 36%; color: var(--muted); font-weight: 600; background: #fafbff; }
.detail .meta-table code { background: var(--accent-soft); color: var(--accent-dark); padding: 2px 7px; border-radius: 6px; font-size: .9em; }

.detail .section { text-align: left; margin-top: 30px; }
.detail .section h2 { font-size: 1.18rem; font-weight: 700; margin-bottom: 8px; }
.detail .section p { color: #3a3f51; }

/* ---------- Skin-tone selector ---------- */
.tone-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.tone {
    font-size: 1.9rem; line-height: 1;
    padding: 9px 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .12s, box-shadow .12s;
}
.tone:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---------- Link grids (category + related) ---------- */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
    max-width: var(--maxw);
    margin: 18px auto 0;
    padding: 0 4px;
}
.emoji-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #3a3f51;
    padding: 14px 6px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform .12s, box-shadow .12s, border-color .12s;
}
.emoji-link:hover { transform: translateY(-3px); border-color: #e3e5f0; box-shadow: var(--shadow-md); }
.emoji-link .ch { font-size: 2.3rem; line-height: 1; }
.emoji-link .nm { font-size: .72rem; color: var(--muted); text-align: center; line-height: 1.25; }

/* ---------- Ads ---------- */
.ad-block { width: 100%; min-height: 1px; }
.ad-inline { margin: 30px auto; text-align: center; max-width: 760px; }
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* ---------- Footer ---------- */
.footer {
    max-width: var(--maxw);
    margin: 40px auto 0;
    width: calc(100% - 32px);
    background: var(--card);
    color: #3a3f51;
    font-size: .92rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 28px;
    box-shadow: var(--shadow-sm);
}
.footer h2 { font-size: 1.2rem; margin: 0 0 8px; color: var(--text); }
.footer h3 { font-size: 1.02rem; margin: 20px 0 6px; color: var(--text); }
.footer p { line-height: 1.7; margin: 0 0 6px; }
.footer .copyright { margin-top: 22px; color: var(--muted); font-size: .85rem; }

.footer-links { text-align: center; padding: 22px 12px 34px; font-size: .85rem; }
.footer-links a { color: var(--muted); text-decoration: none; margin: 0 10px; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Privacy / article ---------- */
.policy { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
          padding: 28px 30px; box-shadow: var(--shadow-sm); }
.policy h1 { font-size: 1.8rem; font-weight: 800; margin: 0 0 4px; }
.policy h2 { font-size: 1.15rem; margin-top: 26px; }
.policy p, .policy li { line-height: 1.75; color: #3a3f51; }
.policy .updated { color: var(--muted); font-size: .85rem; margin-bottom: 18px; }

/* ---------- Misc ---------- */
.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
:focus-visible { outline: 3px solid rgba(91, 108, 255, .4); outline-offset: 2px; }

#scrollTopBtn {
    position: fixed; bottom: 26px; right: 26px; z-index: 100; display: none;
    font-size: 14px; font-weight: 700;
    background: var(--accent); color: #fff; border: none;
    padding: 12px 16px; border-radius: 999px; cursor: pointer;
    box-shadow: var(--shadow-md);
}
#scrollTopBtn:hover { background: var(--accent-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) { .sidebar { display: none; } }

@media (max-width: 768px) {
    .container { padding: 0 12px; }
    .emoji-grid { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; }
    .emoji-item { font-size: 1.9rem; border-radius: 10px; }
    .detail .hero { width: 132px; height: 132px; font-size: 4.4rem; border-radius: 24px; }
    .link-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
    .brand { font-size: 1.3rem; }
}

/* Popular emojis module (home) */
.popular { max-width: 1000px; margin: 4px auto 22px; }
.popular h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 10px; color: var(--text); }
.popular .link-grid { margin-top: 0; }

/* ---------- Emoji combos ---------- */
.combos-pill { background: var(--accent-soft) !important; color: var(--accent-dark) !important; border-color: #d9ddff !important; font-weight: 700; }
.cat-nav a.active.combos-pill { background: var(--accent) !important; color: #fff !important; }

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 18px;
}
.theme-card {
    display: flex; flex-direction: column; gap: 8px;
    padding: 18px 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: transform .12s, box-shadow .12s, border-color .12s;
}
.theme-card:hover { transform: translateY(-3px); border-color: #e3e5f0; box-shadow: var(--shadow-md); }
.theme-card .theme-sample { font-size: 1.7rem; line-height: 1.1; }
.theme-card .theme-name { font-size: .92rem; font-weight: 700; color: var(--text); }

.combo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 18px;
}
.combo {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 16px 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    font-family: inherit;
    transition: transform .12s, box-shadow .12s, border-color .12s;
}
.combo:hover { transform: translateY(-3px); border-color: #e3e5f0; box-shadow: var(--shadow-md); }
.combo .combo-emojis { font-size: 1.6rem; line-height: 1.3; word-break: break-word; }
.combo .combo-label { font-size: .72rem; color: var(--muted); text-transform: capitalize; }

.theme-links { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-links a {
    font-size: .85rem; padding: 7px 13px;
    background: var(--card); border: 1px solid var(--line); border-radius: 999px;
    color: #3a3f51; text-decoration: none; box-shadow: var(--shadow-sm);
    text-transform: capitalize;
}
.theme-links a:hover { border-color: #d7dae6; }
