/* Club icons panel + inline icons (icons1, 21-10-2026). THE SAME FILE on bascdao.com and xelementia.com (see club-icons.js).
   Own prefix `ci-` and `.club-icon`; nothing else on either site uses them. */

/* ---------- Inline icons in posts and comments ---------- */
img.club-icon {
    display: inline-block;
    height: 1.42em;
    width: auto;
    max-width: none;
    margin: 0 0.08em;
    vertical-align: -0.36em;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: none;
    object-fit: contain;
    -webkit-user-drag: none;
    transition: transform 0.18s ease;
}
img.club-icon:hover { transform: translateY(-1px) scale(1.06); }
h1 img.club-icon, h2 img.club-icon, h3 img.club-icon, h4 img.club-icon, h5 img.club-icon { height: 1.15em; vertical-align: -0.2em; }
.ci-jumbo img.club-icon { height: 2.6em; margin: 0.1em 0.12em; vertical-align: middle; }
.ci-jumbo { font-size: 1.32em; line-height: 1.5; }

/* ---------- Icons inside editors (icons2): a chip = the picture + its :code: as hidden text ---------- */
.ci-chip {
    display: inline-block;
    position: relative;
    margin: 0 0.08em;
    vertical-align: -0.36em;
    line-height: 0;
    border-radius: 5px;
    cursor: default;
    -webkit-user-select: all;
    user-select: all;
}
.ci-chip-img {
    display: block;
    height: 1.42em;
    width: auto;
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: none;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
}
.ci-chip-code {
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    opacity: 0;
}
.ci-chip::selection, .ci-chip *::selection { background: transparent; }
h1 .ci-chip-img, h2 .ci-chip-img, h3 .ci-chip-img { height: 1.15em; }
h1 .ci-chip, h2 .ci-chip, h3 .ci-chip { vertical-align: -0.2em; }

/* A <textarea data-ci-field> shown as a box with the icons (it keeps the textarea's own classes and looks) */
.ci-field {
    position: relative;
    display: block;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: normal;
    cursor: text;
    text-align: left;
}
.ci-field.is-empty::before {
    content: attr(data-placeholder);
    position: absolute;
    color: inherit;
    opacity: 0.5;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 24px);
}

/* ---------- Toolbar button (both sites) ---------- */
.ci-trigger {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    min-width: 34px; height: 32px; padding: 0 8px; border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04);
    color: inherit; cursor: pointer; font: inherit; line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.ci-trigger:hover, .ci-trigger[aria-expanded="true"] { background: rgba(0, 221, 235, 0.14); border-color: rgba(0, 221, 235, 0.45); }
.ci-trigger:active { transform: scale(0.95); }
.ci-trigger svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ci-trigger img { width: auto; height: 17px; display: block; }
/* The same button inside the post editors' toolbar (.nce-btn on both sites) */
.nce-btn.nce-btn-icons { display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.nce-btn.nce-btn-icons svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nce-btn.nce-btn-icons[aria-expanded="true"] { background: rgba(0, 221, 235, 0.22); border-color: rgba(0, 221, 235, 0.6); }

/* ---------- Panel ---------- */
.ci-pop {
    --ci-bg: #130a26;
    --ci-bg2: #1b1035;
    --ci-line: rgba(255, 255, 255, 0.09);
    --ci-text: #f4f1ff;
    --ci-muted: #a59cc4;
    --ci-accent: #00ddeb;
    --ci-accent2: #ff2bd6;
    position: fixed; z-index: 2147483000; left: 0; top: 0;
    width: 372px; max-width: calc(100vw - 16px); height: 440px; max-height: calc(100vh - 16px);
    display: flex; flex-direction: column;
    color: var(--ci-text);
    font-family: Inter, 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: 14px; line-height: 1.3; text-align: left;
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(255, 43, 214, 0.13), transparent 60%),
        radial-gradient(120% 60% at 100% 0%, rgba(0, 221, 235, 0.13), transparent 60%),
        linear-gradient(180deg, var(--ci-bg2), var(--ci-bg));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
    opacity: 0; transform: translateY(6px) scale(0.98); transform-origin: top center;
    transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ci-pop[hidden] { display: none; }
.ci-pop.is-in { opacity: 1; transform: none; }
.ci-pop *, .ci-pop *::before, .ci-pop *::after { box-sizing: border-box; }
.ci-pop button { font: inherit; color: inherit; margin: 0; }
.ci-grip { display: none; }

.ci-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; }
.ci-search {
    flex: 1; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; margin: 0;
    border-radius: 12px; background: rgba(0, 0, 0, 0.32); border: 1px solid var(--ci-line); cursor: text;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ci-search:focus-within { border-color: rgba(0, 221, 235, 0.55); box-shadow: 0 0 0 3px rgba(0, 221, 235, 0.14); }
.ci-search svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--ci-muted); stroke-width: 2; stroke-linecap: round; }
.ci-search input {
    flex: 1; min-width: 0; height: 100%; padding: 0; margin: 0; border: 0; outline: 0; background: transparent;
    color: var(--ci-text); font: inherit; font-size: 14px; box-shadow: none;
}
.ci-search input::placeholder { color: var(--ci-muted); opacity: 1; }
.ci-search input::-webkit-search-cancel-button { filter: invert(1) opacity(0.6); }
.ci-x {
    flex: none; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--ci-line);
    background: rgba(255, 255, 255, 0.04); cursor: pointer; font-size: 14px; line-height: 1; padding: 0;
}
.ci-x:hover { background: rgba(255, 255, 255, 0.1); }

