/* --- name-chip.css -----------------------------------------------------------
 *
 * The name chip (WORKPLAN ID-3): every player name the site prints, in one
 * shape -- the name in the player's colour, then up to three badge tiles
 * (role, featured, rank). Drawn by js/name-chip.js; the look is the signed-off
 * ID-1 board (`id-kit.css` on the Autumn Build canvas), colours from tokens.css.
 *
 * WHY THE SELECTORS ARE TWO CLASSES DEEP
 *
 * The chip lands inside rows that already style their own text: `.act-row
 * .who`, `.comment-who`, `.live-player`, `.lsug-meta`. Those set colour and
 * weight on the CONTAINER, which the chip's own rules beat outright (a rule on
 * the element always beats inheritance). What they could not beat is a page
 * rule aimed at an element -- `button`, `span`, `svg` -- and the tiles are
 * buttons and spans. So every rule is scoped `.sc-nc .x` (0,2,0), which no
 * element or single-class page rule outranks. The chip cannot sit inside one
 * id the way the wallet does: it is everywhere. (feedback_css_shared_components)
 *
 * The tooltip and the phone sheet each live once on the page, under their own
 * id, and are scoped to it.
 *
 * Phone rules are at the BOTTOM: a media query adds no specificity, so an
 * override written above its base rule does nothing (feedback_css_media_specificity).
 */

