/* ============================================================
   37: UserChip - the unified compact user plate for list rows
   (friends, requests, the rating board, referrals) and /studio.

   The chip root deliberately wears .profile-card so the style
   packs' selectors apply to it UNCHANGED:
     .profile-card.theme-<id>                  -> plate tokens + skin
     .profile-card.frame-<id> .profile-avatar  -> avatar frame decor
     .profile-card .profile-avatar[class*="shape-"] -> cutout mask
   Same idiom as the store's .shop-preview. Everything below only
   re-scales the card language to row size, which is why this file
   must load AFTER styles/chronos-styles.css (see ChronosHead) -
   these overrides settle their (0,2,0)/(0,3,0) ties by order.
   ============================================================ */

.uchip.profile-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: auto;
    min-width: 0;
    max-width: 100%;
    max-height: none;
    /* Frame decor (founder collar, pack glows) overhangs the avatar box. */
    overflow: visible;
    padding: 5px 12px 5px 6px;
    border-radius: 12px;
    /* The modal-scale double glow reads as a smear at row height. */
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}

/* The card's own decor layers are drawn for a 720px box (corner screws,
   rails, columns); at row scale they squash into noise. Tokens, background
   and border stay - that IS the nameplate. */
.uchip.profile-card::before,
.uchip.profile-card::after {
    content: none;
}

/* A worn frame's decor needs breathing room on the plate. Chip roots never
   carry tier-frame-*, so the substring match only sees pack frame classes. */
.uchip.profile-card[class*="frame-"] {
    gap: 13px;
    padding: 8px 12px 8px 10px;
}

.uchip .profile-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 10px;
    border-width: 2px;
    box-shadow: 0 0 10px color-mix(in srgb, var(--profile-ring) 45%, transparent);
}

.uchip .profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.uchip .profile-avatar-initial { font-size: 17px; }

.uchip-name {
    /* Shrinkable for ellipsis, but never to nothing: badges must not be able to
       push the identity itself off the plate in a cramped container. */
    min-width: 44px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 700;
    /* Inherit, never hardcode white: light packs (grimoire parchment) set a dark
       text colour on .profile-card and the name must follow it to stay readable. */
    color: inherit;
    text-decoration: none;
}

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

/* The pills already size themselves; only their profile-name margin is wrong here. */
.uchip .tier-badge {
    margin-left: 0;
    flex: 0 0 auto;
}

/* ---- avatar decorations (v0.17.11.4, owner concept 2026-08-19) ----------------
   The founder heart + engraved number as ONE capsule seated on the avatar's lower
   edge - the chip-scale twin of the founder pack's .founder-engraving bezel plate.
   A real child, not a pseudo: the ordinal is per-user content and the heart is a
   component. Safe under the cutout shapes because 27-avatar-shapes-base.css masks
   the ring/img/initial INSIDE the avatar box, never the box itself; safe to
   overhang because the chip root keeps overflow: visible for frame decor. */
.uchip .profile-avatar { position: relative; }

.uchip-decor {
    position: absolute;
    left: 50%;
    bottom: -7px;
    transform: translateX(-50%);
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 4px;
    border-radius: 6px;
    /* The engraving plate's dark metal, restated at chip scale (the pack's own
       .founder-engraving::before is drawn for a 96px bezel). */
    background: linear-gradient(180deg, #3a404b, #23272f);
    border: 1px solid #4c525c;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    white-space: nowrap;
}

.uchip-decor-heart {
    display: inline-flex;
    align-items: center;
}

.uchip-decor-num {
    font-family: var(--chronos-font-mono);
    font-size: 8px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.04em;
    color: #cfd6e0;
    font-variant-numeric: tabular-nums;
}

/* Chip-scale trim for the one frame whose decor is drawn far outside the avatar
   box: the damascus tsuba diamond circumscribes an 88px avatar with inset -19px;
   the same geometry around the chip's 40px avatar needs -9px, otherwise the
   diamond crosses neighbouring rows. */
.uchip.profile-card.frame-damascus .profile-avatar::before {
    inset: -9px;
}

/* Row contexts: the plate takes the row's flexible span; trailing controls
   (pair-streak flame, action buttons, the board bar) keep their own width. */
.friend-row .uchip,
.board-row .uchip {
    flex: 1 1 auto;
}

/* (The name-side .founder-badge left chips in v0.17.11.4 - the ordinal rides the
   avatar capsule above, so the old 480px word-yield rule went with it. The badge
   itself still exists on the profile surfaces, styled by the founder pack.) */
