/* AI players (ai-players.mjs, ai-avatar.js): one avatar tile and one AI badge wherever an AI player appears — the
   lobby, the AI tables and the computer seats of a game. The badge is a mark that repeats the visible "AI 玩家" text
   and the accessible name; it never stands alone. Flat fills only; the badge is drawn the same at every size. */
.ai-avatar{--ai-badge:14px;--ai-ring:#181818;position:relative;display:grid;place-items:center;flex:none;aspect-ratio:1;border-radius:50%;color:#d9d9d9;background:none;box-shadow:none;overflow:visible;opacity:1}
.ai-avatar>.ai-face{display:block;width:100%;height:100%;border-radius:50%}
.ai-badge{position:absolute;right:-4px;bottom:-3px;display:grid;place-items:center;box-sizing:border-box;height:var(--ai-badge);min-width:calc(var(--ai-badge) * 1.55);padding:0 3px;border-radius:999px;background:#e4e4e4;color:#1a1a1a;font:600 calc(var(--ai-badge) * .64)/1 var(--sans,system-ui,sans-serif);letter-spacing:.02em;box-shadow:0 0 0 2px var(--ai-ring);pointer-events:none}
/* The words beside a name: "AI 玩家". */
.ai-tag{display:inline-flex;align-items:center;flex:none;color:#a9a9a9;font-weight:400;white-space:nowrap}

/* Game seats: a computer seat played by an AI player shows its face and name where "电脑" used to be. */
.ai-seat-name{display:inline-flex;align-items:center;gap:8px;min-width:0;max-width:100%}
.ai-seat-name>.ai-avatar{--ai-badge:12px;width:26px;height:26px}
.ai-seat-name>span:not(.ai-avatar){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ai-seat-name>.ai-tag{font-size:inherit}
/* Chess: the identity sits beside the side's king; the seat keeps its row. */
.chess-page .player-name .ai-seat-name{vertical-align:middle}
/* Gomoku, xiangqi, flight: the name row under the board. Flight's columns are narrow, so its "AI 玩家" sits on the
   second line beside the planes home. */
.table-page .table-player>.ai-seat-name{flex:1 1 auto;overflow:visible}
.flight-page .table-player>.ai-seat-name{gap:6px}
.flight-page .table-player>.ai-seat-name>.ai-avatar{--ai-badge:11px;width:20px;height:20px;margin-bottom:5px}
/* Dou Dizhu and Guandan: the seat avatar keeps its size; the badge is not clipped; "AI 玩家" stays under the name on
   phones too, where the seat's role line is hidden. */
.cards-page .card-seat-ai{display:block;margin-top:3px;font-size:11px;line-height:1.2}
@media(max-width:760px){.cards-page .card-seat-ai{font-size:10px;margin-top:2px}}
.cards-page .card-seat-avatar.ai-avatar,.cards-page .card-latest-avatar.ai-avatar{overflow:visible;background:none;box-shadow:none;--ai-ring:#232323}
.cards-page .card-latest-avatar.ai-avatar{--ai-badge:11px}
.cards-page .card-seat[data-active=true] .card-seat-avatar.ai-avatar{opacity:1}
/* UNO: the seat avatar slot. */
.uno-page .uno-seat-avatar.ai-avatar{background:none;box-shadow:none;--ai-ring:#262626}
/* Texas Hold'em practice: a small face at the top of each computer seat, "AI 玩家" under the name. */
.poker-page .poker-seat-info>.ai-avatar{--ai-badge:12px;--ai-ring:#2a2a2a;width:26px;height:26px;margin:0 auto 6px}
.poker-page .poker-seat-ai{display:block;margin-top:3px;font-size:11px;line-height:1.2}
@media(max-width:650px){.poker-page .poker-seat-ai{font-size:9px}.poker-page .poker-seat-info>.ai-avatar{width:22px;height:22px;margin-bottom:4px}}

@media (forced-colors:active){
 .ai-avatar{color:CanvasText}
 .ai-face-tile{fill:Canvas}
 .ai-avatar>.ai-face{outline:1px solid CanvasText;outline-offset:-1px}
 .ai-badge{forced-color-adjust:none;background:CanvasText;color:Canvas;box-shadow:0 0 0 2px Canvas}
}
