/* Friend battles: the picker on the Battle tab, and the challenge that pops up for the friend (FriendChallengeInvite) */

.mm-btn.fc-btn-grudge {
    border-color: var(--sc-danger);
    background: var(--sc-danger);
    color: #fff;
}

.fc-pick-hint {
    margin: 6px 4px 10px;
    color: var(--sc-text-muted);
    font-size: 13px;
    line-height: 1.4;
}

.fc-pick-empty {
    margin: 18px 4px;
    color: var(--sc-text-muted);
    text-align: center;
}

.fc-pick-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    padding: 9px 12px;
    border: 1px solid var(--sc-line);
    border-radius: var(--sc-radius);
    background: var(--sc-surface-2, rgba(255, 255, 255, 0.04));
}

.fc-pick-row.is-offline {
    opacity: 0.55;
}

.fc-pick-avatar {
    position: relative;
    flex: none;
    width: 42px;
    height: 42px;
}

.fc-pick-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.fc-pick-name {
    display: grid;
    flex: 1;
    min-width: 0;
}

.fc-pick-name strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fc-pick-name small,
.fc-pick-busy {
    color: var(--sc-text-muted);
    font-size: 12px;
}

.fc-pick-actions {
    display: flex;
    flex: none;
    gap: 6px;
}

/* The incoming challenge: over everything, battles included, until it's answered or lapses */
.fc-invite {
    --tone: var(--sc-danger);
    position: fixed;
    top: calc(var(--sc-safe-top) + 10px);
    left: 50%;
    z-index: 2600;
    display: grid;
    gap: 10px;
    width: min(400px, calc(100vw - 24px));
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--tone) 60%, transparent);
    border-radius: var(--sc-radius-lg);
    background: color-mix(in srgb, var(--sc-bg-elevated) 92%, var(--tone));
    box-shadow: 0 0 28px color-mix(in srgb, var(--tone) 40%, transparent), var(--sc-shadow-lg);
    transform: translateX(-50%);
    animation: fc-invite-in 0.45s var(--sc-ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1)) both;
}

.fc-invite.is-practice {
    --tone: var(--sc-success);
}

.fc-invite-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fc-invite-avatar {
    flex: none;
    width: 48px;
    height: 48px;
    border: 2px solid var(--tone);
    border-radius: 50%;
    object-fit: cover;
    animation: fc-invite-ring 1.2s ease-in-out infinite;
}

.fc-invite-text {
    display: grid;
    min-width: 0;
}

.fc-invite-text small {
    color: var(--tone);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fc-invite-text b {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fc-invite-stakes {
    color: var(--sc-text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.fc-invite-timer {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.fc-invite-timer span {
    display: block;
    height: 100%;
    background: var(--tone);
    transition: width 0.5s linear;
}

.fc-invite-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.fc-invite-actions .mm-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.fc-invite-more {
    position: absolute;
    top: -8px;
    right: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--tone);
    color: #10142a;
    font-size: 11px;
    font-weight: 800;
}

@keyframes fc-invite-in {
    from {
        opacity: 0;
        transform: translate(-50%, -24px) scale(0.96);
    }
}

@keyframes fc-invite-ring {
    50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--tone) 30%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
    .fc-invite, .fc-invite-avatar {
        animation: none;
    }
}
