/* css/emoji.css - the emoji page, pattern-matched to editor.css / shorts.css */

:root {
    --emo-accent: #d97706;
    --emo-accent-hover: #b45309;
    --emo-accent-soft: #fef3c7;
    --emo-card-bg: #ffffff;
    --emo-card-border: #e5e7eb;
    --emo-page-bg: #fffbf5;
    --emo-muted: #6b7280;
    --emo-cell: #ffffff;
    --emo-cell-hover: #fff7e6;
}

body.dark-theme {
    --emo-accent-soft: #451a03;
    --emo-card-bg: #1f2937;
    --emo-card-border: #374151;
    --emo-page-bg: #111827;
    --emo-muted: #9ca3af;
    --emo-cell: #1f2937;
    --emo-cell-hover: #2b3546;
}

/* clip, not hidden: the site-wide `body { overflow-x: hidden }` makes <body> a scroll
   container that never scrolls, and any position: sticky inside it dies silently. The
   group bar below is sticky. */
.emo-body, body.emo-body#page-top {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--emo-page-bg); color: var(--text-color); min-height: 100vh; overflow-x: clip;
}

.emo-main { flex: 1; padding-top: 96px; padding-bottom: 64px; }

.emo-hero { padding: 26px 0 8px; text-align: center; }
.emo-hero-icon { font-size: 3rem; line-height: 1; margin-bottom: 10px; }
.emo-hero h1 { margin: 0 0 12px; font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; }
.emo-hero-lead { max-width: 760px; margin: 0 auto 10px; color: var(--emo-muted); font-size: 1rem; line-height: 1.6; }
.emo-hero-meta { margin: 0; color: var(--emo-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

.emo-work { padding: 22px 0 0; }
/* minmax(0, 1fr), not the default: a grid track will not shrink below the min-content width of
   its items, and the chip row never wraps, so its min-content is the whole row. Without the zero
   minimum the column grew to that width and dragged the entire page along with it. */
.emo-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 1100px; }

/* Banda lipicioasă: căutarea și grupurile, împreună, sub bara de sus. Împreună, fiindcă
   două elemente sticky suprapuse ar lăsa între ele o fantă prin care se vede lista derulând.
   Înălțimea ei o măsoară emoji.js și o pune în --emo-stick, ca ancorele să nu cadă sub ea. */
.emo-sticky {
    position: sticky; top: var(--emo-nav, 72px); z-index: 6; min-width: 0;
    padding: 10px 0 6px; margin: 0 -4px;
    background: var(--emo-page-bg);
    border-bottom: 1px solid transparent;
    transition: border-color .18s, box-shadow .18s;
}
.emo-sticky.is-stuck { border-bottom-color: var(--emo-card-border); box-shadow: 0 8px 18px rgba(0, 0, 0, .07); }
body.dark-theme .emo-sticky.is-stuck { box-shadow: 0 8px 18px rgba(0, 0, 0, .35); }

.emo-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 0 4px; }
.emo-search {
    position: relative; display: flex; align-items: center; gap: 10px;
    flex: 1 1 320px; min-width: 0;
    padding: 0 14px; border: 1px solid var(--emo-card-border); border-radius: 12px;
    background: var(--emo-card-bg);
}
.emo-search > i { color: var(--emo-muted); }
.emo-search input {
    flex: 1; min-width: 0; padding: 11px 0; border: 0; background: transparent;
    color: var(--text-color); font-size: 1rem; outline: none;
}
.emo-search input::-webkit-search-cancel-button { display: none; }
.emo-clear {
    border: 0; background: none; color: var(--emo-muted); cursor: pointer; padding: 6px;
}
.emo-clear[hidden] { display: none; }
.emo-check { display: flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 650; cursor: pointer; }
.emo-check input { accent-color: var(--emo-accent); width: 16px; height: 16px; }
.emo-hint { margin: 0; color: var(--emo-muted); font-size: .78rem; line-height: 1.5; }

.emo-card {
    background: var(--emo-card-bg); border: 1px solid var(--emo-card-border);
    border-radius: 14px; padding: 16px 20px; box-shadow: 0 10px 30px rgba(0,0,0,.05);
}
.emo-card[hidden] { display: none; }
.emo-recent-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.emo-recent-head h2 { margin: 0; font-size: 1rem; font-weight: 800; }
.emo-recent-actions { display: flex; align-items: center; gap: 14px; }
.emo-recent-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 44px; }
.emo-recent-strip .emo-cell { width: 44px; height: 44px; font-size: 1.5rem; }