.sc-nc {
    display: inline-flex; align-items: center; gap: 6px;
    min-width: 0; max-width: 100%; vertical-align: middle;
    line-height: 1.2;
}
.sc-nc .sc-nc-n {
    font-weight: 800; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sc-nc.sc-nc-w6 .sc-nc-n { font-weight: 600; }
.sc-nc .sc-nc-n.sc-nc-anon { color: var(--text-muted); font-weight: 700; }
.sc-nc.sc-nc-w6 .sc-nc-n.sc-nc-anon { font-weight: 600; }
.sc-nc .sc-nc-bs { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.sc-nc .sc-nc-you {
    flex: none; font-size: 9px; font-weight: 800; letter-spacing: 0.6px; line-height: 1.3;
    color: var(--info); border: 1px solid var(--info); border-radius: 4px; padding: 1px 5px;
}

/* --- the name colours (badges.COLOURS) ----------------------------------- */
.sc-nc .sc-nc-c-plain     { color: var(--name-plain); }
.sc-nc .sc-nc-c-bronze    { color: var(--rank-bronze); }
.sc-nc .sc-nc-c-silver    { color: var(--rank-silver); }
.sc-nc .sc-nc-c-gold      { color: var(--rank-gold); }
.sc-nc .sc-nc-c-platinum  { color: var(--rank-platinum); }
.sc-nc .sc-nc-c-diamond   { color: var(--rank-diamond); }
.sc-nc .sc-nc-c-obsidian  { color: var(--rank-obsidian); }
.sc-nc .sc-nc-c-founding  { color: var(--name-founding); }
.sc-nc .sc-nc-c-season    { color: var(--name-season); }
.sc-nc .sc-nc-c-supporter { color: var(--name-supporter); }

/* --- the badge tile: 16px, 12px glyph (the default size) ----------------- */
.sc-nc .sc-nc-bt {
    width: 16px; height: 16px; flex: none; box-sizing: border-box; padding: 0; margin: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 4px;
    color: var(--text); font: inherit; line-height: 0; cursor: default;
    appearance: none; -webkit-appearance: none;
}
.sc-nc .sc-nc-bt svg {
    width: 12px; height: 12px; display: block;
    fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.sc-nc button.sc-nc-bt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sc-nc button.sc-nc-bt:focus:not(:focus-visible) { outline: none; }

/* Small: suggestion authors. 14px tile, 10px glyph. */
.sc-nc.sc-nc-sm { gap: 5px; }
.sc-nc.sc-nc-sm .sc-nc-bt { width: 14px; height: 14px; border-radius: 3px; }
.sc-nc.sc-nc-sm .sc-nc-bt svg { width: 10px; height: 10px; stroke-width: 2.4; }
/* Header: 20px tile, 14px glyph, featured badge only (the rank pill sits beside it). */
.sc-nc.sc-nc-lg .sc-nc-bt { width: 20px; height: 20px; border-radius: 5px; }
.sc-nc.sc-nc-lg .sc-nc-bt svg { width: 14px; height: 14px; stroke-width: 2.1; }

/* Tile colours (the catalogue's `tile` field). */
.sc-nc .sc-nc-bt.t-owner    { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
.sc-nc .sc-nc-bt.t-mod      { color: var(--info); }
.sc-nc .sc-nc-bt.t-founding { background: var(--name-founding); border-color: var(--name-founding); color: var(--text-on-accent); }
.sc-nc .sc-nc-bt.t-season   { color: var(--name-season); }
.sc-nc .sc-nc-bt.t-supporter{ color: var(--name-supporter); }
.sc-nc .sc-nc-bt.t-r-bronze   { color: var(--rank-bronze); }
.sc-nc .sc-nc-bt.t-r-silver   { color: var(--rank-silver); }
.sc-nc .sc-nc-bt.t-r-gold     { color: var(--rank-gold); }
.sc-nc .sc-nc-bt.t-r-platinum { color: var(--rank-platinum); }
.sc-nc .sc-nc-bt.t-r-diamond  { color: var(--rank-diamond); }
.sc-nc .sc-nc-bt.t-r-obsidian { color: var(--rank-obsidian); }

/* A large stand-alone tile (the /referral Recruiter block): 44px, 26px glyph.
   Not inside a chip, so scoped to its own class pair. */
.sc-nc-xl.sc-nc-bt {
    width: 44px; height: 44px; flex: none; box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 10px;
    color: var(--text);
}
.sc-nc-xl.sc-nc-bt svg {
    width: 26px; height: 26px; display: block;
    fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
/* Its badge's own colour, as on a chip (the badge case, ID-5). The chip's rules
   above are scoped to .sc-nc, which a stand-alone tile is not inside. */
.sc-nc-xl.sc-nc-bt.t-owner      { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
.sc-nc-xl.sc-nc-bt.t-mod        { color: var(--info); }
.sc-nc-xl.sc-nc-bt.t-founding   { background: var(--name-founding); border-color: var(--name-founding); color: var(--text-on-accent); }
.sc-nc-xl.sc-nc-bt.t-season     { color: var(--name-season); }
.sc-nc-xl.sc-nc-bt.t-supporter  { color: var(--name-supporter); }
.sc-nc-xl.sc-nc-bt.t-r-bronze   { color: var(--rank-bronze); }
.sc-nc-xl.sc-nc-bt.t-r-silver   { color: var(--rank-silver); }
.sc-nc-xl.sc-nc-bt.t-r-gold     { color: var(--rank-gold); }
.sc-nc-xl.sc-nc-bt.t-r-platinum { color: var(--rank-platinum); }
.sc-nc-xl.sc-nc-bt.t-r-diamond  { color: var(--rank-diamond); }
.sc-nc-xl.sc-nc-bt.t-r-obsidian { color: var(--rank-obsidian); }
/* After the colours, so a locked tile is always the dim dashed one. */
.sc-nc-xl.sc-nc-bt.locked { background: var(--bg); border-style: dashed; border-color: var(--border-strong); color: var(--text-dim); }

/* --- the tooltip: one per page --------------------------------------------- */
#sc-nc-tip {
    position: fixed; z-index: 10050; left: 0; top: 0;
    box-sizing: border-box; width: max-content; max-width: 250px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
    padding: 9px 11px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
    pointer-events: none; font-family: var(--font-ui); text-align: left;
}
#sc-nc-tip[hidden] { display: none; }
#sc-nc-tip .sc-nc-tip-t { font-size: 10px; font-weight: 800; letter-spacing: 0.7px; color: var(--name-plain); white-space: nowrap; }
#sc-nc-tip .sc-nc-tip-d { font-size: 11px; line-height: 1.5; color: var(--text-muted); margin-top: 3px; }

/* --- the phone sheet: one per page ------------------------------------------ */
#sc-nc-sheet { position: fixed; inset: 0; z-index: 10060; font-family: var(--font-ui); }
#sc-nc-sheet[hidden] { display: none; }
#sc-nc-sheet .sc-nc-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); }
#sc-nc-sheet .sc-nc-panel {
    position: absolute; left: 0; right: 0; bottom: 0; box-sizing: border-box;
    max-height: 80vh; overflow-y: auto; overflow-x: hidden;
    background: var(--surface); border-top: 1px solid var(--border-strong);
    border-radius: 14px 14px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    padding: 8px 16px 22px;
}
#sc-nc-sheet .sc-nc-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 0 auto 6px; }
#sc-nc-sheet .sc-nc-head { display: flex; align-items: center; gap: 10px; }
#sc-nc-sheet .sc-nc-head .sc-nc { font-size: 15px; flex: 1; min-width: 0; }
#sc-nc-sheet .sc-nc-x {
    appearance: none; border: 0; background: none; padding: 0; margin: 0; cursor: pointer;
    color: var(--text-dim); width: 44px; height: 44px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
}
#sc-nc-sheet .sc-nc-x:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
#sc-nc-sheet .sc-nc-rows { margin-top: 4px; }
#sc-nc-sheet .sc-nc-row {
    display: flex; gap: 12px; align-items: flex-start; padding: 12px 0;
    border-top: 1px solid var(--border);
}
#sc-nc-sheet .sc-nc-row:first-child { border-top: 0; }
#sc-nc-sheet .sc-nc-row .sc-nc { flex: none; }
#sc-nc-sheet .sc-nc-row-t { font-size: 10px; font-weight: 800; letter-spacing: 0.7px; color: var(--name-plain); }
#sc-nc-sheet .sc-nc-row-d { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-top: 3px; }

/* --- touch screens: the chip is the tap target ------------------------------
   A 16px tile is far under the 44px target, so on a screen without hover a tap
   anywhere on a chip that has badges opens the sheet naming every one. The
   padding/negative-margin pair grows the hit area to ~44px tall without moving
   anything on the page. */
@media (hover: none) {
    .sc-nc.sc-nc-tap { padding: 12px 0; margin: -12px 0; cursor: pointer; }
    .sc-nc.sc-nc-tap .sc-nc-bt { cursor: pointer; }
}

/* --- phones --------------------------------------------------------------- */
@media (max-width: 620px) {
    /* Tight rows (the activity tab, the high roller feed) show the first badge
       only; the sheet still names all of them. As drawn on the phone boards. */
    .sc-nc.sc-nc-tight .sc-nc-bs > .sc-nc-bt ~ .sc-nc-bt { display: none; }
    /* The header shows the name alone: there is no room beside the balance. */
    .sc-nc.sc-nc-hdr .sc-nc-bs { display: none; }
}