.ci-tabs { display: flex; gap: 2px; padding: 0 8px 6px; border-bottom: 1px solid var(--ci-line); }
.ci-tabs.is-searching { opacity: 0.4; pointer-events: none; }
.ci-tab {
    flex: 1; min-width: 0; height: 34px; display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 10px; background: transparent; cursor: pointer; padding: 0; position: relative;
    filter: grayscale(0.55) opacity(0.75); transition: filter 0.15s ease, background 0.15s ease;
}
.ci-tab[hidden] { display: none; }
.ci-tab:hover { filter: none; background: rgba(255, 255, 255, 0.06); }
.ci-tab.is-on { filter: none; background: rgba(255, 255, 255, 0.07); }
.ci-tab.is-on::after {
    content: ""; position: absolute; left: 22%; right: 22%; bottom: -7px; height: 3px; border-radius: 3px;
    background: linear-gradient(90deg, var(--ci-accent2), var(--ci-accent));
}
.ci-tab-emoji { font-size: 18px; line-height: 1; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.ci-tab-img { height: 18px; width: auto; display: block; }

.ci-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 10px 10px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
.ci-body::-webkit-scrollbar { width: 8px; }
.ci-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 8px; }
.ci-sec { padding-top: 6px; }
.ci-sec-title {
    position: sticky; top: -4px; z-index: 1; margin: 0 -10px 4px; padding: 7px 12px 6px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ci-muted);
    background: linear-gradient(180deg, rgba(22, 13, 44, 0.97) 70%, rgba(22, 13, 44, 0));
}
.ci-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.ci-grid--club { grid-template-columns: repeat(6, 1fr); gap: 6px; }
.ci-cell {
    position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 10px; background: transparent; cursor: pointer; padding: 0;
    transition: background 0.12s ease, transform 0.12s ease;
}
.ci-cell:hover, .ci-cell:focus-visible { background: rgba(255, 255, 255, 0.09); outline: none; transform: scale(1.08); }
.ci-cell:focus-visible { box-shadow: 0 0 0 2px var(--ci-accent); }
.ci-emoji { font-size: 24px; line-height: 1; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.ci-cell--icon {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.ci-cell--icon:hover, .ci-cell--icon:focus-visible { background: linear-gradient(160deg, rgba(0, 221, 235, 0.2), rgba(255, 43, 214, 0.14)); }
.ci-cell--wide { grid-column: span 2; aspect-ratio: auto; height: 100%; min-height: 48px; }
.ci-cell-img { height: 70%; width: auto; max-width: 88%; object-fit: contain; display: block; pointer-events: none; }
.ci-cell--wide .ci-cell-img { height: 52%; }
.ci-cell.is-picked { animation: ci-pop 0.32s ease; }
@keyframes ci-pop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
.ci-none { margin: 28px 8px; text-align: center; color: var(--ci-muted); font-size: 13px; }

.ci-foot {
    display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 7px 14px;
    border-top: 1px solid var(--ci-line); background: rgba(0, 0, 0, 0.22);
}
.ci-foot-hint { color: var(--ci-muted); font-size: 12px; }
.ci-foot-pic { display: flex; align-items: center; height: 30px; font-size: 26px; line-height: 1; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.ci-foot-img { height: 30px; width: auto; display: block; }
.ci-foot-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: capitalize; }
.ci-foot-code {
    margin-left: auto; padding: 3px 8px; border-radius: 7px; font-size: 12px; white-space: nowrap;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    color: var(--ci-accent); background: rgba(0, 221, 235, 0.1); border: 1px solid rgba(0, 221, 235, 0.25);
}

/* Phones: a sheet from the bottom */
.ci-pop.ci-pop--sheet {
    left: 0 !important; right: 0; top: auto !important; bottom: 0;
    width: 100%; max-width: none; height: min(62vh, 470px); max-height: none;
    border-radius: 20px 20px 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(24px); transform-origin: bottom center;
}
.ci-pop.ci-pop--sheet.is-in { transform: none; }
.ci-pop--sheet .ci-grip { display: block; width: 42px; height: 4px; margin: 8px auto 0; border-radius: 4px; background: rgba(255, 255, 255, 0.25); }
.ci-pop--sheet .ci-head { padding-top: 8px; }
.ci-pop--sheet .ci-grid { grid-template-columns: repeat(8, 1fr); }
.ci-pop--sheet .ci-grid--club { grid-template-columns: repeat(6, 1fr); gap: 5px; }
.ci-pop--sheet .ci-emoji { font-size: 26px; }

@media (prefers-reduced-motion: reduce) {
    .ci-pop, .ci-cell, img.club-icon { transition: none; }
    .ci-cell.is-picked { animation: none; }
}