.emo-secondary-btn {
    padding: 8px 12px; border: 1px solid var(--emo-card-border); border-radius: 9px;
    background: var(--emo-card-bg); color: var(--text-color); font-size: .82rem; font-weight: 700; cursor: pointer;
}
.emo-secondary-btn:hover { border-color: var(--emo-accent); color: var(--emo-accent); }
.emo-secondary-btn i { margin-right: 5px; }
.emo-linkbtn { padding: 0; border: 0; background: none; color: var(--emo-accent); font-size: .78rem; font-weight: 700; cursor: pointer; text-decoration: underline; }

/* Grupurile stau în banda lipicioasă de mai sus, deci nu mai au nevoie de propriul sticky.
   Un singur rând care se trage lateral, nu trei rânduri rupte: altfel banda ar mânca un sfert
   din ecran, iar rostul ei era tocmai să nu stea în drum. */
.emo-groups {
    display: flex; flex-wrap: nowrap; gap: 6px;
    padding: 8px 4px 4px; overflow-x: auto;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.emo-groups::-webkit-scrollbar { display: none; }
.emo-group-btn {
    display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
    padding: 7px 11px; border: 1px solid var(--emo-card-border); border-radius: 999px;
    background: var(--emo-card-bg); color: var(--text-color); font-size: .8rem; font-weight: 700;
    cursor: pointer; text-decoration: none; white-space: nowrap;
}
.emo-group-btn:hover { border-color: var(--emo-accent); }
.emo-group-btn.is-active { border-color: var(--emo-accent); background: var(--emo-accent-soft); }
.emo-group-btn .emo-group-count { color: var(--emo-muted); font-weight: 600; font-variant-numeric: tabular-nums; }

.emo-section { scroll-margin-top: calc(var(--emo-nav, 72px) + var(--emo-stick, 120px) + 10px); margin-top: 8px; }
.emo-section[hidden] { display: none; }
.emo-section-head { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 6px; }
.emo-section-head h2 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.emo-section-head span { color: var(--emo-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.emo-sub { margin: 10px 0 4px; color: var(--emo-muted); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.emo-sub[hidden] { display: none; }

.emo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 4px; }
.emo-cell {
    display: flex; align-items: center; justify-content: center;
    width: 100%; aspect-ratio: 1; border: 1px solid transparent; border-radius: 10px;
    background: var(--emo-cell); font-size: 1.7rem; line-height: 1; cursor: pointer;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
    transition: transform .08s, background .12s, border-color .12s;
}
.emo-cell:hover { background: var(--emo-cell-hover); border-color: var(--emo-card-border); transform: scale(1.12); }
.emo-cell:active { transform: scale(.96); }
.emo-cell.is-copied { border-color: var(--emo-accent); background: var(--emo-accent-soft); }
.emo-cell[hidden] { display: none; }

.emo-empty { margin: 30px 0; text-align: center; color: var(--emo-muted); }
.emo-empty[hidden] { display: none; }

.emo-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
    z-index: 1060; padding: 10px 16px; border-radius: 999px;
    background: #111827; color: #fff; font-size: .9rem; font-weight: 700;
    box-shadow: 0 10px 30px rgba(0,0,0,.35); pointer-events: none;
    display: flex; align-items: center; gap: 10px;
}
.emo-toast .emo-toast-char { font-size: 1.5rem; line-height: 1; }
.emo-toast[hidden] { display: none; }

@media (max-width: 720px) {
    .emo-main { padding-top: 84px; }
    .emo-hero h1 { font-size: 1.7rem; }
    .emo-sticky { padding: 8px 0 4px; }
    .emo-groups { gap: 5px; }
    .emo-group-btn { padding: 6px 9px; font-size: .74rem; }
    .emo-group-btn .emo-group-count { display: none; }
    .emo-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
    .emo-cell { font-size: 1.45rem; }
}

/* Poze pentru ce nu poate desena fontul (pe Windows: toate steagurile). Se încarcă leneș,
   deci pe un Mac sau pe telefon, unde fontul le are pe toate, nu se cere nicio imagine. */
.emo-img { width: 74%; height: 74%; object-fit: contain; pointer-events: none; }
.emo-cell.is-missing { opacity: .75; }

.emo-belowbar { display: grid; gap: 8px; }
.emo-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
