/* xeunify1 (Mortimer, 08-11-2026: «la sensación debe ser prácticamente la misma que en todos los sistemas de comentarios de
   bascdao.com … cambia los botones, (no los colores) sino las funciones»). Shared by news.xelementia.com and the five tribes
   (templates/news_subdomain.html, templates/tribes_subdomain.html): the reply box that opens under a comment, the 🐾 pets
   (static/js/xe-pets.js) and the light of a comment that arrives. XElementia's colours: the post's tribe (--tribe-*). */

/* ---------- the reply box, right under the comment it answers ---------- */
.news-comments-list .news-comment-form--reply {
    --rb: var(--tribe-color, var(--tribe-primary-bright, #00ddeb));
    margin: 0;
    padding: 10px 12px 12px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--rb) 38%, transparent);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--rb) 9%, transparent), transparent 60%),
        rgba(0, 0, 0, 0.28);
    box-shadow: inset 4px 0 0 color-mix(in srgb, var(--rb) 70%, transparent);
    animation: xe-reply-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.news-comments-list .news-comment-form--reply.news-reply-depth-1 { margin-left: 24px; }
.news-comments-list .news-comment-form--reply.news-reply-depth-2 { margin-left: 46px; }
@keyframes xe-reply-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.news-comment-form--reply .news-comment-form-avatar { width: 36px; height: 36px; }
.news-comment-form--reply .news-comment-editor { min-height: 44px; }
.news-reply-to {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 2px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--rb, #00ddeb);
}
.news-reply-to i { font-size: 11px; }
.news-reply-to b { color: #ffffff; font-weight: 800; }

.news-comment-form .news-reply-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #d6dde8;
    font-weight: 700;
}
.news-comment-form .news-reply-cancel:hover { border-color: rgba(255, 255, 255, 0.32); color: #ffffff; }

/* the 💬 of the comment whose box is open, and the 🐾 when a pet is on */
.news-comment-action-btn.reply-comment[aria-expanded="true"] {
    color: var(--tribe-color, #00ddeb);
}
.news-comment-form .news-comment-tool-btn.is-on,
.news-edit-form .news-comment-tool-btn.is-on,
.news-comment-tool-btn[aria-expanded="true"] {
    background: color-mix(in srgb, var(--tribe-color, #00ddeb) 26%, transparent);
    border-color: color-mix(in srgb, var(--tribe-color, #00ddeb) 60%, transparent);
    color: #ffffff;
}
button.news-comment-action-btn.replies-stat { cursor: pointer; }

/* the edit box: the whole bar, wrapped on a phone */
.news-edit-form .news-comment-format-actions { flex-wrap: wrap; }

/* ---------- 🐾 a pet on a comment (and in the box, with its ✕) ---------- */
.xe-pet {
    --pc: var(--pet-c, #00ddeb);
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 480px;
    margin: 8px 0 4px;
    padding: 9px 12px 9px 9px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--pc) 42%, rgba(255, 255, 255, 0.08));
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--pc) 18%, transparent), transparent 60%),
        rgba(5, 10, 20, 0.55);
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.xe-pet:has(.xe-pet-go):hover { border-color: color-mix(in srgb, var(--pc) 70%, transparent); transform: translateY(-1px); }
.xe-pet-go { position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.xe-pet-go:focus-visible { outline: 2px solid var(--pc); outline-offset: 2px; }
.xe-pet-pic {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--pc) 45%, transparent), 0 6px 18px rgba(0, 0, 0, 0.35);
    color: var(--pc);
    font-size: 22px;
}
.xe-pet-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xe-pet-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.xe-pet-txt b { color: #ffffff; font-size: 14.5px; font-weight: 800; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xe-pet-txt small { color: #aab4c4; font-size: 12.5px; line-height: 1.3; }
.xe-pet-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.xe-pet-p {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1.5;
    color: color-mix(in srgb, var(--tc, #9aa4b2) 40%, #ffffff);
    background: color-mix(in srgb, var(--tc, #9aa4b2) 18%, rgba(0, 0, 0, 0.3));
    border: 1px solid color-mix(in srgb, var(--tc, #9aa4b2) 55%, transparent);
}
.xe-pet-p--tribe { --tc: var(--pc); }
/* nft_rarity's tiers, as Orbis colours them */
.xe-pet-tier--mythic { --tc: #ff4d6d; }
.xe-pet-tier--legendary { --tc: #ffb020; }
.xe-pet-tier--epic { --tc: #b26bff; }
.xe-pet-tier--rare { --tc: #3b9dff; }
.xe-pet-tier--uncommon { --tc: #36d07a; }
.xe-pet-tier--common { --tc: #9aa4b2; }

.news-comment-pet-slot .xe-pet { margin: 0; padding-right: 42px; }
.xe-pet-x {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.45);
    color: #ffffff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}
.news-comment-form .xe-pet-x, .news-edit-form .xe-pet-x { padding: 0; background: rgba(0, 0, 0, 0.45); color: #ffffff; }
.xe-pet-x:hover { border-color: rgba(255, 255, 255, 0.4); }

/* ---------- 🐾 «Your pets» under the field ---------- */
.xe-pet-pick {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 221, 235, 0.2);
    background: rgba(3, 8, 16, 0.72);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.xe-pet-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.xe-pet-head b { color: #ffffff; font-size: 14px; font-weight: 800; }
.xe-pet-head span { color: #9ea6b8; font-size: 12.5px; }
.news-comment-form .xe-pet-close, .news-edit-form .xe-pet-close, .xe-pet-close {
    margin-left: auto;
    padding: 0 6px;
    border: none;
    background: transparent;
    color: #9ea6b8;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.xe-pet-close:hover { color: #ffffff; }
.xe-pet-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.xe-pet-tabs:empty { display: none; }
.news-comment-form .xe-pet-tab, .news-edit-form .xe-pet-tab, .xe-pet-tab {
    --pc: var(--pet-c, #00ddeb);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--pc) 40%, transparent);
    background: color-mix(in srgb, var(--pc) 10%, transparent);
    color: color-mix(in srgb, var(--pc) 55%, #ffffff);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.xe-pet-tab span {
    min-width: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    font-size: 11.5px;
    text-align: center;
}
.news-comment-form .xe-pet-tab.is-on, .news-edit-form .xe-pet-tab.is-on, .xe-pet-tab.is-on {
    background: var(--pc);
    border-color: var(--pc);
    color: #06121c;
    box-shadow: 0 0 18px color-mix(in srgb, var(--pc) 40%, transparent);
}
.xe-pet-tab.is-on span { background: rgba(0, 0, 0, 0.18); }
.xe-pet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
    max-height: 312px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.news-comment-form .xe-pet-opt, .news-edit-form .xe-pet-opt, .xe-pet-opt {
    --pc: var(--pet-c, #00ddeb);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #ffffff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.xe-pet-opt:hover, .xe-pet-opt:focus-visible {
    border-color: color-mix(in srgb, var(--pc) 70%, transparent);
    background: color-mix(in srgb, var(--pc) 10%, transparent);
    transform: translateY(-1px);
    outline: none;
}
.xe-pet-opt-pic {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 9px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    color: var(--pc);
    font-size: 22px;
}
.xe-pet-opt-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xe-pet-opt-tier {
    position: absolute;
    left: 5px;
    top: 5px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    color: #ffffff;
    background: color-mix(in srgb, var(--tc, #9aa4b2) 70%, rgba(0, 0, 0, 0.4));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.xe-pet-opt-n { font-size: 12.5px; font-weight: 800; padding: 0 2px; }
.xe-pet-note { grid-column: 1 / -1; margin: 4px 0; color: #9ea6b8; font-size: 13px; }
.xe-pet-note a { color: var(--tribe-primary-bright, #00ddeb); font-weight: 700; }

/* ---------- a comment that arrives lights up in place (its own glow stays underneath) ---------- */
.news-comment-item.cg-arrive { animation: none; position: relative; }
.news-comment-item.cg-arrive::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    animation: cg-arrive 1.4s ease-in-out 2;
}
.news-comments-login-msg.cg-go { border-radius: 8px; }

@media (max-width: 640px) {
    .news-comments-list .news-comment-form--reply { padding: 9px; }
    .news-comments-list .news-comment-form--reply.news-reply-depth-1 { margin-left: 12px; }
    .news-comments-list .news-comment-form--reply.news-reply-depth-2 { margin-left: 24px; }
    .news-comments-list .news-comment-form--reply .news-comment-form-avatar { display: none; }   /* the whole width for the box */
    .xe-pet { gap: 10px; }
    .xe-pet-pic { flex-basis: 50px; width: 50px; height: 50px; }
    .xe-pet-txt small { font-size: 12px; }
    .xe-pet-pick { padding: 10px; }
    .xe-pet-head { flex-wrap: wrap; row-gap: 2px; }
    .xe-pet-head span { order: 3; flex-basis: 100%; }
    .xe-pet-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -10px 10px; padding: 0 10px 2px; }
    .xe-pet-tabs::-webkit-scrollbar { display: none; }
    .xe-pet-tab { flex: 0 0 auto; }
    .xe-pet-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); max-height: 260px; }
}
@media (prefers-reduced-motion: reduce) {
    .news-comments-list .news-comment-form--reply { animation: none; }
    .news-comment-item.cg-arrive::after { animation: none; }
}
