/* ============================================================================
   Avatar Preview Modal - one shared instance lives in _LayoutV2.cshtml, so
   every _LayoutV2 page/partial gets the same "click a player avatar to see
   it larger with their name" behavior for free. Wiring (open/close, Escape,
   backdrop click) is in Scripts/common/avatar-preview.js.

   Follows the same fixed-overlay / .is-open idiom as .tec-modal /
   #playerPickerModal (Content/css/v2/team-encounter-card-v2.css,
   team-registration-v2.css) rather than the .sc-modal two-element pattern,
   since this is a single self-contained popup with no header/footer.
   ============================================================================ */
.avatar-preview-modal {
    position: fixed;
    inset: 0;
    /* Higher than --z-modal (9999) and --z-profile-modal (10000): this modal is routinely
       opened from an avatar sitting inside another already-open V2 modal (team roster,
       player picker, referee list, ...), and with equal z-index the later-in-DOM modal
       would paint over it regardless of which opened last. */
    z-index: 10010;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--modal-overlay-bg);
    -webkit-backdrop-filter: var(--modal-overlay-blur);
    backdrop-filter: var(--modal-overlay-blur);
}
.avatar-preview-modal.is-open { display: flex; }

.avatar-preview-modal__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 340px;
    padding: 36px 24px 28px;
    background: var(--modal-bg);
    border: var(--modal-border);
    border-radius: var(--modal-radius);
    box-shadow: var(--modal-shadow);
    text-align: center;
}

.avatar-preview-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
    cursor: pointer;
}
.avatar-preview-modal__close:hover { color: var(--color-text-primary); background: var(--color-surface-hover); }
.avatar-preview-modal__close:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.avatar-preview-modal__image {
    width: 192px;
    height: 192px;
    border-radius: var(--radius-circle);
    object-fit: cover;
    background: var(--color-surface-secondary);
    border: 1px solid var(--color-border);
}

.avatar-preview-modal__name {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text-primary);
    word-break: break-word;
}

@media (max-width: 480px) {
    .avatar-preview-modal__image { width: 152px; height: 152px; }
}

/* Any avatar opted into the preview (see avatar-preview.js) looks clickable. */
img.js-avatar-preview { cursor: pointer; }
